7134 Commits

Author SHA1 Message Date
bachinger
8a560429e9 Fix flaky test case
PiperOrigin-RevId: 347987861
2020-12-17 11:25:54 +00:00
bachinger
d9c058c60a Fix flaky test case
PiperOrigin-RevId: 347987306
2020-12-17 11:25:54 +00:00
ibaker
4849b3e35d Remove zero-byte resource from FileDataSourceContractTest
This was added due to a misunderstanding - we're more interested in
testing the edge case of trying to read the last zero bytes of a
non-zero-byte resource.

In a future change I want to be able test reading a subrange, so each
TestResource will need to be at least N bytes long.

PiperOrigin-RevId: 347980843
2020-12-17 11:25:54 +00:00
christosts
8da4eaa377 HlsPlaylistParser: ignore subtitles without URI
Issue: #8323
PiperOrigin-RevId: 347827615
2020-12-17 11:25:54 +00:00
tonihei
3b277b2810 Fix unintentional new sessions after player release in stats listener.
PlaybackStatsListener has a method whose original intention was to be
called when the player is releaed to finish all pending sessions.
However, this also meant that later events (e.g. onVideoDecoderDisabled)
could create new sessions because the old one was already finished.

Use the new onPlayerReleased callback to implement this properly and to
fix the unintentional new session creation.

PiperOrigin-RevId: 347809527
2020-12-17 11:25:54 +00:00
tonihei
e95e2e0f73 Disable flaky tests.
PiperOrigin-RevId: 347807539
2020-12-17 11:25:54 +00:00
ibaker
abff5168f4 Fix EPI.seekTo to balance operation acks when seeking during an ad
This regression was introduced in
b1e9257de1

Issue: #8349

#minor-release

PiperOrigin-RevId: 347802049
2020-12-17 11:25:53 +00:00
krocard
f11a9cdf71 Move documentation in common that linked to core classes
This will allow moving Player in common.

#player-to-common

PiperOrigin-RevId: 347797285
2020-12-17 11:25:53 +00:00
krocard
5a6c99e304 Clarify EventLogger Window log
PiperOrigin-RevId: 347789441
2020-12-17 11:25:53 +00:00
olly
751809b4e5 StyledPlayerView: Fix control overflow logic
PiperOrigin-RevId: 347657903
2020-12-17 11:25:53 +00:00
olly
7c28df62fd StyledPlayerView: Fix progressBar to noBar transformation
Also make some related naming improvements.

PiperOrigin-RevId: 347653802
2020-12-17 11:25:53 +00:00
olly
70ba62a281 StyledPlayerView: Add separate fullscreen button for minimal mode
Moving the fullscreen button around depending on modes is quite error
prone. There is currently a bug where the order of the settings cog
and fullscreen button can end up being swapped around as a result of
moving the fullscreen button to the minimal controls and back again.

It's less error prone just to have a second fullscreen button that's
always part of the minimal controls.

PiperOrigin-RevId: 347639484
2020-12-17 11:25:53 +00:00
olly
7ac19ff406 StyledPlayerView: Fix calculations to account for margins
Also make some related naming improvements.

PiperOrigin-RevId: 347631916
2020-12-17 11:25:53 +00:00
kimvde
761bd091c3 Check atom size and recording mode of Samsung saut boxes
- In slow motion videos flattened by Samsung, the saut box is kept but
only have the 4 first bytes (author field).
- In Samsung normal videos, the recording mode is zero.

In these cases, skip this box.

PiperOrigin-RevId: 347577303
2020-12-17 11:25:53 +00:00
andrewlewis
12f1615205 Use MediaItem as ads identifier by default
Issue: #3750
PiperOrigin-RevId: 347572122
2020-12-17 11:25:53 +00:00
andrewlewis
0633778c70 Fix handling of repeated ads identifiers
Previously the `AdTagLoader` only had one listener which meant that updates
that should affect all periods with matching identifiers in the timeline only
affected the last-attached one. Fix this by having `AdTagLoader` track all its
listeners.

Issue: #3750
PiperOrigin-RevId: 347571323
2020-12-17 11:25:53 +00:00
tonihei
9982e1f154 Release AnalyticsListeners after calling SimpleExoPlayer.release
Currently we don't remove the AnalyticsListeners registed to
SimpleExoPlayer after calling release. We didn't do this mainly
because there are messages triggered as part of the release that
still cause interesting events (e.g. decoderDisabled with the
final counters, final dropped counts etc).

However, we should fully release/remove the listeners once these
pending events are delivered to:
 1. Not leak listener implementations (e.g. if the listener is an
    Activity)
 2. Ensure we don't send future events that may cause listeners
    to unintentionally access released or nulled variables. This
    could happen for example if someone calls a player method
    after the player was released.
