775 Commits

Author SHA1 Message Date
hoangtc
e349905039 Add Builder to ExtractorMediaSource.
Add Builder pattern to ExtractorMediaSource and mark existing constructors as
deprecated.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176088810
2017-11-17 18:56:25 +00:00
olly
74e74402da Deduplicate ExtractorMediaPeriod discontinuity reporting
This change makes sure progress is being made before reporting
a discontinuity. Else in cases like having no network and
playing a live stream, we allow the discontinuity to be read
each time an internal retry occurs, meaning it gets read
repeatedly. This does no harm, but is noisy and unnecessary.

We should also not allow skipping whilst there is a pending
reset or discontinuity notification, just like we don't allow
reads.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175953064
2017-11-17 18:54:55 +00:00
andrewlewis
b8aedfbf4f Add support for float output for FfmpegAudioRenderer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175940553
2017-11-17 18:53:26 +00:00
andrewlewis
15a2f47f31 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=175936872
2017-11-17 18:51:43 +00:00
andrewlewis
6db895bd7b Use ArrayDeque for playback parameters checkpoints
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175837754
2017-11-17 18:48:42 +00:00
olly
28693ac7d6 Allow LoadControl to configure the back-buffer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175833398
2017-11-17 18:47:14 +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
olly
5301d38136 Some test cleanup
The purpose of this change isn't to fix anything. It's just to
simplify things a little bit. There will be following CLs that
make some changes to get things onto correct threads.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175800354
2017-11-17 18:41:38 +00:00
tonihei
5aa053d91d Add method to FakeMediaSource to trigger source info refresh.
This allows to remove the LazyMediaSource used within
DynamicConcatenatingMediaSourceTest and also allows to write test which
simulates dynamic timeline or manifest updates.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175680371
2017-11-17 18:37:08 +00:00
tonihei
b30b786350 Avoid track group array error-prone reference quality check in CastPlayer.
Also 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-11-17 18:32:38 +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
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
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
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
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
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
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