Commit graph

7986 commits

Author SHA1 Message Date
Oliver Woodman
629fe637f7 Bump version to 2.11.8 2020-08-19 18:35:35 +01:00
olly
1c7c6fb90d Increase flexibility of ISM URL handling
PiperOrigin-RevId: 326025335
2020-08-19 18:33:35 +01:00
olly
590e81e5ae Infer ISM content type from URL specified extension
PiperOrigin-RevId: 326012248
2020-08-19 18:27:23 +01:00
olly
fc2e4ef4fa TS EsInfo: Be robust against a invalid descriptor length
Issue: Issue: #7722
PiperOrigin-RevId: 325431839
2020-08-19 18:21:12 +01:00
olly
62829be1ce FMP4: Correctly handle multiple sbgp and sgpd boxes
Find sbgp and sgpd boxes with grouping_type == seig in the case they don't
come first. Previoulsy we would only find them if they came first.

Issue: Issue: #7716
PiperOrigin-RevId: 325407819
2020-08-19 18:21:05 +01:00
olly
36efdc7492 Fix MP4 sniffing for very short files
The sniffer sniffs boxes at the start of the file to try and determine
whether the file is fragmented. However, if the file is extremely short
then it's possible that sniffing will try and read beyond the end of
the file, resulting i EOFException being thrown.

In general it's OK for sniffing to throw EOFException if the file is
not of the correct type. The problem in this case is that EOFException
can be thrown for an actual MP4 file, due to the sniffer continuing up
sniff atoms up to bytesToSearch in case the file is fragmented.

PiperOrigin-RevId: 325205389
2020-08-19 18:14:45 +01:00
kimvde
43b80fbb78 FragmentedMp4Extractor: allow both first_sample_flags and sample_flags
Having both in the trun box is not allowed (see section section 8.8.8.1
of ISO/IEC 14496-12:2015) but this CL makes the code more robust in case
this happens. Before this change, the first sample flag was not read,
making subsequent reads incorrect.

Issue: #7698
PiperOrigin-RevId: 325212160
2020-08-19 18:12:29 +01:00
ibaker
d0875ce790 Document that ConditionVariable instances start closed
PiperOrigin-RevId: 324002247
2020-08-19 18:10:43 +01:00
krocard
8c8ffe601d OMX.broadcom.video_decoder.tunnel.secure needs EOS workaround
The passthrough codec does not propagate
the EOS back to ExoPlayer.

Issue: https://github.com/google/ExoPlayer/issues/7647
PiperOrigin-RevId: 323758941
2020-08-19 18:10:34 +01:00
olly
c010d28b14 FLV: Ignore invalid SCRIPTDATA name type, rather than fail playback
Issue: #7675
PiperOrigin-RevId: 323371286
2020-08-19 18:07:20 +01:00
olly
3198c51bdb Remove invalid documentation that causes javadoc to crash
PiperOrigin-RevId: 322311636
2020-08-19 18:04:08 +01:00
krocard
53d12747e5 Name [-1,1] the "nominal" range of float samples
Float values are allowed to be > 0dbfs,
it is just not nominal as it will might
distort the signal when played without
attenuation.

