9853 Commits

Author SHA1 Message Date
bachinger
0a9b11d3dd Make resetPosition reset the position if true
Issue: #8024
PiperOrigin-RevId: 335846035
2020-10-13 16:26:41 +01:00
aquilescanta
64d5be8719 Fix HLS chunkful preparation bug affecting certain master playlists
The bug affects playlists that start with an I-FRAME only variant.

Issue: #8025
PiperOrigin-RevId: 335819497
2020-10-13 16:26:32 +01:00
andrewlewis
9753c3fcfb Add back copybara stripping
PiperOrigin-RevId: 335683390
2020-10-06 19:49:15 +01:00
tonihei
ed163db1c1 Enable detach surface timeout by default.
Experiments showed the timeout is beneficial to avoid ANRs and
we can thus enable the feature by default.

Also add configuration to set the timeout if required.

Issue: #5887
PiperOrigin-RevId: 335652506
2020-10-06 16:57:43 +00:00
andrewlewis
ac782235ca Fix miscellaneous nits/typos
PiperOrigin-RevId: 335642909
2020-10-06 16:57:31 +00:00
tonihei
008c80812b Enable release timeout by default and make config non-experimental.
Using a timeout prevents ANRs in cases where the underlying platform
gets blocked forever, so we enable this feature by default.

Issue: #4352
PiperOrigin-RevId: 335642485
2020-10-06 16:57:19 +00:00
kimvde
53f50f7c0e Ignore negative payload size in TS PesReader
Issue: #8005
PiperOrigin-RevId: 335625992
2020-10-06 14:31:59 +01:00
andrewlewis
39277ebe95 Pass ad tags via AdsMediaSource
This is in preparation for supporting playlists of ads media sources using
ImaAdsLoader.

