11952 Commits

Author SHA1 Message Date
samrobinson
135eb3f8cf Split some MediaMetadataTest cases into TextInformationFrameTest.
PiperOrigin-RevId: 385562351
2021-07-20 08:52:38 +01:00
andrewlewis
5bc080fd41 Fix diagram name typo
PiperOrigin-RevId: 385561505
2021-07-20 08:51:12 +01:00
ibaker
9cba98114c Document that apps must depend on a consistent module version
PiperOrigin-RevId: 385522972
2021-07-20 08:48:36 +01:00
kimvde
fa1bb32deb Remove deprecated PlaybackPreparer
Also update release note to account for upcoming ControlDispatcher removal.

PiperOrigin-RevId: 385520701
2021-07-20 08:47:26 +01:00
kimvde
30e65acf63 Deprecate ControlDispatcher in Leanback library
PiperOrigin-RevId: 385503851
2021-07-20 08:44:47 +01:00
olly
fdc2cbd7e2 decoder_av1/build.gradle: disable BUILD_TESTING in cmake
this avoids an extra download of googletest by cpu_features after:
06fdc0a cmake: Use CTest default (Fix #169) (#170)

PiperOrigin-RevId: 385181519
2021-07-20 08:43:28 +01:00
ibaker
d4cb62eb7b Fix RTSP docs and add a missing release note
* Add release note for `RtspMediaSource.Factory.setTimeoutMs()`
* Remove mention of what we don't support (any such list is necessarily non-exhaustive)
* Remove markdown quote character ('>')

PiperOrigin-RevId: 385143574
2021-07-20 08:40:55 +01:00
ibaker
a2929d0920 Merge duplicate RTSP sections in dev-v2 release notes
PiperOrigin-RevId: 385139398
2021-07-20 08:39:34 +01:00
kimvde
31c9875ec9 Deprecate ControlDispatcher in the UI
PiperOrigin-RevId: 385129211
2021-07-20 08:38:13 +01:00
kimvde
3830848888 Use Player methods in DefaultControlDispatcher
PiperOrigin-RevId: 385118021
2021-07-20 08:36:46 +01:00
klhyun
f173ffa972 Do not set aspect ratio if unknown.
When the size of the video is unknown,
PlayerView and StyledPlayerView set the aspect ratio as 1,
which could result in wrong view layout.

This CL sets the aspect ratio as 0 (unset) to prevent that.

This handles Issue: #9189.

PiperOrigin-RevId: 385115357
2021-07-20 08:35:17 +01:00
kimvde
626c3e9843 Remove fastforward_increment and rewind_increment attributes
This values won't be configurable from the UI anymore once the
DefaultControlDispatcher is removed.

They can be configured in the Player or by using a ForwardingPlayer.

PiperOrigin-RevId: 385113498
2021-07-20 08:33:49 +01:00
olly
c7d34d768d The sound, vibrate and ticker will only be played once
Android doc:https://developer.android.com/reference/android/app/Notification.Builder#setOnlyAlertOnce(boolean)

PiperOrigin-RevId: 384227580
2021-07-16 16:12:59 +01:00
kimvde
d587420650 Add support for MP4 H263 atom type
#minor-release
Issue:#9158
PiperOrigin-RevId: 383660258
2021-07-16 16:12:59 +01:00
ibaker
17c6092335 Clarify the thread requirements of a SurfaceView or SurfaceHolder
Issue: #9005
PiperOrigin-RevId: 382765045
2021-07-16 16:12:59 +01:00
ibaker
278593f0c8 Use the content URI as well as mediaId for the auto-generated ad ID
MediaItem.mediaId used to default to the content URI, but this changed:
cc26a92e07

Before the mediaId change linked above, a playlist of different content
all with the same ad URI would play the ads for every item. After the
change the ad would only play once (because mediaId == "" for every
item, so they're all the same). This change restores roughly the
original behaviour by always considering both mediaId and the content
URI.

Issue: #9106
PiperOrigin-RevId: 382763618
2021-07-16 16:12:59 +01:00
ibaker
306b2e6d2e Don't propagate attrs into child SubtitleOutput from SubtitleView
PiperOrigin-RevId: 382763308
2021-07-16 16:12:59 +01:00
ibaker
3430912581 Encode emsg duration & ID as int64 instead of uint32
The serialization scheme used here is custom, it doesn't need
to be compatible with emsg-v0 or emsg-v1 (since
97183ef558).

This means that C.TIME_UNSET will propagate correctly through the
serialization.

Issue: #9123
PiperOrigin-RevId: 382762873
2021-07-16 16:12:59 +01:00
ibaker
f5d8efbf40 Add @Deprecated to SEP methods that override deprecated methods
Without this annotation it seems that `SimpleExoPlayer` effectively
'un-deprecates' the method, specifically:
* A usage of these methods isn't flagged by Android Studio if the
  declared type is `SimpleExoPlayer` (up-casting to e.g.
  `ExoPlayer.VideoComponent` results in the warning showing up).
* The `SimpleExoPlayer` javadoc doesn't mention this method is
  deprecated:
  https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/SimpleExoPlayer.html#addVideoListener(com.google.android.exoplayer2.video.VideoListener)
* The Metalava API output for `SimpleExoPlayer` doesn't show these
  methods as deprecated.

PiperOrigin-RevId: 382756174
2021-07-16 16:12:59 +01:00
aquilescanta
d699fb5dd9 Add info about trick-playness to the Format log string
PiperOrigin-RevId: 382139109
2021-07-16 16:12:59 +01:00
kimvde
e272e3b1c8 Improve support for Ogg truncated content
Issue:#7608
PiperOrigin-RevId: 382081687
2021-07-16 16:12:59 +01:00
claincly
ff5694a0b6 Amend RTSP dev guide to match the current code status.
PiperOrigin-RevId: 381852972
2021-07-16 16:12:59 +01:00
Oliver Woodman
125a8d3caa Merge pull request #9119 from chvp:media2-dispatch-previous-next
PiperOrigin-RevId: 381833313
2021-07-16 16:12:59 +01:00
claincly
baa9a367e2 Improve timeout handling and allow customizing the timeout.
Previously, a SocketTimeourException is used to signal the end of the stream
that is caused by "no RTP packets received for a while". However, such
signaling is inappropriate under TransferRtpDataChannel, or FakeRtpDataChannel
in RtspPlaybackTests.

Hence, the signaling of end of stream is changed to use RESULT_END_OF_INPUT.
The RtpDataChannel implementations will Still block until a set timeout, but
will return a C.RESULT_END_OF_INPUT should a timeout occur, instead of
throwing a nested SocketTimeoutException.

This also allowed customization of the timeout amount, in
RtspMediaSource.Factory

PiperOrigin-RevId: 380981534
2021-07-16 16:12:59 +01:00
claincly
e4bd2e213f Amend release note for 46bc49a4f6.
PiperOrigin-RevId: 380766548
2021-07-16 16:12:59 +01:00
olly
90cd2a2131 Fix expansion of items within StyledPlayerView popup
Issue: #9086
PiperOrigin-RevId: 380756562
2021-07-16 16:12:59 +01:00
olly
5b8be42fa1 HLS: Fix issue where a live event doesn't transition to STATE_ENDED
The problem occurs when the primary media playlist URL switches
from one whose latest snapshot has not yet got the ended tag, to
one whose latest snapshot already has the ended tag. In this case:

- We trigger a redundant load of the ended playlist.
- When the redundant load completes,
  MediaPlaylistBundle.processLoadedPlaylist detects that the
  playlist is unchanged from the one it already has, and so
  doesn't call onPlaylistUpdated.
- PrimaryPlaylistListener.onPrimaryPlaylistRefreshed is never
  called with the new primary. Hence the externally visible primary
  is still the one that hasn't ended. HlsMediaSource therefore thinks
  the event hasn't ended, which in turn prevents the player from
  transitioning to the ended state.

This commit detects when the new primary already has the ended tag.
In this case, we call onPrimaryPlaylistRefreshed directly and remove
the unnecessary playlist load.

Issue: #9067
#minor-release
PiperOrigin-RevId: 380680532
2021-07-16 16:12:59 +01:00
olly
79f03dfba3 Fix DefaultTimeBar glitches
The glitches were introduced in:
https://github.com/google/ExoPlayer/commit/6c31e34528

The problem is that Listener.onEvents is called in a later looper iteration
than the listener methods that were previously used. This created a gap on
the main thread between the UI component dispatching a seek operation to the
player, and onEvents being called to update the progress bar's position.

At the start of this gap the progress bar is rendering the new position,
but its position member variable is still set to the old position. If the
progress bar is re-drawn by another message on the main thread within the
gap, it will briefly show the old position until onEvents is called.

There are multiple possible fixes to this, and the best one is probably to
modify ListenerSet to remove the gap. That's high risk though, so for now we
fix the flicker by always updating the progress immediately after the seek
is dispatched, in addition to when onEvents is called.

Issue: #9049
PiperOrigin-RevId: 380678388
2021-07-16 16:12:59 +01:00
olly
93f4e5ff85 Specify a root when inflating child views
#minor-release

PiperOrigin-RevId: 380655806
2021-07-16 16:12:59 +01:00
olly
8287b2529b Workaround for focus issues on API levels less than 26
Issue: #9061
PiperOrigin-RevId: 380640601
2021-07-16 16:12:58 +01:00
ibaker
de16dea006 Re-word the DataSourceContractTest javadoc
This softens the language around suppressing individual test methods.
There are some legitimate cases where this is needed, e.g.
ByteArrayDataSourceContractTest has to suppress all the tests related
to non-existent resources because it's not possible to simulate that
case.

#minor-release

PiperOrigin-RevId: 380570017
2021-07-16 16:12:58 +01:00
claincly
e2040a5893 Use a HashMap like behaviour in parsing SDP.
Some server will wrongly insert duplicated attributes. We used to treat this as
a unrecoverable error, but it is better to treat the duplicated attributes in
an "over-writable" fashion like HashMaps.

Issue: #9080,
Issue: #9014
PiperOrigin-RevId: 380547079
2021-07-16 16:12:58 +01:00
ibaker
60bbe64ab3 Simplify FileDataSourceContractTest
#minor-release

PiperOrigin-RevId: 380531272
2021-07-16 16:12:58 +01:00
ibaker
a27d9a04b8 Allow repeated DRM provisioning in DefaultDrmSessionManager
Also change to explicitly track the provisioning session, which makes
the code easier to reason about than always using the zero'th element
of the list.

PiperOrigin-RevId: 380181453
2021-07-16 16:12:58 +01:00
christosts
ed563183cd Set master playlist's channelCount only on audio renditions
PiperOrigin-RevId: 379935363
2021-07-16 16:12:58 +01:00
christosts
f3e62343fc Forward FRAME-RATE from the master playlist to renditions
Issue: #8960

PiperOrigin-RevId: 379922704
2021-07-16 16:12:58 +01:00
ibaker
4190ff3274 Add a test for the provisioning flow to DefaultDrmSessionManagerTest
#minor-release

PiperOrigin-RevId: 379913814
2021-07-16 16:12:58 +01:00
olly
c269a62fe0 HLS: Fix issue where new init segment would not be loaded
Issue: #9004
PiperOrigin-RevId: 379516815
2021-07-16 16:12:58 +01:00
olly
08dbfd5c5a Fix issue where a trun atom could be associated with the wrong track
Note that this removes a workaround for malformed content, in which the
track_ID is set incorrectly. It's unclear there was sufficient reason to
implement that workaround, and so it's preferable to remove it, rather
than implementing the concept of unrecognized tracks, which would be
needed to keep it and to also fix this issue.

Issue: #9056
PiperOrigin-RevId: 379506261
2021-07-16 16:12:58 +01:00
ibaker
189c52bc96 Add DRM info to Format.toLogString
The Widevine H264 samples in the demo app now log this from the EventLogger:
```
[X] Track:0, id=1, mimeType=video/avc, bitrate=772315, codecs=avc1.42c01e, drm=[widevine,cenc], res=320x142, fps=24.0, supported=YES
```

And the VP9 ones log:
```
[X] Track:0, id=1, mimeType=video/x-vnd.on2.vp9, bitrate=588256, codecs=vp9, drm=[widevine], res=320x142, fps=23.809525, supported=YES
```

#minor-release

PiperOrigin-RevId: 379498332
2021-07-16 16:12:58 +01:00
Oliver Woodman
d3a0709374 Merge pull request #9023 from DolbyLaboratories:dev-v2-multicodecs
PiperOrigin-RevId: 379440699
2021-07-16 16:12:58 +01:00
Oliver Woodman
3ae4c1b07b Merge pull request #6500 from DolbyLaboratories:dev-v2-isDirectPlaybackSupported
PiperOrigin-RevId: 378895355
2021-07-16 16:12:58 +01:00
olly
9a876f7300 Fix IncorrectContextUseViolation on Android 11
Issue: #8246
PiperOrigin-RevId: 378606475
2021-07-16 16:12:58 +01:00
olly
19e3d9b8ca Bump dexmaker version
Issue: #9032
PiperOrigin-RevId: 378605169
2021-07-16 16:12:58 +01:00
aquilescanta
7b96ba0507 Bump the androidx annotation version to 1.2.0
It is the current public stable version and it brings in @DoNotInline.

PiperOrigin-RevId: 378119413
2021-07-16 16:12:52 +01:00
olly
049b6edbb3 Update PlayerNotficationManager to set PendingIntent.FLAG_IMMUTABLE on its Broadcast intent.
In Android 12 mutability flags have to be set on PendingIntents. If they
are not, and the app targets Android 12, then the app will be crashed by
the system.

PiperOrigin-RevId: 373427591
2021-07-16 15:57:38 +01:00
kimvde
227f9a3b93 PlayerNotificationManager: add setUseRewind/FastForwardAction
This is a preliminary step to deprecate ControlDispatcher.

PiperOrigin-RevId: 385097270
2021-07-16 11:25:42 +01:00
bachinger
78ecb10ac0 Add RepresentationHolder.selectedBaseUrl and use it for new chunks
PiperOrigin-RevId: 384968532
2021-07-16 11:24:21 +01:00
aquilescanta
99abb4e1e9 Check for TS synchronization before parsing packet from random position
#minor-release
Issue: #9100
PiperOrigin-RevId: 384962258
2021-07-16 11:22:55 +01:00
olly
7157f3c119 Move E2E DASH test into DASH package
PiperOrigin-RevId: 384912341
2021-07-15 14:47:20 +01:00