From 74e8acf14f23fc60abe7c0a06dd3c03eeb3e2316 Mon Sep 17 00:00:00 2001 From: olly Date: Tue, 8 Aug 2017 10:54:06 -0700 Subject: [PATCH 01/59] Minimal change to expose segment indices in DefaultDashChunkSource Issue: #3037 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=164614478 --- .../source/dash/DefaultDashChunkSource.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSource.java b/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSource.java index 297052f65a6..dd62d47621d 100644 --- a/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSource.java +++ b/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSource.java @@ -85,14 +85,14 @@ public DashChunkSource createDashChunkSource(LoaderErrorThrower manifestLoaderEr private final int[] adaptationSetIndices; private final TrackSelection trackSelection; private final int trackType; - private final RepresentationHolder[] representationHolders; private final DataSource dataSource; private final long elapsedRealtimeOffsetMs; private final int maxSegmentsPerLoad; + protected final RepresentationHolder[] representationHolders; + private DashManifest manifest; private int periodIndex; - private IOException fatalError; private boolean missingLastSegment; @@ -377,9 +377,12 @@ private static Chunk newMediaChunk(RepresentationHolder representationHolder, // Protected classes. + /** + * Holds information about a single {@link Representation}. + */ protected static final class RepresentationHolder { - public final ChunkExtractorWrapper extractorWrapper; + /* package */ final ChunkExtractorWrapper extractorWrapper; public Representation representation; public DashSegmentIndex segmentIndex; @@ -387,7 +390,7 @@ protected static final class RepresentationHolder { private long periodDurationUs; private int segmentNumShift; - public RepresentationHolder(long periodDurationUs, Representation representation, + /* package */ RepresentationHolder(long periodDurationUs, Representation representation, boolean enableEventMessageTrack, boolean enableCea608Track) { this.periodDurationUs = periodDurationUs; this.representation = representation; @@ -417,8 +420,8 @@ public RepresentationHolder(long periodDurationUs, Representation representation segmentIndex = representation.getIndex(); } - public void updateRepresentation(long newPeriodDurationUs, Representation newRepresentation) - throws BehindLiveWindowException{ + /* package */ void updateRepresentation(long newPeriodDurationUs, + Representation newRepresentation) throws BehindLiveWindowException { DashSegmentIndex oldIndex = representation.getIndex(); DashSegmentIndex newIndex = newRepresentation.getIndex(); From bc0829503acd094d58fecb6bde64f4b734654c5d Mon Sep 17 00:00:00 2001 From: olly Date: Wed, 9 Aug 2017 03:21:25 -0700 Subject: [PATCH 02/59] Clean up terminology for MediaSession extension ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=164705750 --- extensions/mediasession/README.md | 8 ++++---- .../ext/mediasession/MediaSessionConnector.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/mediasession/README.md b/extensions/mediasession/README.md index 3acf8e4c79e..60fec9fb608 100644 --- a/extensions/mediasession/README.md +++ b/extensions/mediasession/README.md @@ -2,10 +2,10 @@ ## Description ## -The MediaSession extension mediates between an ExoPlayer instance and a -[MediaSession][]. It automatically retrieves and implements playback actions -and syncs the player state with the state of the media session. The behaviour -can be extended to support other playback and custom actions. +The MediaSession extension mediates between a Player (or ExoPlayer) instance +and a [MediaSession][]. It automatically retrieves and implements playback +actions and syncs the player state with the state of the media session. The +behaviour can be extended to support other playback and custom actions. [MediaSession]: https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat.html diff --git a/extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.java b/extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.java index 0e839b80831..33807930a53 100644 --- a/extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.java +++ b/extensions/mediasession/src/main/java/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.java @@ -47,7 +47,7 @@ * Connects a {@link MediaSessionCompat} to a {@link Player}. *

* The connector listens for actions sent by the media session's controller and implements these - * actions by calling appropriate ExoPlayer methods. The playback state of the media session is + * actions by calling appropriate player methods. The playback state of the media session is * automatically synced with the player. The connector can also be optionally extended by providing * various collaborators: *