Existing ways of passing ad tags should still function but are deprecated (and
won't be supported with playlists).

Issue: #3750
PiperOrigin-RevId: 335618364
2020-10-06 14:31:50 +01:00
kimvde
6ed371aaf3 Add search bytes parameter to TsExtractor
Context: Issue: #7988
PiperOrigin-RevId: 335608610
2020-10-06 14:31:41 +01:00
samrobinson
a552e35f6a Add getter and callbacks for static metadata retrieval.
Issue:#7266
PiperOrigin-RevId: 335416280
2020-10-06 14:31:32 +01:00
andrewlewis
41192ee046 Allow apps to add a VideoAdPlayerCallback
Issue: #7944
PiperOrigin-RevId: 335012643
2020-10-06 14:31:23 +01:00
bachinger
067712f599 Fix flaky test
PiperOrigin-RevId: 334801561
2020-10-06 14:31:14 +01:00
ibaker
43fe38672c Bump compileSdkVersion to 30
Without this, depending on Robolectric 4.5 causes compilation failures.

PiperOrigin-RevId: 334795155
2020-10-06 14:31:05 +01:00
andrewlewis
3e8dacc284 Move DataSource reading methods into Util
This will be used to read ads responses out of data: URLs in a subsequent
change.

PiperOrigin-RevId: 334778780
2020-10-06 14:30:56 +01:00
ibaker
907e2e0515 Tweak null-checking in TextRenderer#getNextEventTime()
`subtitle` is only guaranteed to be non-null if
`nextSubtitleEventIndex != C.INDEX_UNSET`. The null check added in
0efec5f6c1
was too early.

Issue: #8017
PiperOrigin-RevId: 334777742
2020-10-06 14:30:47 +01:00
ibaker
990051f5c5 Merge 2 UI sections in dev-v2 part of release notes
PiperOrigin-RevId: 334771927
2020-10-06 14:30:38 +01:00
ibaker
7b8895d655 Use Mp4WebvttDecoder for WebVTT content in DASH MP4 containers
This was broken by 74a9d8f680
because DashManifestParser switched to setting Format.sampleMimeType to
text/vtt while SubtitleDecoderFactory was still expecting
application/x-mp4-vtt. This change teaches SubtitleDecoderFactory to
check both Format.containerMimeType and Format.sampleMimeType.

I'll investigate a follow-up change to remove
MimeTypes.APPLICATION_MP4VTT completely (it's currently still used in
AtomParsers).

Issue: #7985
PiperOrigin-RevId: 334771672
2020-10-06 14:30:29 +01:00
claincly
4d3a781ca4 End to end playback test for gapless playback
In the test, a real instance of SimpleExoplayer plays two identical Mp3 files.
The GaplessMp3Decoder will write randomized data to decoder output on receiving
input. The test compares the bytes written by the decoder with the bytes
received by the AudioTrack, to verify that the trimming of encoder delay/
padding is correctly carried out.

Test mp3 has delay 576 frames and padding 1404 frames. File generated from:
ffmpeg -f lavfi -i "sine=frequency=1000:duration=1" test.mp3

This change needs robolectric version 4.5, which is not currently released (2020 Sep 30).

PiperOrigin-RevId: 334648486
2020-10-06 14:30:19 +01:00
ibaker
8cee5c5f6b Create a robolectricutils module
This holds shared test infrastructure that needs to depend on
Robolectric.

PiperOrigin-RevId: 334604041
2020-10-06 14:30:10 +01:00
ibaker
ae0d9b1359 Preserve limit when resetting ParsableByteArray in OggPacket#populate
When I moved ParsableByteArray#data behind a getter I replaced some
assignments with calls to reset(byte[]):
ce2e6e2fd6

reset(byte[]) deliberately sets `limit` to `data.length`, in order to
handle cases that were reassigning `data` but not updating `limit`.
However OggPacket was already using `limit` to track where to write
'new' data into the array, so changing `limit` to `data.length` caused
us to try and write new data beyond the end of the array.

I looked at other uses of reset(byte[]) in ce2e6e2fd6
and condluded the only other usage in MatroskaExtractor is legit and
shouldn't be updated like this (because MatroskaExtractor previously
*wasn't* correctly updating/maintaining `limit`).

Issue: #7992
PiperOrigin-RevId: 334601586
2020-10-06 14:30:01 +01:00
christosts
a0d99a6ac8 Fix flaky unit tests
PiperOrigin-RevId: 334580007
2020-10-06 14:29:52 +01:00
andrewlewis
c35787a08f Add ImaUtil for IMA extension utilities
PiperOrigin-RevId: 334567234
2020-09-30 11:55:52 +01:00
andrewlewis
8728706c6e Use Builder in ImaAdsLoader constructor
PiperOrigin-RevId: 334562209
2020-09-30 11:55:44 +01:00
ibaker
88999da3be Add playback tests for more TS assets
PiperOrigin-RevId: 334549894
2020-09-30 11:55:35 +01:00
andrewlewis
6b13640eeb Fix position ramping behavior with AudioTrack speed params
Non-realtime AudioTrack playback speed was not taken into account when
extrapolating the old mode's position, causing the position not to
advance smoothly.

This should be a no-op when not using AudioTrack playback params for
speed adjustment.

Issue: #7982
PiperOrigin-RevId: 334151163
2020-09-30 11:55:27 +01:00
samrobinson
c95e43d9bd Do not require subtitleButton in custom layouts of StyledPlayerView
Every other subtitleButton has an if not null check, but does not force non null.

Issue: #7962
PiperOrigin-RevId: 334124323
2020-09-30 11:55:18 +01:00
andrewlewis
151a3d3bf5 Fix position reporting with fetch errors
On receiving a fetch error for an ad that would otherwise play based on an
initial/seek position, the pending content position wasn't cleared which meant
that position reporting was broken after a fetch error. Fix this by always
clearing the pending position (if there was a pending position that will have
triggered the fetch error).

Also deduplicate the code for handling empty ad groups (fetch errors)
and ad group load errors.

Issue: #7956
PiperOrigin-RevId: 334113131
2020-09-30 11:55:09 +01:00
Oliver Woodman
19a0258bac Merge pull request #7798 from yoobi:trackSelectionView
PiperOrigin-RevId: 333751261
2020-09-25 17:49:12 +01:00
kimvde
908785b701 Parse TLEN duration in Mp3Extractor
Issue: #7949
PiperOrigin-RevId: 333733615
2020-09-25 16:34:46 +01:00
bachinger
ea57e5d28b Always pass true for ongoing with the first notification
ISSUE: #7977
PiperOrigin-RevId: 333726625
2020-09-25 16:34:37 +01:00
bachinger
d1416aeb98 Align live window to available DASH segments
PiperOrigin-RevId: 333720336
2020-09-25 16:34:28 +01:00
bachinger
c107017a4b Ensure implicit manifest updates arrives asap
PiperOrigin-RevId: 333714978
2020-09-25 16:34:19 +01:00
christosts
397fe8f305 Bring back setRenderTimeLimitMs
PiperOrigin-RevId: 333712782
2020-09-25 16:34:10 +01:00
christosts
9b39268e0b Mark DataSpec with FLAG_MIGHT_NOT_USE_FULL_NETWORK_SPEED
Set the FLAG_MIGHT_NOT_USE_FULL_NETWORK_SPEED on live load DataSpecs
for segments that are not yet fully available.

PiperOrigin-RevId: 333712684
2020-09-25 16:34:01 +01:00
samrobinson
851ca20cc0 Add support for mp2 boxes.
Issue: #7967
PiperOrigin-RevId: 333709003
2020-09-25 16:33:52 +01:00
christosts
0066586499 Remove SynchronousMediaCodecBufferEnqueuer
Remove the SynchronousMediaCodecBufferEnqueuer interface
since we only keep the AsynchronousMediaCodecBufferEnqueuer
implementation.

PiperOrigin-RevId: 333701115
2020-09-25 16:33:42 +01:00
krocard
7dfdde9246 Retry AudioTrack init and write before throwing
Retry AudioTrack init and write for 100ms before
giving up and aborting playback.

This was tested by throwing every 2 init/write and
making sure playback did not stopped.

#exo-offload

PiperOrigin-RevId: 333536841
2020-09-25 16:33:33 +01:00
krocard
56cb327f1e Clarify offload stream event callback impl
#exo-offload

PiperOrigin-RevId: 333532900
2020-09-25 16:33:23 +01:00
krocard
55a13d8871 Callback on audio track failure
Intended for statistics now that all errors
are not surfaced to the app.

PiperOrigin-RevId: 333519898
2020-09-25 16:33:14 +01:00
krocard
fad2846d1c Workaround AudioTrack incorrect error code
#exo-offload

PiperOrigin-RevId: 333513385
2020-09-25 16:33:05 +01:00
krocard
aa7309cdea Release wakelock when sleeping for offload
#exo-offload

PiperOrigin-RevId: 333512383
2020-09-25 16:32:55 +01:00
krocard
d97af76280 Retry after offload playback failure
Do that by adding a recoverable state to
the ExoPlaybackException marking when
it is needed to recreate the renderers.

PiperOrigin-RevId: 333507849
2020-09-25 16:32:46 +01:00
christosts
cf30ee504e Util.getStringForTime() prefixes negative times
Fix bug to place the negative sign in the beginning
of the returned String.

PiperOrigin-RevId: 333504868
2020-09-25 16:32:37 +01:00
christosts
3b14b05d93 Remove MediaCodecOperationMode
Remove MediaCodecOperationMode and replace it with a boolean
flag to enable/disable asynchronous queueing.

PiperOrigin-RevId: 333504817
2020-09-25 16:32:28 +01:00
krocard
dd99d23621 Remove unnecessary AudioTrack alias
Those aliases were introduced when the class
was also called AudioTrack.

PiperOrigin-RevId: 333499360
2020-09-25 16:32:18 +01:00
krocard
f37d79a4dd Callback when sleeping for offload and existing from it
#exo-offload

PiperOrigin-RevId: 333497538
2020-09-25 16:32:09 +01:00
tonihei
294ae10ef1 Change default of throwsWhenUsingWrongThread to true
Apps can still opt out for now, but this option will be removed in
the future.

Issue: #4463
PiperOrigin-RevId: 333489424
2020-09-25 16:32:00 +01:00
kim-vde
a92ccb0184 Merge pull request #7968 from DolbyLaboratories:dev-v2-channelConfiguration
PiperOrigin-RevId: 333485323
2020-09-25 16:31:49 +01:00
tonihei
66636f9ec0 Switch SntpClient to time.android.com and allow to set host.
PiperOrigin-RevId: 333480727
2020-09-25 16:31:38 +01:00
krocard
3be2463a94 Fix offload buffer full detection after setEndOfStream
This issue has been observed on a test app stress
testing setEndOfStream.

The issue has not been observed on ExoPlayer,
probably due to timing differences, but it is fixed
preventively.

#exo-offload

PiperOrigin-RevId: 333472136
2020-09-25 16:31:29 +01:00