771 Commits

Author SHA1 Message Date
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
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
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
Googler
1fc49ce288 Removing @CallSuper from [add,remove]Listener of ForwardingListener.
PiperOrigin-RevId: 543373503
2023-06-26 09:28:48 +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
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
kimvde
69cef452a0 Make SpeedChangingAudioProcessor public
PiperOrigin-RevId: 542533743
2023-06-22 15:46:42 +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
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
Googler
63ca2595be Add public API for isWear check in media3-common.
PiperOrigin-RevId: 541925117
2023-06-22 15:24:56 +00:00
ibaker
71f73229dd Fix two more unresolved SVGs in Timeline.Window and Timeline.Period
These were missed in 10342507f7

#minor-release

PiperOrigin-RevId: 541860649
2023-06-20 14:06:02 +01:00
samrobinson
74948d5424 Add a constructor for AudioFormat that takes Format.
PiperOrigin-RevId: 541662208
2023-06-20 13:59:47 +01:00
huangdarwin
949e9cbd96 GL: Rename GL methods.
To more accurately describe what they do, especially as Compositor will
starts to use more contexts or threads, and it's important to know what
needs to be reset/recreated/focused before what methods.

PiperOrigin-RevId: 541010135
2023-06-19 16:29:03 +01:00
huangdarwin
daa42322d7 GL: Remove configAttributes from createFocusedPlaceholderEglSurface.
PiperOrigin-RevId: 540901189
2023-06-19 16:27:02 +01:00
bachinger
bd97dd8519 Rollback of 7956c80f73
*** Original commit ***

Rollback of 2a6f893fba

*** Original commit ***

Set video size to 0/0 when video render is disabled

In terms of MCVR wi...

***

PiperOrigin-RevId: 540525069
2023-06-19 16:09:13 +01:00
tonihei
51fb72b00d Replace deprecated NullableType from checkerframework with our own one
The existing NullableType has been deprecated 5 years ago and causes
crashes in Kotlin apps because Kotlin doesn't recognize this annotation
as a nullable type annotation.

While we can't align on a single @Nullable annotation yet, we can at
least replace this one by JSR305's @Nonnull(MAYBE) as it fulfils all
requirements, including full Kotlin compatiblity. To avoid the
cumbersome name, we can redefine it as our own @NullableType
annotation. (We can't use @Nullable to avoid name clashes with the main
@Nullable annotation from AndroidX)

Issue: google/ExoPlayer#6792
PiperOrigin-RevId: 540497469
2023-06-19 16:08:20 +01:00
tofunmi
4bceb64dee Version bump to media3:1.1.0-rc01
#minor-release

PiperOrigin-RevId: 539632164
2023-06-12 14:14:33 +00:00
claincly
5f43180a68 Allow using different video effects per MediaItem
PiperOrigin-RevId: 539596345
2023-06-12 14:04:42 +00:00
Googler
5c29abbbf4 Rollback of a66f08ba97
*** Original commit ***

Add a timer to end a video stream prematurely in ExtTexMgr

***

This has been submitting for more than 1.5hrs. "This presubmit is running slowly because you have been throttled by Build Queue due to using too much of your Product Area's quota."

adding NO_SQ as this is a pure rollback

PiperOrigin-RevId: 539135970
2023-06-09 18:36:17 +00:00
tianyifeng
db3e662bdc Throw exception when TimestampAdjuster initialization hits timeout
Add `HlsMediaSource.Factory.setTimestampAdjusterInitializationTimeoutMs(long)` to set the timeout for the loading thread to wait for the `TimestampAdjuster` to initialize. If the initialization doesn't complete before the timeout, a `PlaybackException` is thrown to avoid the playback endless stalling. The timeout is set to zero by default.

This can avoid HLS playback endlessly stalls when manifest has missing discontinuities. According to the HLS spec, all variants and renditions have discontinuities at the same points in time. If not, the one with discontinuities will have a new `TimestampAdjuster` not shared by the others. When the loading thread of that variant is waiting for the other threads to initialize the timestamp and hits the timeout, the playback will stall.

