1471 Commits

Author SHA1 Message Date
Googler
2c61dd9c95 Corrected ordering of javadoc params
PiperOrigin-RevId: 482231370
2022-10-24 10:45:31 +00:00
huangdarwin
bb215857e5 HDR: Support RGBA_1010102 in GlUtil as a parameter.
Make it easier to support use of RGBA_101012 rather than RGBA_8888 for EGL
contexts, displays, and surfaces.

This tangentially supports adding HDR tests, by slightly simplifying the color
selection logic we'd have to add in HDR tests.

PiperOrigin-RevId: 482219428
2022-10-24 10:43:40 +00:00
kimvde
cf14d0687d Make Muxer public
The reason for making the Muxer public is that we want to add an option
to disable or configure the timer that will throw when the muxer doesn't
receive any data for a given period of time.

PiperOrigin-RevId: 482199360
2022-10-24 10:42:42 +00:00
christosts
601eaba7a6 Use Service.stopForeground(int) on API 24+
The MediaNotficationManager stops the service from the foreground
calling Service.stopForeground(boolean) which is deprecated in API 33.
This change calls Service.stopForeground(int), which was added in API
24.

#minor-release

PiperOrigin-RevId: 482190332
2022-10-24 10:41:47 +00:00
huangdarwin
e39826a8db Effect: Remove unnecessary "this" qualifier
`transformationMatrix` is not ambiguous, as there's no other local
transformationMatrix variable nearby.

PiperOrigin-RevId: 482184602
2022-10-24 10:40:53 +00:00
Rohit Singh
1565a2daba Merge pull request #183 from jasper-apps:bugfix/make-download-notification-appear-immediately
PiperOrigin-RevId: 482165983
2022-10-24 10:38:13 +00:00
ibaker
a5b09b8ccc Remove ForwardingPlayer special case from PlayerControlView.setPlayer
This was originally added in 4fd7d777b6, but it hasn't done anything
since 98ee159df1 (when the instanceof ExoPlayer check was removed).

PiperOrigin-RevId: 482161662
2022-10-24 10:37:05 +00:00
huangdarwin
cce79a7040 Test: Update MatrixProcessorPixelTest to use input width and height.
Before, they used `width` and `height`, which was inconsistent with other pixel tests, and less descriptive.

Refactoring change only. No functional change intended.

PiperOrigin-RevId: 481970243
2022-10-24 10:36:09 +00:00
tonihei
f850206c51 Ensure onMediaItemTransition is sent for repeats of the same item
Currently, repeating the same item (via seekNext/Previous) implicitly
results in a seek to the default position of the current item, which
looks exactly the same as a direct seek. As a result, we don't send
onMediaItemTransition as we would for every other seekNext/Previous
call.

This can be fixed by explicitly marking the repeat case in the internal
BasePlayer/ExoPlayerImpl methods, so that the callback can be triggered.

Issue: google/ExoPlayer#10667
PiperOrigin-RevId: 481951788
2022-10-24 10:35:19 +00:00
christosts
46d5a0e33b MediaController: Add missing event flags (1/2)
This is the first commit out of two. This change adds the missing event
flags for the onEvents() callback when MediaController is connected to a
media3 session (see MediaControllerImplBase). I updated the
MediaControllerListenerTest and MediaControllerStateMaskingTest with
assertions that on onEvents() is called alongside individual
Player.Listener callbacks.

There will be a follow-up change for the case where a MediaController is
connected to a legacy MediaSession (MediaControllerImplLegacy). I've
split this in two separate changes to make the size of the commit
manageable for reviewing.

#minor-release

PiperOrigin-RevId: 481933437
2022-10-24 10:34:30 +00:00
huangdarwin
93ee1f48ad GL: Move loadAsset to GlProgram, where it's used.
(Also, make some public methods private)

PiperOrigin-RevId: 481912071
2022-10-24 10:33:35 +00:00
kimvde
9221b1251c Remove deprecated setOutputMimeType
This is to prepare Muxer to become public

PiperOrigin-RevId: 481893842
2022-10-24 10:32:43 +00:00
samrobinson
7ac7e643ac Fix parameter comment block.
#cleanup

