2176 Commits

Author SHA1 Message Date
rohks
766e7d7d35 Add media3 guide entries in README files
PiperOrigin-RevId: 520650881
2023-03-30 17:28:03 +00:00
ibaker
2e4f49fef7 Temporarily use exoplayer2-hosted SVGs in media3 javadoc
The media3-hosted versions of these SVGs were removed due to a change in
the way the reference docs are generated. While work on getting them
hosted on developer.android.com, this change simply links to the
(identical) exoplayer2 versions in order to fix the media3 docs.

#minor-release

PiperOrigin-RevId: 520647905
2023-03-30 17:27:20 +00:00
rohks
6a928805d4 Fix javadoc links in media README files
Also fixed the javadoc link in devsite and removed javadoc links from decoder extensions as it is not published yet on developer.android.com.

#minor-release

PiperOrigin-RevId: 520636868
2023-03-30 17:26:40 +00:00
tianyifeng
cb578fcf25 Rollback of 26aee812d5
*** Original commit ***

Rollback of 6109a0eb62

*** Original commit ***

Intercept audio capabilities change in `DefaultAudioSink`

***

***

PiperOrigin-RevId: 520619600
2023-03-30 17:26:03 +00:00
ibaker
43ad45dbef Remove all RawCC references from media3
RawCC is a Google-internal subtitle format that is no longer directly
supported by this library (since 4f616d6003).

PiperOrigin-RevId: 520591591
2023-03-30 17:25:20 +00:00
tonihei
b3788ce568 Remove deprecated stop(boolean)
This method has been deprecated for over 2 years.

PiperOrigin-RevId: 520586238
2023-03-30 17:24:35 +00:00
ibaker
f4a3478d84 Use Future.get() @Deterministic annotation in OfflineLicenseHelper
This means we don't need to manually store the result of `get()` into a
local to convince the nullness checker that it remains non-null.

PiperOrigin-RevId: 520576719
2023-03-30 17:23:55 +00:00
bachinger
f599a9b8f9 Keep content timeline and ad playback states together
For multi-period live streams the content timeline for
which the global ad playback state has been split needs
to be kept together to not run into a race between
timeline refreshes and ad events.

PiperOrigin-RevId: 520358964
2023-03-30 17:23:14 +00:00
tonihei
4b7875fe21 Remove deprecated HlsMasterPlaylist
And some further remaining usages of "master" in the HLS module.
These usages are all package-private.

PiperOrigin-RevId: 520334163
2023-03-30 17:22:34 +00:00
bachinger
331d5479e6 Do not use content timeline to calculate current position
In multi-period live streams, we can't use the content timeline if we want to
lookup a period from the public timeline by index or uid because it may be
that the content timeline has already been refreshed in the
`ImaServerSideAdInsertionMediaSource` but hasn't yet arrived in `ExoPlayerImpl`.

This change is taking the current position that needs to be reported
to the SDK every 200ms is not relying on the content timeline.

PiperOrigin-RevId: 520328126
2023-03-30 17:21:55 +00:00
claincly
952edb3f0a Add a base class for GL shader programs.
By having a single base class for GL shader programs we simplify the customization
of new shader programs. The concrete cases include

- Allow frame dropping in shader program
- Creating a FrameCache that selectively (based on timestamp) replays and clears
  the cached content

PiperOrigin-RevId: 520322060
2023-03-30 17:21:17 +00:00
tonihei
6952771e2f Remove remaining references to exoplayer.dev
PiperOrigin-RevId: 520314781
2023-03-30 17:20:36 +00:00
ibaker
376bddef47 Post OfflineLicenseHelper interactions to its internal handler thread
`DefaultDrmSession(Manager)` expect most of their methods to be called
on the 'playback thread'. There isn't a playback thread in the case of
`OfflineLicenseHelper`, but in that case it's the thread backing
`DefaultDrmSessionManager.playbackLooper`, which is `OfflineLicenseHelper.handlerThread`.

PiperOrigin-RevId: 520053006
2023-03-30 17:19:53 +00:00
Googler
f88280dc78 Allow associating LoadControl methods with the relevant MediaPeriod.
PiperOrigin-RevId: 520037412
2023-03-30 17:19:10 +00:00
kimvde
1dbb19a44c Rollback of 7e6236cfdb
*** Original commit ***

Rollback of fc539da061

*** Original commit ***

Release SequenceAssetLoader when ended

Before, the SequenceAssetLoader was released at the end of the export.
Release resources earlier if possible.

***

***

