5767 Commits

Author SHA1 Message Date
eguven
92bec21c03 Add DownloadIndex and DefaultDownloadIndex
DownloadIndex will be used to store and query DownloadStates.

PiperOrigin-RevId: 228673766
2019-01-14 23:57:24 +00:00
tonihei
637b52ae0e Add missing call to timeline.getWindow.
The window object is used without being filled with data. This used to work
well for most cases as the same live stream is sending regular updates and the
first update is almost never used if it's not the first item in a playlist.

It causes problems when the first timeline update of a live stream is actually
used for playback (e.g. when the live stream is lazily prepared in a playlist
and played first).

PiperOrigin-RevId: 228530232
2019-01-14 23:57:14 +00:00
tonihei
8792c20be5 Update README and dev guide with Java 8 config for Kotlin.
Setting the target conpatibility only seems to work for Java. Added the
equivalent Kotlin config options to the docs.

Issue:#5276
PiperOrigin-RevId: 228482496
2019-01-14 23:57:03 +00:00
Oliver Woodman
e0c6f538af Merge pull request #5201 from zsmatyas:dev-v2
PiperOrigin-RevId: 228341073
2019-01-08 17:17:59 +00:00
eguven
0b56a03880 Use stop flag to prevent download start when not initialization/released
PiperOrigin-RevId: 228324452
2019-01-08 17:17:47 +00:00
olly
255a34d367 Noop cleanup of Cea608Decoder.CueBuilder
PiperOrigin-RevId: 228309236
2019-01-08 17:17:37 +00:00
olly
6e127d0152 SimpleCache: Scan sub-directories during initialization
This is the initialization part of mitigating issue #4253. The
remaining work is on the writing side, and is simply a case of
having startFile return File instances that are sharded into
sub-directories. We still need to decide what scheme we want
to use for doing that.

Issue: #4253
PiperOrigin-RevId: 228306327
2019-01-08 17:17:27 +00:00
olly
194caf23e5 Doc fix.
PiperOrigin-RevId: 228296962
2019-01-08 17:17:16 +00:00
olly
8c47b02083 Reduce number of calls to File.length()
Calls to File.length() can be O(N) where N is the number of files
in the containing folder. This is believed to be true for at least
FAT32. Repeated calls for the same file tend to be faster,
presumably due to caching in the file system, however are still
surprisingly expensive. Hence minimizing the number of calls is
preferable.

Issue: #4253
PiperOrigin-RevId: 228179921
2019-01-08 07:38:31 +00:00
aquilescanta
be69d5b747 Expand check for muxed audio media tags to include uris that match variants
Issue:#5313
PiperOrigin-RevId: 228155222
2019-01-08 07:38:21 +00:00
aquilescanta
147deafd01 Increase search size in mp4 sniffing once moov has been found
Issue:#5320
PiperOrigin-RevId: 228142567
2019-01-08 07:38:11 +00:00
tonihei
e8a7cb2546 Remove player and isTopLevelSource parameters from MediaSource.prepare.
They are not longer needed anywhere, are error-prone (because of threading
requirements), and complicate testing and using MediaSources without a player.

PiperOrigin-RevId: 227871157
2019-01-08 07:38:00 +00:00
tonihei
6828797555 Pass Handler together with Runnable callbacks for playlist commands.
We currently either use the app thread returned by the player or the thread
the commands are called on depending on whether the media source is already
prepared or not.

This change lets the application decide which callback thread to use. As a
side effect, we also don't longer need access the player instance passed to
MediaSource.prepare.

PiperOrigin-RevId: 227871111
2019-01-08 07:37:50 +00:00
andrewlewis
0afd9b0d23 Update FakeAd overrides
These are part of published IMA SDK 3.10.2.

PiperOrigin-RevId: 227861713
2019-01-08 07:37:40 +00:00
andrewlewis
14027bc98e Treat AVERROR_INVALIDDATA as non-fatal
Also configure the FFmpeg context to ignore errors as far as possible (this
appears to have an effect only for certain decoders).