PiperOrigin-RevId: 481882181
2022-10-24 10:31:37 +00:00
ibaker
cc1d35cfd7 Remove more references to overriding layouts from Player(Control)View
In exoplayer2 this affects StyledPlayer(Control)View

#minor-release

PiperOrigin-RevId: 481878940
2022-10-24 10:30:39 +00:00
kimvde
3399f4ecdf Add DefaultMuxer forwarding to FrameworkMuxer
- The naming DefaultMuxer is more consistent with the rest of
Transformer codebase (e.g. DefaultEncoderFactory).
- By hiding the implementation details of DefaultMuxer, the transition
to in-app Muxer will be seamless for apps using DefaultMuxer.
- The current plan is that DefaultMuxer will become the in-app muxer.

PiperOrigin-RevId: 481838790
2022-10-24 10:29:27 +00:00
bachinger
2625061ec0 Add manifest to make gradle build work
PiperOrigin-RevId: 481606248
2022-10-17 16:05:52 +00:00
Googler
0128fa36e7 Fix display settings window UI bug for foldable devices.
PiperOrigin-RevId: 481215581
2022-10-17 16:03:12 +00:00
ibaker
e1d3f1b863 Fix the position of IntDef annotations on fields in the UI module
PiperOrigin-RevId: 481150758
2022-10-17 16:02:16 +00:00
huangdarwin
f9724e9fb6 Effect: Remove unused private int ouptutTexId in pixel tests.
PiperOrigin-RevId: 481143798
2022-10-17 16:01:32 +00:00
ibaker
e97b25a668 Mark effectively-final PlayerControlView fields as actually final
This means the null checker can be more sure that these fields don't
get reassigned between a null-check and a usage.

PiperOrigin-RevId: 481142004
2022-10-17 16:00:27 +00:00
claincly
cf65ff7cb0 Use static import for Assertions in MCVR
PiperOrigin-RevId: 481122795
2022-10-17 15:59:34 +00:00
Marc Baechinger
172cae4775 Merge pull request #10578 from thucngv:release-v2
PiperOrigin-RevId: 481115402
2022-10-17 15:58:34 +00:00
tonihei
409c9f874c Ensure sessions without MediaPeriodId are ended after seek to new item
We already have logic to end all session except the current one if the
current one doesn't have a MediaPeriodId yet. This is assuming that this
only happens after a seek on the app side where the player doesn't have
detailled knowledge about the MediaPeriodIds yet.

Currently this logic isn't triggered if the window we are coming from
doesn't have its MediaPeriodId either as we run into another check that
keeps sessions around until we have a valid windowSequenceNumber.

Swapping both conditions fixes this case without breaking any of the
other known transition scenarios.

Issue: androidx/media#180
PiperOrigin-RevId: 480866465
2022-10-17 15:57:35 +00:00
bachinger
006a519a0e Migrate media constants from androidx.media.util.MediaConstants
Adds root extras and metadata extras to MockMediaLibraryService and MockMediaBrowserCompatService and completed test cases for asserting
interoperability with a media1 or Media3 browser.

PiperOrigin-RevId: 480854842
2022-10-17 15:56:30 +00:00
kimvde
2786db9e73 Remove supportsSampleMimeType from Muxer.Factory
- This method is redundant with getSupportedSampleMimeTypes().
- This is to prepare the Muxer class to become public.

