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
(cherry picked from commit 139a6e8d3175143957c44e4c4b5e15853202682e)
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
(cherry picked from commit 253486d4af057776da0eb5926e31190f43dbe3b3)
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
(cherry picked from commit 7783c6e4f71943b543ddb569b120bdbbab362b96)
"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
(cherry picked from commit de82a2be336e9308e194d5baf91c348a2700a5de)
Per go/java-practices/imports#static
No functional changes intended.
PiperOrigin-RevId: 477974779
(cherry picked from commit d5c272fde88f3efde7535933331270d2aea2fbb9)
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
(cherry picked from commit 62b95a71902349e95693174f83bb48e6927d5249)
One of the tests in MediaBrowserListenerTest caused the remote
browser service to crash and then just timed out. As this asserts
nothing useful besides checking that the timeout method is working,
we can remove the test.
Crashing the remote browser service had the side effect of letting
subsequent tests in the same class fail because the previous session
was never released and was still present in the static MediaSession
SESSION_ID_TO_SESSION_MAP instance, which prevented the creation
of new sessions with the same id. This is only an issue in test
runs because a real process would also lose its static variables
when it crashes.
PiperOrigin-RevId: 476905337
(cherry picked from commit d2887d523773de75ed99403c22d634538f6c81df)
`PlaybackStateCompat.toKeyCode(command)` was replaced by our
own implementation of `toKeyCode()`. The legacy implementation used PLAY and PAUSE, while the new implementation uses PLAY_PAUSE. This made `pause` a pending intent that attempt to start the service in the foreground, but `service.startForeground()` won't be called in `MediaNotificationManager.updateNotificationInternal` when paused.
PiperOrigin-RevId: 476895752
(cherry picked from commit acd9e581c494b18f6347f5abb2cf9fc82344c723)
Calling maybeUpdateLegacyErrorState potentially creates a new legacy playback
state which involves calling player methods. This change makes sure that the call
sites of `maybeUpdateLegacyErrorState` are called on the app thread as enforced by
the library.
PiperOrigin-RevId: 476406282
(cherry picked from commit 74124f48ea838fcdb436726ba8337e82abc7552e)
This allows to access the associated functionality of AudioTrack and
fills a feature gap to MediaPlayer, which has a similar method.
Issue: androidx/media#135
PiperOrigin-RevId: 476398964
(cherry picked from commit a069ebda47fffd692838b29aa9acd1b51df86151)
* Before this CL, the texture was stored during the construction of the LUT processor. This failed since if one creates a list of GlEffects on the application thread, the texture will get stored in the application thread during the effect creation and not on the GL thread, which executes the FrameProcessors.
* This is an issue since the executing thread then can't index from the texture stored on a different thread.
PiperOrigin-RevId: 476388021
(cherry picked from commit 44b9aec0b973b1cd5df31df32fff276f340e6ce4)
If the sample type is dolby vision and the following conditions match
a)There is a supported alternative codec mimetype
b)Display does not support Dolby Vision
Then getDecoderInfos will return the alternative types.
Issue: google/ExoPlayer#9794
PiperOrigin-RevId: 476356223
(cherry picked from commit ed79f4696f026872f2840c53f9526980f4c966d4)
* Transform the intermediate color space to linear SDR by applying the SMPTE 170M EOTF and OETF.
* Use linear colors for the color filter pixel tests and update all golden bitmaps.
PiperOrigin-RevId: 476124592
(cherry picked from commit 3433758c3b1f02c0ec28b86a8c3b659171f6f92b)
The ClearKey CDM will attach an 'invalid' URL in `KeyRequest` objects,
when the documentation states this should be an empty string if a
default URL is not known.
#minor-release
PiperOrigin-RevId: 476113513
(cherry picked from commit 715c948004eeabb6f7e2d45b8b8856ee4a015391)
Tested:
* Manually using both path and file descriptor.
PiperOrigin-RevId: 475860978
(cherry picked from commit 9ec4e1340a97472c63e9f017f95f2b1a38f88588)
* The command changed after creating a custom effects module.
PiperOrigin-RevId: 474777823
(cherry picked from commit 75141f3016ba0c7072d1561b94740201e3fb09cb)
Currently doSomeWork is never closed and so tracing is deceiving.
See https://screenshot.googleplex.com/eZDzn5APpBNnhe5
PiperOrigin-RevId: 474755816
(cherry picked from commit 06230f19c7e32728c52f71eff4243f52f534b9e1)
By skipping every other row and column, SSIM calculation time reduces by 10-30%.
PiperOrigin-RevId: 474286702
(cherry picked from commit 314b312af18c568c5353b661b31ebc60a0736678)
As part of this change, MssimCalculator is moved from androidTest/ to main/
PiperOrigin-RevId: 473771344
(cherry picked from commit 8ce42f0670504a89c5c3e546f8be3d849be36195)
* Add docs for the public constructor for consistency with all the
other frame processors.
PiperOrigin-RevId: 473726586
(cherry picked from commit 7a460fa3bd1abe6207049cf70b7ce4efd6cf12fd)
*** Original commit ***
Handle int instead of byte in SSIM.
The value of pixels are converted to integers at the point of use,
move this logic to the initialisation step.
This is a prerequisite step for testing SSIM calculation, which
will lead on to some SSIM improvements being verifiable.
Tested manually and SSIM values match for the same video
before and after this change.
***
PiperOrigin-RevId: 473259446
(cherry picked from commit d188babd2daea5b737ef43604aa00baf157a2df5)
The value of pixels are converted to integers at the point of use,
move this logic to the initialisation step.
This is a prerequisite step for testing SSIM calculation, which
will lead on to some SSIM improvements being verifiable.
Tested manually and SSIM values match for the same video
before and after this change.
PiperOrigin-RevId: 473231779
(cherry picked from commit 3d5ddf0c42f1d2b91d4ef33c75f59656c6e566bc)
* Refactor caching for matrix transformations to reuse it for rgb matrices.
PiperOrigin-RevId: 473042194
(cherry picked from commit 55afa598e74271e3802020f13ad5d23d27e88bb1)