2853 Commits

Author SHA1 Message Date
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
tonihei
b865259e63 Forward ad group and ad index when creating period from concatanted media sources.
Also added tests which verify the intended behaviour.

GitHub:#3452

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175656478
2017-11-17 18:28:21 +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
hoangtc
67bbbed9fe Notify TrackSelection when it's enabled and disabled.
Add onEnable() and onDisable() call-backs to TrackSelection. This allows
TrackSelection to perform interesting operations (like subscribe to
NetworkStatus) and clean up after itself.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175558485
2017-11-13 20:06:06 +00:00
arnaudberry
db7e9a548c Make it possible to extend DashManifestParser to parse revision-id.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175554723
2017-11-13 20:04:40 +00:00
Oliver Woodman
e92667ba5b Only set shutter color if attr is declared 2017-11-13 17:28:25 +00:00
ojw28
99d0a7a3da
Merge pull request #3451 from nvalletta/dev-v2-shutter-background-color
Add an easy way to set the shutter view background color
2017-11-13 17:11:39 +00:00
ojw28
73e96be85c
Merge pull request #3440 from yqritc/fix-bravia
Skip using MediaCodec.setOutputSurface on Bravia
2017-11-13 17:11:24 +00:00
hoangtc
0be4b46bb4 Introduce Builder pattern to create MediaSource.
Start with DASH MediaSource. The number of injected arguments is getting
out-of-control.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175529031
2017-11-13 17:08:24 +00:00
hoangtc
735af5c0b0 Update several minor code/test style issues.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175180089
2017-11-13 15:15:07 +00:00
olly
eb4e05199f Expose first index in SampleQueue
This will be needed when retaining a back-buffer. Being able to
query the first index allows us to work out when we've discarded
all samples that were obtained from a particular chunk, which
we'll use to determine when to remove chunks from
ChunkSampleStream.mediaChunks.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175172085
2017-11-13 15:13:43 +00:00
eguven
694bd997cb Re-enable index file store at the end of the SimpleCache.initialize()
In the case converting cache files from an earlier version of
SimpleCache, there is no previous version of the index file. If the app
doesn't call any SimpleCache methods which would make the index file
stored before it exists whole data gets lost.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175153650
2017-11-13 15:12:18 +00:00
tonihei
04baa42349 Add custom callbacks to allows seeks after dynamic playlist modifications.
These callbacks are executed on the app thread after the corresponding
timeline update was triggered. This ensures that seek operations see the
updated timelines and are therefore valid, even if the seek is performed into a
window which didn't exist before.

GitHub:#3407

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175136187
2017-11-13 15:10:56 +00:00
tonihei
6616e6c1a9 Don't check if next period is prepared when ignoring renderer media clock.
When the renderer media clock source read its stream to end but is not ready,
this means one of two things. Either the next period is not prepared yet and
we need to stop the renderers and buffer until it's prepared, or we are
waiting for another track in the current period with a uneven (longer)
duration.

The second case was already covered by this if condition and uses the standalone
clock instead to continue.

The first case now also uses the standalone clock, but it doesn't make a
difference, because both clocks are stopped and still synchronized.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175134975
2017-11-13 15:09:35 +00:00
hoangtc
3171c86bdb Supports Out-of-band, in MPD EventStream.
MPD file may include multiple EventStreams in its Periods, which contains Events
that the application may need to handle/respond to.
This change adds support for parsing the EventStream/Event nodes from MPD
file, and exposing these EventStreams as a metadata sample stream that application
can respond in a similar way to other metadata events.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175017697
2017-11-13 15:08:09 +00:00
olly
ed2e4dd91e Don't allow cancelation of non-cancelable loads
Issue: #3441

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175011804
2017-11-13 15:06:25 +00:00
olly
367bb64ba0 Add default implementations for ExoMediaDrm.* interfaces
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175010595
2017-11-13 15:04:49 +00:00
olly
acf5247f6e Work around incorrect ClearKey encoding prior to O-MR1
Issue: #3138

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175006223
2017-11-13 15:03:29 +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
nvalletta
580acb4e2f Add an easy way to set the shutter view background color 2017-11-12 14:25:14 -07:00
yqritc
d5600b52e1 update bravia workaround more precisely 2017-11-09 10:56:47 +09:00
yqritc
6f729bdf97 add issue link 2017-11-08 13:41:04 +09:00
yqritc
73851144ba add bravia workaround to skip using setOutputSurface in MediaCodec 2017-11-08 11:01:47 +09:00
hoangtc
b60364600b Fix an issue with seeking that can lead to STATE_END not delivered.
GitHub: #1897

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174841175
2017-11-07 14:45:05 +00:00
olly
7f135f2cda Be more robust against load callback failures
Issue: #2795

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174836960
2017-11-07 14:43:38 +00:00
tonihei
f014b67d3e Use helper method to disable Renderers.
Removes duplicated code and starts cleaning up handling of media clocks.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174829840
2017-11-07 14:42:24 +00:00
olly
ea80c3e456 Relax parsing of ctts sample deltas
Issue: #3384

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174715851
2017-11-07 14:41:07 +00:00
olly
2daa098a20 Don't use InputStream.available in ContentDataSource
Issue: #3426

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174700804
2017-11-07 14:39:51 +00:00
olly
decf437f17 Broaden Samsung workaround to API level 25 + J7
Issue: #3257

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174686747
2017-11-07 14:38:31 +00:00
olly
475ea19ae7 Simplify ContentDataSourceTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174685374
2017-11-07 14:37:12 +00:00
aquilescanta
54a2a69b05 Allow playback to continue even after SingleSampleMediaPeriod load errors
This prevents users from having to check sideloaded subtitles URLs before
preparing a SingleSampleMediaSource with it.

