10014 Commits

Author SHA1 Message Date
tonihei
51c8ffbb0e Tweak DefaultLivePlaybackSpeedControl parameters.
Changing them to have fewer updates when adjusting the playback speed.

PiperOrigin-RevId: 341834423
2020-11-13 14:54:22 +00:00
olly
3b8b2f707b Remove C.StreamType constant that's not a real stream type
#minor-release

PiperOrigin-RevId: 341833274
2020-11-13 14:54:12 +00:00
claincly
6f7c97a729 Add method to expose the locally opened port for UdpDataSource.
PiperOrigin-RevId: 341707809
2020-11-11 09:51:09 +00:00
olly
b1eef00b80 Fix incorrect IntDef usage
#minor-release

PiperOrigin-RevId: 341668326
2020-11-11 09:50:59 +00:00
kimvde
4ae0401c34 Work around AudioManager#getStreamVolume crashes
#minor-release
Issue:#8191
PiperOrigin-RevId: 341632732
2020-11-11 09:50:49 +00:00
ibaker
363693d8ec Add multi-channel audio samples to Mp4PlaybackTest
Robolectric now supports multi-channel audio:
https://github.com/robolectric/robolectric/commit/9d84ceb6d588d5f53be29b

PiperOrigin-RevId: 341574417
2020-11-11 09:50:40 +00:00
ibaker
1e776a864b Fix some typos
PiperOrigin-RevId: 341573964
2020-11-11 09:50:30 +00:00
ibaker
337c412d2b Add multi-channel audio samples to TsPlaybackTest
Multi-channel audio is now supported by Robolectric:
https://github.com/robolectric/robolectric/commit/9d84ceb6d588d5f53be29b

PiperOrigin-RevId: 341573838
2020-11-11 09:50:21 +00:00
ibaker
f13058942a Add Robolectric playback tests for existing FLV assets
PiperOrigin-RevId: 341573808
2020-11-11 09:50:11 +00:00
christosts
9e98a680da Add flag to force synchronization in async queueing
Add experiment flag to force synchronization between
queueing threads in AsynchronousMediaCodecAdapter.

PiperOrigin-RevId: 341431481
2020-11-11 09:50:01 +00:00
christosts
9473fda056 Synchronize codec interaction with buffer queueing
Add experimental method to synchronize MediaCodec interactions
with asynchronous queueing. When the feature is enabled, interactions
such as MediaCodec.setOutputSurface() triggered by the
MediaCodecRenderer will wait until all input buffers pending queueing
are first submitted to the MediaCodec.

PiperOrigin-RevId: 341423837
2020-11-11 09:49:51 +00:00
tonihei
86ae7ebac4 Decrease target live offset if safely possible.
To check what is safely possible we keep track of the live offset
corresponding to the buffered duration and only deecrease the
target offset to a safe margin from the buffered duration.

Also, while still possible (i.e. while the actual offset is larger
than the safe margin), we increase the target offset to the safe
margin to avoid rebuffers to start with.

Issue: #4904
PiperOrigin-RevId: 341396492
2020-11-11 09:49:41 +00:00
bachinger
b03df4e8b5 Add dispatchPrepare(player) to ControlDispatcher
Issue: #7882
PiperOrigin-RevId: 341394254
2020-11-11 09:49:32 +00:00
christosts
1d4321b86e Move ownership of MediaCodec to MediaCodecAdapter
Move ownership of MediaCodec to MediaCodecAdapter so that all MediaCodec
interactions go through MediaCodecAdapter.

PiperOrigin-RevId: 341066926
2020-11-11 09:49:21 +00:00
claincly
8b5ecdb98d Fix javadoc formatting
PiperOrigin-RevId: 341051348
2020-11-06 16:40:34 +00:00
christosts
92ec1ab628 Add more MediaCodec methods to MediaCodecAdapter
Add more MediaCodec methods to MediaCodedAdapter so that renderers
interact with the MediaCodec through the MediaCodecAdapter.

PiperOrigin-RevId: 341023452
2020-11-06 16:35:23 +00:00
andrewlewis
ae4cf9f1da Clean up AdTagLoader and ImaAdsLoader
In preparation for adding support for ads in playlists:
- Make releasing a no-op if the instance was already released
- Remove null checks on non-null `adDisplayContainer` and `adsLoader`
- Move initializing the ads manager into a private method as it will need to be
  called from two places soon.
- Misc other cleanup.

