Commit 592b5eaf by olly Committed by Oliver Woodman

Support multiple CC channels in DASH

Issue: #5656
PiperOrigin-RevId: 241235377
parent 5db33dee
......@@ -5,7 +5,10 @@
* Update to Mockito 2
* Add new `ExoPlaybackException` types for remote exceptions and out-of-memory
errors.
* DASH: Parse role and accessibility descriptors into `Format.roleFlags`.
* DASH:
* Parse role and accessibility descriptors into `Format.roleFlags`.
* Support multiple CEA-608 channels muxed into FMP4 representations
([#5656](https://github.com/google/ExoPlayer/issues/5656)).
* HLS:
* Work around lack of LA_URL attribute in PlayReady key request init data.
* Prevent unnecessary reloads of initialization segments.
......
......@@ -17,12 +17,14 @@ package com.google.android.exoplayer2.source.dash;
import android.os.SystemClock;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.source.chunk.ChunkSource;
import com.google.android.exoplayer2.source.dash.PlayerEmsgHandler.PlayerTrackEmsgHandler;
import com.google.android.exoplayer2.source.dash.manifest.DashManifest;
import com.google.android.exoplayer2.trackselection.TrackSelection;
import com.google.android.exoplayer2.upstream.LoaderErrorThrower;
import com.google.android.exoplayer2.upstream.TransferListener;
import java.util.List;
/**
* An {@link ChunkSource} for DASH streams.
......@@ -41,10 +43,8 @@ public interface DashChunkSource extends ChunkSource {
* @param elapsedRealtimeOffsetMs If known, an estimate of the instantaneous difference between
* server-side unix time and {@link SystemClock#elapsedRealtime()} in milliseconds,
* specified as the server's unix time minus the local elapsed time. If unknown, set to 0.
* @param enableEventMessageTrack Whether the chunks generated by the source may output an event
* message track.
* @param enableCea608Track Whether the chunks generated by the source may output a CEA-608
* track.
* @param enableEventMessageTrack Whether to output an event message track.
* @param closedCaptionFormats The {@link Format Formats} of closed caption tracks to be output.
* @param transferListener The transfer listener which should be informed of any data transfers.
* May be null if no listener is available.
* @return The created {@link DashChunkSource}.
......@@ -58,7 +58,7 @@ public interface DashChunkSource extends ChunkSource {
int type,
long elapsedRealtimeOffsetMs,
boolean enableEventMessageTrack,
boolean enableCea608Track,
List<Format> closedCaptionFormats,
@Nullable PlayerTrackEmsgHandler playerEmsgHandler,
@Nullable TransferListener transferListener);
}
......
......@@ -54,7 +54,6 @@ import com.google.android.exoplayer2.util.MimeTypes;
import com.google.android.exoplayer2.util.Util;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
......@@ -86,7 +85,7 @@ public class DefaultDashChunkSource implements DashChunkSource {
int trackType,
long elapsedRealtimeOffsetMs,
boolean enableEventMessageTrack,
boolean enableCea608Track,
List<Format> closedCaptionFormats,
@Nullable PlayerTrackEmsgHandler playerEmsgHandler,
@Nullable TransferListener transferListener) {
DataSource dataSource = dataSourceFactory.createDataSource();
......@@ -104,7 +103,7 @@ public class DefaultDashChunkSource implements DashChunkSource {
elapsedRealtimeOffsetMs,
maxSegmentsPerLoad,
enableEventMessageTrack,
enableCea608Track,
closedCaptionFormats,
playerEmsgHandler);
}
......@@ -141,9 +140,8 @@ public class DefaultDashChunkSource implements DashChunkSource {
* @param maxSegmentsPerLoad The maximum number of segments to combine into a single request. Note
* that segments will only be combined if their {@link Uri}s are the same and if their data
* ranges are adjacent.
* @param enableEventMessageTrack Whether the chunks generated by the source may output an event
* message track.
* @param enableCea608Track Whether the chunks generated by the source may output a CEA-608 track.
* @param enableEventMessageTrack Whether to output an event message track.
* @param closedCaptionFormats The {@link Format Formats} of closed caption tracks to be output.
* @param playerTrackEmsgHandler The {@link PlayerTrackEmsgHandler} instance to handle emsg
* messages targeting the player. Maybe null if this is not necessary.
*/
......@@ -158,7 +156,7 @@ public class DefaultDashChunkSource implements DashChunkSource {
long elapsedRealtimeOffsetMs,
int maxSegmentsPerLoad,
boolean enableEventMessageTrack,
boolean enableCea608Track,
List<Format> closedCaptionFormats,
@Nullable PlayerTrackEmsgHandler playerTrackEmsgHandler) {
this.manifestLoaderErrorThrower = manifestLoaderErrorThrower;
this.manifest = manifest;
......@@ -184,7 +182,7 @@ public class DefaultDashChunkSource implements DashChunkSource {
trackType,
representation,
enableEventMessageTrack,
enableCea608Track,
closedCaptionFormats,
playerTrackEmsgHandler);
}
}
......@@ -629,7 +627,7 @@ public class DefaultDashChunkSource implements DashChunkSource {
int trackType,
Representation representation,
boolean enableEventMessageTrack,
boolean enableCea608Track,
List<Format> closedCaptionFormats,
TrackOutput playerEmsgTrackOutput) {
this(
periodDurationUs,
......@@ -638,7 +636,7 @@ public class DefaultDashChunkSource implements DashChunkSource {
trackType,
representation,
enableEventMessageTrack,
enableCea608Track,
closedCaptionFormats,
playerEmsgTrackOutput),
/* segmentNumShift= */ 0,
representation.getIndex());
......@@ -783,7 +781,7 @@ public class DefaultDashChunkSource implements DashChunkSource {
int trackType,
Representation representation,
boolean enableEventMessageTrack,
boolean enableCea608Track,
List<Format> closedCaptionFormats,
TrackOutput playerEmsgTrackOutput) {
String containerMimeType = representation.format.containerMimeType;
if (mimeTypeIsRawText(containerMimeType)) {
......@@ -799,12 +797,6 @@ public class DefaultDashChunkSource implements DashChunkSource {
if (enableEventMessageTrack) {
flags |= FragmentedMp4Extractor.FLAG_ENABLE_EMSG_TRACK;
}
// TODO: Use caption format information from the manifest if available.
List<Format> closedCaptionFormats =
enableCea608Track
? Collections.singletonList(
Format.createTextSampleFormat(null, MimeTypes.APPLICATION_CEA608, 0, null))
: Collections.emptyList();
extractor =
new FragmentedMp4Extractor(
flags, null, null, null, closedCaptionFormats, playerEmsgTrackOutput);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment