18832 Commits

Author SHA1 Message Date
ibaker
f2c0eab468 Replace exoplayer.dev@gmail.com with android-media-github@google.com
#minor-release

PiperOrigin-RevId: 544596686
2023-06-30 10:20:38 +01:00
Googler
6732c0e286 Resume/Pause on playback suppression changes with timeout.
Auto-resume playback when the removal of playback suppression due to unsuitable output is conveyed via change in playback suppression to Player.PLAYBACK_SUPPRESSION_REASON_NONE within a configurable timeout defaulting to 5 minutes.

PiperOrigin-RevId: 544411987
2023-06-29 23:17:57 +00:00
Googler
832d5b5f98 Update playback suppression states dynamically.
Instead of playing or pausing itself, the ExoPlayer implementation should only update the playback suppression reason as and when audio outputs are added or removed dynamically.

PiperOrigin-RevId: 544379033
2023-06-29 23:16:39 +00:00
huangdarwin
4e4045b98e GL: Allow differentiation of error messages
In the absence of stack traces, these 2 messages were hard to differentiate
before this CL.

PiperOrigin-RevId: 544368823
2023-06-29 23:15:24 +00:00
samrobinson
f60f79bb10 Handle media item (Effects/Format) changes in AudioSamplePipeline.
On a MediaItem change, the input Format (and Effects to apply) may be
different. Therefore the AudioProcessingPipeline must be reconfigured
to determine what processing is active, and what the AudioFormat of the
data output is. In the event that it is different, additional
AudioProcessor instances must be used to ensure the encoder will still
be able to accept the audio buffers.

PiperOrigin-RevId: 544338451
2023-06-29 23:14:10 +00:00
kimvde
32bd5dd718 Fix forceInterpretHdrAsSdr not being set in DefaultAssetLoaderFactory
PiperOrigin-RevId: 544296301
2023-06-29 23:13:00 +00:00
claincly
98eb339333 Add tracing info for EOS signaling in the texture managers
PiperOrigin-RevId: 544063377
2023-06-29 23:11:44 +00:00
tianyifeng
d895a46b28 Ensure that ShuffleOrder has the same length as the current playlist
Add a fail-fast check in `ExoPlayerImpl` to ensure the equality of the lengths of `ShuffleOrder` and the current playlist. Also improve the documentation of `setShuffleOrder(ShuffleOrder)` with explicit instruction on this.

Issue: androidx/media#480

#minor-release

PiperOrigin-RevId: 544009359
2023-06-29 23:10:29 +00:00
andrewlewis
fd284d7de2 Remove unnecessary final on DefaultHttpDataSource.Factory method
PiperOrigin-RevId: 543997872
2023-06-29 23:09:14 +00:00
tofunmi
a98b33b03c Replace glFinish in texture output with Gl sync token
Providing the sync token in the api allows the client to decide which waiting method they would like to use depending on the use case, allowing them to optimise if possible.

PiperOrigin-RevId: 543997311
2023-06-29 23:07:56 +00:00
andrewlewis
81fc9ea509 Make DefaultDecoderFactory visible
This fixes a broken javadoc link and makes it possible to customize media
source creation via the asset loader factory without also having to
implementing a decoder factory from scratch.

PiperOrigin-RevId: 543995538
2023-06-29 23:06:47 +00:00
tonihei
b324b8aa72 Clarify MediaPeriod.readDiscontinuity Javadoc
It currently wrongly documents that it is only called before reading
streams (that has never been the case and all MediaPeriods already need
to handle calls after reading samples from the streams).

It was also a bit unclear what a discontinuity implies and the new
Javadoc calls out the main use case for discontinuties and the intended
meaning of returning a discontinuity.

#minor-release

PiperOrigin-RevId: 543989124
2023-06-29 23:05:31 +00:00
kimvde
a632118875 Remove TransformationRequest.Builder deprecated methods
TransformationRequest.Builder will become package private.

PiperOrigin-RevId: 543987255
2023-06-29 23:03:41 +00:00
tofunmi
8cecb93570 Texture Input: Add GLSyncToken to the OnInputFrameProcessedListener
PiperOrigin-RevId: 543867944
2023-06-29 23:02:20 +00:00
claincly
f98a10f3f2 Move GlShaderProgram creation away from VFP creation
PiperOrigin-RevId: 543773418
2023-06-29 23:00:11 +00:00
kimvde
b358d075a1 Replace usages of deprecated TransformationRequest setter
PiperOrigin-RevId: 543765376
2023-06-29 22:59:06 +00:00
ibaker
dc311fd0ca Remove IfAny suffix from @Nullable IntDef locals in MCImplBase
We use `@Nullable` for IntDefs in other places and don't use this suffix
elsewhere, so I don't think we need it here either.

PiperOrigin-RevId: 543687285
2023-06-29 22:57:38 +00:00
kimvde
f8491fc61f Deprecate Transformer.Builder.setTransformationRequest()
Usages will be removed in follow-up changes.