Issue: #5293
PiperOrigin-RevId: 227851397
2019-01-08 07:37:30 +00:00
andrewlewis
5efbcb4443 Fix nullness issue
PiperOrigin-RevId: 227822937
2019-01-08 07:37:13 +00:00
andrewlewis
ed1f41db1b Parse frame rate from 'mdta' metadata
PiperOrigin-RevId: 227813461
2019-01-08 07:37:01 +00:00
olly
d834eeab6f Set MediaSessionConnector components separately
Also support preparation without a player, in line with PlayerView.

PiperOrigin-RevId: 227735260
2019-01-08 07:36:50 +00:00
aquilescanta
d30375c9a1 Prevent IllegalStateException in Mp4 sniffing
If a negative value is read, sniffing should just fail.

PiperOrigin-RevId: 227689568
2019-01-08 07:34:33 +00:00
eguven
781ba39097 Disabled test case due to flakiness
PiperOrigin-RevId: 227682600
2019-01-08 07:34:24 +00:00
eguven
a940d8bc9d Use removing and restarting state internally in DownloadManager
PiperOrigin-RevId: 227682159
2019-01-08 07:34:14 +00:00
tonihei
c130723929 Replace isTopLevelSource check by period count check in AdsMediaSource.
The top level requirement only tried to ensure that the entire timeline only
has one period. This is already asserted by ImaAdsLoader. AdsMediaSource
itself works fine as long as the wrapped timeline has one period only. This
is now asserted instead.

PiperOrigin-RevId: 227682141
2019-01-08 07:34:03 +00:00
tonihei
e4ad90efd0 Set Player separately in AdsLoader interface.
Passing the player through MediaSource.prepare is only needed for the AdsLoader
and complicates other usages of MediaSource. Providing the player directly to
the AdsLoader is also in line with the usage pattern of PlayerView and other
components.

Also rename methods to start/stop to better reflect their usage.

PiperOrigin-RevId: 227682112
2019-01-08 07:33:52 +00:00
aquilescanta
bfc8f9c4d8 Enable setOutputSurfaceWorkaround for Huawei P10 lite
Issue:#5312
PiperOrigin-RevId: 227673949
2019-01-08 07:33:42 +00:00
aquilescanta
7f266ceb33 Fix bug when calculating EOF position in mp4 sniffing
PiperOrigin-RevId: 227668426
2019-01-08 07:33:32 +00:00
eguven
7ae768376c Prepare DownloadState for upcoming changes
Made DownloadState top level class.
Replaced action field DownloadAction fields.
Added removing, removed and restarting states.
Renamed started state to downloading.

PiperOrigin-RevId: 227664735
2019-01-08 07:33:23 +00:00
tonihei
803b878a8a Use Handler instead of ExoPlayer messages in ConcatenatingMediaSource
ExoPlayer methods must not be called from any thread besides the specified
app thread. Therefore we shouldn't use them here. Using a regular Handler
instead is fully equivalent.

Issue:#5240
PiperOrigin-RevId: 227650489
2019-01-08 07:33:13 +00:00
andrewlewis
440824ae5c Fix replacement char check
PiperOrigin-RevId: 227646358
2019-01-08 07:33:01 +00:00
olly
0ed7ddecd7 Reduce the number of cache files
- Increase the default cache file size to 5MB
- Recommended a minimum cache file size of 2MB to discourage
  applications from specifying values small enough such that
  unreasonably large numbers of cache files are generated
- Allow maxCacheFileSize=C.LENGTH_UNSET, equivalent to setting it
  to MAX_VALUE. This is just for API consistency with other APIs
  we have that accept LENGTH_UNSET

Issue: #4253
PiperOrigin-RevId: 227524233
2019-01-08 07:32:51 +00:00
olly
ae65bcecd4 Move syncFileDescriptor to use an experimental method
PiperOrigin-RevId: 227520168
2019-01-08 07:32:41 +00:00
andrewlewis
1e99224019 Remove AdsLoader listeners on releasing ImaAdsLoader
Issue: #4114
PiperOrigin-RevId: 227516509
2019-01-08 07:32:31 +00:00
olly
3a9557c72f Don't pass maxCacheFileSize to CacheEvictor if real size is unknown
CacheEvictor.onStartFile currently receives a length, which is the
maximum size of the content that might be written. The LRU cache
evictor will make sure there's sufficient space for the specified
size. If the actual size of the content is unknown, CacheDataSink
passes maxCacheFileSize.