Issue: androidx/media#323

#minor-release

PiperOrigin-RevId: 539108886
2023-06-10 20:25:05 +00:00
michaelkatz
fafeafa72d Return offload unsupported for formats not supported by the sdk level
PiperOrigin-RevId: 539079342
2023-06-10 20:20:20 +00:00
claincly
a66f08ba97 Add a timer to end a video stream prematurely in ExtTexMgr
PiperOrigin-RevId: 539036285
2023-06-09 14:04:49 +00:00
Googler
605af62d00 Add playback suppression for the attempted playbacks on an unsuitable output.
This CL introduces the new public API setSuppressPlaybackWhenUnsuitableOutput which if set to TRUE will cause suppression of a requested playback if that is going to happen on an unsuitable audio output (e.g. builtin speaker on a WearOS device).

PiperOrigin-RevId: 538867212
2023-06-09 13:58:42 +00:00
jbibik
28b8fb706a Make StreamKey Bundleable and remove deprecated trackIndex
#minor-release

PiperOrigin-RevId: 538809105
2023-06-09 13:57:05 +00:00
sheenachhabra
53c174f047 Add support for passing custom metadata via transformer
Changes included:
1. Enable MP4 extractor to read all types of metadata.
2. Allow passing String and Float metadata via Transformer.

Reference to QuickTime spec: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW21

PiperOrigin-RevId: 538783982
2023-06-09 13:51:15 +00:00
tianyifeng
f4bf376e89 Defer outputting the metadata sample when TimestampAdjuster isn't initialized
The sample timestamp carried by the emsg box can have a significant delta when comparing to the earliest presentation timestamp of the segment. Using this timestamp to intialize the timestamp offset in TimestampAdjuster will cause the media sample to have a wrong adjusted timestamp. So we should defer adjusting the metadata sample timestamp until the TimestampAdjuster is initialized with a real media sample.

PiperOrigin-RevId: 538172841
2023-06-06 18:10:41 +00:00
claincly
08e7158be5 Add utility to create ScheduledExecutorService
PiperOrigin-RevId: 538129792
2023-06-06 18:09:26 +00:00
jbibik
d9764c18ad Allow playback of MediaItems with LocalConfiguration
When initiated by MediaController, it should be possible for `MediaSession` to pass `MediaItems` to the `Player` if they have `LocalConfiguration`. In such case, it is not required to override `MediaSession.Callback.onAddMediaItems`, because the new current default implementation will handle it.

However, in other cases, MediaItem.toBundle() will continue to strip the LocalConfiguration information.

Issue: androidx/media#282

#minor-release

PiperOrigin-RevId: 537993460
2023-06-06 18:08:17 +00:00
Googler
7956c80f73 Rollback of 2a6f893fba
*** Original commit ***

BEGIN_PUBLIC
Set video size to 0/0 when video render is disabled

In terms of MCVR with a `VideoRendererEventListener`, the video size is set to
0/0 right after `onVideoDisabled()` is called and is set to the actual size as
soon as the video size is known after 'onVideoEnabled()`.

For ExoPlayer and in terms of the `Player` interface, `Player.getVideoSize()`
returns a video size of 0/0 when `Player.getCurrentTracks()` does not support
`C.TRACK_TYPE_VIDEO`. This is ensured by the masking behavior

***

PiperOrigin-RevId: 537938947
2023-06-06 18:06:46 +00:00
Googler
83e9080b71 Override ParserException#getMessage
PiperOrigin-RevId: 537908595
2023-06-06 18:05:33 +00:00
michaelkatz
6b7b97ccfe Requiring offload disables any tracks that are non-compatible
With `AudioOffloadModePreference` `AUDIO_OFFLOAD_MODE_PREFERENCE_REQUIRED`, the `DefaultTrackSelector` will select a single audio track that it finds is offload compatible. If not any audio track is supported in offload, then no track will be selected.

