400 Commits

Author SHA1 Message Date
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
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
aquilescanta
52ec70dd80 Add support for KEYFORMAT and SAMPLE-AES (only parsing, not decryption)
Also add sample streams that use METHOD=SAMPLE-AES. Note that some of
the streams provide alternative EXT-X-KEY's. Support for alternative
decryption methods will be added in a later CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166048858
2017-08-22 16:20:45 +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
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
aquilescanta
38360f6267 Add support for HLS's FRAME-RATE attribute
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164482135
2017-08-08 15:46:53 +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
olly
db99187381 Fix some lint warnings
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164105662
2017-08-03 14:47:04 +01:00
olly
1f019ca808 Fix build.gradle to use modulePrefix
Issue: #3131

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164004981
2017-08-02 20:19:19 +01:00
olly
c2d7e05429 Propagate skipped input buffers through to CodecCounters
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163683081
2017-07-31 21:14:23 +01:00
aquilescanta
5278a63768 Change copyRenditionsList parameters names
Also instantiate the resulting list with a predicted size to minimize
list resizing.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163332285
2017-07-31 20:58:21 +01:00
eguven
bcc69c2da7 Add HlsMasterPlaylist.copy method
Creates a copy of this playlist which includes only the variants identified by the given variantUrls.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163212562
2017-07-31 20:56:56 +01:00
eguven
3f7b4dc75f Add HlsDownloader
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163052346
2017-07-31 20:50:10 +01:00
olly
5e203f482a Correctly flush HlsSampleStreamWrapper when primary selection changes
Issue: #3079

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162473480
2017-07-19 14:20:57 +01:00
olly
078c57413b Correctly reset the upstream format from SampleQueues in HLS
When resetting a SampleQueue, by default the upstream format
is not cleared. This is necessary for progressive playbacks,
since (a) the formats never change, and (b) the extractors
only output them once. So when a seek occurs, it's necessary
to clear all sample data from the queue, but retain the current
upstream format.

Uniquely for HLS, the media in a SampleQueue that we may read
from can be in a format not supported by the consuming renderers.
We clear all the sample data from the queue in this case, but
not the upstream format. Since we have an optimization that
allows the upstream format to be read in advance of another
sample being written into the queue, this can result in an
unsupported format being read by a consuming renderer. This
change ensures the upstream format is correctly cleared in the
problematic case.

Issue: #3079

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162360267
2017-07-19 14:13:09 +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
bf5495f2f5 Optimize in-buffer seeking for HLS
Also move to using an array to hold the SampleQueues,
as we've moved to doing in ExtractorMediaPeriod.

Issue: #551

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161972990
2017-07-15 17:33:33 +01:00
olly
06b3b3ca8d Migrate HLS over to new SampleQueue methods
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161391296
2017-07-10 16:17:09 +01:00
aquilescanta
a04663372f Detect playlist stuck and playlist reset conditions in HLS
This CL aims that the player fails upon:

- Playlist that don't change in a suspiciously long time,
  which might mean there are server side issues.
- Playlist with a media sequence lower that its last snapshot
  and no overlapping segments.

This two error conditions are propagated through the renderer,
but not through MediaSource#maybeThrowSourceInfoRefreshError.

Issue:#2872

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160899995
2017-07-05 15:02:39 +01:00
aquilescanta
e344e9cbb7 Add SinglePeriodTimeline constructor to fill missing window information
Issue:#2930

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160520480
2017-06-30 16:39:41 +01:00
aquilescanta
efb367b417 Add URLs EXT-X-STREAM-INF uris only once
This prevents ExoPlayer from thinking there are many more video tracks
than there actually are. And will prevent downloading multiple times
the same rendition once offline support for HLS is added.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160285777
2017-06-28 22:26:05 +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
eguven
40039ed0a1 Fix and move Util.getRemainderDataSpec() to DataSpec.subrange()
Made the method copy all of the fields of DataSpec in to the new instance. Also converted
it to an instance method of DataSpec for ease of usage, discovery and maintenance.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159670314
2017-06-22 20:13:43 +01:00
olly
e4617567a3 Rename DefaultTrackOutput to SampleQueue
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158842843
2017-06-14 19:31:47 +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
olly
047e0eb645 Renames to prepare for upcoming media buffer changes
Currently, media is discarded from DefaultTrackOutput
and SampleMetadataQueue as soon as it's been read. In
upcoming changes we'll decouple discard and read. This
will make it possible to retain already-read media in
these buffer classes, and allow the read position to
be moved backward as far as media is retained. This is
important for fixing an edge case around 608/EMSG
tracks, and could also underpin future features like
allowing retaining of X-seconds past media in the
buffer.

