3674 Commits

Author SHA1 Message Date
ibaker
74f7ec729c Add playback tests for TS and MP4 samples that run on Robolectric
This commit introduces the infrastructure classes, and a couple of
illustrative usages.

PiperOrigin-RevId: 328301593
2020-08-26 16:39:49 +01:00
tonihei
a6ee778cfe Remove unnecessary ID suffix.
PiperOrigin-RevId: 328154018
2020-08-26 16:39:39 +01:00
tonihei
996e58973d Make renderer flush when setting pause-at-end more targeted.
We currently always reset everything if playingPeriod != readingPeriod.
However, this is only needed when the pausing is actually required, i.e.,
if the feature is enabled and we are in the last period of the window.

PiperOrigin-RevId: 328141242
2020-08-26 16:39:29 +01:00
andrewlewis
4b0e39e4b9 Add an event for the audio position advancing
Currently the audio renderer can become ready before the AudioTrack
actually has enough data to play something, which means that the
player may transition to the ready state before audio starts
playing. This makes the player's current state transition not very
useful for detecting when audio actually starts playing.

This change adds a new event to notify apps when the audio position
is increasing after a pause or seek/flush/reset event, and includes
an estimate of the system time at which audio playout started.

Issue: #7577
PiperOrigin-RevId: 327810040
2020-08-26 16:39:18 +01:00
takusemba
3f5c584574 apply output surface workaround for F02H, F03H 2020-08-25 14:53:57 +09:00
bachinger
e55b345595 Make all media source factories create a drm session
PiperOrigin-RevId: 327691347
2020-08-21 12:55:14 +01:00
andrewlewis
e2fc5c2190 Fix EventLogger audio underrun logging
PiperOrigin-RevId: 327610950
2020-08-21 12:51:23 +01:00
aquilescanta
79a846eb5e Fix check in placeholder session acquisition
PiperOrigin-RevId: 327223824
2020-08-21 12:49:16 +01:00
aquilescanta
41e6577dca Remove DrmSessionManager.acquirePlaceholderSession
In order to acquire a placeholder session, clients can call acquireSession
with a format with a null drmInitData.

PiperOrigin-RevId: 327220249
2020-08-21 12:49:06 +01:00
olly
7588c26b60 Remove support for cbc1 and cens encryptions schemes
PiperOrigin-RevId: 327199833
2020-08-21 12:48:39 +01:00
insun
b853978a91 Fix bug to show 'play' button at the end of stream
PiperOrigin-RevId: 327158791
2020-08-18 08:11:54 +01:00
olly
513b301e77 ExoPlaybackException: Align some method naming
PiperOrigin-RevId: 327003695
2020-08-17 16:14:39 +01:00
olly
7ef31e2208 Tweak DefaultMediaSourceFactory documentation
PiperOrigin-RevId: 327000958
2020-08-17 16:14:30 +01:00
olly
02ed809a18 Tweak offload disable Javadoc
PiperOrigin-RevId: 326998407
2020-08-17 16:14:21 +01:00
ibaker
f0ae8afd80 Separate the dump files from the test assets
This allows us to more easily create different dumps derived from the
same assets.

This moves media/source files from `assets/` to `assets/media/` and
dump files from `assets/` to `assets/extractordumps/` and
`assets/audiosinkdumps/` as appropriate. I intend to add
`assets/playbackdumps/` in a future CL.

PiperOrigin-RevId: 326986283
2020-08-17 16:13:53 +01:00
olly
94b66f4c24 Specify which function is triggering a TimeoutException
PiperOrigin-RevId: 326666629
2020-08-17 16:13:16 +01:00
andrewlewis
977f0d1ed0 Scale AudioTrack buffer size for AudioTrack speed adjustment
PiperOrigin-RevId: 326642908
2020-08-17 16:13:07 +01:00
samrobinson
eabc486b58 Keep AudioTrack on seek - experimental.
PiperOrigin-RevId: 326622573
2020-08-17 16:12:58 +01:00
andrewlewis
61abe5951a Use consistent naming for 'offload scheduling enabled'
PiperOrigin-RevId: 326413842
2020-08-17 16:11:35 +01:00
aquilescanta
cde795ea98 Fix typo in DrmSessionManager's javadoc
PiperOrigin-RevId: 326413433
2020-08-17 16:11:26 +01:00
aquilescanta
fcb263a407 Make DrmSessionManager take a Format instead of DrmInitData
Skipping acquirePlaceholderSession which will be removed
in a following change.

PiperOrigin-RevId: 326402746
2020-08-17 16:11:17 +01:00
andrewlewis
501f464217 Add support for using framework speed adjustment
AudioTrack.setPlaybackParams can be used to adjust playback speed.
This is preferable to application-level speed adjustment (currently
implemented in ExoPlayer) from API 23 because the speed change
occurs in the mixer, which means that the audio track buffer doesn't
need to drain out before the speed adjustment takes effect.

Issue: #7502
PiperOrigin-RevId: 326392301
2020-08-17 16:10:50 +01:00
olly
a0088f068a Change getMaxInputSize visibility.
PiperOrigin-RevId: 326341905
2020-08-17 16:10:31 +01:00
andrewlewis
6aeacd70bc Fix miscellaneous nits
PiperOrigin-RevId: 326208366
2020-08-17 16:09:19 +01:00
krocard
b02398ff75 Save input format in Configuration
This will allow for better exception
on AudioTrack error.

PiperOrigin-RevId: 326091883
2020-08-17 16:09:10 +01:00
andrewlewis
607e11718b Remove deprecated AudioSink methods
Also do some minor cleanup in DefaultAudioSink.

