637 Commits

Author SHA1 Message Date
aquilescanta
002df729a5 Allow late HLS sample queue building
Issue:#3149

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177836048
2017-12-12 18:30:00 +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
aquilescanta
23cc102151 Move internal HlsSampleStreamWrapper methods under internal methods
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177462449
2017-12-04 17:38:11 +00:00
aquilescanta
ce8736c71a Avoid concurrent read/write access to sampleQueues in HlsSampleStreamWrapper
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177435977
2017-12-04 17:38:11 +00:00
aquilescanta
69f8b250d5 Match SequenceableLoader method order in HlsSampleStreamWrapper
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177146923
2017-12-04 17:38:11 +00:00
olly
d84398788a Update moe equivalence
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177063576
2017-12-04 17:38:10 +00:00
olly
a0f6bba842 Force wrapping of HLS ID3 timestamp
Merge of https://github.com/google/ExoPlayer/pull/3495

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177057183
2017-11-27 21:29:14 +00:00
simophin
77d8c13621
Guard against out-of-range timestamp
We've found that in our production environment, the AAC stream's timestamp exceeds the 33bit limit from time to time, when it happens, `peekId3PrivTimestamp` returns a value that is greater than `TimestampAdjuster.MAX_PTS_PLUS_ONE`, which causes a overflow in `TimestampAdjuster.adjustTsTimestamp` (overflow inside `ptsToUs`) after playing for a while . When the overflow happens, the start time of the stream becomes negative and the playback simply stucks at buffering forever.

I fully understand that the 33bit is a spec requirement, thus I asked our stream provider to correct this mistake. But in the mean time, I'd also like ExoPlayer to handle this situation more error tolerance, as in other platforms (iOS, browsers) we see more tolerance behavior.
2017-11-24 17:27:35 +13:00
olly
2537e883d6 Move HlsSampleStreamWrapper to use ArrayList
Also prevent skip when there's a pending reset, and add a
TODO to split/fix chunk discard and downstream format change
reporting.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176760955
2017-11-23 15:13:51 +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
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
hoangtc
28df0e133b Add Builder pattern to HlsMediaSource.
Add Builder pattern to HlsMediaSource and mark existing constructors as
deprecated.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175803853
2017-11-17 18:44:28 +00:00
aquilescanta
b17ae80679 Fix cenc mode support and add support for the .mp4a extension.
Also add encrypted HLS internal sample streams.

Issue:#1661

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175577648
2017-11-17 18:26:41 +00:00
olly
afe6f667b2 Move all buffer discard to MediaPeriod.discardBuffer
This is a step toward retaining a back-buffer in a way that
works for all MediaSource implementations. It's not possible
to adjust the discardBuffer calls in ExoPlayerImplInternal
to discard up to (position - backBufferDurationUs). Next steps
are to:

1. Find an appropriate place to specify the back buffer value,
   to be passed to the discardBuffer calls. I guess the
   LoadControl is the appropriate place to define such values.
2. Enhance discardBuffer to support a toKeyframe argument to
   pass through to discardTo.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175565363
2017-11-13 20:07:25 +00:00
aquilescanta
15543f13b7 Decouple TrackGroups from SampleQueues in HlsSampleStreamWrapper
This CL does not aim to introduce any functionality changes.

Issue:#3149

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174864875
2017-11-13 15:01:55 +00:00
aquilescanta
98301467dc Fix DefaultHlsExtractorFactory javadoc
Issue:#2748

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174854541
2017-11-13 15:00:32 +00:00
aquilescanta
4630fa2b4c Propagate codec information from EXT-X-STREAM-INF to EXT-X-MEDIA
This is the first CL in a series to add chunkless preparation support.

Also did a bit a tidying up in HlsSampleStreamWrappen and
HlsMasterPlaylistParserTest.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174461737
2017-11-03 16:11:11 +00:00
aquilescanta
6ec53f4717 Add support for 608/708 captions in HLS+fMP4
This also allows exposing multiple CC channels to any fMP4 extractor client.

Issue:#1661

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174458725
2017-11-03 16:08:20 +00:00
aquilescanta
4cb2be2a46 Replace Queue with ArrayDequeue in HlsPlaylistParser
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174327876
2017-11-02 16:33:46 +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
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
aquilescanta
2cfc478c3e Allow extractor injection for HLS
Issue:#2748

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172726367
2017-10-19 16:47:04 +01:00
Oliver Woodman
12513e9898 Tweak recently merged pull requests 2017-10-13 20:40:08 +01:00
Nate Roy
9783fc0924 remove reordering playlist parser 2017-10-06 14:35:18 -04:00
Nate Roy
2f622b8bd8 Allow passing of HlsPlaylistParser to HlsMediaSource.
Also create helper method in HlsMasterPlaylist to allow the copying of
the playlist to another, but with the variants reordered based on a
passed comparator. Also added an implementation of HlsPlaylistParser
which will reorder the variants returned.
2017-10-06 14:31:46 -04:00
olly
a3be937650 Prevent unnecessary consecutive playlist loads
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170078933
2017-09-26 19:19:57 +01:00
Oliver Woodman
792f046c02 Clean up HlsPlaylistTracker 2017-09-26 17:06:36 +01:00
ojw28
8ee6da1fe9 Merge pull request #3280 from yqritc/fix-primary-playlist-update
Fix primary hls playlist update
2017-09-26 16:54:47 +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
yqritc
455f9fb9f0 remove space 2017-09-21 16:01:32 +09:00
yqritc
cac16f1647 remove keep alive check for updating primary url to avoid redundant playlist loading 2017-09-21 14:18:59 +09:00
yqritc
ff2ece56dd fix primarySnapshotAccessAgeMs 2017-09-21 12:01:25 +09: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
aquilescanta
fed2a1a6ea Fix PTS wraparound in HLS+Webvtt
Issue:#2928

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169246424
2017-09-19 18:17:43 +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
6bd0ba887c Allow more aggressive switching for HLS with independent segments
We currently switch without downloading overlapping segments, but
we do not actually switch more aggressively. This change fixes
this. Note there's an implicit assumption made that if one media
playlist declares independent segments, the others will too. This
is almost certainly true in practice, and if it's not the penalty
isn't too bad (the player may try and switch to a higher quality
variant one segment's worth of buffer too soon).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167120992
2017-08-31 16:33:43 +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
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