21 Commits

Author SHA1 Message Date
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
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
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
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