10376 Commits

Author SHA1 Message Date
tonihei
f18d81f8a8 Ensure onEvents is called when listener is removed.
When a listener is removed or released we may not have called
onEvents for events that happened before this point. To ensure
listeners don't miss events we need to trigger a final onEvents
with all events we have happened so far (if any).

PiperOrigin-RevId: 346553030
2020-12-14 10:16:34 +00:00
christosts
e7f5912677 Add Factory to MediaCodecAdapter
In a later change, MediaCoderAdapter.Factory will be injectable to
MediaCodecRenderer.

PiperOrigin-RevId: 346525171
2020-12-14 10:16:24 +00:00
bachinger
9a00ba1d38 Improve javadoc of Window.windowStartTimeMs
PiperOrigin-RevId: 346346359
2020-12-14 10:16:14 +00:00
aquilescanta
9eef7b06f7 Ease the creation of SampleQueues without DRM management
This is useful in cases where the client is not interested in DRM.

PiperOrigin-RevId: 346313024
2020-12-14 10:16:04 +00:00
kimvde
d148db5725 Transformer: add a setter for the looper
PiperOrigin-RevId: 346270250
2020-12-14 10:15:54 +00:00
krocard
93b3f43ed2 Fix some extractor nullness checks
Fix Matroska, Heif, FLAC, Ogg, Opus, Vorbis
extractor nullness check.

There should be no functional change.
Every media that fail to be parsed should still fail.
Every media that parsed successfully should still succeed.

This refactor aims to push all nullness constraints up the call stack to clarify each API nullness contract. This ensures implementation and caller have to prove their respective contract close to where such logic is implemented. This also allows to fail early if an nullness contract is broken instead of deep in the call stack.

For example, by adding a requirement that all implementation of `StreamReader.readHeaders` have to initialize `setupData.format` if the return false, each overriding method is forced to prove this next to the logic initializing it. This also means the runtime check might not be needed because the nullnessChecker can prove itself the contract holds.

This is in contrast with adding a null check at the point of usage, which will not catch logic errors where they are produce, but later when they are perceived; making it harder to debug and catching the issue at run time instead of compile time.

#exofixit

PiperOrigin-RevId: 346163124
2020-12-14 10:15:45 +00:00
krocard
42f5e53def Add an TrackSelector base interface
This will allow Player to move in common without
trackSelector and all its many dependency.

Currently all users of `getTrackSelector` are
downcasting it in `DefaultTrackSelector`, this change
thus does not break them.

Track selection API is intended to be reworked, methods
will be added to the currently empty interface.

#player-to-common

PiperOrigin-RevId: 346159765
2020-12-14 10:15:35 +00:00
krocard
b5f0379ba0 Move ExoPlaybackException in common
This is needed to move Player in common.

#player-to-common

PiperOrigin-RevId: 346157905
2020-12-14 10:15:25 +00:00
krocard
7d3e5f2af8 Move MediaPeriodId in common minimalistically
This is needed to move ExoPlayerException in common.
The follow up cl moves MediaPeriodId completely.

#player-to-common

PiperOrigin-RevId: 346133091
2020-12-14 10:15:15 +00:00
bachinger
734565a83c Use parts when choosing next chunk after track change
Issue: #5011
PiperOrigin-RevId: 346080748
2020-12-14 10:15:05 +00:00
andrewlewis
6796c4d01c Add a setting for enabling continuous playback
Issue: #3750
PiperOrigin-RevId: 346079830
2020-12-14 10:14:55 +00:00
kimvde
dd782ef9b4 Throw ParserException if AAC config is invalid
Issue:#8295
PiperOrigin-RevId: 346064966
2020-12-14 10:14:45 +00:00
aquilescanta
0501d47144 Add iso9 to the list of supported MP4 brands
Issue: #8308
#minor-release
PiperOrigin-RevId: 345707141
2020-12-14 10:14:35 +00:00
krocard
f0edcc4003 Reference C.FORMAT_* in deprecated RendererCapabilities
Avoid duplicating the values.

#player-to-common

PiperOrigin-RevId: 345642356
2020-12-14 10:14:24 +00:00
kimvde
3a17dd5fec Slomo flattening: get metadata from smta box
Retrieve the capture frame rate and the SVC temporal layer count from
the smta box instead of the meta box because this is what Samsung do. It
is not guaranteed that the meta box will be present and will contain all
the necessary info in all slomo files.