The current behavior isn't ideal. It seems valid for a developer to
specify maxCacheFileSize=Long.MAX_VALUE if they don't want any
file fragmentation in the cache. However if they then attempt to
cache something with unknown length, LRU cache will try and make
room for content of length Long.MAX_VALUE, and end up evicting the
entire cache to do so.

This change alters the logic so a length is only passed if the
actual size of the content is known. In other cases C.LENGTH_UNSET
is now passed. The LRU evictor will not evict until after the file
is committed. Note a custom LRU evictor could still opt to evict to
ensure some application specified amount of space, if that's the
desired behavior.

PiperOrigin-RevId: 227509525
2019-01-08 07:32:21 +00:00
olly
243b12f37e Remove stray word
PiperOrigin-RevId: 227500707
2019-01-08 07:32:10 +00:00
andrewlewis
fc6a1ea522 Handle rectangular rotation projections in Matroska
See also https://github.com/Matroska-Org/matroska-specification/issues/269.

PiperOrigin-RevId: 226758584
2019-01-08 07:31:59 +00:00
tonihei
9728ac54ba Improve doc for setKeepContentOnPlayerReset.
This also applies when seeking or transitioning to unprepared media, which
isn't clear from the current documentation.

Issue:#5267
PiperOrigin-RevId: 226486685
2019-01-08 07:31:49 +00:00
eguven
3c0107752a Add STOPPED state to DownloadManager
PiperOrigin-RevId: 226460891
2019-01-08 07:31:39 +00:00
olly
173f36897b Update release notes
PiperOrigin-RevId: 226459209
2019-01-08 07:31:28 +00:00
olly
f4d741a565 Bump for 2.9.3
PiperOrigin-RevId: 226356810
2018-12-20 21:14:04 +00:00
olly
a16f4aec90 Fix out of data Javadoc
PiperOrigin-RevId: 226356758
2018-12-20 21:13:52 +00:00
andrewlewis
d3ecbf75b2 Fix buffer size for renderers with TRACK_TYPE_NONE
This includes NoSampleRenderers.

PiperOrigin-RevId: 226323693
2018-12-20 21:13:42 +00:00
andrewlewis
bad8ec5952 Relax audio decoder capability checks
Issue: #5145
PiperOrigin-RevId: 226297129
2018-12-20 12:44:18 +00:00
olly
4f8b098307 Blacklist OMX.SEC.mp3.dec for more devices
Issue #4519

PiperOrigin-RevId: 226205245
2018-12-19 21:29:27 +00:00
Oliver Woodman
be2636c365 Merge pull request #4993 from saschpe:icy
PiperOrigin-RevId: 226031838
2018-12-18 19:46:54 +00:00
andrewlewis
0e8e9621c0 Use the true bitrate for CBR MP3 seeking
PiperOrigin-RevId: 225989898
2018-12-18 19:46:43 +00:00
eguven
ee2e89e0cd Remove DownloadManager Download interim state when created
When a Download is created it's set to queued state but doesn't notify
listeners about this state. DownloadManager checks if it can start the
download. After this checks it notifies the listeners.

With this change Download can immediately check if it can be started and
sends correct notification.

PiperOrigin-RevId: 225967129
2018-12-18 19:46:33 +00:00
Oliver Woodman
4d282b2278 Merge pull request #5216 from mseroczynski:dev-v2
PiperOrigin-RevId: 225966289
2018-12-18 19:46:23 +00:00
eguven
3dc72a690c Remove targetState in DownloadManager.Download
PiperOrigin-RevId: 225849846
2018-12-18 19:46:08 +00:00
eguven
3d6707e2c4 Don't create Downloads until DownloadManager is initialized
PiperOrigin-RevId: 225824428
2018-12-18 19:45:58 +00:00
aquilescanta
f4fd3b12e6 Handle failure to get Cast context more gracefully
Issue:#4160
Issue:#4743
PiperOrigin-RevId: 225813243
2018-12-18 19:45:48 +00:00
aquilescanta
768f48e1d9 Update the Cast framework dependency
PiperOrigin-RevId: 225812585
2018-12-18 19:45:39 +00:00