Search in sources :

Example 1 with DvbSubtitleInfo

use of com.google.android.exoplayer2.extractor.ts.TsPayloadReader.DvbSubtitleInfo in project ExoPlayer by google.

the class DvbSubtitleReader method createTracks.

@Override
public void createTracks(ExtractorOutput extractorOutput, TrackIdGenerator idGenerator) {
    for (int i = 0; i < outputs.length; i++) {
        DvbSubtitleInfo subtitleInfo = subtitleInfos.get(i);
        idGenerator.generateNewId();
        TrackOutput output = extractorOutput.track(idGenerator.getTrackId(), C.TRACK_TYPE_TEXT);
        output.format(new Format.Builder().setId(idGenerator.getFormatId()).setSampleMimeType(MimeTypes.APPLICATION_DVBSUBS).setInitializationData(Collections.singletonList(subtitleInfo.initializationData)).setLanguage(subtitleInfo.language).build());
        outputs[i] = output;
    }
}
Also used : DvbSubtitleInfo(com.google.android.exoplayer2.extractor.ts.TsPayloadReader.DvbSubtitleInfo) TrackOutput(com.google.android.exoplayer2.extractor.TrackOutput)

Example 2 with DvbSubtitleInfo

use of com.google.android.exoplayer2.extractor.ts.TsPayloadReader.DvbSubtitleInfo in project Telegram-FOSS by Telegram-FOSS-Team.

the class DvbSubtitleReader method createTracks.

@Override
public void createTracks(ExtractorOutput extractorOutput, TrackIdGenerator idGenerator) {
    for (int i = 0; i < outputs.length; i++) {
        DvbSubtitleInfo subtitleInfo = subtitleInfos.get(i);
        idGenerator.generateNewId();
        TrackOutput output = extractorOutput.track(idGenerator.getTrackId(), C.TRACK_TYPE_TEXT);
        output.format(Format.createImageSampleFormat(idGenerator.getFormatId(), MimeTypes.APPLICATION_DVBSUBS, null, Format.NO_VALUE, 0, Collections.singletonList(subtitleInfo.initializationData), subtitleInfo.language, null));
        outputs[i] = output;
    }
}
Also used : DvbSubtitleInfo(com.google.android.exoplayer2.extractor.ts.TsPayloadReader.DvbSubtitleInfo) TrackOutput(com.google.android.exoplayer2.extractor.TrackOutput)

Example 3 with DvbSubtitleInfo

use of com.google.android.exoplayer2.extractor.ts.TsPayloadReader.DvbSubtitleInfo in project media by androidx.

the class DvbSubtitleReader method createTracks.

@Override
public void createTracks(ExtractorOutput extractorOutput, TrackIdGenerator idGenerator) {
    for (int i = 0; i < outputs.length; i++) {
        DvbSubtitleInfo subtitleInfo = subtitleInfos.get(i);
        idGenerator.generateNewId();
        TrackOutput output = extractorOutput.track(idGenerator.getTrackId(), C.TRACK_TYPE_TEXT);
        output.format(new Format.Builder().setId(idGenerator.getFormatId()).setSampleMimeType(MimeTypes.APPLICATION_DVBSUBS).setInitializationData(Collections.singletonList(subtitleInfo.initializationData)).setLanguage(subtitleInfo.language).build());
        outputs[i] = output;
    }
}
Also used : DvbSubtitleInfo(androidx.media3.extractor.ts.TsPayloadReader.DvbSubtitleInfo) TrackOutput(androidx.media3.extractor.TrackOutput)

Aggregations

TrackOutput (com.google.android.exoplayer2.extractor.TrackOutput)2 DvbSubtitleInfo (com.google.android.exoplayer2.extractor.ts.TsPayloadReader.DvbSubtitleInfo)2 TrackOutput (androidx.media3.extractor.TrackOutput)1 DvbSubtitleInfo (androidx.media3.extractor.ts.TsPayloadReader.DvbSubtitleInfo)1