Issue:#3140

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174475274
2017-11-07 14:35:47 +00:00
aquilescanta
ecaaed9674 Relax string comparison in DASH parseContentProtection
... by making it case insensitive and null-tolerant for schemeId (as was before
adding playlist drm data merging).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174472123
2017-11-07 14:34:22 +00:00
Oliver Woodman
1cfea62545 Remove DownloadManager test 2017-11-03 16:23:21 +00:00
olly
b5b87d6a27 Bump to 2.6.0
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174467964
2017-11-03 16:12:34 +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
tonihei
dbe0e602ef Use Timeline.getPeriodPosition to resolve period index in ExoPlayerImpl.seekTo
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174460558
2017-11-03 16:09:46 +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
eguven
872cfc131a Fix unnecessary CachedContentIndex store() calls
First fix, prevents forced rewriting when cipher is set but encrypt is
false.

Second, removes the store() call in SimpleCache.initialize() so
initialization doesn't fail because of CachedContentIndex write issues.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174450586
2017-11-03 14:17:43 +00:00
olly
d90d04190e Allow chunk cancelation only if nothing has been consumed from it.
The mediaChunks.size() > 1 check was supposed to ensure this, and
did roughly the right thing when there was only a single stream
(although it was unnecessarily restrictive in preventing chunk
cancelation for the first chunk, where bytesLoaded != 0 and none
of the samples had been consumed).

Now we have multiple streams the check doesn't do the right thing,
and adding a back-buffer feature will make even more incorrect.
This change switches to checking the condition we actually want
to check directly :).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174449398
2017-11-03 14:16:28 +00:00
olly
b6b09ad40b Automated g4 rollback of changelist 173379623.
*** Reason for rollback ***

Breaks setting PlaybackParameters before start of playback

*** Original change description ***

Add support for float output in DefaultAudioSink

Also switch from using MIME types to C.ENCODING_* encodings in DefaultAudioSink.

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174445506
2017-11-03 14:15:06 +00:00
eguven
321bc9c24e Simplify DownloadService by removing broadcasting
Client can add this functionality by extending DownloadService.

Also made DownloadManager accept multiple listeners. So instead of
broadcast event, client can listen to DownloadManager directly.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174335820
2017-11-02 16:35:14 +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
9abc1d2974 Don't call Drawable.setLayoutDirection pre-API-23
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174323423
2017-11-02 16:32:29 +00:00
olly
233a1d165f Explicitly document internal onXError are for reporting only
Issue: #3366

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174214690
2017-11-02 16:31:03 +00:00
olly
3021897383 Allow multiple listeners on TimeBar
Issue: #3406

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174214296
2017-11-02 16:29:36 +00:00
aquilescanta
8c424798c4 Fill manifest drm info with media files' pssh when needed
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174185407
2017-11-02 16:28:10 +00:00
olly
72b6791660 Use resolved position for masking when seeking to C.TIME_UNSET
Also fire onPositionDiscontinuity in this case

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174039483
2017-11-01 14:13:55 +00:00
eguven
37d33f58af Execute DownloadTask threads manually
Instead of using an Executor to run DownloadTasks creates and manages
threads internally.

Also added DownloadThread internal class to better separate the code
that doesn't run on the main thread.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174036872
2017-11-01 14:12:32 +00:00