PiperOrigin-RevId: 520036433
2023-03-30 17:18:30 +00:00
kimvde
24a164827e Fix handling of non-empty decoder end-of-stream output buffer
PiperOrigin-RevId: 520027236
2023-03-30 17:17:48 +00:00
kimvde
7e6236cfdb Rollback of fc539da061
*** Original commit ***

Release SequenceAssetLoader when ended

Before, the SequenceAssetLoader was released at the end of the export.
Release resources earlier if possible.

***

PiperOrigin-RevId: 519993003
2023-03-30 17:17:06 +00:00
kimvde
49d5955ce1 Add error code for muxer timeout
PiperOrigin-RevId: 519965132
2023-03-30 17:15:41 +00:00
kimvde
fc539da061 Release SequenceAssetLoader when ended
Before, the SequenceAssetLoader was released at the end of the export.
Release resources earlier if possible.

PiperOrigin-RevId: 519952572
2023-03-30 17:14:58 +00:00
huangdarwin
a0838771d3 HDR: Implement DefaultVideoFrameProcessor texture output for tests.
Previously, we always used ImageReader to read from the output of DefaultVideoFrameProcessor, for pixel tests. This has a limitation of not being
able to read HDR contents, so that we couldn't support HDR pixel tests.

Reading from a texture allows us to use glReadPixels to read from
DefaultVideoFrameProcessor, and build upon this to implement HDR pixel tests. We do
still want tests for surface output though, because real use-cases only will output
to Surfaces.

Also, add some tests for outputting to textures, since this test infrastructure is
a bit complex.

PiperOrigin-RevId: 519786535
2023-03-30 17:14:15 +00:00
tianyifeng
26aee812d5 Rollback of 6109a0eb62
*** Original commit ***

Intercept audio capabilities change in `DefaultAudioSink`

***