PiperOrigin-RevId: 543654397
2023-06-29 22:55:29 +00:00
tianyifeng
140c83ce7e Use different package names in DiagnosticInfo for media3 and exoplayer
Issue: androidx/media#476

#minor-release

PiperOrigin-RevId: 543460075
2023-06-29 22:54:02 +00:00
samrobinson
0d67733d28 Update media in silence concatentation test to match silent format.
Goal of tests (SequenceExportTest) that use this media is for the
silence and the media to match exactly with audio format, however
`sample_with_increasing_timestamps.mp4` had a different sample rate.

testvid_1022ms.mp4: channel count = 2, sample rate = 44100.

PiperOrigin-RevId: 543458948
2023-06-29 22:52:32 +00:00
sheenachhabra
8735382590 Move SSIM related files to test_util
PiperOrigin-RevId: 543444043
2023-06-29 22:51:20 +00:00
tonihei
2322462404 Do not trim audio samples by changing their timestamp
MP4 edit lists sometimes ask to start playback between two samples.
If this happens, we currently change the timestamp of the first
sample to zero to trim it (e.g. to display the first frame for a
slightly shorter period of time). However, we can't do this to audio
samples are they have an inherent duration and trimming them this
way is not possible.

#minor-release

PiperOrigin-RevId: 543420218
2023-06-29 22:50:04 +00:00
tonihei
7996766b22 Rollback of b69b33206e
*** Original commit ***

Mark output sample as decode-only based on start time

We currently do the same check on the input timestamps and
expect the output timestamps to match. Some codecs produce
samples with modified timestamps and the logic is a lot safer
when the comparison with the start time is done on the output
side of the codec.

Issue: google/ExoPlayer#11000

***

PiperOrigin-RevId: 543379665
2023-06-26 11:39:52 +00:00
tofunmi
10cf06386d Fix version bump for media3:1.1.0
#minor-release

PiperOrigin-RevId: 543376501
2023-06-26 09:30:16 +00:00
Googler
1fc49ce288 Removing @CallSuper from [add,remove]Listener of ForwardingListener.
PiperOrigin-RevId: 543373503
2023-06-26 09:28:48 +00:00
tofunmi
81dfe9d4b4 Version bump for exoplayer 2.19.0 continued
#minor-release

PiperOrigin-RevId: 543369900
2023-06-26 09:02:21 +00:00
tofunmi
114364897b Version bump to media3-1.1.0 and exoplayer 2.19.0
#minor-release

PiperOrigin-RevId: 542881427
2023-06-23 16:52:42 +00:00
kimvde
bdd593e0d3 Make FallbackListener.onTransformationRequestFinalized() synchronized
FallbackListener.onTransformationRequestFinalized() is called from the
AssetLoader thread for audio, and from the GL thread for video.

PiperOrigin-RevId: 542851284
2023-06-23 16:50:56 +00:00
andrewlewis
90c8f642af Pass GlObjectsProvider to methods
By passing this class where it's needed, implementations don't need to store it
in a field (reducing boilerplate) and it's clearer that it can't be unset when
needed.

PiperOrigin-RevId: 542823522
2023-06-23 16:49:12 +00:00
jbibik
c2d8051662 Cleaner unified PlayerInfo update method in MediaControllerImplBase
`MediaControllerImplBase` has 2 methods for updating listeners about `PlayerInfo` changes - `updatePlayerInfo` (for masking the state) and `onPlayerInfoChanged` (when communicating with the session). There is a set number of listener callbacks related to `PlayerInfo` updates and both methods should go through the same control flow (whether we know that masking will ignore most of them or not).

A unified method `notifyPlayerInfoListenersWithReasons` encapsulates only the shared logic of 2 methods - listeners' callbacks. This ensures that both methods call them in the same order and none are missed out.

PiperOrigin-RevId: 542587879
2023-06-23 16:47:58 +00:00
ibaker
ca766b6979 Check the two Extractor instantiation sites in HLS remain consistent
PiperOrigin-RevId: 542585842
2023-06-23 16:46:11 +00:00
jbibik
ea0f564c1e Fix missing equals sign in inline-comment parameter names
PiperOrigin-RevId: 542577676
2023-06-23 16:44:33 +00:00
claincly
12584fbb20 Add test for force EOS when a decoder drops frames
This is for the timer added in abd96598d9

PiperOrigin-RevId: 542571387
2023-06-23 16:42:46 +00:00
samrobinson
b46b6a8278 Use stereo audio in silence -> audio SequenceExportTest.
With the upcoming "handle format changes" CL, stereo -> mono audio
would add an AudioProcessor. Robolectric decodes output encoded data,
which crashes some AudioProcessors because the number of frames may not
be an integer.