PiperOrigin-RevId: 326012441
2020-08-17 16:08:52 +01:00
olly
361e5d9326 Demo app: Fix DRM support check for ClearKey
Issue: Issue: #7735
PiperOrigin-RevId: 325900705
2020-08-17 16:08:15 +01:00
krocard
19db6feddb Use message to set offload scheduling
The code was mutating boolean across threads.

PiperOrigin-RevId: 325826214
2020-08-17 16:07:57 +01:00
krocard
192c1e5dee Improve OnExperimentalOffloadSchedulingEnabled name
For consistency with onShuffleModeEnabledChanged.

PiperOrigin-RevId: 325820951
2020-08-17 16:07:48 +01:00
samrobinson
63faf51c7e Change experimental method naming of setReleaseTimeoutMs.
PiperOrigin-RevId: 325795609
2020-08-17 16:07:39 +01:00
samrobinson
78424efc90 Change experimental method naming for throwWhenStuckBuffering.
PiperOrigin-RevId: 325795485
2020-08-17 16:07:29 +01:00
samrobinson
69c2a76d01 Change experimental method naming of set*MediaCodecOperationMode.
PiperOrigin-RevId: 325790799
2020-08-17 16:07:20 +01:00
krocard
6c3a011dc3 Listener for offload scheduling
Let the app know when offload scheduling is enabled or disabled.

PiperOrigin-RevId: 325790017
2020-08-17 16:07:11 +01:00
samrobinson
9a0203e954 Change experimental method naming for blockUntilDelivered.
PiperOrigin-RevId: 325786522
2020-08-17 16:07:02 +01:00
samrobinson
eb9463454b Change setBandwidthAllocationCheckpoints naming.
PiperOrigin-RevId: 325786473
2020-08-17 16:06:53 +01:00
samrobinson
6db25cdab6 Change experimental method naming for allowMultipleAdaptiveSelections
PiperOrigin-RevId: 325784936
2020-08-17 16:06:43 +01:00
samrobinson
b956f85b45 Change experimental method naming for enableOffloadScheduling.
PiperOrigin-RevId: 325784822
2020-08-17 16:06:34 +01:00
ibaker
28697b9b9e Fix DefaultTrackSelector docs on select*Track methods
formatSupport is a 2-dimensional int array but it's documented as
being indexed by 3 things. This seems to be a copy-paste mistake in
e97b8347eb

selectAllTracks() takes a 3-dimensional array with the same
3-indexed documentation, which makes sense there.

Also rename formatSupports -> formatSupport for consistency.

PiperOrigin-RevId: 325779435
2020-08-17 16:06:25 +01:00
ibaker
16d54f5e3d Add a sentence to TrackSelector javadoc calling out #invalidate()
PiperOrigin-RevId: 325767964
2020-08-17 16:06:15 +01:00
ibaker
5ed0c12ff0 Tweak how MediaCodecVideoRenderer renotifies the existing surface
Use a dedicated boolean to track if we've notified the current surface,
rather than re-using rendereredFirstFrameAfterReset.

PiperOrigin-RevId: 325757948
2020-08-17 16:06:06 +01:00
andrewlewis
acc8453628 Add support for audio-only ad display containers
Issue: #7689
PiperOrigin-RevId: 325752377
2020-08-17 16:05:56 +01:00
krocard
03a1a3ee82 Temporary disable offload after failure
PiperOrigin-RevId: 325429029
2020-08-07 19:04:37 +01:00
christosts
a5e6e3054d Offline DRM in main demo app
PiperOrigin-RevId: 325413035
2020-08-07 19:04:09 +01:00
christosts
c7a1151c2b Use MimeType.allSamplesAreSyncSamples in ClippingMediaPeriod
PiperOrigin-RevId: 325409392
2020-08-07 19:03:59 +01:00
tonihei
eee9b312dc Change default value of throwWhenStuckBuffering to true.
This change caused no problems and can be enabled by default.

PiperOrigin-RevId: 325264859
2020-08-07 19:03:30 +01:00
ibaker
092c66fac3 Rollback of 1ed5d8b563
*** Original commit ***

Rollback of bf5e6c7862

*** Original commit ***

Pass startPositionUs into Renderer.replaceStream

Plumb this down into BaseRenderer.onStreamChanged and use it when
deciding whether to render the first frame of a new period.

***

***

PiperOrigin-RevId: 325251261
2020-08-07 19:03:21 +01:00
olly
60630fe97b Upgrade some null checks to assertions
PiperOrigin-RevId: 325226353
2020-08-07 19:03:11 +01:00
ibaker
ea347a464a Rollback of 1ed5d8b563
*** Original commit ***

Rollback of bf5e6c7862

*** Original commit ***

Pass startPositionUs into Renderer.replaceStream

Plumb this down into BaseRenderer.onStreamChanged and use it when
deciding whether to render the first frame of a new period.

***

***

PiperOrigin-RevId: 325218588
2020-08-07 19:02:52 +01:00
olly
283bed8cb2 Fix ExoMediaCryptoType attachment
- Attach types for placeholder sessions. If a placeholder session will be
  attached and a downstream renderer doesn't know what to do with it, then
  this attachment is necessary to correctly determine that the renderer
  does not support the track.
- Attach types to sample formats. Without this, if playback fails due to
  a CryptoException, the ExoPlaybackException that gets thrown spuriously
  indicates that the format's DRM type was not supported.

PiperOrigin-RevId: 325214745
2020-08-07 19:02:42 +01:00
tonihei
94fb9adec1 Update initial bandwidth estimates.
Also include 5G-NSA estimates and update code to use immutable
structures to prevent external updates by the app.

PiperOrigin-RevId: 325196303
2020-08-07 19:02:04 +01:00