Matroska: Support additional PCM codec modes
- Support 32-bit A_PCM/FLOAT/IEEE PCM - Support 8-bit and 16-bit A_PCM/INT/BIG PCM Issue: #8142 PiperOrigin-RevId: 340264679
This commit is contained in:
parent
ac1ffa4fc2
commit
c9683195c0
@ -8,6 +8,10 @@
|
|||||||
([#8106](https://github.com/google/ExoPlayer/issues/8106)).
|
([#8106](https://github.com/google/ExoPlayer/issues/8106)).
|
||||||
* Suppress ProGuard warnings caused by Guava's compile-only dependencies
|
* Suppress ProGuard warnings caused by Guava's compile-only dependencies
|
||||||
([#8103](https://github.com/google/ExoPlayer/issues/8103)).
|
([#8103](https://github.com/google/ExoPlayer/issues/8103)).
|
||||||
|
* Extractors:
|
||||||
|
* Matroska: Add support for 32-bit floating point PCM, and 8-bit and
|
||||||
|
16-bit big endian integer PCM
|
||||||
|
([#8142](https://github.com/google/ExoPlayer/issues/8142)).
|
||||||
* IMA extension:
|
* IMA extension:
|
||||||
* Upgrade IMA SDK dependency to 3.21.0, and release the `AdsLoader`
|
* Upgrade IMA SDK dependency to 3.21.0, and release the `AdsLoader`
|
||||||
([#7344](https://github.com/google/ExoPlayer/issues/7344)).
|
([#7344](https://github.com/google/ExoPlayer/issues/7344)).
|
||||||
|
@ -128,6 +128,8 @@ public class MatroskaExtractor implements Extractor {
|
|||||||
private static final String CODEC_ID_FLAC = "A_FLAC";
|
private static final String CODEC_ID_FLAC = "A_FLAC";
|
||||||
private static final String CODEC_ID_ACM = "A_MS/ACM";
|
private static final String CODEC_ID_ACM = "A_MS/ACM";
|
||||||
private static final String CODEC_ID_PCM_INT_LIT = "A_PCM/INT/LIT";
|
private static final String CODEC_ID_PCM_INT_LIT = "A_PCM/INT/LIT";
|
||||||
|
private static final String CODEC_ID_PCM_INT_BIG = "A_PCM/INT/BIG";
|
||||||
|
private static final String CODEC_ID_PCM_FLOAT = "A_PCM/FLOAT/IEEE";
|
||||||
private static final String CODEC_ID_SUBRIP = "S_TEXT/UTF8";
|
private static final String CODEC_ID_SUBRIP = "S_TEXT/UTF8";
|
||||||
private static final String CODEC_ID_ASS = "S_TEXT/ASS";
|
private static final String CODEC_ID_ASS = "S_TEXT/ASS";
|
||||||
private static final String CODEC_ID_VOBSUB = "S_VOBSUB";
|
private static final String CODEC_ID_VOBSUB = "S_VOBSUB";
|
||||||
@ -1743,36 +1745,43 @@ public class MatroskaExtractor implements Extractor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isCodecSupported(String codecId) {
|
private static boolean isCodecSupported(String codecId) {
|
||||||
return CODEC_ID_VP8.equals(codecId)
|
switch (codecId) {
|
||||||
|| CODEC_ID_VP9.equals(codecId)
|
case CODEC_ID_VP8:
|
||||||
|| CODEC_ID_AV1.equals(codecId)
|
case CODEC_ID_VP9:
|
||||||
|| CODEC_ID_MPEG2.equals(codecId)
|
case CODEC_ID_AV1:
|
||||||
|| CODEC_ID_MPEG4_SP.equals(codecId)
|
case CODEC_ID_MPEG2:
|
||||||
|| CODEC_ID_MPEG4_ASP.equals(codecId)
|
case CODEC_ID_MPEG4_SP:
|
||||||
|| CODEC_ID_MPEG4_AP.equals(codecId)
|
case CODEC_ID_MPEG4_ASP:
|
||||||
|| CODEC_ID_H264.equals(codecId)
|
case CODEC_ID_MPEG4_AP:
|
||||||
|| CODEC_ID_H265.equals(codecId)
|
case CODEC_ID_H264:
|
||||||
|| CODEC_ID_FOURCC.equals(codecId)
|
case CODEC_ID_H265:
|
||||||
|| CODEC_ID_THEORA.equals(codecId)
|
case CODEC_ID_FOURCC:
|
||||||
|| CODEC_ID_OPUS.equals(codecId)
|
case CODEC_ID_THEORA:
|
||||||
|| CODEC_ID_VORBIS.equals(codecId)
|
case CODEC_ID_OPUS:
|
||||||
|| CODEC_ID_AAC.equals(codecId)
|
case CODEC_ID_VORBIS:
|
||||||
|| CODEC_ID_MP2.equals(codecId)
|
case CODEC_ID_AAC:
|
||||||
|| CODEC_ID_MP3.equals(codecId)
|
case CODEC_ID_MP2:
|
||||||
|| CODEC_ID_AC3.equals(codecId)
|
case CODEC_ID_MP3:
|
||||||
|| CODEC_ID_E_AC3.equals(codecId)
|
case CODEC_ID_AC3:
|
||||||
|| CODEC_ID_TRUEHD.equals(codecId)
|
case CODEC_ID_E_AC3:
|
||||||
|| CODEC_ID_DTS.equals(codecId)
|
case CODEC_ID_TRUEHD:
|
||||||
|| CODEC_ID_DTS_EXPRESS.equals(codecId)
|
case CODEC_ID_DTS:
|
||||||
|| CODEC_ID_DTS_LOSSLESS.equals(codecId)
|
case CODEC_ID_DTS_EXPRESS:
|
||||||
|| CODEC_ID_FLAC.equals(codecId)
|
case CODEC_ID_DTS_LOSSLESS:
|
||||||
|| CODEC_ID_ACM.equals(codecId)
|
case CODEC_ID_FLAC:
|
||||||
|| CODEC_ID_PCM_INT_LIT.equals(codecId)
|
case CODEC_ID_ACM:
|
||||||
|| CODEC_ID_SUBRIP.equals(codecId)
|
case CODEC_ID_PCM_INT_LIT:
|
||||||
|| CODEC_ID_ASS.equals(codecId)
|
case CODEC_ID_PCM_INT_BIG:
|
||||||
|| CODEC_ID_VOBSUB.equals(codecId)
|
case CODEC_ID_PCM_FLOAT:
|
||||||
|| CODEC_ID_PGS.equals(codecId)
|
case CODEC_ID_SUBRIP:
|
||||||
|| CODEC_ID_DVBSUB.equals(codecId);
|
case CODEC_ID_ASS:
|
||||||
|
case CODEC_ID_VOBSUB:
|
||||||
|
case CODEC_ID_PGS:
|
||||||
|
case CODEC_ID_DVBSUB:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2102,8 +2111,44 @@ public class MatroskaExtractor implements Extractor {
|
|||||||
if (pcmEncoding == C.ENCODING_INVALID) {
|
if (pcmEncoding == C.ENCODING_INVALID) {
|
||||||
pcmEncoding = Format.NO_VALUE;
|
pcmEncoding = Format.NO_VALUE;
|
||||||
mimeType = MimeTypes.AUDIO_UNKNOWN;
|
mimeType = MimeTypes.AUDIO_UNKNOWN;
|
||||||
Log.w(TAG, "Unsupported PCM bit depth: " + audioBitDepth + ". Setting mimeType to "
|
Log.w(
|
||||||
+ mimeType);
|
TAG,
|
||||||
|
"Unsupported little endian PCM bit depth: "
|
||||||
|
+ audioBitDepth
|
||||||
|
+ ". Setting mimeType to "
|
||||||
|
+ mimeType);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CODEC_ID_PCM_INT_BIG:
|
||||||
|
mimeType = MimeTypes.AUDIO_RAW;
|
||||||
|
if (audioBitDepth == 8) {
|
||||||
|
pcmEncoding = C.ENCODING_PCM_8BIT;
|
||||||
|
} else if (audioBitDepth == 16) {
|
||||||
|
pcmEncoding = C.ENCODING_PCM_16BIT_BIG_ENDIAN;
|
||||||
|
} else {
|
||||||
|
pcmEncoding = Format.NO_VALUE;
|
||||||
|
mimeType = MimeTypes.AUDIO_UNKNOWN;
|
||||||
|
Log.w(
|
||||||
|
TAG,
|
||||||
|
"Unsupported big endian PCM bit depth: "
|
||||||
|
+ audioBitDepth
|
||||||
|
+ ". Setting mimeType to "
|
||||||
|
+ mimeType);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CODEC_ID_PCM_FLOAT:
|
||||||
|
mimeType = MimeTypes.AUDIO_RAW;
|
||||||
|
if (audioBitDepth == 32) {
|
||||||
|
pcmEncoding = C.ENCODING_PCM_FLOAT;
|
||||||
|
} else {
|
||||||
|
pcmEncoding = Format.NO_VALUE;
|
||||||
|
mimeType = MimeTypes.AUDIO_UNKNOWN;
|
||||||
|
Log.w(
|
||||||
|
TAG,
|
||||||
|
"Unsupported floating point PCM bit depth: "
|
||||||
|
+ audioBitDepth
|
||||||
|
+ ". Setting mimeType to "
|
||||||
|
+ mimeType);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CODEC_ID_SUBRIP:
|
case CODEC_ID_SUBRIP:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user