568 Commits

Author SHA1 Message Date
tonihei
eea8cd169c Replaced the duplicated EMPTY track group array with the one already defined
in TrackGroupArray.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175670266
2017-12-12 20:38:47 +00:00
aquilescanta
79a9155438 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-12-12 20:36:11 +00:00
hoangtc
5bf4c249a2 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-12-12 20:31:58 +00:00
Oliver Woodman
3562fe1c69 SampleStream fixes 2017-11-22 20:38:53 +00:00
Oliver Woodman
75b9062583 Send discontinuity at adjustments after shuffle/repeat mode changes. 2017-11-22 18:06:14 +00:00
Oliver Woodman
56c1c3f6a7 Revert "Make ExtractorMediaSource timeline dynamic until duration is set"
This reverts commit b688a562508e74721841aaaa770e9dc47bd378dd.
2017-11-22 17:59:36 +00:00
olly
74569bba45 Don't do work after track selection when in ended state
This causes the player to report that it's started loading
when in the ended state.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176371892
2017-11-21 13:57:46 +00:00
olly
fa3052d36b Report additional position discontinuities
- Properly report internal discontinuities
- Add DISCONTINUITY_REASON_SEEK_ADJUSTMENT to distinguish
  seek adjustments from other internal discontinuity events

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176367365
2017-11-21 13:57:16 +00:00
olly
b688a56250 Make ExtractorMediaSource timeline dynamic until duration is set
We (eventually - albeit possibly infinitely far in the future)
expect a timeline update with a window of known duration. This
also stops live radio stream playbacks transitioning to ended
state when their tracks are disabled.

As part of this fix, I found an issue where getPeriodPosition
could return null even when defaultPositionProjectionUs is 0,
which is not as documented.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176492024
2017-11-21 13:48:27 +00:00
Oliver Woodman
1439b4a3ef Mini cleanup 2017-11-21 13:46:18 +00:00
Ian Bird
494237548a Fix initializationData check for SSA subtitles 2017-11-21 13:46:12 +00:00
olly
e469269f3c Fix some lint issues.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176337058
2017-11-20 13:48:32 +00:00
eguven
8940e7b32a Replace hard coded UUID in OfflineLicenseHelper with a parameter
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176102179
2017-11-17 19:34:34 +00:00
tonihei
be0648541f 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 19:32:51 +00:00
yqritc
a573099f93 update bravia workaround more precisely 2017-11-13 20:14:06 +00:00
yqritc
2c495502e0 add issue link 2017-11-13 20:14:01 +00:00
yqritc
2c8c14d647 add bravia workaround to skip using setOutputSurface in MediaCodec 2017-11-13 20:13:55 +00:00
eguven
fbfbe7d6c9 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:47:30 +00:00
tonihei
1331f7adde 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:47:04 +00:00
olly
86c0198c81 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:46:42 +00:00
olly
e1b3fed5e9 Add default implementations for ExoMediaDrm.* interfaces
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175010595
2017-11-13 15:46:30 +00:00
olly
681a05d004 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:46:15 +00:00
hoangtc
26366f6c80 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-13 15:45:54 +00:00
olly
3472eda6dc Be more robust against load callback failures
Issue: #2795

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174836960
2017-11-13 15:45:54 +00:00
tonihei
065091cfe3 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-13 15:45:54 +00:00
olly
298a66fc0e Relax parsing of ctts sample deltas
Issue: #3384

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174715851
2017-11-13 15:45:54 +00:00
olly
e6e75a536a Don't use InputStream.available in ContentDataSource
Issue: #3426

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174700804
2017-11-13 15:45:54 +00:00
olly
585e70c139 Broaden Samsung workaround to API level 25 + J7
Issue: #3257

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174686747
2017-11-13 15:45:54 +00:00
olly
b7f1368696 Simplify ContentDataSourceTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174685374
2017-11-13 15:45:54 +00:00
aquilescanta
061bcdd136 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-13 15:45:54 +00:00
Oliver Woodman
e4a0e977cd Remove DownloadManager test 2017-11-03 16:24:28 +00:00
olly
069466988f Bump to 2.6.0
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174467964
2017-11-03 16:15:31 +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
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
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
olly
199b983d42 Split PlaybackInfo into its own file
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174030901
2017-11-01 14:11:09 +00:00
olly
f150856567 Fix masking step 1
1. Move Timeline/Manifest into PlaybackInfo
2. Don't update externally visible Timeline/Manifest during preparation
3. Ignore MSG_POSITION_DISCONTINUITY during preparation
4. Correctly set masking variables at start of preparation, and use them

Once this change goes in, PlaybackInfo will contain timeline, manifest
and position, which should always be self-consistent with one another.
The next step would then be to move a bunch of logic in ExoPlayerImpl
that derives state from timeline and position into PlaybackInfo, and
split that into its own top level class that can be easily tested to make
sure it never IndexOutOfBounds.

I think we could also replace the masking variables and instead just assign
a new PlaybackInfo to the playbackInfo variable whenever we're doing
something that requires masking. This should be possible because we no
longer update playbackInfo whenever we have pending acks. It would
require allowing PlaybackInfo to mask the window position internally when
the timeline is empty, but I think this is ok, and again is something we
could test pretty easily.

Issue: #3362

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173909791
2017-11-01 14:09:33 +00:00
aquilescanta
9b9a294fd8 Fix javadoc @see for TrimmingAudioProcessor.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173877969
2017-11-01 14:08:04 +00:00
olly
8c793184d9 Fix crash when bad VTT timestamp encountered
Issue: #3396

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173868849
2017-11-01 14:05:11 +00:00
Oliver Woodman
d02e1df4b4 Clean up VideoFrameReleaseTimeHelper 2017-10-27 19:22:59 +01:00
ojw28
eb54da596d
Merge pull request #3345 from drhill/dev-v2_framerate_switch
make videoframereleasetimehelper get refresh rate when it's enabled, …
2017-10-27 18:54:38 +01:00
olly
dd5905a9fb Don't query empty timeline for next/previous windows
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173668909
2017-10-27 16:31:21 +01:00
olly
3285851147 Pass prepareAcks in SourceInfo
This makes it a bit more obvious what's going on during
preparation. In particular, it makes it clear that
MSG_SOURCE_INFO_REFRESHED arrives before MSG_TRACKS_CHANGED.

Issue: #3362

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173392080
2017-10-27 16:17:05 +01:00
eguven
8b3ec4800c Set cause of the exceptions in AtomicFile.startWrite()
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173388899
2017-10-27 16:15:34 +01: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