256 Commits

Author SHA1 Message Date
eguven
b3da82dc1c Open source DownloadService, DownloadManager and related classes
Issue: #2643

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184844484
2018-02-08 14:47:54 +00:00
eguven
1dde2adbf3 Add SegmentDownloader.getAllRepresentationKeys method
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183656655
2018-02-01 14:59:11 +00:00
tonihei
e4a91b9e3d Make SsMediaSource reusable.
GitHub:#3498

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183369041
2018-02-01 14:26:54 +00:00
aquilescanta
677fc291cf Use long for HLS media sequences
Issue:#3747

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183366339
2018-02-01 14:25:01 +00:00
hoangtc
3d320e9506 Fix a minor bug in SsMediaSource.
When SsMediaSource loads Manifest, it dispatches loadCompleted event even when
the load is cancelled. This change makes sure SsMediaSource dispatch
loadCancelled event instead.

GitHub: #3754

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183241940
2018-02-01 14:21:21 +00:00
eguven
8b79028880 Add filtering manifest parsers for DASH, HLS and SmoothStreaming
These parsers can be used to get a manifest which includes only the
representations identified by the given keys.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182932874
2018-01-23 19:36:41 +00:00
tonihei
e991a8015b Use Truth instead of framework asserts in all tests.
This achieves two things:
1. All our tests use the same type of assertions.
2. The tests currently run as instrumentation test can be moved to
   Robolectric without changing the assertions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182910542
2018-01-23 19:29:12 +00:00
tonihei
cfed8791b0 Send downStreamFormatChanged notification for embedded streams.
This allows listeners to get notified of any change to the embedded tracks.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181969023
2018-01-23 18:38:17 +00:00
olly
ff1bb2f702 Apply SeekParameters to DASH + SmoothStreaming playbacks
Issue: #2882

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181314086
2018-01-15 11:34:48 +00:00
tonihei
4867748c50 Add assertions to check that media sources are not prepared twice.
This lets apps fail-fast when they try to reuse media source instances.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180934445
2018-01-15 11:23:31 +00:00
olly
2e3667eeff Expose ability to get adjusted seek position from MediaPeriod
Issue: #2882

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178606133
2017-12-12 19:16:34 +00:00
andrewlewis
8947950b52 Make SsMediaSource.Builder a factory for SsMediaSources
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178380856
2017-12-12 19:09:46 +00:00
hoangtc
88dea59cd2 Add ability for media period to discard buffered media at the back of the queue
In some occasions, we may want to discard a part of the buffered media to
improve playback quality. This CL adds this functionality by allowing the
loading media period to re-evaluate its buffer periodically (every 2s) and discard
chunks as it needs.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177958910
2017-12-12 18:43:26 +00:00
andrewlewis
fd938fb454 Update internal usages of deprecated AdaptiveMediaSourceEventListener
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177786580
2017-12-04 17:38:11 +00:00
olly
c06fe73b66 Bump target API level to 27
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176366693
2017-11-21 13:03:28 +00:00
hoangtc
0de57cbfae Allow more flexible loading strategy when loading multiple sub streams.
Currently for a DASH ChunkSource that consists of multiple sub-streams, we
always use a CompositeSequenceableLoader, which only allows the furthest behind
loader or any loader that are behind current playback position to continue
loading.
This changes allow clients to have more flexibility when deciding the loading
strategy:
- They can construct a different kind of composite SequenceableLoader from
the sub-loaders, and use it by injecting a different CompositeSequeableLoaderFactory accordingly.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176363870
2017-11-21 12:59:11 +00:00
olly
82d0a27fd9 Fix some lint issues.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176337058
2017-11-20 13:39:03 +00:00
olly
bd0bc03f64 Inject toKeyframe discard parameter from ExoPlayerImplInternal
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175805139
2017-11-17 18:45:51 +00:00
olly
22b95032b3 Reinstate buffer discard for SmoothStreaming
Now we have a ChunkSampleStream.discardBuffer, we need to call
it from SsMediaPeriod as well as for the DASH case.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175675427
2017-11-17 18:35:39 +00:00
hoangtc
fee6cf5cd8 Continue adding Builder to MediaSource.
Add Builder pattern to SsMediaSource and mark existing constructors as
deprecated.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175659618
2017-11-17 18:29:50 +00:00
olly
3c201a0491 Pass MediaSource instance through onSourceInfoRefreshed
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173382423
2017-10-27 16:13:59 +01:00
andrewlewis
9306b24c65 Fix some Android Studio inspection warnings
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173085316
2017-10-27 15:54:17 +01:00
olly
d09f872179 Fix positions passed to TrackSelection
- When transitioning to a new period, the value of bufferedDurationUs
  passed to TrackSelection.updateSelectedTrack was incorrectly set to
  0. It should have been set to correctly reflect buffered media in
  previous periods still being played out.