This change renames some variables and methods to
prepare for the upcoming changes. read/write indices
are renamed to start/end. The upcoming changes will
add a read index that's between the two. isEmpty is
inverted and renamed to hasNextSample, since it will
be possible to not have a next sample (because the
read index == end index) but for the buffer to not
be empty (because start index < read index).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158409630
2017-06-12 10:24:42 +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
aquilescanta
0f27efae44 Ignore invalid EXT-X-PLAYLIST-TYPE values
Issue:#2889

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157571216
2017-05-31 12:09:32 +01:00
aquilescanta
12ef97fc34 Fix and complete MediaPlaylist javadocs
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157243533
2017-05-31 11:39:52 +01:00
aquilescanta
53b52e784c Use AVERAGE-BANDWIDTH instead of BANDWIDTH when available
Also prevent BANDWIDTH's regex from matching the AVERAGE-BANDWIDTH attribute.

Issue:#2863

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157219453
2017-05-31 11:35:12 +01:00
aquilescanta
26728142ee Expose all "other" tags that start with #EXT through the playlist
"other" includes tags for which there is no existing behavior defined.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157217270
2017-05-31 11:34:04 +01:00
aquilescanta
3108b07c90 Minimize overlapping chunks if #EXT-X-INDEPENDENT-SEGMENTS is present
It is worth mentioning that the tag can be in the master playlist as well, which
means that it applies to all media playlists. There are a few tags with this
characteristic. This will be addressed in a later CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157210505
2017-05-31 11:32:52 +01:00
olly
c4f7a2d62d Correctly transition to ended state
This fixes transitioning into the ended state if we see
endOfStream from the chunk source whilst in the pending
reset state. Prior to this fix we'd still be pending a
reset, and so readData would never allow EOS to be read
by the consuming renderer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157101755
2017-05-25 15:04:24 +01:00
aquilescanta
002dd72e70 Propagate playlist loading error if it prevents playback
This imitates DashMediaSource's behavior.

Issue:#2623

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155485738
2017-05-11 05:53:20 +01:00
aquilescanta
5d459c8103 Expose no CC tracks if CLOSED-CAPTIONS=NONE is present
Issue:#2743

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155182859
2017-05-05 15:34:57 +01:00
aquilescanta
b408750aa9 Propagate EXT-X-DATERANGE tags with media playlists
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155062718
2017-05-04 20:53:28 +01:00
aquilescanta
d3fe20cc64 Check the type of the (non-initial) loaded HLS playlist
This prevents illegal casts.

Issue:#2702

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154078240
2017-04-24 21:38:33 +01:00
olly
8be85d4d2f Consolidate version codes in root gradle file
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153453768
2017-04-18 19:42:27 +01:00
olly
035fab225d Rename skipToKeyframeBefore -> skipData and allow skipping to EOS
This change also ensures that format changes are read whilst the
renderer is enabled but without a codec. This is necessary to
ensure the drm session is updated (or replaced).

Updating the format is also needed so that the up-to-date format is
used in the case that the codec is initialized later due to the
surface being set. Previously, if an ABR change occurred between
the format being read and the surface being attached, we would
instantiate the codec and then immediately have to reconfigure it
when as a result of reading the up-to-date format. For a non-adaptive
codec this resulted in the codec being immediately released and
instantiated again!

Issue: #2582

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151608096
2017-03-31 19:11:08 +01:00
eguven
2f9e082fe1 Enable gradle test code coverage for the library modules that aren't affected by 'stuck in endless loop' issue
'library-core' is still affected by https://code.google.com/p/android/issues/detail?id=226070

Code coverage report can be generated for the rest of the modules by:
./gradlew :[module name]:createDebugCoverageReport
Report is generated under:
[module folder]/buildout/reports/coverage/debug

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151448536
2017-03-31 19:06:58 +01:00
olly
e7a4c28dde Fix missing NonNull annotations for overriding methods
If the super method has the annotation on an argument, then
the overriding method should have it too.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151440313
2017-03-31 19:05:54 +01:00
olly
5ebb3d4481 Correct allowTimeBeyondBuffer values for skipToKeyframeBefore calls
The only case where we should pass false is if we want to know
whether the passed time is within the buffered media. This is
relevant within seekTo implementations only.

This is related to (but does not fix) issue #2582

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151315676
2017-03-31 19:00:06 +01:00
olly
382ba7ecf0 Generate combined Javadoc
Notes:
- Now only generating a single module Javadoc task for the
  release variant.
- Combined Javadoc now includes extensions. VP9 is excluded
  for now since it's failing for an unknown reason.

Issue: #2139

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150865589
2017-03-22 19:11:28 +00:00
olly
88e74ef381 Generate Javadoc for each module individually
Notes:
- The VP9 one is failing claiming that the util package
  doesn't exist and that LibraryLoader cannot be found.
  Unsure why, since it appears to be setup exactly like
  other extensions (e.g. Opus) that does work.
- @link across modules will not work when generating
  Javadoc for a single module. This is WAI. I subsequent
  change will add an aggregated Javadoc generator that
  will generate Javadoc for all modules together and
  apply cross module @link correctly.

Issue: #2139

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150864273
2017-03-22 19:10:15 +00:00
andrewlewis
f2e5c3b4c9 Fix imports.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150732864
2017-03-22 19:03:53 +00:00
olly
25a093b37c Split HLS into a separate module
Issue: #2139

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150643456
2017-03-22 18:59:56 +00:00