DemoPlayer moves into core library as SimpleExoPlayer, which
implements ExoPlayer.
Issue: #383
Issue: #592
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123090184
1. Properly split out listening responsibilities so that
DemoPlayer only listens to its own components.
2. Revert StreamingDrmSessionManager UnsupportedDrmScheme
exceptions back to how they worked in V1, and inject
a DrmSessionManager rather than a MediaDrmCallback into
DemoPlayer.
This much better prepares DemoPlayer for promotion into
the core ExoPlayer library, since it removes assumptions
such as what SampleSource and DrmSessionManager impls
might be used with it.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122980952
Bigger changes will be coming, but this gets DRM back
up and working again.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122719062
- Don't report errors to listeners if playback will immediately
fail. Doing so is redundant, since such errors are immediately
reported through ExoPlayer's listener as a result of playback
failure. We were also reporting these errors inconsistently
across renderers.
- Reduce code duplication through EventDispatcher classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122519976
Allows the user to provide their own criteria for selecting one of the available tracks
without having to reimplement the track assignment logic, i.e. linking type x tracks with
type x renderer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122422087
1. Merge HlsOutput and HlsSampleSource -> HlsTrackStreamWrapper.
2. Rename HlsSource -> HlsSampleSource2. This will be renamed to
HlsSampleSource in a subsequent CL.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122415970
Mechanical step to create a new HlsSource in the library.
Note that naming is now confusing. This will be fixed in
the next CL, when:
HlsSource -> HlsSampleSource
HlsSampleSource+HlsOutput -> HlsOutput
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122054800
Support for opus content in ogg container.
TODO: Sample duration and seeking.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121940392
Dash/SS SampleSources now instantiate ChunkSource and
ChunkSampleSource (renamed to ChunkTrackStream) instances
on demand as tracks are enabled. The TrackGroups exposed
by the DASH/SS SampleSources are now constructed at the
top level.
Note that this change resolves the TODOs at the top of the
ChunkSource classes, allowing multiple adaptation sets of
the same type.
Next steps will include:
- Bring back UTC timing element support for DASH, which
will be an extra request during preparation in the DASH
SampleSource.
- Simplification of manifest fetching to use a Loader directly
in the two top level SampleSource classes. ManifestFetcher
should eventually go away once HLS no longer needs it.
- Eventually, some consolidation between DASH/SS. There's a
lot of common code there now.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121001777
This is a mechanical change. The two new SampleSource classes
are forked from MultiSampleSource, with the logic that previously
was in the demo app's SourceBuilder methods copied into the
corresponding constructors. Subsequent steps will:
1. Pull the initial manifest processing from DashChunkSource and
SmoothStreamingChunkSource into the new SampleSource classes.
2. Remove the construction of ChunkSampleSource instances from
the constructors, instead instantiating children only as needed
when tracks are enabled.
3. Simplify ChunkSampleSource down into a ChunkTrackStream object.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121001021
The construction currently in SourceBuilder will be
moving inside of the core lib, so it can't refer to
DemoPlayer constants.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120822759
- RollingSampleBuffer -> DefaultTrackOutput
- TsChunk -> HlsMediaChunk
- Established hls.playlist package for HLS playlist things
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120325049
- Rename preparePlayer to initializePlayer, to reflect the fact that the
preparing state is gone. Replace playerNeedsPrepare with playerNeedsSource.
- playWhenReady is now always true in calls to initializePlayer.
- Handle the intent just before setting the source.
- Use URIs consistently instead of Strings to avoid reparsing.
- onShown becomes initializePlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120125576
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
This is in preparation for the player knowing about the live
window, at which point only correct playback positions will be
passed into ChunkSource implementations. Note that both
implementations bound the chunk index within range in case of,
for example, off-by-one errors caused by very recent manifest
updates.
This will temporarily cause live playbacks to always start at
the beginning of the current live window (we'll be trying to
play from t=0, which will be adjusted to the start of the live
window as a result of the bounding).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119733559
Both of these features are being promoted to first class
citizens in V2 (multi-period support will be handled via
playlists, seeking-in-window will be handled by exposing
the window/timeline from the player and via the normal
seek API). For now, it's much easier to continue the
refactoring process with the features removed.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119518675
Step 6 of the refactor involves moving the logic that's
currently in the SourceBuilder classes in the demo app
into new SampleSource classes in the library. These classes
will construct video/audio/text pipelines on-demand (i.e.
when tracks are enabled) rather than constructing them all
up front as is currently the case in the SourceBuilder
classes. Hence we need a way to instantiate DataSource
instances (i.e. a DataSourceFactory ;)).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118722180
In V2 we'll at some point start using DataSource factories
for creating DataSource instances. If there are two DataSource
interfaces this gets unnecessarily awkward.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118470751
* Do not stop playback onPause but onStop in N and greater.
* Fix back navigation after app has been put to background.
* Make VIEW intent work when PlaybackActitivty is already launched.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118022964
When showing a track selection for a renderer, the override
variable could end up being retained from some previous call
to show a track selection for some other renderer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117557994
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
- Format can represent both container and sample formats.
If a container contains a single track (as is true in
DASH and SmoothStreaming) then the container Format can
also contain sufficient information about the samples
to allow for track selection. This avoids the Format to
MediaFormat conversions that we were previously doing in
ChunkSource implementations.
- One important result of this change is that adaptive
format evaluation and static format selection now use the
same format objects, which is a whole lot less confusing
for someone who wants to implement both initial selection
and subsequent adaptation logic. It's not in the V2 doc,
but it may well make sense if the TrackSelector not only
selects the tracks to enable for an adaptive playback, but
also injects a FormatEvaluator when enabling them that will
control the subsequent adaptive selections. That would make
it so that all format selection logic originates from the
same place.
- As part of this change, the adaptiveX variables are removed
from the format object; they don't really correspond to a
single format. This also saves on having to inject the max
video dimensions through a bunch of classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=114546777
This change removes the need for SourceBuilders to load their
manifests before building their sources. This is done by pushing
initial manifest loads into the ChunkSource classes. This simplifies
the SourceBuilders a lot, and also DemoPlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=113259259
Notes:
1. The logic in ExoPlayerImplInternal is very temporary, until we
have proper TrackSelector implementations. Ignore the fact that
it's crazy and has loads of nesting.
2. This change removes all capabilities checking. TrackRenderer
implementations will be updated to perform these checks in a
subsequent CL.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=113151233
GitHub note - Apologies for the cryptic change descriptions,
they relate to a design doc that's not externally visible.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=113043764