Issue: #3750
PiperOrigin-RevId: 341021493
2020-11-06 16:35:14 +00:00
andrewlewis
764e5e8141 Expose the ads identifier in the Timeline period
Issue: #3750
PiperOrigin-RevId: 341021084
2020-11-06 16:35:06 +00:00
andrewlewis
0c301fefa8 Pass AdsMediaSource to other AdsLoader methods
Issue: #3750
PiperOrigin-RevId: 341020676
2020-11-06 16:34:57 +00:00
kimvde
d94943f014 Add SEF super slomo test sample
PiperOrigin-RevId: 341019272
2020-11-06 16:34:48 +00:00
christosts
07e33a1395 Add getInputBuffer/getOutputBuffer in MediaCodecAdapter
PiperOrigin-RevId: 341016263
2020-11-06 16:34:37 +00:00
olly
1bcf1cf9f7 Decide whether to release rather than flush in onInputFormatChanged
- This change removes the last piece of logic that could cause deferred
  codec release (i.e., where the decision to release was made in
  processEndOfStream rather than in onInputFormatChanged.
- After this change, whether the codec will be released as a result of
  a format change is always established in onInputFormatChanged.

PiperOrigin-RevId: 341012403
2020-11-06 16:34:28 +00:00
olly
1fb675e876 Move last-buffer timestamp fix to better location
PiperOrigin-RevId: 340915538
2020-11-06 16:34:19 +00:00
olly
477eae3c57 Fix incorrect decoder non-reuse when operating rate needs clearing
This fixes a case where updateCodecOperatingRate would configure
the decoder to be drained and then released, only for
onInputFormatChanged to override the drain action with something
else.

We've not seen any reports of this issue, which suggests that either
it's OK to not release the decoder in such cases, or that the
case doesn't happen very often. I suspect that it's both, but let's
restore the intended behaviour for now.

PiperOrigin-RevId: 340909132
2020-11-06 16:34:08 +00:00
ibaker
702e5cfb3e Fix or suppress nullness warnings introduced by checkerframework 3.7.0
PiperOrigin-RevId: 340826532
2020-11-06 16:33:59 +00:00
olly
773e890768 Move another adaptation workaround into MediaCodecInfo
PiperOrigin-RevId: 340654217
2020-11-06 16:33:50 +00:00
tonihei
effbc22a62 Increase target live offset when rebuffering.
Issue: #4904
PiperOrigin-RevId: 340654178
2020-11-06 16:33:42 +00:00
tonihei
2416d99857 Limit target buffer to media configured min/max values.
Issue: #4904
PiperOrigin-RevId: 340653126
2020-11-06 16:33:33 +00:00
olly
c9e80a20e6 Move reconfiguration workaround to canKeepCodec
PiperOrigin-RevId: 340651654
2020-11-06 16:33:24 +00:00
bachinger
7f49b33fea Block HLS playlist requests at part level
Issue: #5011
PiperOrigin-RevId: 340625816
2020-11-06 16:33:15 +00:00
bachinger
4332dc2304 Parse HLS #EXT-X-RENDITION-REPORT tag
Issue: #5011
PiperOrigin-RevId: 340621758
2020-11-06 16:33:06 +00:00
tonihei
ae17e6d6f8 Forward Timeline and period id to TrackSelection.Factory
This information is already available in the MappingTrackSelector,
but not currently forwarded to the TrackSelection.Factory.

This makes it more complicated (or impossible) to depend on period
or manifest information in the track selection (for example to only
select tracks which are cached for the current format).

PiperOrigin-RevId: 340605886
2020-11-06 16:32:57 +00:00
bachinger
c04dd8b328 Use blocking HLS media playlist reload for segments
Issue: #5011
PiperOrigin-RevId: 340477795
2020-11-06 16:32:40 +00:00
andrewlewis
5fd1601f91 Signal an ads identifier to the AdsLoader
In a later change, the AdPlaybackState will include the playing adsId (set by
the AdsLoader) and the ads loader will use this to determine what ad
information is associated with the playing/next periods, to allow loading ads
in playlists.

Apps can continue to pass just a URI for an ad tag with their MediaItem, in
which case the associated playlist will request that ad tag just and the same
state will be used for all occurrences of the ad tag.

This change has breaking changes to the AdsLoader interface and removes
deprecated ways of passing the ad tag, as it's very likely to go into a major
release anyway and not needing to handle the deprecated cases simplifies
ImaAdsLoader.

Issue: #3750
PiperOrigin-RevId: 340438580
2020-11-06 16:32:31 +00:00
ibaker
f937e40eab Make Tx3gDecoder fields final, and remove unnecessary null-check
PiperOrigin-RevId: 340412910
2020-11-06 16:32:22 +00:00
andrewlewis
57c53c5ac4 Fix ImaPlaybackTest
This test is not run in presubmit as it was too flaky, and is currently broken
due to assets moving.

Also migrate off ImaPlaybackTest off deprecated APIs.

#minor-release

PiperOrigin-RevId: 340405666
2020-11-06 16:32:11 +00:00
olly
e139a4652a Short term fix for setFrameRate ISE when surface is not valid
PiperOrigin-RevId: 340314496
2020-11-02 23:02:27 +00:00
olly
2c7473dc05 Clean up logic for determining whether DRM reconfig needs codec re-init
1. Move logic to decide to re-initialize the codec rather than using
   MediaCodec.setMediaDrmSession if (a) PlayReady is in use, and (b)
   the new session is still provisioning. This would previously have
   happened asynchronously after an input format change, after the
   decoder has subsequently been flushed. After this change the logic
   executes synchronously when the input format changes. This helps
   with the ref'd bug, since we want to propagate reasons for codec
   re-initialization through inputFormatChanged events.
2. Whilst moving the logic for re-initialization if PlayReady is
   being used, I fixed a bug that would occur when switching from
   [PlayReady --> non-PlayReady]. Re-use doesn't work in this case.
   The old logic only checked for the [Something --> PlayReady] case.
3. Remove pointless codec flush if updating the DRM session having
   not queued anything to the codec.

PiperOrigin-RevId: 340299790
2020-11-02 23:02:16 +00:00
olly
9d3875a860 Matroska: Support additional PCM codec modes
- Support 32-bit A_PCM/FLOAT/IEEE PCM
- Support 8-bit and 16-bit A_PCM/INT/BIG PCM

#minor-release
Issue: #8142
PiperOrigin-RevId: 340264679
2020-11-02 23:02:06 +00:00
christosts
42a2b9230a HLS: populate targetLiveOffset in MediaItem from server control
Issue: #5011
PiperOrigin-RevId: 340260636
2020-11-02 23:01:57 +00:00
Oliver Woodman
e1211f9254 Merge pull request #8133 from xufuji456:dev-v2
PiperOrigin-RevId: 340254878
2020-11-02 23:01:45 +00:00
ibaker
8e9c5c67a3 Migrate Tx3gDecoderTest to Guava and SpannedSubject
#minor-release

PiperOrigin-RevId: 340249019
2020-11-02 23:01:35 +00:00
olly
1d12d03283 Clarify DRM error deferral comments
- I don't think the session recovering later would work, because
  the codec will be configured not to use it.
- I'm not sure session recovery makes sense in general, and our
  implementations do not do this. Document it as a terminal state
  for now.

PiperOrigin-RevId: 340204194
2020-11-02 23:01:25 +00:00
olly
be1fd23666 Rename setOperatingRate to setPlaybackSpeed
This avoids confusion that currently exists between "operating rate"
and "codec operating rate", which are different. It also tightens the
requirement of the value being passed to be more than a "hint". It's
already being used as more than a hint for setting the Surface frame
rate.

PiperOrigin-RevId: 340201829
2020-11-02 23:01:16 +00:00
andrewlewis
4289112947 Fix buildForAdsResponse
PiperOrigin-RevId: 340198099
2020-11-02 23:01:07 +00:00
olly
c1dc802050 Make defaultLicenseUrl optional
Some content types always provide the license URL in the media.
The PlayReady example in the demo app doesn't provide a default
license URL for this reason, as an example.

#minor-release

PiperOrigin-RevId: 340125784
2020-11-02 23:00:57 +00:00
andrewlewis
32b710712e Split AdTagLoader out of ImaAdsLoader
In a later change ImaAdsLoader will use multiple AdTagLoaders.

This change shouldn't have any substantial changes in behavior (it's almost
entirely moving code around). An exception is that ImaSdkSettings is configured
when making a request rather than at construction time.

Issue: #3750
PiperOrigin-RevId: 339891712
2020-11-02 23:00:48 +00:00
andrewlewis
27707e9c65 Clean up deprecated ad tag handling
PiperOrigin-RevId: 339890695
2020-11-02 23:00:39 +00:00
andrewlewis
df19725d58 Move more IMA extension utils into ImaUtil
These symbols will be referenced from AdTagLoader too in a later change.

PiperOrigin-RevId: 339889990
2020-11-02 23:00:29 +00:00
samrobinson
9962cf015b Add SEF based test to MetadataRetrieverTest
PiperOrigin-RevId: 339885432
2020-11-02 23:00:20 +00:00