299 Commits

Author SHA1 Message Date
olly
5cde3aa314 Show toast if media contains only unplayable audio/video.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123885817
2016-06-15 19:42:03 +01:00
olly
00aef6ddb7 Always include extension renderers in SimplePlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123868547
2016-06-15 19:42:03 +01:00
olly
e652116806 Treat unchecking of all boxes as disabling, not default.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123845317
2016-06-15 19:42:02 +01:00
olly
6d62962ab0 Bump version to 2.0.0.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123410989
2016-06-15 19:41:53 +01:00
olly
800006d08d Remove TODOs that we have little urge to actually do.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123410274
2016-06-15 19:41:53 +01:00
andrewlewis
c2b89d6285 Add SampleSourceProvider as a factory for SampleSources (playlists #2).
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
2016-06-15 19:41:35 +01:00
olly
ff7819e86a Delete another class from the demo app.
Merge the two MediaDrmCallback classes, since they're pretty
much identical.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123220343
2016-06-15 19:41:34 +01:00
olly
35d7dad047 Clean up SimpleExoPlayer.
- Simplify setSurface by always blocking when the surface
  is being cleared.
- Add analogous setVolume API.
- Support setting of playback params for extension audio
  decoders. We can probably use this to add a setPlaybackRate
  API to SimpleExoPlayer for API level 23 and above only,
  but we'd probably want to make sure it works properly when
  there's no audio track too, so some thought will be
  required.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123204581
2016-06-15 19:41:34 +01:00
olly
c0cad7f396 Load demo app samples from json.
Also handle .exolist.json links. This lets you put a list of
samples somewhere (e.g. on the web). Clicking it opens the
app and displays the samples it defines.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123198928
2016-06-15 19:41:34 +01:00
vigneshv
9609302b3d Support VPx in ISO-BMFF (MP4) Container
Netflix created a spec to encapsulate VPx codecs in ISO-BMFF (MP4)
Container [1]. This CL adds support for VP8 and VP9 video codecs
in the MP4 container.

[1] https://github.com/Netflix/vp9-dash/blob/master/Downloads/VPCodecISOMediaFileFormatBinding.pdf
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123160650
2016-06-15 19:41:34 +01:00
olly
ced7de15a9 Promote DemoPlayer to library as SimpleExoPlayer.
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
2016-06-15 19:41:34 +01:00
olly
58953d370f Simplify DemoPlayer + misc surrounding components.
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
2016-06-15 19:41:34 +01:00
andrewlewis
ddde6edb92 Add FFmpeg extension.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122978403
2016-06-15 19:41:33 +01:00
andrewlewis
7d9541848e Rename mpdIntent to intent.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122730041
2016-06-15 19:41:33 +01:00
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