252 Commits

Author SHA1 Message Date
andrewlewis
d657360341 Expose period information from MediaSources.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128357449
2016-07-28 19:39:07 +01:00
olly
692d756ee6 Simplification: Move common logic to TrackSelection
- TrackSelection now exposes the selected formats, ordered
  by decreasing bandwidth. This removes the need for DASH,
  SS and HLS to do the sorting individually.
- The change also removes the need to reconstruct TrackSelection
  instances with a different group index in various places
  (e.g. MergingMediaPeriod).
- This is also a step toward potentially packaging the
  FormatEvaluator inside of the TrackSelection (TBD).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128159064
2016-07-22 22:41:36 +01:00
olly
fc457e4c1b Move default DRM callback implementation to library
This also removes direct use of HttpURLConnection and
allows use of any HttpDataSource for license requests,
which means those using OkHttp can finally use the
same network stack for license requests as they're using
for everything else, without having to implement their
own callback.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127841045
2016-07-22 22:41:35 +01:00
mishragaurav
a61828a675 Merge widevine playback tests to v2.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127825954
2016-07-22 22:41:35 +01:00
olly
6c2a967763 BandwidthMeter shouldn't extend TransferListener
There may be other ways to estimate bandwidth that don't
require listening to our own transfers.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127741651
2016-07-22 22:21:54 +01:00
olly
74b43e26bd Allow injection of custom ChunkSources
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127737169
2016-07-22 22:21:06 +01:00
olly
5360ddc519 Allow injection of custom FormatEvaluators
This was possible previously, but now we support things
like multi-period DASH we need to do the injection in
the form of factories rather than concrete instances.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127735816
2016-07-22 22:20:32 +01:00
olly
dcc1ac56df Make Renderer an interface
In V1 we received complaints that Renderer was too locked down.
In particular, it wasn't possible to implement a Renderer that
wrapped another Renderer, since most of the methods were package
private and final (e.g. enable).

This change defines Renderer as a proper interface, removing
this limitation. A method-reordering-only change will follow
this one, to get things into a nice consistent/sane order in
each of the Renderer classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127527995
2016-07-15 18:19:23 +01:00
olly
7c551081f5 Only pass RendererCapabilities to TrackSelectors
We should only give a TrackSelector access to what it
needs, not the whole Renderer. This is particular true
if [] happens, since more Renderer methods
will become publicly visible.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127526473
2016-07-15 18:18:50 +01:00
olly
f758082d40 Big (and hopefully near-final) rename.
1. Rename "extensions" package to "decoder". It's used by both
   text and (should be used by) metadata, so it's no longer just
   for extensions.
2. Move Buffer objects move into the decoder package.
3. Rename SubtitleParser and MetadataParser to SubtitleDecoder
   and MetadataDecoder respectively, since they extend Decoder.
   Ditto for all subclasses.
4. Subtitle and Metadata decoders now throw their own exception
   types rather than ParserException.
5. Move MediaCodec classes into a mediacodec package, with the
   exception of the concrete audio and video renderers.
6. Create an audio package to hold the two audio renderer classes
   plus related util classes.
7. Create a video package to hold the one video renderer class
   plus related util classes.

After this change the following nice properties hold:

1. Want a video renderer? Look in the video package. Ditto for
   audio, text and metadata.
2. All TrackRenderer implementations use a decoder of some kind
   to decode buffers received from the source, so we have
   consistent terminology there.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127326805
2016-07-15 18:14:55 +01:00
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
bcca373f5b Rename DecoderInfo -> MediaCodecDecoderInfo
All other MediaCodec specific classes are prefixed MediaCodec,
and we now have other decoders that aren't not related to
MediaCodec.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127093330
2016-07-15 18:04:19 +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
olly
06fd826a5c Restore injection of non-default retry count.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126646585
2016-07-07 20:43:38 +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
4fe6e5d755 Misc fixes for playback tests.
- AllowedVideoJoiningTimeMs must be set to 0 for tests so
  that tests which disable/enable video renderers don't
  register a large number of dropped frames.