PiperOrigin-RevId: 537877183
2023-06-06 18:03:02 +00:00
ibaker
3cb6fe9fcf Add Throwable parameter to all methods on Log.Logger interface
This is a breaking change, but the alternatives seem either equally
breaking or worse, since the only way to make this non-breaking is
to add the `Throwable` overloads as `default` methods. It's then
unclear how we would ever migrate to these being the 'only' methods
or whether we'd have to keep both forms forever (which results in
duplication in the `Logger` implementations).

The clean break here also makes it clear that the `message` parameter
of `Log.Logger.{d,i,w,w}()` no longer automatically includes any info
from the `Throwable` passed to the static `Log.{d,i,w,e}() methods.

----

This CL also cleans up the javadoc on the static `Log.{d,w,i,e}` methods
since they no longer necessarily call straight through to the
corresponding `android.util.Log` methods (and haven't since <unknown commit>
and Issue: google/ExoPlayer#10185).

PiperOrigin-RevId: 537817974
2023-06-06 17:56:36 +00:00
ibaker
7e6dae7b31 Remove exoplayer2-only javadoc machinery from media3
This introduces whitespace-only changes in exoplayer2 due to the way
copybara stripping works.

PiperOrigin-RevId: 537296933
2023-06-05 09:47:58 +00:00
Ian Baker
1b564c67f2 Switch from boxed Boolean to primitive boolean
Also add a parameter comment and reformat with `google-java-format`.
2023-05-31 18:16:03 +01:00
Chang Xiangzhong
c331ac64e7 Save state throwsWhenUsingWrongThread when copy() 2023-05-31 18:04:27 +01:00
tofunmi
49ea280bb8 Version bump to media3:1.1.0-beta01
#minor-release

PiperOrigin-RevId: 536464412
2023-05-30 18:48:06 +00:00
jbibik
25bf0c6738 Remove previously deprecated MediaItem.PlaybackProperties in favour of LocalConfiguration.
Deprecated field `MediaItem.playbackProperties` remains for backwards compatibility, but its type is changed from `MediaItem.PlaybackProperties` to `MediaItem.LocalConfiguration`. The private `MediaItem` constructor will now also take in a `LocalConfiguration` argument instead.

PiperOrigin-RevId: 535648420
2023-05-30 10:13:11 +00:00
tofunmi
16d36da88a Remove unneeded image mimetypes
not needed after 94d29f35fc is submitted

PiperOrigin-RevId: 535627522
2023-05-30 10:10:39 +00:00
Tofunmi Adigun-Hameed
c3dd88d715 Merge pull request #335 from cedricxperi:dts-direct-passthrough-support
PiperOrigin-RevId: 535255453
2023-05-25 15:13:38 +00:00
tofunmi
a19e07c4d2 Move OnInputFrameProcessedListener into it's own file
PiperOrigin-RevId: 535183521
2023-05-25 15:09:36 +00:00
Tianyi Feng
730cfecd57 Make the API 34 check inline and refactor the comment 2023-05-25 09:58:07 +00:00
Tianyi Feng
f301214a1e Refactor the comment 2023-05-25 09:58:07 +00:00
Tianyi Feng
ea32f11292 Refactor the methods and reword the comments 2023-05-25 09:58:07 +00:00
Tianyi Feng
c61f8d317a Add C.ENCODING_DTS_UHD_P2 to C.Encoding 2023-05-25 09:58:07 +00:00
Tianyi Feng
47b0726ea9 Format with google-java-format 2023-05-25 09:55:10 +00:00
Cedric T
53f35f46f5 Use ImmutableSet to store discovered encodings in AudioCapabilities.java 2023-05-25 09:55:10 +00:00
Cedric T
924723d6b3 Additional changes to AudioCapabilities.java and Util.java 2023-05-25 09:55:10 +00:00
Cedric T
753257e454 Refactor Audio Capabilities 2023-05-25 09:55:10 +00:00