- This change fixes the issue described above, and also propagates the
  playback position through to this method. The position of the next
  load within the period can be calculated by adding the position and
  bufferedDurationUs.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172736101
2017-10-19 16:48:39 +01:00
hoangtc
324339b88f Tweak live-streaming track selection logic.
Follow-up on the update to ABR logic in AdaptiveTrackSelection for live
streaming case:
- Do not reset liveEdgeTimeUs when user seek to a different position.
- For HlsChunkSource, for non-independent segments, currently the
bufferedDuration calculate will subtract previousChunk's duration. So to make
it work with live-streaming ABR logic, we subtract timeToLiveEdgeUs a similar
amount to compensate for that operation.
- Minor update to DefaultSSChunkSource, only perform TrackSelection when needed
(after checking necessary conditions).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169531275
2017-09-26 13:48:23 +01:00
olly
ce7aaab3c6 Handle bracket params on the end of SmoothStreaming URLs
Issue: #3230

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169421873
2017-09-20 19:29:17 +01:00
aquilescanta
6314a0ec82 Add support for Widevine encrypted HLS
This includes both cbcs and cenc. Will only work for streams that require a single
pssh.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169382884
2017-09-20 19:28:02 +01:00
hoangtc
5019da3e7b Update ABR logic in AdaptiveTrackSelection for live streaming case
In live streaming, if the playback position is very close to live edge,
the buffered duration will never reach minDurationForQualityIncreaseMs,
which prevents switching from ever happening. So we will provide the
durationToLiveEdgeUs to AdaptiveTrackSelection in live streaming case,
so it can handle this edge case.

GitHub: #3017

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168535969
2017-09-15 23:33:10 +01:00
olly
ca2bfbc56e DashManifestParser: Move schemeType up to DrmInitData
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167171407
2017-09-04 10:23:33 +01:00
olly
b0df6dce98 Fix moe config
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166914821
2017-08-29 23:55:19 +01:00
olly
5bed2bf503 Don't copy primary-track format to non-primary tracks
This time plumbing the track type in from the other side.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166898172
2017-08-29 23:17:16 +01:00
eguven
cc58b515b7 Make Downloaders open source
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166486294
2017-08-29 23:03:08 +01:00
tonihei
10f1bd7396 Add shuffle mode parameter to Timeline interface methods.
This parameter is used by methods such as getNextWindowIndex
and getPreviousWindowIndex to determine the playback order.
Additionally, there are method to query the first and last
window index given the shuffle mode.

