- The package is renamed to avoid conflicts with v1, should any
app wish to include both v1 and v2 for a period of time. This is
similar to the approach used by some other open source projects
(e.g. okhttp).
- Copyright year is updated everywhere for completeness.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126895326
Before this change, calling seekTo then setPlayWhenReady would cause the player
throw an error, due to using the sample source provider before it's set.
Transition to the buffering state in seekToInternal only if we have a sample
source provider.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126804528
Also attempt to clear up naming a little, using "buffering" to
mean the user visible buffering state, and "loading" to mean a
source being loaded.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126693592
At a high level, everything that we need to load in sync
with anything else now implements a new SequenceableLoader
class. This includes ChunkTrackStream, since multiple
demuxed tracks in DASH/SS need to be loaded in sync with
one another. At a higher level, SampleSources are also
SequenceableLoaders, which allows them to be kept in sync
by MultiSampleSource.
CompositeSequenceableLoader is able to load multiple
instances SequenceableLoaders in sync with one another,
and is used in various places where this is required.
This change also removes LoadControl registration, which
was complicated and error prone.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126632861
- Removes the load delay that was previously present after
source preparation.
- Prevents premature failure in the case that the buffering
source fails to prepare.
- SampleSource.Callback will get a second method in a
subsequent CL, approximately meaning "tell me if I can load
more stuff". This will remove the need for LoadControl and
the complexity that comes with it.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126172573
This is required for buffering to work properly across
playlist transitions. It's also much simpler, since
specifying the buffering policy becomes independent of
the type of media being played (i.e. the source).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126051755
1. The readiness of the timeline is only relevant if there
aren't any enabled renderers. It's also only ready if
the source after the playing source is actually prepared
(if not, we're waiting for preparation).
2. Prevent early transition to the ENDED state when the
playback position hits the duration, but we're not at the
final entry in the playlist.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125685193
- Update playbackInfo duration/position/bufferedPosition in a
single place.
- Remove sampleSource variable, and remove side effects from
getSampleSource. There was actually a subtle bug where
getSampleSource wasn't called by anything where no renderers
where enabled (meaning the source never transitioned).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125676540
Also, getBufferedPosition shouldn't be called if no tracks
are selected.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125670213
Also do some naming cleanup + do ms->us seek conversion
in ExoPlayerImpl, since that's where we now do all the
conversions coming out of the player.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125662973
ExoPlayer.EventListener.onPositionDiscontinuity is notified during seeking and
transitioning from one source to the next.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125578976
When buffering playlist items after the currently-playing one,
continueBuffering should take a position that is negative because the playback
position is before the start of the source being buffered. This change makes
sure that ExtractorSampleSources always have a known duration when they are
fully buffered, which means that the correct (negative) source-relative
position can be calculated.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124949409
This is similar to suppression of failures disabling the
renderers (in the block above).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123847812
- Remove need for SampleSources to ref ChunkSources.
- Correctly propagate errors loading manifests through
ChunkSource components.
- Fix some misc warnings.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123732918
Initially only the first source index is used. In a later change,
ExoPlayerImplInternal will create SampleSources for different playlist item
indices as necessary.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123312595
Where multiple messages are required to be sent in order
to perform a player reconfiguration, it will usually be
desirable to process all messages in a single "transaction"
(i.e. without any rendering happening when only some of
the messages have been applied).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123228334
This is required because in V2 we'll be instantiating DRM
session managers before the ExoPlayer instance (and hence
we wont have the Looper). This logic will be further cleaned
up in later CLs that overhaul DrmSessionManager in more
depth.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122453765
If rendererMediaClock is non-null, the rendererMediaClockSource is enabled or
started, so remove the check in updatePositionUs.
When disabling renderers for track selection, renderers with changing track
selections always transition from started -> enabled.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120819483
- Code is simpler. We only ever reset all tracks.
- Allows the standalone media clock to be updated properly. This
allows simpler recovery for live streams in ExtractorSampleSource.
- Fixes#1285 and paves the way for a fix for #758.
Issue: #1285
Issue: #758
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120530682
- Use same constant for unknown/unset microsecond times/durations.
- Change constant values to be nowhere near the "normal" range.
- Misc cleanup.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119944019
prepare(SampleSource) is renamed to setSource(SampleSource). The player
immediately transitions to STATE_BUFFERING when the source is set, at which
point doSomeWork is called.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119838825
TrackRenderer and SampleSourceTrackRenderer both now use a TrackStream
so they can be merged.
(This may also be useful for adding playlist support, in case TrackStreams need
to be replaced during playback.)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119743228
This fixes some nuances with the initial solution. Mainly,
that the TrackStreams returned by selectTrack could not be
used safely until after endTrackSelection was invoked. It
also reduces the need for member variables to track state
between the track selection methods.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118556651
This removes the need for each SampleSource implementation to
implement 3x "if(condition) {noop}" tests (ChunkSampleSource
and SingleSampleSource were missing some of these checks).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118036233
1. SampleSource now has an explicit track selection state. This state is entered
after the source is prepared, and also by calling startTrackSelection.
2. endTrackSelection commits selection changes, and is responsible for doing the
right thing w.r.t starting/stopping/restarting load operations.
3. All sources now start or restart a load in the case of a new track selection.
This fixes a problem where a source could be advanced by repeatedly disabling
and re-enabling whilst paused. Some sources didn't restart a load in this case,
since the position was unchanged, however the downstream renderer would then
consume media up to the first keyframe in order to render something. Hence
each disable/re-enable would advance by a keyframe.
4. This change will enable a subsequent change where we'll discard media for
non-selected tracks earlier than we do currently (i.e. we'll hook the extractor
to a dummy track output, so the samples will never be written to a rolling
buffer). This will enable a further subsequent change where buffer contributions
are per-renderer rather than per-source.
Issue: #1041
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118024436
- Made enabledRenderers an array to avoid loads of method calls.
- Made if so that enabled renderers are always called in a consistent
order, rather than their order changing if they're enabled/disabled
over time. This is likely to make performance more predictable.
- Split out reading of resets into a separate method. This method is
now called directly after seeking on the source, so as to ensure
instant propagation of the new position from source->renderers in
the common case.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117225639
Notes:
- The way this works is that every time the player needs to
select some tracks it invokes the TrackSelector. When a
track selection is actually activated (i.e. "hits the
screen") it gets passed back to the TrackSelector, which
allows it to expose the current tracks through an API that
it may choose to define. Since playlist support doesn't exist
yet, it's currently the case that the pass-back always occurs
immediately.
- A TrackSelector can invalidate its previous selections if its
selection criteria changes. This will force the player to invoke
it again to make a new selection. If the new selection is the
same as the previous one for a renderer then the player handles
this efficiently (i.e. turns it into a no-op).
- DefaultTrackSelector supports disabling/enabling of renderers.
Separately, it supports overrides to select specific formats.
Since formats may change (playlists/periods), overrides are
specific to not only the renderer but also the set of formats
that are available to it. If the formats available to a renderer
change then the override will no longer apply. If the same set
of formats become available at some point later, it will apply
once more. This will nicely handle cases like ad-insertion where
the ads have different formats, but all segments of main content
use the same set of formats.
- In general, in multi-period or playlist cases, the preferred
way of selecting formats will be via constraints (e.g. "don't play
HD", "prefer higher quality audio") rather than explicit format
selections. The ability to set various constraints on
DefaultTrackSelector is future work.
Note about the demo app:
- I've removed the verbose log toggle. I doubt anyone has
ever used it! I've also removed the background audio option.
Without using a service it can't be considered a reference
implementation, so it's probably best to leave developers to
figure this one out. Finally, listening to AudioCapabilities
has also gone. This will be replaced by having the player
detect and handle the capabilities change internally in a
future CL. This will work by allowing a renderer to invalidate
the track selections when its capabilities change, much like
how a selector is able to invalidate the track selections in
this CL.
- It's now possible to enable ABR with an arbitrary subset of
tracks.
- Unsupported tracks are shown grayed out in the UI. I'm not
showing tracks that aren't associated to any renderer, but we
could optionally add that later.
- Every time the tracks change, there's logcat output showing
all of the tracks and which ones are enabled. Unassociated
tracks are displayed in this output.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117122202
This change replaces TrackGroup[] with TrackGroupArray. This is
to allow equality based hashCode and equals implementations.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=115563146
The TrackSelector API will look like:
TrackSelection[] selectTrack(
TrackRenderer[] renderers, TrackGroup[] trackGroups);
In this CL:
- SampleSources return TrackGroup[], so that the result can be easily
passed to the selector.
- TrackStream gets its own file to sit alongside other Track* classes.
- A TrackSelection object is introduced to encapsulate group and track
indices.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=115251331