In addition, we can add a onPlayerReleased callback to
AnalyticsListener to allow implementations to clean themselves up
once all pending events are delivered.

PiperOrigin-RevId: 347434344
2020-12-17 11:25:53 +00:00
christosts
e18892cd03 Make setters of TestResource.Builder accept a value.
PiperOrigin-RevId: 347388172
2020-12-17 11:25:52 +00:00
christosts
401634a9fb Create UdpDataSource contract test
PiperOrigin-RevId: 347386108
2020-12-17 11:25:52 +00:00
krocard
d857eec1f7 Move classes Player depends on to common
This will allow player to be moved to common.

#player-to-common

PiperOrigin-RevId: 347375344
2020-12-17 11:25:52 +00:00
bachinger
a335c96450 Deprecate HttpDataSource.Factory.getDefaultRequestProperties
#exofixit

PiperOrigin-RevId: 347375323
2020-12-17 11:25:52 +00:00
olly
5aac1898bb Use longs to avoid intger overflow
PiperOrigin-RevId: 347351440
2020-12-17 11:25:36 +00:00
sneelavara
b70f08b740 CEA-708 Decoder fixes for issue #1807
Fixed the verticalAnchorType and horizontalAnchorType calculation

The anchorID 0, 1 and 2 should correspond to verticalAnchorType=ANCHOR_TYPE_START, anchorID 3, 4, 5 is ANCHOR_TYPE_MIDDLE, anchorID 6, 7 and 8 is ANCHOR_TYPE_END

The anchorID 0, 3 and 6 should correspond to horizzonatlAnchor=ANCHOR_TYPE_START, anchorID 1, 4, 7 is ANCHOR_TYPE_MIDDLE, anchorID 2, 5 and 8 is ANCHOR_TYPE_END
2020-12-16 16:22:12 -08:00
olly
94e745872d Fix UI menu not dismissing on API level 22 and earlier
Issue: #8272
#minor-release
PiperOrigin-RevId: 347010412
2020-12-14 10:18:43 +00:00
olly
2accb41ef6 StyledPlayerControlView: Fixes for minimal mode
- Re-layer layout so that the central controls end up on
  top (and, more importantly, have preference for receiving
  touch input) if the view is so small that elements start
  to overlap. This requires splitting the background and
  the controls themselves.
- Fix bug that could cause the scrubber to not be hidden
  in minimal mode, if the mode is entered when the controls
  are not visible.
- Fix positioning of minimal controls.
- Remove scrubber padding in minimal mode, since the scrubber
- Remove unused bar_gravity value.

PiperOrigin-RevId: 347008789
2020-12-14 10:18:33 +00:00
olly
7d478a9f5a StyledPlayerControlView: Simplify layout
- Replace some magic constants with use of layout gravity where possible
- Remove some attributes that are set in code anyway
- Remove some attributes that are set to their default values
- Inline transport controls
- Minor naming cleanup

PiperOrigin-RevId: 346980595
2020-12-14 10:18:23 +00:00
krocard
7aeeb8dd22 Minor refactor in Matroska extractor
#exofixit

PiperOrigin-RevId: 346975740
2020-12-14 10:18:13 +00:00
bachinger
297c2bf901 Make StyledPlayerControlView use control dispatcher for speed changes
#exofixit

PiperOrigin-RevId: 346972678
2020-12-14 10:18:03 +00:00
bachinger
2ee40270e5 Support setPlaybackSpeed(float) with the MediaSessionConnector
Issue: #8229
#exofixit
PiperOrigin-RevId: 346968046
2020-12-14 10:17:53 +00:00
kimvde
4ee02a27de Mp4Extractor: add smta metadata to audio track
This is needed for slomo audio flattening.

PiperOrigin-RevId: 346965990
2020-12-14 10:17:43 +00:00
ibaker
73b9cee83a Add a ContentDataSource contract test
PiperOrigin-RevId: 346954787
2020-12-14 10:17:33 +00:00
bachinger
05c928f96d Add live configuration to Timeline.Window
Issue: #5011
PiperOrigin-RevId: 346828103
2020-12-14 10:17:23 +00:00
christosts
392b3ab573 Inject MediaCodecAdapter.Factory
Make the MediaCodecFactory injectable from the constructors of
MediaCodecAudioRenderer and MediaCodecVideoRenderer.

PiperOrigin-RevId: 346784661
2020-12-14 10:17:13 +00:00
olly
aac22da2d6 Fix missing Javadoc
PiperOrigin-RevId: 346764371
2020-12-14 10:17:03 +00:00
olly
d01654386f VideoFrameReleaseTimeHelper: Split out frame-rate estimation
PiperOrigin-RevId: 346554044
2020-12-14 10:16:43 +00:00
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
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
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
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