Java Code Examples for com.google.android.exoplayer2.util.MimeTypes#AUDIO_AC3
The following examples show how to use
com.google.android.exoplayer2.util.MimeTypes#AUDIO_AC3 .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SsManifestParser.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
private static String fourCCToMimeType(String fourCC) { if (fourCC.equalsIgnoreCase("H264") || fourCC.equalsIgnoreCase("X264") || fourCC.equalsIgnoreCase("AVC1") || fourCC.equalsIgnoreCase("DAVC")) { return MimeTypes.VIDEO_H264; } else if (fourCC.equalsIgnoreCase("AAC") || fourCC.equalsIgnoreCase("AACL") || fourCC.equalsIgnoreCase("AACH") || fourCC.equalsIgnoreCase("AACP")) { return MimeTypes.AUDIO_AAC; } else if (fourCC.equalsIgnoreCase("TTML")) { return MimeTypes.APPLICATION_TTML; } else if (fourCC.equalsIgnoreCase("ac-3") || fourCC.equalsIgnoreCase("dac3")) { return MimeTypes.AUDIO_AC3; } else if (fourCC.equalsIgnoreCase("ec-3") || fourCC.equalsIgnoreCase("dec3")) { return MimeTypes.AUDIO_E_AC3; } else if (fourCC.equalsIgnoreCase("dtsc")) { return MimeTypes.AUDIO_DTS; } else if (fourCC.equalsIgnoreCase("dtsh") || fourCC.equalsIgnoreCase("dtsl")) { return MimeTypes.AUDIO_DTS_HD; } else if (fourCC.equalsIgnoreCase("dtse")) { return MimeTypes.AUDIO_DTS_EXPRESS; } else if (fourCC.equalsIgnoreCase("opus")) { return MimeTypes.AUDIO_OPUS; } return null; }
Example 2
Source File: FfmpegAudioRenderer.java From Telegram with GNU General Public License v2.0 | 6 votes |
private boolean shouldUseFloatOutput(Format inputFormat) { Assertions.checkNotNull(inputFormat.sampleMimeType); if (!enableFloatOutput || !supportsOutput(inputFormat.channelCount, C.ENCODING_PCM_FLOAT)) { return false; } switch (inputFormat.sampleMimeType) { case MimeTypes.AUDIO_RAW: // For raw audio, output in 32-bit float encoding if the bit depth is > 16-bit. return inputFormat.pcmEncoding == C.ENCODING_PCM_24BIT || inputFormat.pcmEncoding == C.ENCODING_PCM_32BIT || inputFormat.pcmEncoding == C.ENCODING_PCM_FLOAT; case MimeTypes.AUDIO_AC3: // AC-3 is always 16-bit, so there is no point outputting in 32-bit float encoding. return false; default: // For all other formats, assume that it's worth using 32-bit float encoding. return true; } }
Example 3
Source File: SsManifestParser.java From Telegram with GNU General Public License v2.0 | 6 votes |
private static String fourCCToMimeType(String fourCC) { if (fourCC.equalsIgnoreCase("H264") || fourCC.equalsIgnoreCase("X264") || fourCC.equalsIgnoreCase("AVC1") || fourCC.equalsIgnoreCase("DAVC")) { return MimeTypes.VIDEO_H264; } else if (fourCC.equalsIgnoreCase("AAC") || fourCC.equalsIgnoreCase("AACL") || fourCC.equalsIgnoreCase("AACH") || fourCC.equalsIgnoreCase("AACP")) { return MimeTypes.AUDIO_AAC; } else if (fourCC.equalsIgnoreCase("TTML") || fourCC.equalsIgnoreCase("DFXP")) { return MimeTypes.APPLICATION_TTML; } else if (fourCC.equalsIgnoreCase("ac-3") || fourCC.equalsIgnoreCase("dac3")) { return MimeTypes.AUDIO_AC3; } else if (fourCC.equalsIgnoreCase("ec-3") || fourCC.equalsIgnoreCase("dec3")) { return MimeTypes.AUDIO_E_AC3; } else if (fourCC.equalsIgnoreCase("dtsc")) { return MimeTypes.AUDIO_DTS; } else if (fourCC.equalsIgnoreCase("dtsh") || fourCC.equalsIgnoreCase("dtsl")) { return MimeTypes.AUDIO_DTS_HD; } else if (fourCC.equalsIgnoreCase("dtse")) { return MimeTypes.AUDIO_DTS_EXPRESS; } else if (fourCC.equalsIgnoreCase("opus")) { return MimeTypes.AUDIO_OPUS; } return null; }
Example 4
Source File: FfmpegAudioRenderer.java From Telegram-FOSS with GNU General Public License v2.0 | 6 votes |
private boolean shouldUseFloatOutput(Format inputFormat) { Assertions.checkNotNull(inputFormat.sampleMimeType); if (!enableFloatOutput || !supportsOutput(inputFormat.channelCount, C.ENCODING_PCM_FLOAT)) { return false; } switch (inputFormat.sampleMimeType) { case MimeTypes.AUDIO_RAW: // For raw audio, output in 32-bit float encoding if the bit depth is > 16-bit. return inputFormat.pcmEncoding == C.ENCODING_PCM_24BIT || inputFormat.pcmEncoding == C.ENCODING_PCM_32BIT || inputFormat.pcmEncoding == C.ENCODING_PCM_FLOAT; case MimeTypes.AUDIO_AC3: // AC-3 is always 16-bit, so there is no point outputting in 32-bit float encoding. return false; default: // For all other formats, assume that it's worth using 32-bit float encoding. return true; } }
Example 5
Source File: SsManifestParser.java From Telegram-FOSS with GNU General Public License v2.0 | 6 votes |
private static String fourCCToMimeType(String fourCC) { if (fourCC.equalsIgnoreCase("H264") || fourCC.equalsIgnoreCase("X264") || fourCC.equalsIgnoreCase("AVC1") || fourCC.equalsIgnoreCase("DAVC")) { return MimeTypes.VIDEO_H264; } else if (fourCC.equalsIgnoreCase("AAC") || fourCC.equalsIgnoreCase("AACL") || fourCC.equalsIgnoreCase("AACH") || fourCC.equalsIgnoreCase("AACP")) { return MimeTypes.AUDIO_AAC; } else if (fourCC.equalsIgnoreCase("TTML") || fourCC.equalsIgnoreCase("DFXP")) { return MimeTypes.APPLICATION_TTML; } else if (fourCC.equalsIgnoreCase("ac-3") || fourCC.equalsIgnoreCase("dac3")) { return MimeTypes.AUDIO_AC3; } else if (fourCC.equalsIgnoreCase("ec-3") || fourCC.equalsIgnoreCase("dec3")) { return MimeTypes.AUDIO_E_AC3; } else if (fourCC.equalsIgnoreCase("dtsc")) { return MimeTypes.AUDIO_DTS; } else if (fourCC.equalsIgnoreCase("dtsh") || fourCC.equalsIgnoreCase("dtsl")) { return MimeTypes.AUDIO_DTS_HD; } else if (fourCC.equalsIgnoreCase("dtse")) { return MimeTypes.AUDIO_DTS_EXPRESS; } else if (fourCC.equalsIgnoreCase("opus")) { return MimeTypes.AUDIO_OPUS; } return null; }
Example 6
Source File: SsManifestParser.java From K-Sonic with MIT License | 6 votes |
private static String fourCCToMimeType(String fourCC) { if (fourCC.equalsIgnoreCase("H264") || fourCC.equalsIgnoreCase("X264") || fourCC.equalsIgnoreCase("AVC1") || fourCC.equalsIgnoreCase("DAVC")) { return MimeTypes.VIDEO_H264; } else if (fourCC.equalsIgnoreCase("AAC") || fourCC.equalsIgnoreCase("AACL") || fourCC.equalsIgnoreCase("AACH") || fourCC.equalsIgnoreCase("AACP")) { return MimeTypes.AUDIO_AAC; } else if (fourCC.equalsIgnoreCase("TTML")) { return MimeTypes.APPLICATION_TTML; } else if (fourCC.equalsIgnoreCase("ac-3") || fourCC.equalsIgnoreCase("dac3")) { return MimeTypes.AUDIO_AC3; } else if (fourCC.equalsIgnoreCase("ec-3") || fourCC.equalsIgnoreCase("dec3")) { return MimeTypes.AUDIO_E_AC3; } else if (fourCC.equalsIgnoreCase("dtsc")) { return MimeTypes.AUDIO_DTS; } else if (fourCC.equalsIgnoreCase("dtsh") || fourCC.equalsIgnoreCase("dtsl")) { return MimeTypes.AUDIO_DTS_HD; } else if (fourCC.equalsIgnoreCase("dtse")) { return MimeTypes.AUDIO_DTS_EXPRESS; } else if (fourCC.equalsIgnoreCase("opus")) { return MimeTypes.AUDIO_OPUS; } return null; }
Example 7
Source File: SoftAudioRenderer.java From DanDanPlayForAndroid with MIT License | 6 votes |
private boolean shouldUseFloatOutput(Format inputFormat) { Assertions.checkNotNull(inputFormat.sampleMimeType); if (!enableFloatOutput || !supportsOutput(inputFormat.channelCount, C.ENCODING_PCM_FLOAT)) { return false; } switch (inputFormat.sampleMimeType) { case MimeTypes.AUDIO_RAW: // For raw audio, output in 32-bit float encoding if the bit depth is > 16-bit. return inputFormat.pcmEncoding == C.ENCODING_PCM_24BIT || inputFormat.pcmEncoding == C.ENCODING_PCM_32BIT || inputFormat.pcmEncoding == C.ENCODING_PCM_FLOAT; case MimeTypes.AUDIO_AC3: // AC-3 is always 16-bit, so there is no point outputting in 32-bit float encoding. return false; default: // For all other formats, assume that it's worth using 32-bit float encoding. return true; } }
Example 8
Source File: FfmpegAudioRenderer.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
private boolean shouldUseFloatOutput(Format inputFormat) { Assertions.checkNotNull(inputFormat.sampleMimeType); if (!enableFloatOutput || !supportsOutputEncoding(C.ENCODING_PCM_FLOAT)) { return false; } switch (inputFormat.sampleMimeType) { case MimeTypes.AUDIO_RAW: // For raw audio, output in 32-bit float encoding if the bit depth is > 16-bit. return inputFormat.pcmEncoding == C.ENCODING_PCM_24BIT || inputFormat.pcmEncoding == C.ENCODING_PCM_32BIT || inputFormat.pcmEncoding == C.ENCODING_PCM_FLOAT; case MimeTypes.AUDIO_AC3: // AC-3 is always 16-bit, so there is no point outputting in 32-bit float encoding. return false; default: // For all other formats, assume that it's worth using 32-bit float encoding. return true; } }
Example 9
Source File: SsManifestParser.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
private static String fourCCToMimeType(String fourCC) { if (fourCC.equalsIgnoreCase("H264") || fourCC.equalsIgnoreCase("X264") || fourCC.equalsIgnoreCase("AVC1") || fourCC.equalsIgnoreCase("DAVC")) { return MimeTypes.VIDEO_H264; } else if (fourCC.equalsIgnoreCase("AAC") || fourCC.equalsIgnoreCase("AACL") || fourCC.equalsIgnoreCase("AACH") || fourCC.equalsIgnoreCase("AACP")) { return MimeTypes.AUDIO_AAC; } else if (fourCC.equalsIgnoreCase("TTML")) { return MimeTypes.APPLICATION_TTML; } else if (fourCC.equalsIgnoreCase("ac-3") || fourCC.equalsIgnoreCase("dac3")) { return MimeTypes.AUDIO_AC3; } else if (fourCC.equalsIgnoreCase("ec-3") || fourCC.equalsIgnoreCase("dec3")) { return MimeTypes.AUDIO_E_AC3; } else if (fourCC.equalsIgnoreCase("dtsc")) { return MimeTypes.AUDIO_DTS; } else if (fourCC.equalsIgnoreCase("dtsh") || fourCC.equalsIgnoreCase("dtsl")) { return MimeTypes.AUDIO_DTS_HD; } else if (fourCC.equalsIgnoreCase("dtse")) { return MimeTypes.AUDIO_DTS_EXPRESS; } else if (fourCC.equalsIgnoreCase("opus")) { return MimeTypes.AUDIO_OPUS; } return null; }
Example 10
Source File: FfmpegAudioRenderer.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
private boolean shouldUseFloatOutput(Format inputFormat) { Assertions.checkNotNull(inputFormat.sampleMimeType); if (!enableFloatOutput || !supportsOutputEncoding(C.ENCODING_PCM_FLOAT)) { return false; } switch (inputFormat.sampleMimeType) { case MimeTypes.AUDIO_RAW: // For raw audio, output in 32-bit float encoding if the bit depth is > 16-bit. return inputFormat.pcmEncoding == C.ENCODING_PCM_24BIT || inputFormat.pcmEncoding == C.ENCODING_PCM_32BIT || inputFormat.pcmEncoding == C.ENCODING_PCM_FLOAT; case MimeTypes.AUDIO_AC3: // AC-3 is always 16-bit, so there is no point outputting in 32-bit float encoding. return false; default: // For all other formats, assume that it's worth using 32-bit float encoding. return true; } }
Example 11
Source File: SsManifestParser.java From MediaSDK with Apache License 2.0 | 6 votes |
private static String fourCCToMimeType(String fourCC) { if (fourCC.equalsIgnoreCase("H264") || fourCC.equalsIgnoreCase("X264") || fourCC.equalsIgnoreCase("AVC1") || fourCC.equalsIgnoreCase("DAVC")) { return MimeTypes.VIDEO_H264; } else if (fourCC.equalsIgnoreCase("AAC") || fourCC.equalsIgnoreCase("AACL") || fourCC.equalsIgnoreCase("AACH") || fourCC.equalsIgnoreCase("AACP")) { return MimeTypes.AUDIO_AAC; } else if (fourCC.equalsIgnoreCase("TTML") || fourCC.equalsIgnoreCase("DFXP")) { return MimeTypes.APPLICATION_TTML; } else if (fourCC.equalsIgnoreCase("ac-3") || fourCC.equalsIgnoreCase("dac3")) { return MimeTypes.AUDIO_AC3; } else if (fourCC.equalsIgnoreCase("ec-3") || fourCC.equalsIgnoreCase("dec3")) { return MimeTypes.AUDIO_E_AC3; } else if (fourCC.equalsIgnoreCase("dtsc")) { return MimeTypes.AUDIO_DTS; } else if (fourCC.equalsIgnoreCase("dtsh") || fourCC.equalsIgnoreCase("dtsl")) { return MimeTypes.AUDIO_DTS_HD; } else if (fourCC.equalsIgnoreCase("dtse")) { return MimeTypes.AUDIO_DTS_EXPRESS; } else if (fourCC.equalsIgnoreCase("opus")) { return MimeTypes.AUDIO_OPUS; } return null; }
Example 12
Source File: AudioTrack.java From K-Sonic with MIT License | 5 votes |
@C.Encoding private static int getEncodingForMimeType(String mimeType) { switch (mimeType) { case MimeTypes.AUDIO_AC3: return C.ENCODING_AC3; case MimeTypes.AUDIO_E_AC3: return C.ENCODING_E_AC3; case MimeTypes.AUDIO_DTS: return C.ENCODING_DTS; case MimeTypes.AUDIO_DTS_HD: return C.ENCODING_DTS_HD; default: return C.ENCODING_INVALID; } }
Example 13
Source File: FfmpegLibrary.java From PowerFileExplorer with GNU General Public License v3.0 | 5 votes |
/** * Returns the name of the FFmpeg decoder that could be used to decode {@code mimeType}. */ /* package */ static String getCodecName(String mimeType) { switch (mimeType) { case MimeTypes.AUDIO_AAC: return "aac"; case MimeTypes.AUDIO_MPEG: case MimeTypes.AUDIO_MPEG_L1: case MimeTypes.AUDIO_MPEG_L2: return "mp3"; case MimeTypes.AUDIO_AC3: return "ac3"; case MimeTypes.AUDIO_E_AC3: return "eac3"; case MimeTypes.AUDIO_TRUEHD: return "truehd"; case MimeTypes.AUDIO_DTS: case MimeTypes.AUDIO_DTS_HD: return "dca"; case MimeTypes.AUDIO_VORBIS: return "vorbis"; case MimeTypes.AUDIO_OPUS: return "opus"; case MimeTypes.AUDIO_AMR_NB: return "amrnb"; case MimeTypes.AUDIO_AMR_WB: return "amrwb"; case MimeTypes.AUDIO_FLAC: return "flac"; case MimeTypes.AUDIO_ALAC: return "alac"; default: return null; } }
Example 14
Source File: FfmpegLibrary.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
/** * Returns the name of the FFmpeg decoder that could be used to decode the format, or {@code null} * if it's unsupported. */ /* package */ static @Nullable String getCodecName(String mimeType, @C.PcmEncoding int encoding) { switch (mimeType) { case MimeTypes.AUDIO_AAC: return "aac"; case MimeTypes.AUDIO_MPEG: case MimeTypes.AUDIO_MPEG_L1: case MimeTypes.AUDIO_MPEG_L2: return "mp3"; case MimeTypes.AUDIO_AC3: return "ac3"; case MimeTypes.AUDIO_E_AC3: return "eac3"; case MimeTypes.AUDIO_TRUEHD: return "truehd"; case MimeTypes.AUDIO_DTS: case MimeTypes.AUDIO_DTS_HD: return "dca"; case MimeTypes.AUDIO_VORBIS: return "vorbis"; case MimeTypes.AUDIO_OPUS: return "opus"; case MimeTypes.AUDIO_AMR_NB: return "amrnb"; case MimeTypes.AUDIO_AMR_WB: return "amrwb"; case MimeTypes.AUDIO_FLAC: return "flac"; case MimeTypes.AUDIO_ALAC: return "alac"; case MimeTypes.AUDIO_RAW: if (encoding == C.ENCODING_PCM_MU_LAW) { return "pcm_mulaw"; } else if (encoding == C.ENCODING_PCM_A_LAW) { return "pcm_alaw"; } else { return null; } default: return null; } }
Example 15
Source File: AudioDecoder.java From DanDanPlayForAndroid with MIT License | 4 votes |
/** * Returns the name of the FFmpeg decoder that could be used to decode the format, or {@code null} * if it's unsupported. */ private static @Nullable String getCodecName(String mimeType, @C.PcmEncoding int encoding) { switch (mimeType) { case MimeTypes.AUDIO_AAC: return "aac"; case MimeTypes.AUDIO_MPEG: case MimeTypes.AUDIO_MPEG_L1: case MimeTypes.AUDIO_MPEG_L2: return "mp3"; case MimeTypes.AUDIO_AC3: return "ac3"; case MimeTypes.AUDIO_E_AC3: case MimeTypes.AUDIO_E_AC3_JOC: return "eac3"; case MimeTypes.AUDIO_TRUEHD: return "truehd"; case MimeTypes.AUDIO_DTS: case MimeTypes.AUDIO_DTS_HD: return "dca"; case MimeTypes.AUDIO_VORBIS: return "vorbis"; case MimeTypes.AUDIO_OPUS: return "opus"; case MimeTypes.AUDIO_AMR_NB: return "amrnb"; case MimeTypes.AUDIO_AMR_WB: return "amrwb"; case MimeTypes.AUDIO_FLAC: return "flac"; case MimeTypes.AUDIO_ALAC: return "alac"; case MimeTypes.AUDIO_RAW: if (encoding == C.ENCODING_PCM_MU_LAW) { return "pcm_mulaw"; } else if (encoding == C.ENCODING_PCM_A_LAW) { return "pcm_alaw"; } else { return null; } default: return null; } }
Example 16
Source File: AtomParsers.java From K-Sonic with MIT License | 4 votes |
/** * Returns codec-specific initialization data contained in an esds box. */ private static Pair<String, byte[]> parseEsdsFromParent(ParsableByteArray parent, int position) { parent.setPosition(position + Atom.HEADER_SIZE + 4); // Start of the ES_Descriptor (defined in 14496-1) parent.skipBytes(1); // ES_Descriptor tag parseExpandableClassSize(parent); parent.skipBytes(2); // ES_ID int flags = parent.readUnsignedByte(); if ((flags & 0x80 /* streamDependenceFlag */) != 0) { parent.skipBytes(2); } if ((flags & 0x40 /* URL_Flag */) != 0) { parent.skipBytes(parent.readUnsignedShort()); } if ((flags & 0x20 /* OCRstreamFlag */) != 0) { parent.skipBytes(2); } // Start of the DecoderConfigDescriptor (defined in 14496-1) parent.skipBytes(1); // DecoderConfigDescriptor tag parseExpandableClassSize(parent); // Set the MIME type based on the object type indication (14496-1 table 5). int objectTypeIndication = parent.readUnsignedByte(); String mimeType; switch (objectTypeIndication) { case 0x6B: mimeType = MimeTypes.AUDIO_MPEG; return Pair.create(mimeType, null); case 0x20: mimeType = MimeTypes.VIDEO_MP4V; break; case 0x21: mimeType = MimeTypes.VIDEO_H264; break; case 0x23: mimeType = MimeTypes.VIDEO_H265; break; case 0x40: case 0x66: case 0x67: case 0x68: mimeType = MimeTypes.AUDIO_AAC; break; case 0xA5: mimeType = MimeTypes.AUDIO_AC3; break; case 0xA6: mimeType = MimeTypes.AUDIO_E_AC3; break; case 0xA9: case 0xAC: mimeType = MimeTypes.AUDIO_DTS; return Pair.create(mimeType, null); case 0xAA: case 0xAB: mimeType = MimeTypes.AUDIO_DTS_HD; return Pair.create(mimeType, null); default: mimeType = null; break; } parent.skipBytes(12); // Start of the AudioSpecificConfig. parent.skipBytes(1); // AudioSpecificConfig tag int initializationDataSize = parseExpandableClassSize(parent); byte[] initializationData = new byte[initializationDataSize]; parent.readBytes(initializationData, 0, initializationDataSize); return Pair.create(mimeType, initializationData); }
Example 17
Source File: FfmpegLibrary.java From Telegram-FOSS with GNU General Public License v2.0 | 4 votes |
/** * Returns the name of the FFmpeg decoder that could be used to decode the format, or {@code null} * if it's unsupported. */ /* package */ static @Nullable String getCodecName(String mimeType, @C.PcmEncoding int encoding) { switch (mimeType) { case MimeTypes.AUDIO_AAC: return "aac"; case MimeTypes.AUDIO_MPEG: case MimeTypes.AUDIO_MPEG_L1: case MimeTypes.AUDIO_MPEG_L2: return "mp3"; case MimeTypes.AUDIO_AC3: return "ac3"; case MimeTypes.AUDIO_E_AC3: case MimeTypes.AUDIO_E_AC3_JOC: return "eac3"; case MimeTypes.AUDIO_TRUEHD: return "truehd"; case MimeTypes.AUDIO_DTS: case MimeTypes.AUDIO_DTS_HD: return "dca"; case MimeTypes.AUDIO_VORBIS: return "vorbis"; case MimeTypes.AUDIO_OPUS: return "opus"; case MimeTypes.AUDIO_AMR_NB: return "amrnb"; case MimeTypes.AUDIO_AMR_WB: return "amrwb"; case MimeTypes.AUDIO_FLAC: return "flac"; case MimeTypes.AUDIO_ALAC: return "alac"; case MimeTypes.AUDIO_RAW: if (encoding == C.ENCODING_PCM_MU_LAW) { return "pcm_mulaw"; } else if (encoding == C.ENCODING_PCM_A_LAW) { return "pcm_alaw"; } else { return null; } default: return null; } }
Example 18
Source File: FfmpegLibrary.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
/** * Returns the name of the FFmpeg decoder that could be used to decode the format, or {@code null} * if it's unsupported. */ /* package */ static @Nullable String getCodecName(String mimeType, @C.PcmEncoding int encoding) { switch (mimeType) { case MimeTypes.AUDIO_AAC: return "aac"; case MimeTypes.AUDIO_MPEG: case MimeTypes.AUDIO_MPEG_L1: case MimeTypes.AUDIO_MPEG_L2: return "mp3"; case MimeTypes.AUDIO_AC3: return "ac3"; case MimeTypes.AUDIO_E_AC3: return "eac3"; case MimeTypes.AUDIO_TRUEHD: return "truehd"; case MimeTypes.AUDIO_DTS: case MimeTypes.AUDIO_DTS_HD: return "dca"; case MimeTypes.AUDIO_VORBIS: return "vorbis"; case MimeTypes.AUDIO_OPUS: return "opus"; case MimeTypes.AUDIO_AMR_NB: return "amrnb"; case MimeTypes.AUDIO_AMR_WB: return "amrwb"; case MimeTypes.AUDIO_FLAC: return "flac"; case MimeTypes.AUDIO_ALAC: return "alac"; case MimeTypes.AUDIO_RAW: if (encoding == C.ENCODING_PCM_MU_LAW) { return "pcm_mulaw"; } else if (encoding == C.ENCODING_PCM_A_LAW) { return "pcm_alaw"; } else { return null; } default: return null; } }
Example 19
Source File: FfmpegLibrary.java From Telegram with GNU General Public License v2.0 | 4 votes |
/** * Returns the name of the FFmpeg decoder that could be used to decode the format, or {@code null} * if it's unsupported. */ /* package */ static @Nullable String getCodecName(String mimeType, @C.PcmEncoding int encoding) { switch (mimeType) { case MimeTypes.AUDIO_AAC: return "aac"; case MimeTypes.AUDIO_MPEG: case MimeTypes.AUDIO_MPEG_L1: case MimeTypes.AUDIO_MPEG_L2: return "mp3"; case MimeTypes.AUDIO_AC3: return "ac3"; case MimeTypes.AUDIO_E_AC3: case MimeTypes.AUDIO_E_AC3_JOC: return "eac3"; case MimeTypes.AUDIO_TRUEHD: return "truehd"; case MimeTypes.AUDIO_DTS: case MimeTypes.AUDIO_DTS_HD: return "dca"; case MimeTypes.AUDIO_VORBIS: return "vorbis"; case MimeTypes.AUDIO_OPUS: return "opus"; case MimeTypes.AUDIO_AMR_NB: return "amrnb"; case MimeTypes.AUDIO_AMR_WB: return "amrwb"; case MimeTypes.AUDIO_FLAC: return "flac"; case MimeTypes.AUDIO_ALAC: return "alac"; case MimeTypes.AUDIO_RAW: if (encoding == C.ENCODING_PCM_MU_LAW) { return "pcm_mulaw"; } else if (encoding == C.ENCODING_PCM_A_LAW) { return "pcm_alaw"; } else { return null; } default: return null; } }