mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
add DVB subtitle support, based in the TVHeadend spec, to the MatroskaExtractor
This commit is contained in:
parent
937675d1db
commit
0c49b81b48
@ -99,6 +99,7 @@ public final class MatroskaExtractor implements Extractor {
|
||||
private static final String CODEC_ID_SUBRIP = "S_TEXT/UTF8";
|
||||
private static final String CODEC_ID_VOBSUB = "S_VOBSUB";
|
||||
private static final String CODEC_ID_PGS = "S_HDMV/PGS";
|
||||
private static final String CODEC_ID_DVBSUB = "S_DVBSUB";
|
||||
|
||||
private static final int VORBIS_MAX_INPUT_SIZE = 8192;
|
||||
private static final int OPUS_MAX_INPUT_SIZE = 5760;
|
||||
@ -1233,8 +1234,8 @@ public final class MatroskaExtractor implements Extractor {
|
||||
|| CODEC_ID_PCM_INT_LIT.equals(codecId)
|
||||
|| CODEC_ID_SUBRIP.equals(codecId)
|
||||
|| CODEC_ID_VOBSUB.equals(codecId)
|
||||
|| CODEC_ID_PGS.equals(codecId);
|
||||
}
|
||||
|| CODEC_ID_PGS.equals(codecId)
|
||||
|| CODEC_ID_DVBSUB.equals(codecId); }
|
||||
|
||||
/**
|
||||
* Returns an array that can store (at least) {@code length} elements, which will be either a new
|
||||
@ -1461,6 +1462,14 @@ public final class MatroskaExtractor implements Extractor {
|
||||
case CODEC_ID_PGS:
|
||||
mimeType = MimeTypes.APPLICATION_PGS;
|
||||
break;
|
||||
case CODEC_ID_DVBSUB:
|
||||
mimeType = MimeTypes.APPLICATION_DVBSUBS;
|
||||
initializationData = new ArrayList<>(4);
|
||||
initializationData.add(null);
|
||||
initializationData.add(new byte[] {codecPrivate[0], codecPrivate[1]});
|
||||
initializationData.add(new byte[] {codecPrivate[2], codecPrivate[3]});
|
||||
initializationData.add("mkv".getBytes());
|
||||
break;
|
||||
default:
|
||||
throw new ParserException("Unrecognized codec identifier.");
|
||||
}
|
||||
@ -1495,7 +1504,8 @@ public final class MatroskaExtractor implements Extractor {
|
||||
format = Format.createTextSampleFormat(Integer.toString(trackId), mimeType, null,
|
||||
Format.NO_VALUE, selectionFlags, language, drmInitData);
|
||||
} else if (MimeTypes.APPLICATION_VOBSUB.equals(mimeType)
|
||||
|| MimeTypes.APPLICATION_PGS.equals(mimeType)) {
|
||||
|| MimeTypes.APPLICATION_PGS.equals(mimeType)
|
||||
|| MimeTypes.APPLICATION_DVBSUBS.equals(mimeType)) {
|
||||
type = C.TRACK_TYPE_TEXT;
|
||||
format = Format.createImageSampleFormat(Integer.toString(trackId), mimeType, null,
|
||||
Format.NO_VALUE, initializationData, language, drmInitData);
|
||||
|
Loading…
x
Reference in New Issue
Block a user