- Fixed a threading issue that could cause occassional test
  failure.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124978843
2016-06-15 20:28:17 +01:00
olly
aab551e907 Add HlsTest to V2.
The ones that are commented out are legitimately broken
and will need a library fix.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124978438
2016-06-15 20:27:48 +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
266c0dce40 Add DashTest to V2
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124831095
2016-06-15 19:43:17 +01:00
olly
5cd7deffe7 Add playback tests to V2.
DashTest will be migrated separately, since it's a little
more work.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124722462
2016-06-15 19:43:17 +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
mishragaurav
c1e99277d2 Check support for adaptive playback
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111348701
2016-01-05 14:52:36 +00:00
mishragaurav
81a74af933 Adding tests for H265
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111310622
2016-01-04 20:58:53 +00:00
mishragaurav
f2fd57cde1 Adding dummy device report log.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=110768506
2016-01-04 20:58:30 +00:00
olly
7fbffc873c Expose control over decoder selection.
This allows implementation and injection of custom MediaCodecSelector
instances. By injecting a custom selector, it's possible for applications
to exert more control over which decoder(s) they instantiate. For example,
applications can force use of a software decoder.

GitHub Issue #938
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=110369810
2015-12-16 20:41:51 +00:00
olly
f37fcddfb0 Tweak DashTest VP9 constants.
This is a no-op change that just makes the definitions consistent
with the H264 ones, for general neatness/consistency reasons.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=109892547
2015-12-14 10:39:45 +00:00
olly
345e4ec74e Bump version to 1.5.3.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=109698010
2015-12-08 18:00:46 +00:00
Oliver Woodman
1fc32d56c8 check maximum consecutively dropped frames in video tests 2015-11-25 17:01:21 +00:00
Oliver Woodman
632ccc6c20 Simplify passthrough playback rate calculation.
This change also fixes pre-M DTS HD passthrough playback on NVIDIA Shield.
2015-11-25 16:43:56 +00:00
Oliver Woodman
a4f1e3ce53 Don't re-buffer when AudioTrack underruns occur. 2015-11-17 16:27:53 +00:00
Oliver Woodman
c92bc3e6c2 Enhance DASH playback tests 2015-11-17 16:18:43 +00:00
Oliver Woodman
cda5b20353 Bump version to 1.5.2 2015-10-27 20:15:37 +00:00
Oliver Woodman
0de2d3a863 Add VP9 playback tests 2015-10-26 15:25:02 +00:00
Oliver Woodman
c0f0cbcb7a Move to target API level 23 2015-10-26 15:02:32 +00:00
Oliver Woodman
0545c58dee Bump version to 1.5.1 2015-10-14 12:12:03 +01:00
Oliver Woodman
b7d242e2c1 Add missing Eclipse files for playback tests. 2015-10-12 12:32:49 +01:00
Oliver Woodman
bcb9f8282d Enable SmoothFrameTimeHelper by default.
Context:
- Currently, playback is significantly more juddery with it disabled,
  particularly on AndroidTV.
- We should be able to do the "best" job of this internally, so injection
  doesn't buy anything useful. If someone has a better implementation for
  adjusting the frame release, they should improve the core library.
2015-10-12 12:32:10 +01:00
Oliver Woodman
427cb34aca Bump version to 1.5.0 2015-09-28 20:56:28 +01:00
Oliver Woodman
c3e0d34aa1 Fixed int overflow issue with callbacks on very long-running streams. 2015-09-28 12:22:12 +01:00
Oliver Woodman
88452d95ee Playback test tweaks. 2015-09-18 18:24:33 +01:00
Oliver Woodman
8022d28e04 Make certain we have appropriate locks held for playback tests. 2015-09-18 18:21:26 +01:00