PiperOrigin-RevId: 345639680
2020-12-14 10:14:14 +00:00
bachinger
32e68f608b Make issue templates shorter
PiperOrigin-RevId: 345624512
2020-12-14 10:14:03 +00:00
olly
0f64ace515 Only set experimentalSetForegroundModeTimeoutMs value when it's > 0
PiperOrigin-RevId: 345489364
2020-12-14 10:13:51 +00:00
olly
2980354510 VideoFrameReleaseTimeHelper: Account for playback speed
Previously the helper would constantly lose (or never establish) sync
for non-1x playback speeds. This changes the helper to account for
other playback speeds correctly.

PiperOrigin-RevId: 345458859
2020-12-03 17:13:21 +00:00
ibaker
74bbd5367e Gracefully handle null-terminated subtitle content in MKV containers
This was reported for SSA/ASS in PR #8265, but it seems to me the
SubRip part of the Matroska spec is similarly loose, so this change
handles null-terminated strings in both.

#minor-release

PiperOrigin-RevId: 345452667
2020-12-03 17:13:12 +00:00
ibaker
95e2ce26f3 Update the log tag of DefaultAudioSink
The old tag reflects the original name of this class. It was renamed in
2017:
<unknown commit>

Possibly the old name was kept for compatibility with existing logs
analysis? I didn't see an explicit discussion of this in the review
comments of the rename change.

The current tag confused me slightly - I assumed a line was being
emitted by the android.media.AudioTrack rather than ExoPlayer's
DefaultAudioSink.

PiperOrigin-RevId: 345450056
2020-12-03 17:13:03 +00:00
olly
2766211d0c Disable VSYNC adjustments if display cannot be queried
PiperOrigin-RevId: 345442367
2020-12-03 17:12:50 +00:00
bachinger
3b7aa1d5f1 Use HLS rendition report when changing primary playlist
Issue: #5011
PiperOrigin-RevId: 345440697
2020-12-03 17:12:41 +00:00
ibaker
0278949262 Set subtitle track to default in sample_with_srt.mkv
This will mean the track is automatically used when running in a
playback test.

Command used to change the flag:
```
$ mkvpropedit sample_with_srt.mkv --edit track:3 --set flag-default=1
```

PiperOrigin-RevId: 345436666
2020-12-03 17:12:33 +00:00
ibaker
374ba12738 Disable subtitle output in the playback tests
This is currently flaky, so it's better to disable it than end up with
flaky tests.

PiperOrigin-RevId: 345436319
2020-12-03 17:12:25 +00:00
Oliver Woodman
5211a1f0a7 Merge pull request #8154 from samoylenkodmitry:handle_out_of_space
PiperOrigin-RevId: 345428731
2020-12-03 17:12:15 +00:00
bachinger
4907c2153b Add FLAG_MIGHT_NOT_USE_FULL_NETWORK_SPEED to HLS preload media chunks
Issue: #5011
PiperOrigin-RevId: 345425048
2020-12-03 17:12:04 +00:00
krocard
09509c2390 Simple migration to common
Migrate all classes that are simple to move to
common.

#player-to-common

PiperOrigin-RevId: 345412080
2020-12-03 17:11:56 +00:00
andrewlewis
ebe54113a9 Fix SonicAudioProcessor end of stream behavior
The `AudioProcessor` interface requires that no more input is queued after
queueing end of stream, but `DefaultAudioSink` did queue more input and the
implementation of `SonicAudioProcessor` actually relied on this to drain output
at the end of the stream.

Fix this behavior by getting `Sonic` output in `getOutput` and having
`DefaultAudioSink` only queue input to processors that are not draining.

Also add TODOs to clean up audio processor implementations where the code
handles interaction that doesn't conform to the interface.

PiperOrigin-RevId: 345406478
2020-12-03 17:11:47 +00:00
krocard
830982496d Move Timeline to common
PiperOrigin-RevId: 345398603
2020-12-03 17:11:38 +00:00
krocard
553d5351c2 Move Renderer.VideoScalingMode back to C
As Player depends on VideoScalingMode, and
Renderer should not move to common,
to move Player to common, VideoScalingMode
needs to move first.

#player-to-common

PiperOrigin-RevId: 345314448
2020-12-03 17:11:30 +00:00
bachinger
affdff65e3 Remove HLS chunks based on parts not in playlist anymore
Issue: #5011
PiperOrigin-RevId: 345275266
2020-12-03 17:11:22 +00:00
ibaker
10b9de8342 Add an MKV asset with SSA subtitles for extractor and playback tests
Asset generated using a temporary SSA file and:
```
$ mkvmerge -o sample_with_ssa_subtitles.mkv sample.mkv input.ssa
```

