2986 Commits

Author SHA1 Message Date
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
olly
88b6df1d08 Disable secure DummySurface on Samsung devices on API level 25
Issue: #3373

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173381588
2017-10-27 16:12:34 +01:00
andrewlewis
7c18baa23f 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=173379623
2017-10-27 16:10:45 +01:00
mishaque
5a91a71cd0 Make CronetDataSource interruptable.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173262660
2017-10-27 16:07:30 +01:00
olly
ea764b1b79 Fix retry count for live streams in ExtractorMediaPeriod
Also simplify boolean condition in ExtractorMediaSource

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173247443
2017-10-27 16:06:01 +01:00
olly
e5e984f4c6 Re-order events into more of a natural ordering
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173232494
2017-10-27 16:04:33 +01:00
olly
c4f3cad586 Better behavior if media doesn't support DRM scheme
We don't expect this case to occur, since track selection is
normally expected to check canAcquireSession before selecting
a track. Nevertheless, if an attempt is made to acquire a
session when the media doesn't support the manager's UUID, we
should fail in a more graceful way.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173124170
2017-10-27 16:01:40 +01:00
olly
3289e3e9cb Be robust against provideProvisionResponse throwing unchecked exceptions
Other catch blocks in this class catch everything. This one should
too.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173118891
2017-10-27 16:00:15 +01:00
andrewlewis
43d70bdde9 Ignore seekTo if an ad is playing
Issue: #3309

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173114842
2017-10-27 15:58:51 +01:00
olly
82edf01c22 Re-use single session when multiSession disabled
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173098862
2017-10-27 15:55:46 +01:00
andrewlewis
9306b24c65 Fix some Android Studio inspection warnings
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173085316
2017-10-27 15:54:17 +01:00
eguven
9568802c6d Persist DownloadActions in DownloadManager
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172875067
2017-10-27 15:52:41 +01:00
Drew Hill
2081667591 cleanups for videoframereleasetimehelper 2017-10-24 11:19:26 -04:00
Drew Hill
3830307cd3 fix not initialized error 2017-10-19 20:28:49 -04:00
Drew Hill
84afad0748 adjustments 2017-10-19 16:24:41 -04:00
olly
c2d05f4405 Bump to 2.5.4
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172758309
2017-10-19 18:10:27 +01:00
Drew Hill
feff4d3e02 fix missing cause of display refresh rate changing between videoframereleasetimehelper constructor and enable being called 2017-10-19 12:49:51 -04:00
Oliver Woodman
64b928e77f Stylistic cleanup 2017-10-19 17:28:24 +01:00
ojw28
28bd4661ed Merge pull request #3371 from andymiao858/dev-v2
Fix FLV AVCVIDEOPACKET  CTS Type Issue
2017-10-19 17:23:50 +01:00
eguven
7d0ec68d86 Put DownloadTasks on hold until preceding conflicting tasks are complete
Tasks conflict if both of them work on the same media and at least one
of them is remove action.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172741795
2017-10-19 16:52:43 +01:00
andrewlewis
bb3dea5191 Remove USE_CHORD_PITCH
We have been using USE_CHORD_PITCH == false for a while and the quality of
pitch changes seems fine. It's now possible to set the sample rate too, but
this only works if USE_CHORD_PITCH is false, so remove the constant.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172736631
2017-10-19 16:51:29 +01:00
andrewlewis
08706f9bfb Retain playback position on re-preparation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172736350
2017-10-19 16:50:04 +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
andrewlewis
eb08e1a5c3 Work around AudioTrack Bluetooth connection issue
If connecting a Bluetooth audio device fails, the AudioTrack may be left in a
bad state, where it is not actually playing and its position has jumped back to
zero. Detect and work around this case by resetting the track.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172600912
2017-10-19 16:42:52 +01:00
olly
b8ef1dcc78 Fix MediaPeriod position param Javadoc.
prepare and selectTracks receive the position from which any
loading should start, where-as continueLoading receives the
actual playback position. These are different in the case that
a previous period is still being played out.

Also removed "relative to the start of the period" from prepare
documentation because it couldn't really be relative to anything
else.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172592769
2017-10-19 16:41:23 +01:00
andrewlewis
1e79d6eb84 Fix seeking with repeated periods
newPlayingPeriodHolder could be set then updated if seeking to a repeated period
that was loaded more than once. This led to MediaPeriodHolders leaking.

Only set newPlayingPeriodHolder once so that any later holders with the same
period identifier get released.

Also add a regression test. FakeMediaSource checks that all created
MediaPeriods were released when it is released.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172591937
2017-10-19 16:39:57 +01:00
olly
fc5e8ee516 Add some additional device specific workarounds
Issue: #3355
Issue: #3257

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172587141
2017-10-19 16:37:10 +01:00
苗华栋(Rabbit)
69e50a43a8 add readSignedInt24 in ParsableByteArray 2017-10-19 23:18:12 +08:00
miaohuadong
5895884c53 Fix bug 2017-10-19 14:10:18 +08:00
苗华栋(Rabbit)
4f8f87221e Fix FLV AVCVIDEOPACKET -> compositionTimeMs Type from UI 24 to SI 24 2017-10-18 23:03:26 +08:00
andrewlewis
f9249d23ea Add an extractor flag for ignoring edit lists
Issue: #3358

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172464053
2017-10-17 18:28:39 +01:00
olly
2c10e6f1c3 We're not playing an ad if the timeline is empty.
Issue: #3334

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172447125
2017-10-17 18:27:26 +01:00