None of the timeline implementations nor the ExoPlayer
implementation supports shuffling so far.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166170229
2017-08-29 22:37:27 +01:00
Oliver Woodman
cc9a93d9d9 Rm SS offline for now 2017-08-17 23:18:58 +01:00
olly
34960ad891 Tweak and add READMEs + remove refs to V1
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165578518
2017-08-17 22:59:34 +01:00
olly
f72cd2b014 Add SmoothStreaming downloader and download action
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165305815
2017-08-17 22:45:35 +01:00
olly
b9f5cc7256 Add missing TrackKey class
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165296184
2017-08-17 22:44:20 +01:00
olly
4b706d9484 Add SsManifest.copy and TrackKey for SmoothStreaming downloads
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165295985
2017-08-17 22:43:05 +01:00
olly
40f34956a8 Bump minimum and target API levels + support lib version
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164863447
2017-08-11 15:01:43 +01:00
eguven
427411befb Disable test coverage again
https://issuetracker.google.com/issues/37019591 causes local variables can't be found while debugging.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164449443
2017-08-07 13:38:15 +01:00
tonihei
3ff9695a73 Move getBufferedPositionUs into SequenceableLoader.
All implementations of SequenceableLoader already implement this method.
Moreover, all composite media periods contained an exact copy of an
implementation that now moved to CompositeSequencableLoader.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162349083
2017-07-19 14:08:59 +01:00
olly
387720d182 Allow module registrations + log player release
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162223981
2017-07-17 23:21:34 +01:00
olly
4a59c7cf40 Make it easier to use ExoPlayer modules in other projects II
With this change, it becomes possible to depend on ExoPlayer
locally in settings.gradle by doing:

gradle.ext.exoplayerRoot = 'path/to/exoplayer/root'
apply from: new File(gradle.ext.exoplayerRoot, 'core_settings.gradle')

You can optionally add a prefix onto ExoPlayer's module names
by adding:

gradle.ext.exoplayerModulePrefix = 'prefix'

Issue: #2851
Issue: #2974

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160277967
2017-06-28 22:26:05 +01:00
olly
2a8eb5a2a1 Make it easier to use ExoPlayer modules in other projects
It's currently difficult to use ExoPlayer modules in other gradle
projects because they rely on constants and dependencies defined
in our own top level gradle file. This change moves the constants
into a separate file referenced directly from each module. It also
removes the need for the top level gradle file to declare a
dependency on com.novoda:bintray-release. This is now only needed
if "exoplayerPublishEnabled = true" is specified.

Issue: #2851
Issue: #2974

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160272072
2017-06-28 22:26:05 +01:00
andrewlewis
675756d32d Create MediaPeriods based on an identifier not an index
This will allow MediaSources to provide MediaPeriods that correspond to ad
breaks in a timeline period rather than content for a timeline period, in a
future change.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160267841
2017-06-28 22:26:05 +01:00
aquilescanta
aca80b8347 Add support for pattern encryption and default initialization vectors
This will extend our CENC modes support to cbcs and cens. The change was
not split into two different CLs due to lack of test content for
default initialization vectors, aside from AES-CBCS encrypted ones.

Issue:#1661
Issue:#1989
Issue:#2089

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159810371
2017-06-22 20:23:42 +01:00
aquilescanta
317a994499 Add type to DrmInitData.SchemeData
At the moment, only CENC-defined scheme types are known values.
This will allow having more information about the encryption
scheme through the format, which in turn will allow more informed
decisions on format support.

Issue:#1661
Issue:#1989
Issue:#2089

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159538907
2017-06-22 20:04:26 +01:00
andrewlewis
4e006a9616 Move positionUs parameter from createPeriod to prepare
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158494794
2017-06-12 10:25:49 +01:00
tonihei
cdad6a4ef1 Move playback test utils to testutils.
This allows other tests to reuse the util classes without having to link to playbacktests.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158214560
2017-06-12 10:18:50 +01:00
tonihei
edbc2046e2 Clean-up manifest merge attributes.
1. Remove tools:replace in manifest files. This attribute is only needed to establish priority when two manifests are merged and have the same attribute with different values.
As this is not happening here, the attributes can be removed.

2. Some BUILD files also define a deprecated manifest merge strategy different from the android default merge strategy. For consistency these are set to "android'.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158075128
2017-06-06 16:38:45 +01:00
olly
f8cbe53f20 Fix SmoothStreaming Timeline
There were a few things wrong. Specifically the case in
the ref'd issue. Also, the timeline was being marked as
non-dynamic in the empty-but-live case (it should be
marked dynamic as segments may be added later).

Issue: #2760

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157103727
2017-05-25 15:05:25 +01:00