PiperOrigin-RevId: 345217628
2020-12-03 17:11:13 +00:00
Oliver Woodman
b22b53f6f1 Merge pull request #8215 from TiVo:p-fix-apple-iframe-bug
PiperOrigin-RevId: 345202157
2020-12-03 17:11:03 +00:00
olly
8192bb5503 VideoFrameReleaseTimeHelper: Simplify and add comments
PiperOrigin-RevId: 345198316
2020-12-03 17:10:53 +00:00
olly
69dcad71de Update StyledPlayers control overlay scrim from 30% opacity to 60% opacity for Accessibility requirements.
PiperOrigin-RevId: 345190774
2020-12-03 17:10:44 +00:00
olly
104ad64b76 Change CronetDataSource.buildRequestBuilder method to protected.
This allows overriding the implementation of building the UrlRequest
from dataSpec when necessary

PiperOrigin-RevId: 345149165
2020-12-03 17:10:35 +00:00
olly
815927cf32 Mini release note tweaks
PiperOrigin-RevId: 345036042
2020-12-03 17:10:27 +00:00
christosts
1ff0965a10 Do not advance SystemClock manually in tests
Changes MetadataRetriever and Transformer so that their
respective tests don't need to manually control the SystemClock
in order to execute taks posted with delay from Loader.

PiperOrigin-RevId: 345024140
2020-12-03 17:10:19 +00:00
bachinger
1a5d79b78a Schedule load for non-primary playlist for low latency streams
Low latency streams potentially need to remove preload chunks in case they are removed from the playlist. Hence we need to schedule loading the next playlist even if the playlist is not a primary playlist.

Issue: #5011
PiperOrigin-RevId: 344995891
2020-12-03 17:10:10 +00:00
andrewlewis
c7e1d3f222 Mark assertion methods as @Pure
See https://checkerframework.org/manual/#type-refinement-purity.

PiperOrigin-RevId: 344994705
2020-12-03 17:10:01 +00:00
andrewlewis
69dad31b67 Mask ad media periods before the URI is available
Previously `MediaPeriodQueue` would return null if an ad media URI hadn't
loaded yet, but this meant that the player could be stuck in `STATE_READY` if
an `AdsLoader` unexpectedly didn't provide an ad URI. Fix this behavior by
masking ad media periods. `MaskingMediaPeriod` no longer requires a
`MediaSource` to instantiate it.

This also fixes a specific case where playback gets stuck when using the IMA
extension with an empty ad where the IMA SDK unexpectedly doesn't notify the ad
group fetch error.

Issue: #8205
PiperOrigin-RevId: 344984824
2020-12-03 17:09:53 +00:00
tonihei
8349d7849e Prevent reading into preload parts.
This is to ensure we can still discard the data if needed.

Issue: #5011
PiperOrigin-RevId: 344977548
2020-12-03 17:09:44 +00:00
ibaker
84a7ffc12a Add ParsableByteArray#ensureCapacity() method that keeps data
#exofixit

PiperOrigin-RevId: 344845328
2020-12-03 17:09:35 +00:00
samrobinson
7e635d9560 Set Format gapless info separately to Metadata in Extractors.
PiperOrigin-RevId: 344838400
2020-12-03 17:09:26 +00:00
bachinger
e6046a5c07 Discard HLS preload chunks when an HTTP 410 or 404 occurs
This change avoids an early fatal exception for replaced hinted parts.

Issue: #5011
PiperOrigin-RevId: 344828076
2020-12-03 17:09:17 +00:00
ibaker
e508fb64f3 Bump version to 2.12.2
PiperOrigin-RevId: 344801462
2020-11-30 16:11:44 +00:00
tonihei
de67030f24 Add back VpxOutputBuffer proguard config.
This is needed to support old binary builds that still rely on the
existance of this class.

PiperOrigin-RevId: 344799495
2020-11-30 16:11:36 +00:00
tonihei
f8041e1bc0 Add explaning comment to UI proguard file.
PiperOrigin-RevId: 344787160
2020-11-30 16:11:27 +00:00
aquilescanta
054bff80fd Fix ffmpeg build script's strip tool for armeabi-v7a
Broken in bf21e3c690.

PiperOrigin-RevId: 344777455
2020-11-30 16:11:19 +00:00
tonihei
9f6ff55c0f Replace PeriodSeekInfo by static methods.
The inner class was only used to obtain 3 distinct pieces of
information which is better handled by static methods.

#exofixit

PiperOrigin-RevId: 344767661
2020-11-30 09:33:22 +00:00