385 Commits

Author SHA1 Message Date
olly
7d4c786e21 Make DRM work in ExoPlayer V2.
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
2016-06-15 19:41:33 +01:00
olly
a16a333df2 Clean up renderer event listeners.
- 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
2016-06-15 19:41:32 +01:00
aquilescanta
2f4bfc3f5f Add the TrackSelectionPolicy to decouple track "assignment" and selection
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
2016-06-15 19:41:32 +01:00
olly
ca49d6ff40 Refactor #6.HLS.2
Rename HlsSampleSource2 -> HlsSampleSource.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122418334
2016-06-15 19:41:32 +01:00
olly
770f2c2c58 Refactor #6.HLS.1
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
2016-06-15 19:41:32 +01:00
olly
d70f4a8fc7 Update FMP4 samples.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122409929
2016-06-15 19:41:31 +01:00
olly
f9f95d638b Make ExtractorSampleSource amenable to proguarding.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122085277
2016-06-15 19:41:30 +01:00
olly
5ca9f62753 Refactor #6.HLS.0
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
2016-06-15 19:41:30 +01:00
eguven
9ee3030b79 Opus initialization data should be in native order.
http://developer.android.com/reference/android/media/MediaCodec.html#CSD
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121957004
2016-06-15 19:41:30 +01:00
andrewlewis
cba4d80277 Add extension renderers before library renderers.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121942162
2016-06-15 19:41:30 +01:00
olly
73c90ca0bc Enable FF/RW using Fugu remote.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121940474
2016-06-15 19:41:29 +01:00
eguven
3674f9598e ogg't'opus reader
Support for opus content in ogg container.
TODO: Sample duration and seeking.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121940392
2016-06-15 19:41:29 +01:00
eguven
642b2009f3 Add extensions to v2 demo app.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121674924
2016-06-15 19:40:39 +01:00
olly
0841d043b8 Refactor #6.4: Create child source instances on demand.
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
2016-06-15 19:39:52 +01:00
olly
15a890c3ce Refactor #6.0: Add SampleSources for DASH and SS.
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
2016-06-15 19:39:52 +01:00
olly
784a18a188 Use C constants as event source ids.
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
2016-06-15 19:39:35 +01:00
olly
2e0518f47b Apply Android studio code analysis suggestions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120326293
2016-06-15 19:39:09 +01:00
olly
48bc98f1ed Naming cleanup.
- RollingSampleBuffer -> DefaultTrackOutput
- TsChunk -> HlsMediaChunk
- Established hls.playlist package for HLS playlist things
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120325049
2016-06-15 19:39:09 +01:00
andrewlewis
febf86c54e Clean up demo app source building.
- 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
2016-06-15 19:39:09 +01:00
olly
d9dcc58dca Simplify source building.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119842861
2016-06-15 19:39:08 +01:00
andrewlewis
e4ee19513c Remove ExoPlayer.STATE_PREPARING.
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
2016-06-15 19:39:08 +01:00
olly
f963c626af Remove seeking to live edge.
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
2016-06-15 19:39:07 +01:00
olly
35e0dd8401 Use a single set of track type constants.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119732992
2016-06-15 19:39:07 +01:00
olly
7170ff380c Remove V1 DASH multi-period + seeking-in-window from V2.
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
2016-06-15 19:39:06 +01:00
olly
7c35e38b4e Fix a few issues with SmoothStreaming in V2.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119049397
2016-06-15 19:39:06 +01:00
olly
b977265f59 Remove dead code.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118954433
2016-06-15 19:39:06 +01:00
olly
b041b72bae Yet more simplifications.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118775612
2016-06-15 19:39:05 +01:00
olly
292b2402e6 More SampleSource simplification.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118775144
2016-06-15 19:39:05 +01:00
olly
b0c8a6132d Add DataSourceFactory + implementation.
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
2016-06-15 19:39:05 +01:00
olly
6cc507aac0 Make all DataSource implementations implement getUri.
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
2016-06-15 19:39:04 +01:00
olly
454b3e896c Make demo app ready for multi-window environment coming with N.
* 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
2016-06-15 19:39:04 +01:00
olly
a49c8dc86d Added loadErrorNotification to SingleSampleSource.
Also hooked up DemoPlayer to ExtractorSampleSource events.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117809051
2016-06-15 19:38:06 +01:00
olly
4a38b2cade Fully reset state when displaying track selections.
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
2016-06-15 19:38:06 +01:00
olly
03ed811c7c Add missing eclipse files to experimental.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117544932
2016-06-15 19:38:06 +01:00
olly
1eff6cf210 Bring back multi-audio and VTT support for HLS.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117338865
2016-06-15 19:38:05 +01:00
olly
9cfff0b028 Merge cleaned version of https://github.com/google/ExoPlayer/pull/1234.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117224172
2016-06-15 19:37:44 +01:00
olly
d3d63101d1 [Refactor - Step #5] Introduce TrackSelector
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
2016-06-15 18:54:51 +01:00
olly
a7adcce018 One Format object to rule them all.
- 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
2016-06-15 18:54:50 +01:00
olly
ce324f1ca9 ExoPlayer V2 Refactor - Step 7 (partial)
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
2016-06-15 18:54:38 +01:00
olly
be47148940 ExoPlayer V2 Refactor - Step 4
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
2016-06-15 18:54:26 +01:00
olly
cdae9ac5d2 ExoPlayer V2 Refactor - Steps 1/2.
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
2016-06-15 18:53:40 +01:00
Oliver Woodman
39a7cea987 Bump version to 1.5.4 2016-01-22 16:07:16 +00:00
Oliver Woodman
89ce1ccedf OggVorbisExtractor (WIP - Seeking not yet enabled) 2016-01-22 11:46:37 +00:00
Oliver Woodman
eda8ac4e01 Add eventSourceId to onAvailableRangeChange events 2016-01-22 11:38:06 +00:00
andrewlewis
317842a6b7 Use expandable headers in the sample chooser.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112149442
2016-01-14 17:13:32 +00:00
olly
2690f569af Enable track selection + WebVTT for HLS.
See the documentation of buildTracks for the gory details.

Issue: #151
Issue: #676
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112149293
2016-01-14 17:13:32 +00:00
olly
59cf3e02f5 HlsChunkSource: Expose stuff for WebVtt/Variant selection.
Issue: #151
Issue: #676
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111945466
2016-01-14 17:13:32 +00:00
eguven
8c8794878d Fixed demo-misc-vp9-opus-sw DASH check
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111839055
2016-01-14 17:13:32 +00:00
olly
ab9e3bac46 Introduce HlsTrackSelector.
This is equivalent to DashTrackSelector and SmoothStreamingTrackSelector.
This is a step toward allowing HlsChunkSource to expose multiple tracks,
which is a requirement for supporting WebVtt.

This change also enables WebVtt extractor instantiation.

Issue: #151
Issue: #676
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111698833
2016-01-14 17:08:25 +00:00
olly
00f8deda3d Introduce PtsTimestampAdjusterProvider for HLS WebVTT.
This allows the same adjusters to be used by multiple
HlsChunkSource instances. This is necessary because
WebVTT chunks will be loaded by a second chunk source
to the one loading audio/video. In both cases the same
timestamp adjustments will need to be applied.

Each source may transition from one discontinuity sequence
to the next at a slightly different time, so it's necessary
to maintain a separate adjuster for each sequence.

An adjuster can only be initialized correctly using audio/video
and not WebVTT, because the start time in a WebVTT file in
HLS doesn't necessarily correspond to the chunk start time,
which means the timestamp offset calculated by the adjuster
could end up being incorrect. Hence sources providing WebVTT
chunks will set isMasterSource to false. Lovely, right :(?

Issue: #151
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111693126
2016-01-14 17:08:25 +00:00