This is also consistent with
[AudioTrack.write(FloatBuffer)](https://developer.android.com/reference/android/media/AudioTrack#write(float[],%20int,%20int,%20int)) that explicitly
allows it up to 3dbfs.

PiperOrigin-RevId: 321345077
2020-08-19 18:00:37 +01:00
olly
c5edc1c2f5 Clip float point PCM to its allowed range before resampling
PiperOrigin-RevId: 321340777
2020-08-19 17:57:16 +01:00
andrewlewis
c0cd73f5fd Upgrade IMA SDK to 3.19.4
This brings in a fix for the IMA SDK ignoring the media load timeout.

Issue: #7170
PiperOrigin-RevId: 320557386
2020-08-19 17:57:10 +01:00
kimvde
3b7669ff72 Fix saiz and senc sample count checks for FMP4
Issue: #7592
PiperOrigin-RevId: 320556981
2020-08-19 17:56:22 +01:00
andrewlewis
4633a63546 Upgrade IMA to 3.19.2
PiperOrigin-RevId: 319764381
2020-08-19 17:51:43 +01:00
kimvde
f1dd1894fa Add compatible brands to MP4 sniffer
Issue: #7584
PiperOrigin-RevId: 319744023
2020-08-19 17:51:33 +01:00
Oliver Woodman
5bfad37cd0
Merge pull request #7562 from google/dev-v2-r2.11.7
r2.11.7
2020-06-29 14:47:37 +01:00
olly
8fcbbb09af Bump release to 2.11.7
PiperOrigin-RevId: 318790917
2020-06-29 13:45:56 +01:00
andrewlewis
ce8bb26802 Fix postroll content complete notifications
On reaching the end of the content we would notify content complete
and skip unplayed ads, causing a timeline change. That timeline change
was handled in a way that caused a further timeline change in the
2.11.6 release, where we don't yet deduplicate no-op Timeline changes,
causing repeated timeline changes indefinitely.

At tip-of-tree, the timeline wouldn't refresh repeatedly. However the
code for sending content complete at the point of transitioning to
play a preloaded postroll ad was not correct in that it didn't mark
previous ads as skipped. Instead they happened to be marked as
skipped later on due to the timeline change handling content
completion code triggering again.

Fix this by only marking ads as skipped when content completes once,
to avoid the duplicate timeline change, and moving the skipped ad
marking so it happens in the same place as notifying content complete.

PiperOrigin-RevId: 318454908
2020-06-26 14:21:57 +01:00
Oliver Woodman
1a5b304b1f
Merge pull request #7517 from google/dev-v2-r2.11.6
r2.11.6
2020-06-24 00:39:54 +01:00
andrewlewis
67c99e1d11 Fix resuming postrolls
Postrolls would be skipped because the period duration wasn't know at
the moment of resuming playback after backgrounding, so the position
wouldn't be resolved to resume the postroll ad.

We have the period duration stored in the AdPlaybackState, so we can
use that directly.

Issue: #7518
PiperOrigin-RevId: 317830418
2020-06-23 15:58:48 +01:00
andrewlewis
df10fdf773 Fix handling of postrolls preloading
The IMA SDK now preloads postrolls which is great as we no longer need
to rely on detecting buffering at the end of the stream to trigger
playing postrolls.

Add in the required logic to detect the period transition to playing
the postroll.

Issue: #7518
PiperOrigin-RevId: 317610682
2020-06-23 15:58:42 +01:00
andrewlewis
0ffe747076 Fix incorrect rounding of ad cue points
We currently get float ad cue points from IMA, but store these as
longs in microseconds. The cast from double to long would take the
floor of the value, which could lead to stored ad cue points being
off-by-one. Use Math.round to avoid this.

ImaAdsLoader also has code to map a double AdPodInfo position (which
should match a cue point) onto the corresponding ad group index by
searching the long ad cue points. Match the calculation used where we
map float cue points, including narrowing the position to a float
first to avoid regressions if IMA SDK behavior changes to represent
positions in more than float precision later, and also remove the
requirement that the ad positions match exactly as a defensive
measure.

PiperOrigin-RevId: 317607017
2020-06-23 15:58:36 +01:00
olly
f39a65cb66 Bump version to 2.11.6
PiperOrigin-RevId: 316949571
2020-06-23 15:58:19 +01:00
Oliver Woodman
99c0305278 Fix release notes 2020-06-17 20:51:59 +01:00
andrewlewis
49951d4f87 Workaround unexpected discard of preloaded ad
After an ad pod coming up has preloaded, if the user seeks before it
plays we get pauseAd/stopAd called for that ad pod. Also, the ad will
not load again. Work around this unexpected behavior by handling
pauseAd/stopAd and discarding the ad.

In future, it's likely that the IMA SDK will stop calling those
methods, and will loadAd again for the preloaded ad that was
unexpectedly discarded. This change should be compatible with that,
because the ad won't be discarded any more due to not calling stopAd.

Issue: #7492
PiperOrigin-RevId: 316873699
2020-06-17 20:36:02 +01:00
andrewlewis
fc76dbfad4 Remove some ad playback state change requirements
Ads can appear due to asynchronous ad tag requests completing after
earlier ads in a pod have loaded, so remove the requirement that the
ad count can't change. The MediaPeriodQueue should handling discarding
buffered content if an ad appears before already buffered content, so
I think this case is actually handled correctly by the core player
already.

Also remove the requirement that an ad URI can't change. This is a
defensive measure for now, but it's likely that a later fix in the IMA
SDK for an issue where loadAd is not called after preloading then
seeking before a preloaded ad plays will result in loadAd being called
more than once, and I think it's possible that the second call to
loadAd may have a different URI. Because the ad URI should only change
after an intermediate seek to another MediaPeriod, there shouldn't be
any problems with buffered data not getting discarded.

Issue: #7477
PiperOrigin-RevId: 316871371
2020-06-17 20:35:31 +01:00
andrewlewis
5fd287b340 Move IMA SDK callbacks into inner class
The release() method was added in the recent IMA API changes for
preloading and now 'collides' with the ExoPlayer AdsLoader release
method. This led to all ads completing being treated as a call to
completely release the ads loader, which meant that the ad playback
state was not updated on resuming after all ads had completed, which
in turn led to playback getting stuck buffering on returning from the
background after all ads played.

Move the IMA callbacks into an inner class to avoid this.

Issue: #7508
PiperOrigin-RevId: 316834561
2020-06-17 20:35:04 +01:00
olly
6e1c197309 Add MIME types for which every sample is known to be a sync sample.
- Leaving the TODO, since there are still MIME types we're unsure about.
- Removing AAC because xHE-AAC does not have this property. We may re-add
  it with an additional profile check to exclude xHE-AAC in the future.

PiperOrigin-RevId: 316715147
2020-06-17 20:34:18 +01:00
ibaker
a0e90ce1ff Pull IMA cuePoints -> adGroupTimesUs logic into a helper class
We're then able to use this same helper class from tests, to avoid
running into spurious failures caused by long microseconds being
round-tripped through float seconds.

PiperOrigin-RevId: 316435084
2020-06-17 20:33:53 +01:00
andrewlewis
1ce040003a Add AdPlaybackState toString
This is useful for debugging both in tests and via logging.

PiperOrigin-RevId: 316102968
2020-06-17 20:26:42 +01:00
andrewlewis
f1197d8af3 Handle errors in all VideoAdPlayer callbacks
Some but not all VideoAdPlayer callbacks from the IMA SDK included
defensive handling of unexpected cases. Add the remaining ones.

Issue: #7492
PiperOrigin-RevId: 316082651
2020-06-17 20:26:30 +01:00
andrewlewis
8ab3fab4c1 Fix catch type in ImaAdsLoader defensive checks
PiperOrigin-RevId: 316079131
2020-06-17 20:25:21 +01:00
andrewlewis
e261b8d0ef Allow skipping the ad before the start position
PiperOrigin-RevId: 315867160
2020-06-17 20:20:33 +01:00
olly
e5ec8e6b47 Prevent shutter closing for within-window seeks to unprepared periods
Issue: #5507
PiperOrigin-RevId: 315512207
2020-06-17 20:19:11 +01:00
andrewlewis
80f4197e0f Separate ads rendering and AdsManager init
In a later change it will be necessary to be able to destroy the ads
manager if all ads are skipped while creating ads rendering settings.
This change prepares for doing that by not having the ads manager
passed into the method (so the caller can null or initialize it).

PiperOrigin-RevId: 315488830
2020-06-17 20:15:52 +01:00
andrewlewis
5d74fced1d Add tests for resuming ad playbacks
This is in preparation for refactoring the logic to support not
playing an ad before the resume position (optionally).

PiperOrigin-RevId: 315431483
2020-06-17 20:15:46 +01:00
andrewlewis
28c5fa665f Improve ImaAdsLoaderTest ad duration handling
Previously the fake ads loader listener would always pass the same ad
durations to the fake player, but actually the known ad durations can
change during playback.

Make the fake behavior more realistic by only exposing durations for
ads that have loaded.

PiperOrigin-RevId: 314956223
2020-06-17 20:15:34 +01:00
Oliver Woodman
6026b919a1 Fix test 2020-06-09 12:58:53 +01:00
Oliver Woodman
6bfdf8f8f6
Merge pull request #7437 from google/dev-v2-r2.11.5
r2.11.5
2020-06-05 16:06:36 +01:00
olly
46d29b25c9 Reintroduce isConnected check for download requirements
PiperOrigin-RevId: 314925639
2020-06-05 15:46:05 +01:00
Oliver Woodman
cdb4025758 Revert "Update Gradle plugins."
This reverts commit c20b85ac60.
2020-06-05 13:14:55 +01:00
olly
7a8f878a1f Bump version to 2.11.5
PiperOrigin-RevId: 314903986
2020-06-05 13:08:38 +01:00
olly
1347a2200f Fix more cases of downloads not being resumed
Issue: #7453
PiperOrigin-RevId: 314710328
2020-06-04 15:56:54 +01:00
olly
a818049143 Fix position jank after pausing and seeking
Issue: #6901
PiperOrigin-RevId: 314418536
2020-06-03 10:18:04 +01:00
olly
fb011e66a6 AudioTrackPositionTracker: Prevent negative timestamps
Issue: #7456
PiperOrigin-RevId: 314408767
2020-06-03 10:17:53 +01:00
aquilescanta
79acadcc89 Check for section_syntax_indicator in TS tables
Issue:#7325
PiperOrigin-RevId: 314321914
2020-06-03 10:17:39 +01:00
Oliver Woodman
5e2b89b562 Add release date 2020-06-01 19:15:15 +01:00
Oliver Woodman
9f87c2eaef Finalize release notes 2020-06-01 19:12:39 +01:00