473 Commits

Author SHA1 Message Date
olly
4f718363b5 Remove BandwidthMeter from SimpleExoPlayer
The BandwidthMeter should only be used by MediaSource
instances and the objects they reference, so there's
really no reason for the player to need to know about it.

This change sacrifices DebugTextViewHelper showing the
estimated bandwidth, but I think that's a price worth
paying.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127316755
2016-07-15 18:14:14 +01:00
[]inger
e4a3483d6f Propagate audioSessionId.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127300225
2016-07-15 18:12:20 +01:00
olly
d4d1640808 Use extension rather than composition for track selection
It doesn't look like TrackSelectionPolicy is going to be
useful other than with DefaultTrackSelector, and it's kinda
confusing dealing with both "selector" and "policy"
terminology. This change does the following:

DefaultTrackSelector -> selector.MappingTrackSelector
DefaultTrackSelectionPolicy -> selector.DefaultTrackSelector
TrackSelectionPolicy -> [deleted]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127196326
2016-07-15 18:08:36 +01:00
olly
be9d77c59c Add new UI package.
There aren't really enough classes to justify it right
now, but if we're going to do a VideoView equivalent and
sensible player controls at some point, it's worth making
now to get classes into the correct place.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127184374
2016-07-15 18:06:12 +01:00
aquilescanta
9385b4fdf4 Add version to SampleChooserActivity for Exoplayer2
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127179274
2016-07-15 18:05:37 +01:00
olly
4e86c55361 Introduce source package for sources
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127073630
2016-07-15 18:02:31 +01:00
olly
9558a4cb99 Rename TrackRenderer -> Renderer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127065122
2016-07-15 18:00:32 +01:00
olly
8e0354c0a6 Finalize class naming
SampleSourceProvider -> MediaSource
SampleSource -> MediaPeriod
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126914964
2016-07-15 17:59:52 +01:00
olly
dbb43567a3 Finalize v2 directory + package name
- 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
2016-07-08 12:12:09 +01:00
andrewlewis
af3452d231 Make SampleSources reusable and implement SampleSourceProvider.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126888556
2016-07-08 10:15:14 +01:00
olly
19d65a7a9d Report loading on/off changes via ExoPlayer.
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
2016-07-07 20:45:53 +01:00
andrewlewis
dd031691b0 Pass an ExtractorsFactory to ExtractorSampleSource.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126672854
2016-07-07 20:44:12 +01:00
olly
7b9e47ec6b Event based buffering.
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
2016-07-07 20:41:52 +01:00
olly
f0f25aef83 Support playlists in exolist.json.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126622342
2016-07-07 20:40:44 +01:00
olly
bd3574dfba Allow SampleSourceProvider concatenation, simplify demo.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126196431
2016-07-07 20:37:35 +01:00
olly
76f426e944 Introduce a global buffering policy.
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
2016-07-07 20:34:57 +01:00
andrewlewis
2073f3fce3 Expose source indices via ExoPlayer (playlists #5).
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
2016-07-07 20:23:21 +01:00
olly
e9f9df8faa Track selection UI needs to scroll.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124976833
2016-06-15 20:27:14 +01:00
olly
ec4c7d3acf Remove Eclipse support. Simplify manifests.
It looks like the manifests are essentially pointless,
but various tools are unhappy if I delete them.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124976509
2016-06-15 20:26:37 +01:00
olly
f4e4fd51c6 Clean up chunked media source event listeners.
- Event listener is now at the SampleSource level, since the
  individual ChunkTrackStream instances are created internally.
- Event listener receives events corresponding to loads made
  at the SampleSource level (e.g. manifest fetches) in addition
  to those made by the ChunkTrackStream instances.
- Added ability for FormatEvaluators to propagate arbitrary
  information (as an Object) through to the listeners. This was
  a request from YouTube.
- Added significantly more information to each event, for example
  the DataSpec that defines the load being made is now passed, as
  is timing information.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124732984
2016-06-15 19:43:17 +01:00
olly
0978227a84 Create a new CodecCounters on enable
If the same instance is reset then rapidly re-enabling the
renderer after disabling it can prevent an application from
reading the final values at the time when the renderer was
disabled. Hence we now instantiate a new CodecCounters each
time. This is needed to migrate DashTest to V2.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124721106
2016-06-15 19:42:58 +01:00
olly
4a3980c71e Add format change events to SimpleExoPlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124344637
2016-06-15 19:42:12 +01:00
olly
cb9a64da33 Merge ID3 parsing improvements from GitHub.
- Parse APIC and TextInformation frames.
- In MPEG-TS, don't mind if packets contain end padding.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124079930
2016-06-15 19:42:04 +01:00
olly
ff745ac444 Make ExtractorSampleSource constructor consistent.
The allocator and buffering policy (e.g. how large the buffer
is) is moving to the top level as part of playlist support,
so it no longer makes sense to inject these parameters as
args into ExtractorSampleSource's constructor.

Instantiating the allocator and buffer size inside of the
source is temporary and only until they're moved up.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123968976
2016-06-15 19:42:03 +01:00
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