PiperOrigin-RevId: 542568875
2023-06-23 16:40:57 +00:00
ibaker
bc06039f7f Add Extractor.getUnderlyingImplementation
This change uses this new method everywhere we currently `instanceof`
check an `Extractor` directly. This allows us to introduce
wrapping/delegating `Extractor` instances - because the `instanceof`
checks will continue to operate on the underlying instance.

HLS is a slightly different case, because it directly re-instantiates
`Extractor` instances, which is not compatible with an arbitrary
wrapping structure. Luckily the only `Extractor` instances that HLS
re-instantiates do not support muxed subtitles, so won't be wrapped
in the first place (although future changes might use the
delegating-`Extractor` pattern for other purposes, which might affect
HLS).

PiperOrigin-RevId: 542550928
2023-06-22 15:49:52 +00:00
tofunmi
7e475146dd Merge release notes for media3 1.1.0 stable release
#minor-release

PiperOrigin-RevId: 542539300
2023-06-22 15:48:12 +00:00
kimvde
69cef452a0 Make SpeedChangingAudioProcessor public
PiperOrigin-RevId: 542533743
2023-06-22 15:46:42 +00:00
jbibik
b8ac5b4210 Order MediaControllerImplBase listener callbacks as in ExoPlayerImpl
The callbacks for `PlayerInfo` changes are currently in both `MediaControllerImplBase.updatePlayerInfo` (masking) and `MediaControllerImplBase.onPlayerInfoChanged`. But the order was different between them both and `ExoPlayerImpl.updatePlaybackInfo` which they are trying to mimic.

#minor-release

PiperOrigin-RevId: 542519070
2023-06-22 15:45:21 +00:00
michaelkatz
ca22fe7c74 Disable gapless support for offload when pre-API 33
Devices pre-API 33 are not able to comprehend the position reset that occurs by the HAL in offloaded gapless track transitions.

PiperOrigin-RevId: 542503662
2023-06-22 15:43:50 +00:00
tofunmi
be38670391 Transformer: Decode image in sRGB
The effects pipeline must receive images in the sRGB colorspace due to the color transfers applied in the shaders. Currently the burden to making sure images are in the right colorspaces falls onto apps. This CL ensures that this is not the case anymore.

PiperOrigin-RevId: 542323613
2023-06-22 15:41:55 +00:00
claincly
1831220a53 Fix the last shader program doesn't get GlObjectsProvider
PiperOrigin-RevId: 542299317
2023-06-22 15:40:33 +00:00
ibaker
3f7599e9c3 Add a section to CONTRIBUTING.md about push access to PR forks
#minor-release

PiperOrigin-RevId: 542294607
2023-06-22 15:39:04 +00:00
samrobinson
64f93a895e Assert that Formats passed to ASP represent valid decoded audio.
Ensure SequenceAssetLoader knows downstream is decoding audio if
silence is generated.

PiperOrigin-RevId: 542293633
2023-06-22 15:37:26 +00:00
sheenachhabra
7a819bc275 Add java doc link to muxer README files
PiperOrigin-RevId: 542249083
2023-06-22 15:36:06 +00:00
Tofunmi Adigun-Hameed
6e9df8df77 Merge pull request #461 from almiki:release
PiperOrigin-RevId: 542228372
2023-06-22 15:34:28 +00:00
Tofunmi Adigun-Hameed
e665e2aee8 Merge pull request #419 from v-novaltd:vnova-104
PiperOrigin-RevId: 542214119
2023-06-22 15:33:06 +00:00
samrobinson
d2105204e1 Propagate Metadata from extracted Format to decoded Format.
MediaCodec does not retain the `Metadata` of its input `Format`, so
add it to the output `Format`.

PiperOrigin-RevId: 542194322
2023-06-22 15:31:30 +00:00
tofunmi
09fe0d7390 Correct the DefaultFrameDroppingShaderProgram logic
copies the previous texture to a temp texture to ensure the correct frame is queued.

#minor-release

PiperOrigin-RevId: 541972349
2023-06-22 15:29:41 +00:00
ibaker
34f23451e6 Switch to SVG assets hosted on developer.android.com for reference docs
#minor-release

PiperOrigin-RevId: 541970884
2023-06-22 15:27:58 +00:00
bachinger
4604f0cde6 Fix ArrayIndexOutOfBoundIndex when re-preparing after exception
When an app tried to re-prepare a live streeam with server side inserted
ad after a playback exception, the player tried to find the ad group by
its index in the ad playback state of the next timeline when creating
the first period.

If a source that supports server side ad, has removed the ad playback
state when the source has been removed, this causes a crash. For live
streams this is a reasonable thing to do given the exception could be
caused by an invalid ad playback state.

This change removes the ad metadata from the current period for live
streams and the timeline. In case the ad playback state is not reset
by the source, the first timeline refresh would ad the metadata again.

PiperOrigin-RevId: 541959628
2023-06-22 15:26:25 +00:00