private static void buildManifestEventTrackGroupInfos(List<EventStream> eventStreams, TrackGroup[] trackGroups, TrackGroupInfo[] trackGroupInfos, int existingTrackGroupCount) { for (int i = 0; i < eventStreams.size(); i++) { EventStream eventStream = eventStreams.get(i); Format format = Format.createSampleFormat(eventStream.id(), MimeTypes.APPLICATION_EMSG, null, Format.NO_VALUE, null); trackGroups[existingTrackGroupCount] = new TrackGroup(format); trackGroupInfos[existingTrackGroupCount++] = TrackGroupInfo.mpdEventTrack(i); } }
@Override public void createTracks(ExtractorOutput extractorOutput, TrackIdGenerator idGenerator) { idGenerator.generateNewId(); output = extractorOutput.track(idGenerator.getTrackId(), C.TRACK_TYPE_METADATA); output.format(Format.createSampleFormat(idGenerator.getFormatId(), MimeTypes.APPLICATION_ID3, null, Format.NO_VALUE, null)); }
cea608TrackGroupIndex); if (eventMessageTrackGroupIndex != C.INDEX_UNSET) { Format format = Format.createSampleFormat(firstAdaptationSet.id + ":emsg", MimeTypes.APPLICATION_EMSG, null, Format.NO_VALUE, null); trackGroups[eventMessageTrackGroupIndex] = new TrackGroup(format);
@Override public void init(TimestampAdjuster timestampAdjuster, ExtractorOutput extractorOutput, TsPayloadReader.TrackIdGenerator idGenerator) { this.timestampAdjuster = timestampAdjuster; idGenerator.generateNewId(); output = extractorOutput.track(idGenerator.getTrackId(), C.TRACK_TYPE_METADATA); output.format(Format.createSampleFormat(idGenerator.getFormatId(), MimeTypes.APPLICATION_SCTE35, null, Format.NO_VALUE, null)); }
Format.createSampleFormat( /* id= */ "ID3", MimeTypes.APPLICATION_ID3,
@Test public void testParcelable() { Format format1 = Format.createSampleFormat("1", MimeTypes.VIDEO_H264, 0); Format format2 = Format.createSampleFormat("2", MimeTypes.AUDIO_AAC, 0); Format format3 = Format.createSampleFormat("3", MimeTypes.VIDEO_H264, 0); TrackGroup trackGroup1 = new TrackGroup(format1, format2); TrackGroup trackGroup2 = new TrackGroup(format3); TrackGroupArray trackGroupArrayToParcel = new TrackGroupArray(trackGroup1, trackGroup2); Parcel parcel = Parcel.obtain(); trackGroupArrayToParcel.writeToParcel(parcel, 0); parcel.setDataPosition(0); TrackGroupArray trackGroupArrayFromParcel = TrackGroupArray.CREATOR.createFromParcel(parcel); assertThat(trackGroupArrayFromParcel).isEqualTo(trackGroupArrayToParcel); parcel.recycle(); } }
@Override public void consume(ParsableByteArray sectionData) { if (!formatDeclared) { if (timestampAdjuster.getTimestampOffsetUs() == C.TIME_UNSET) { // There is not enough information to initialize the timestamp adjuster. return; } output.format(Format.createSampleFormat(null, MimeTypes.APPLICATION_SCTE35, timestampAdjuster.getTimestampOffsetUs())); formatDeclared = true; } int sampleSize = sectionData.bytesLeft(); output.sampleData(sectionData, sampleSize); output.sampleMetadata(timestampAdjuster.getLastAdjustedTimestampUs(), C.BUFFER_FLAG_KEY_FRAME, sampleSize, 0, null); }
@Test public void testParcelable() { Format format1 = Format.createSampleFormat("1", MimeTypes.VIDEO_H264, 0); Format format2 = Format.createSampleFormat("2", MimeTypes.AUDIO_AAC, 0); TrackGroup trackGroupToParcel = new TrackGroup(format1, format2); Parcel parcel = Parcel.obtain(); trackGroupToParcel.writeToParcel(parcel, 0); parcel.setDataPosition(0); TrackGroup trackGroupFromParcel = TrackGroup.CREATOR.createFromParcel(parcel); assertThat(trackGroupFromParcel).isEqualTo(trackGroupToParcel); parcel.recycle(); } }
@Override public void createTracks(ExtractorOutput extractorOutput, TrackIdGenerator idGenerator) { idGenerator.generateNewId(); formatId = idGenerator.getFormatId(); output = extractorOutput.track(idGenerator.getTrackId(), C.TRACK_TYPE_AUDIO); if (exposeId3) { idGenerator.generateNewId(); id3Output = extractorOutput.track(idGenerator.getTrackId(), C.TRACK_TYPE_METADATA); id3Output.format(Format.createSampleFormat(idGenerator.getFormatId(), MimeTypes.APPLICATION_ID3, null, Format.NO_VALUE, null)); } else { id3Output = new DummyTrackOutput(); } }
language, out); } else if (childAtomType == Atom.TYPE_camm) { out.format = Format.createSampleFormat(Integer.toString(trackId), MimeTypes.APPLICATION_CAMERA_MOTION, null, Format.NO_VALUE, null);
new Object[]{RENDERER_DECODER, AUDIO_UNHANDLED_FORMAT_ERROR, createRenderer(new AudioProcessor.UnhandledFormatException(0, 0, 0))}, new Object[]{RENDERER_DECODER, AUDIO_DECODER_ERROR, createRenderer(new AudioDecoderException("audio-decoder-exception"))}, new Object[]{RENDERER_DECODER, INITIALISATION_ERROR, createRenderer(new MediaCodecRenderer.DecoderInitializationException(Format.createSampleFormat("id", "sample-mimety[e", 0), new Throwable(), true, 0))}, new Object[]{RENDERER_DECODER, DECODING_SUBTITLE_ERROR, createRenderer(new SubtitleDecoderException("metadata-decoder-exception"))},