PiperOrigin-RevId: 519760267
2023-03-30 17:13:34 +00:00
sheenachhabra
df46748c6b Add unit test for "elst" box
PiperOrigin-RevId: 519727954
2023-03-30 17:12:52 +00:00
ibaker
2c05a9af26 Use TestUtil.getPublicMethods instead of getDeclaredMethods
JaCoCo introduces private synthetic methods (even on interfaces) which
have to be skipped when checking that a 'forwarding' implementation does
forward everything. Instead we can use the existing `getPublicMethods()`
method which implicitly skips these (since they're private).

PiperOrigin-RevId: 519665752
2023-03-30 17:11:30 +00:00
tonihei
b9790e69d7 Handle output format changes for empty sample streams correctly
When MediaCodecRenderer is given an empty sample stream, it puts
its output format change tracking in a bad state where we never
process future stream changes because we are waiting for a sample
that doesn't exist.

We can fix this by:
 - Looping the pending output stream changes to see if we processed
   more than one change at once (this fixes the tracking for empty
   sample streams that are not the first in the queue).
 - Checking if none of the previous streams queued any samples in
   onStreamChanged to handle this in the same way as the case
   where we already output all samples (this fixes the problem when
   the empty sample stream comes first in the queue).
 - Also calling onProcessedStreamChange for the case above, which
   was missing previously.

#minor-release

PiperOrigin-RevId: 519226637
2023-03-30 17:10:49 +00:00
sheenachhabra
35f016f5c4 Add end to end test for edit box
PiperOrigin-RevId: 519184599
2023-03-30 17:10:07 +00:00
tonihei
fc54a7a487 Add COMMAND_RELEASE to set whether Player instances can be released
This wasn't added so far because releasing is always allowed from a
MediaController (as it just releases the connection, not the session
player). But Player instances can be created for other purposes and
the receiver of a Player instance should not always be allowed to
call release if it doesn't own the player resource.

PiperOrigin-RevId: 519121122
2023-03-30 17:09:28 +00:00
kimvde
710b462b5f Update documentation of supported Compositions
Account for features implemented recently.

PiperOrigin-RevId: 519113898
2023-03-30 17:08:46 +00:00
claincly
b70e7ca9e7 Remove redundant volatile.
PiperOrigin-RevId: 519099339
2023-03-30 17:08:05 +00:00
kimvde
b118565730 Add an API entry point for looping a sequence
Also
- Add unit tests
- Fix bug discovered by unit tests

PiperOrigin-RevId: 519092249
2023-03-30 17:07:27 +00:00
Tianyi Feng
dc3481fca7 Merge pull request #11051 from TiVo:p-fix-for-issue-11050
PiperOrigin-RevId: 518953648
2023-03-30 17:06:46 +00:00
kimvde
1f6b000219 Handle looping sequences in TransformerInternal
PiperOrigin-RevId: 518895943
2023-03-30 17:06:01 +00:00
Googler
67f8fbf3bd [Media3][Shader] Reset the composite RGB matrix upon update
Since the composite matrix is ultimately rewritten to, we need to ensure it's cleared (to identity) before update.

Test plan: use an effect as a time based approach and see that the effect no longer clips

PiperOrigin-RevId: 518886623
2023-03-30 17:05:23 +00:00
sheenachhabra
69cece1d82 Make getMp4LocationData method inline
PiperOrigin-RevId: 518827223
2023-03-30 17:04:46 +00:00
michaelkatz
ecf4d8b891 Retry RTSP Setup with TCP if response with UDP is UnsupportedTransport
If RTSP Setup Request with UDP receives HTTP Error Status 461 UnsupportedTransport, then client will retry with TCP.

Issue: google/ExoPlayer#11069
PiperOrigin-RevId: 518807829
2023-03-30 17:04:07 +00:00
tianyifeng
df558b59db Deprecate onUpdateNotification(MediaSession)
PiperOrigin-RevId: 518612625
2023-03-30 17:03:28 +00:00
sheenachhabra
0747486e5a Remove helper method to create "hdlr" box for "meta" box
The "hdlr" box for "meta" box can be easily created by passing required parameters to Boxes.hdlr() method.

PiperOrigin-RevId: 518568103
2023-03-30 17:00:53 +00:00
sheenachhabra
e211889d70 Add Mp4 boxes test cases
PiperOrigin-RevId: 518531999
2023-03-30 16:57:33 +00:00
tofunmi
8df4fd769c Log export errors that occur after export completes
PiperOrigin-RevId: 518281002
2023-03-22 10:35:05 +00:00
tofunmi
3a6ee77daf skip transformer tests if no internet connection
The failure reason (no network) will be logged in the test output, but the test will not be marked as failing, rather skipped.

PiperOrigin-RevId: 518262203
2023-03-21 14:06:11 +00:00
michaelkatz
ea3a85f89f Add RequiresApi annotations to some unittest methods
PiperOrigin-RevId: 518258380
2023-03-21 14:24:10 +00:00
huangdarwin
cbaf0f8232 Effect: Early return and rename variable (+ nits).
Reduce nesting by using an early return. Also, rename
`outputSizeOrRotationChanged` to `outputChanged`, because this also applies to when the output surface changes.

Also, update local variable initialization, add some javadoc, and remove unneeded
local variable

PiperOrigin-RevId: 518241708
2023-03-21 14:22:46 +00:00
sheenachhabra
87cd90eb15 Fix TODO in Boxes.java
The fix is as per MP4 spec ISO/IEC 14496-12

PiperOrigin-RevId: 518240043
2023-03-21 14:22:08 +00:00
bachinger
0bae410f7d Use final reference to content timeline inside handler message
The content timeline field may be updated when the live timeline
is refreshed in the looper event preceding the runnable that is
posted to the player thread. Hence a new timeline may contain a
new period uid that is not present in the ad playback state map.

Using a final reference makes sure period and ad playback state
match when asserted.

PiperOrigin-RevId: 518228165
2023-03-21 14:21:21 +00:00
bachinger
0a2a20d4fb Skip played live ad media periods
This change makes sure that live ad periods that are played are
skip when attempted to be added to the queue. To make this work
the existing filter logic had to be take into account the content
resume offset that live periods use.

PiperOrigin-RevId: 518068138
2023-03-21 14:20:43 +00:00
huangdarwin
fca9197e1c HDR: Only check for HDR encoders on API 33+.
FEATURE_HdrEditing is only available on and above API 33, so it doesn't make
sense to check for support under API 33.

PiperOrigin-RevId: 518036855
2023-03-21 14:20:01 +00:00
sheenachhabra
669008f437 Use FakeExtractorOutput in Mp4MuxerMetadataTest
The FakeExtractorOutput dumps data in more readable format
so using that where ever possible.

The MdtaMetadataEntry which contains key and value dumped only "key".
Added fix to dump "value" as well.

PiperOrigin-RevId: 517968996
2023-03-21 14:19:12 +00:00
bachinger
b13b272695 Use correct period duration in fake live timeline
PiperOrigin-RevId: 517953981
2023-03-21 14:18:30 +00:00
sheenachhabra
ccdbd3b0a3 Add tkhd, mvhd and mdhd box test cases
PiperOrigin-RevId: 517933485
2023-03-21 14:17:47 +00:00
kimvde
aed5d62602 Remove TODOs
PiperOrigin-RevId: 517444208
2023-03-21 14:17:04 +00:00
kimvde
d41d025803 Add support for looping sequences in SequenceAssetLoader
PiperOrigin-RevId: 517418886
2023-03-21 14:16:19 +00:00