PiperOrigin-RevId: 480840902
2022-10-17 15:54:39 +00:00
ibaker
706b129904 Add Cea608DecoderTest
When debugging and fixing Issue: google/ExoPlayer#10666 I wanted to write a regression
test, but needed to add a test first... This is just a small bit of
coverage to start with. It checks the field/channel filtering works
correctly, but doesn't check any styling info. It also doesn't test
'pop on' subtitles (i.e. when the subtitle isn't shown until a 'end of
subtitle' signal is received).

PiperOrigin-RevId: 480644568
2022-10-17 15:53:36 +00:00
Googler
0468b5ab72 Delete deprecated DefaultAudioSink constructors.
#inlineme

PiperOrigin-RevId: 480189473
2022-10-17 15:48:17 +00:00
christosts
cb3a672508 MediaControllerWithMediaSessionCompatTest
Fix a race condition making test flaky.

PiperOrigin-RevId: 480104467
2022-10-17 15:47:28 +00:00
tonihei
b0daae72cf Treat NO_VALUE as zero when adding up total required bitrate
We currently use the literal -1 (=NO_VALUE) when adding up the
total. Tracks without known bitrate can be ignored in the
calculation, but we should use an explicit value of 0.

#minor-release

Issue: google/ExoPlayer#10664
PiperOrigin-RevId: 480048126
2022-10-17 15:46:32 +00:00
christosts
6f8863fc11 Minor naming cleanup in MediaControllerListenerTest
PiperOrigin-RevId: 480041937
2022-10-17 15:45:33 +00:00
michaelkatz
266de1b21b Adjust track selection with Dolby Vision if display does not support
If the sample type is Dolby Vision and the display does not support Dolby Vision, then the capabilities DecoderSupport flag is set to DECODER_SUPPORT_FALLBACK_MIMETYPE. This denotes that the renderer will use a decoder for a fallback mimetype if possible. This alters track selection as tracks with DecoderSupport DECODER_SUPPORT_PRIMARY are preferred.

UnitTests included
-DefaultTrackSelector test that checks track selection reordering with DECODER_SUPPORT_FALLBACK_MIMETYPE
-MediaCodecVideoRenderer test that checks setting of DecoderSupport flag based on Display's Dolby Vision support

Issue: google/ExoPlayer#8944
PiperOrigin-RevId: 480040876
2022-10-17 15:44:24 +00:00
christosts
ba1ecafb8f MediaControllerListenerTest: use local MediaController instances
Replace the instance-field MediaController with a local instance created
in each test.

PiperOrigin-RevId: 480039768
2022-10-17 15:43:28 +00:00
claincly
a426cb27c0 Remove late frame dropping in FrameProcessor
Currently, a frame is dropped if it's requested release time is in the past.
This mode was added to support previewing. However, in normal ExoPlayer
playback, slightly late frames (<30ms late) are also rendered. On MediaCodec
side, this means calling `releaseOutputBuffer` with a release time in the
past.

PiperOrigin-RevId: 479615291
2022-10-17 15:41:25 +00:00
christosts
36e12fbadb MediaControllerImplBase: clean imports
Remove static imports to constants and imports to intdefs, to make the
code more readable.

PiperOrigin-RevId: 479594144
2022-10-17 15:40:28 +00:00
huangdarwin
8548e3519e HDR: Disable tone mapping on unsupported pixel build ID.
Also, update tests to allow AnyOf error codes, and no longer check exception messages, which caused quite a bit of churn.

PiperOrigin-RevId: 479570861
2022-10-17 15:38:30 +00:00
ibaker
91caf7a650 Document the allowed values of TsPayloadReader.Flags IntDef
PiperOrigin-RevId: 479569806
2022-10-17 15:37:28 +00:00
claincly
26be9ae885 Add a FrameProcessor flag to drop the processed frame
This mode is supported by using `C.TIME_UNSET` (which is a negative value). The
new logic decouples the value of `C.TIME_UNSET` and the frame dropping
behaviour.

PiperOrigin-RevId: 479368880
2022-10-17 15:36:29 +00:00
aquilescanta
0beccb6e14 Fix typo in MediaController javadoc
PiperOrigin-RevId: 479268879
2022-10-17 15:35:19 +00:00
tianyifeng
5bff862374 Provide access to original media timestamps in AudioSink.
* Add `setOutputStreamOffsetUs(long)` method in `AudioSink`.
* Add private methods `setOutputStreamOffsetUs(long)` method in `MediaCodecRenderer` and `DecoderAudioRenderer`.
* Add protected method `onOutputStreamOffsetUs(long)` method in `MediaCodecRenderer`, in which:
  * `MediaCodecRenderer` itself will be no-op for this method.
  * `MediaCodecAudioRenderer` will propagate this value to its `audioSink`.
* Add logics in `DecoderAudioRenderer` to calculate `outputStreamOffsetUs`.

PiperOrigin-RevId: 479265429
2022-10-17 15:34:12 +00:00
christosts
bf948db669 Misc fix on DefaultMediaNotificationProviderTest
PiperOrigin-RevId: 479079184
2022-10-17 15:33:14 +00:00
tonihei
b70258e43d Fix RequestMetadata JavaDoc link to point to the right MediaController.
The JavaDoc of RequestMetadata should point to the media3 controller,
not the platform one.

PiperOrigin-RevId: 479047924
2022-10-17 15:32:22 +00:00
claincly
139a6e8d31 Add FrameProcessor functionality to release a frame immediately
Currently `FrameProcessor.releaseOutputFrame()` method supports

Release at a specific system time
Drops the frame
This API is not that convenient to use when the caller wants to release a frame, now, regardless of the release time. A use case is to release (present) a frame when no frame is shown for a while, and it's thus better to just release the frame, now.

Currently if MCVR wants a frame to be rendered now, MCVR calls release frame with a set offset like 10us: `releaseOutputFrame(System.nanoTime() + 10_000)`. The 10us offset is to prevent the frame processor dropping the frame, due to thread hopping delays.

To make the API better usable, consider adding a mode for releasing the frame now, like (bold marks the new mode)

- Use C.TIME_UNSET to drop
- **Use -1 to release the frame immediately, or**
- Use an actual release time.

PiperOrigin-RevId: 479044215
2022-10-17 15:31:34 +00:00
yschimke
278853a2a1 Add suppression reason for unsuitable audio route.
A follow up to stopping speaker playback with a Player decorator from
https://github.com/androidx/media/issues/15.

It looks like we will need to change to using playback suppression to avoid
errors like https://github.com/androidx/media/issues/167, when we don't start
a foreground service.

We may not have this implemented by 1.0, but would like it in the API and it seems to be appropriate.

PiperOrigin-RevId: 478835686
2022-10-17 15:29:26 +00:00
huangdarwin
253486d4af HDR: Check isToneMappingApplied in HDR editing test.
Assert that tone mapping is applied when an HDR edit cannot be HDR, but is successfully tone mapped. Meanwhile, assert that fallback, which is applied after codec configuration (which throws the "Tone-mapping requested but not supported by the decoder" error) is not applied when that error is called.

PiperOrigin-RevId: 478762951
2022-10-17 15:28:24 +00:00
Googler
7783c6e4f7 Allow using different notification IDs for different media sessions
When a media service currently produces multiple media sessions, the notification of the second session overwrites the notification of the first one, because all sessions use the same notification ID. When we use different notification IDs for different sessions, multiple media notifications can be up at the same time, which means that they can both be controlled at the same time.

PiperOrigin-RevId: 478709069
2022-10-17 15:27:19 +00:00
huangdarwin
6e5a4c05b5 HDR: Add tests with HLG10 input.
PiperOrigin-RevId: 478019046
2022-10-17 15:25:17 +00:00
yterletskyi
ed55d0b5cc Set ForegroundServiceBehavior to FOREGROUND_SERVICE_IMMEDIATE 2022-10-09 21:37:17 +03:00
huangdarwin
de82a2be33 Effect: Update javadoc to remove "final effect" references
"Final" was likely added to reference the FinalMatrixTextureProcessorWrapper,
which is a package-private class. However, I think more clear to express that
this is the input size, which then has all effects applied, to get the output
size.

PiperOrigin-RevId: 477975358
2022-09-30 18:33:50 +00:00
huangdarwin
d5c272fde8 Tests: Statically import BitmapTestUtil methods.
Per go/java-practices/imports#static

No functional changes intended.

PiperOrigin-RevId: 477974779
2022-09-30 18:32:50 +00:00
huangdarwin
62b95a7190 Test: Rename to avoid redundant substrings.
Rename test files to avoid substrings that can be implied by the directory name,
like "Transformation" and "Test"

No functional changes. Renaming-only.

PiperOrigin-RevId: 477724724
2022-09-30 18:31:56 +00:00