6675 Commits

Author SHA1 Message Date
tonihei
e760965595 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-15 14:12:09 +00:00
olly
80645056d2 Doc fix.
PiperOrigin-RevId: 228296962
2019-01-15 14:11:25 +00:00
aquilescanta
93f4a19f07 Expand check for muxed audio media tags to include uris that match variants
Issue:#5313
PiperOrigin-RevId: 228155222
2019-01-15 14:10:59 +00:00
aquilescanta
32bad69158 Increase search size in mp4 sniffing once moov has been found
Issue:#5320
PiperOrigin-RevId: 228142567
2019-01-15 14:10:53 +00:00
andrewlewis
ff9a40f0d7 Update FakeAd overrides
These are part of published IMA SDK 3.10.2.

PiperOrigin-RevId: 227861713
2019-01-15 14:10:19 +00:00
andrewlewis
99bc13221c 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-15 14:10:02 +00:00
andrewlewis
189e3c31be Fix nullness issue
PiperOrigin-RevId: 227822937
2019-01-15 14:09:18 +00:00
andrewlewis
a568fbdd51 Parse frame rate from 'mdta' metadata
PiperOrigin-RevId: 227813461
2019-01-15 14:09:04 +00:00
aquilescanta
4847889a2f Prevent IllegalStateException in Mp4 sniffing
If a negative value is read, sniffing should just fail.

PiperOrigin-RevId: 227689568
2019-01-15 14:07:59 +00:00
aquilescanta
61a7750f23 Enable setOutputSurfaceWorkaround for Huawei P10 lite
Issue:#5312
PiperOrigin-RevId: 227673949
2019-01-15 14:07:28 +00:00
aquilescanta
aff689a7da Fix bug when calculating EOF position in mp4 sniffing
PiperOrigin-RevId: 227668426
2019-01-15 14:07:18 +00:00
tonihei
fc16833903 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-15 14:07:05 +00:00
andrewlewis
f11abbda97 Fix replacement char check
PiperOrigin-RevId: 227646358
2019-01-15 14:06:47 +00:00
olly
6373554d6a Move syncFileDescriptor to use an experimental method
PiperOrigin-RevId: 227520168
2019-01-15 14:05:21 +00:00
andrewlewis
13638f1c29 Remove AdsLoader listeners on releasing ImaAdsLoader
Issue: #4114
PiperOrigin-RevId: 227516509
2019-01-15 14:05:00 +00:00
olly
e448ecdff8 Remove stray word
PiperOrigin-RevId: 227500707
2019-01-15 14:04:06 +00:00
andrewlewis
d3f5057d59 Handle rectangular rotation projections in Matroska
See also https://github.com/Matroska-Org/matroska-specification/issues/269.

PiperOrigin-RevId: 226758584
2019-01-15 14:03:54 +00:00
aquilescanta
c0cdf3cd2d Handle failure to get Cast context more gracefully
Issue:#4160
Issue:#4743
PiperOrigin-RevId: 225813243
2019-01-15 14:00:12 +00:00
aquilescanta
c9cf8e409d Update the Cast framework dependency
PiperOrigin-RevId: 225812585
2019-01-15 13:57:03 +00:00
tonihei
f79005ab0a Fix manifest uri in SsDownloadHelper.
This is the same as in SsMediaSource.

PiperOrigin-RevId: 225001911
2019-01-15 13:47:53 +00:00
tonihei
3833d98755 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-15 13:43:39 +00:00
olly
9ab08bbe5d Fix DRM protected SmoothStreaming with subtitles
Issue: #5378
PiperOrigin-RevId: 229261658
2019-01-14 23:58:45 +00:00
olly
0bfbcea632 Reset requiresSecureDecoder boolean on codec release
PiperOrigin-RevId: 229253065
2019-01-14 23:58:35 +00:00
olly
1b62277a0b Disable cache fragmentation except for progressive
DataSpec.FLAG_ALLOW_CACHE_FRAGMENTATION is added to indicate to the
cache when fragmentation is allowed. This flag is set for progressive
requests only.

To avoid breaking changes, CacheDataSink defaults to ignoring the flag
(and enabling fragmentation) for now. Respecting the flag can be
enabled manually. DownloaderConstructorHelper enables respecting of
the flag.

Issue: #4253
PiperOrigin-RevId: 229176835
2019-01-14 23:58:25 +00:00
tonihei
86637facdd Don't forget isSeekable in ExtractorMediaSource.
We currently forget whether a source is seekable at re-preparation. This was
implemented intentionally this way under the assumption that we really can't seek
until we have loaded the seek map again. However, seek operations are only
allowed after a media period is prepared. So there is no harm in remembering
whether a source is seekable.

This problem currently prevents reusing ClippingMediaSources with
ExtractorMediaSource and a non-zero start clip position.

Issue: #5351
PiperOrigin-RevId: 229169441
2019-01-14 23:58:15 +00:00
andrewlewis
f44fc542bb Blacklist OMX.SEC.mp3.dec for more devices
Issue: #4519
PiperOrigin-RevId: 229145790
2019-01-14 23:58:05 +00:00
olly
1f03093dc5 DRM: Pass sessionId rather than MediaCrypto
ExoMediaCrypto.requiresSecureDecoderComponent() is removed, and
FrameworkMediaCrypto.forceAllowInsecureDecoderComponents is made
public to allow determining whether a secure decoder is required
to be implemented in MediaCodecRenderer.

PiperOrigin-RevId: 228909771
2019-01-14 23:57:55 +00:00
olly
2d30d66746 Fix release of DRM sessions
There were some edge cases in which we'd forget to release DRM
sessions. For example if we read a format and acquired a
pendingDrmSession (in onInputFormatChanged), then immediately
read another format and overwrote pendingDrmSession, we'd
forget to release the one that's been overwritten.

This change hopefully makes release much clearer. We keep a list
of all drm sessions we're currently holding. Whenever we update
either drmSession or pendingDrmSession, we release any other
sessions that are in the list.

PiperOrigin-RevId: 228905465
2019-01-14 23:57:45 +00:00
eguven
71d4f39400 Call Listener methods on the thread started RequirementsWatcher
PiperOrigin-RevId: 228701917
2019-01-14 23:57:34 +00:00
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
Zsolt Matyas
fff602358f CEA608: Limiting duplicated command checks to immediate frames
Reported in https://github.com/google/ExoPlayer/issues/3860
For failing examples see the github link above.

[Problem]
We drop matching control codes even if they are not received on
consecutive frames.

The specification says
"(4) If the first transmission of a control code pair passes parity,
it is acted upon within one video frame. If the NEXT frame contains
a perfect repeat of the same pair, the redundant code is ignored."

Keyword is the NEXT. The frames must arrive immediately after
each other.

See https://www.law.cornell.edu/cfr/text/47/79.101

[Solution]
Set an additional flag when any data is processed. Control code
duplication checks should be limited only for the first control
byte pairs processed after any control code.

[Test]
Sarnoff tests have equivalent CEA708 and CEA608 Streams.
2019-01-10 12:15:14 -08: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