14953 Commits

Author SHA1 Message Date
andrewlewis
dfc04d8ddf Remove unused log tag constant
PiperOrigin-RevId: 466025324
(cherry picked from commit 273cf0866aad78018da3674ba1cbe11187d16afd)
2022-08-08 13:20:34 +00:00
hmzh
98dd4f88e2 Add support for multiple mid-track tempo changes
PiperOrigin-RevId: 466018462
(cherry picked from commit 4725cff70e3293f43bd11866f305041c6c18792e)
2022-08-08 12:35:28 +00:00
leonwind
1234470e35 Switch @param to @code tags in RgbAdjustment.
PiperOrigin-RevId: 465591877
(cherry picked from commit 650a9d21ec6582230f4cf0dc2120b17d86707715)
2022-08-05 17:20:54 +00:00
andrewlewis
01a4188d68 Throw if tone-mapping is requested but not enabled
In the case where this check fails, the downstream frame processor chain won't be able to handle the incoming (SDR) data anyway as we've already set it up for HDR.

PiperOrigin-RevId: 465584814
(cherry picked from commit 0e99d28a79ddca5ba9517ffba73d2c36fc2679a7)
2022-08-05 16:49:26 +00:00
andrewlewis
1db2c74fb3 Clarify SSIM request method name
`requestCalculateSsim` more clearly represents the intention of the caller.

Also rephrase the javadoc to simplify it and make it more precise.

PiperOrigin-RevId: 465575578
(cherry picked from commit d90d7d30789ec819d905fd98291f66ab7031f47b)
2022-08-05 16:02:07 +00:00
Googler
03b490b47f Fix ConcurrentHashMap usage in demo MediaPipeProcessor.
PiperOrigin-RevId: 465563540
(cherry picked from commit 6e4fc4752248f1a1d233dea041305718cae08cd0)
2022-08-05 14:56:54 +00:00
yschimke
7218cb961b Make AudioTrackBufferSizeProvider public.
Was getting "java.lang.IllegalAccessError: Illegal class access" in debug app.

PiperOrigin-RevId: 465562541
(cherry picked from commit c09b34a61be80f250bac6a5e1f56e8180f68b9e2)
2022-08-05 14:51:07 +00:00
andrewlewis
a0efd08b39 Fix frame processor reference
PiperOrigin-RevId: 465562260
(cherry picked from commit aafa31e996f30daebec12f5e9e61aab1dbd0ba81)
2022-08-05 14:49:23 +00:00
Googler
db2545b8a1 Use multiple output frames in transformer MediaPipe demo pre API 23.
PiperOrigin-RevId: 465545764
(cherry picked from commit 6da0a3543491a9d9bb3dbfaf1b203a04f7a19f5c)
2022-08-05 12:58:48 +00:00
leonwind
e8a4cceb12 Add RgbAdjustment class to build RgbaMatrices
* Add RgbaMatrix interface implementation.
* Add Builder class for easy adjustments.
* Adjust existing RgbaMatrixPixelTests to use new RgbAdjustment class.

PiperOrigin-RevId: 465545429
(cherry picked from commit 6502fce634913420af77ec78c275f97a61b8fac4)
2022-08-05 12:56:26 +00:00
huangdarwin
acf40801cf HDR: Add comment to clarify lack of support HDR10 for AVC
PiperOrigin-RevId: 465360186
(cherry picked from commit e63d594f490da6461bc5087d0526c5ca5215958d)
2022-08-04 18:18:18 +00:00
claincly
e9e7fb4e8a Factor out RTP timestamp to sample time method
PiperOrigin-RevId: 465337074
(cherry picked from commit a1be6d6eb39a40b91f9dee0524d13e5ac805246f)
2022-08-04 16:49:03 +00:00
yschimke
6865cd4d07 Expose AudioOffload track state.
Adds a new event to AudioOffloadListener to get the offload state of the track, which indicates when software decoding is taking place.

PiperOrigin-RevId: 465264362
(cherry picked from commit fe2b846552e1dc0095a409a3407c328e38bd6a30)
2022-08-04 09:47:41 +00:00
yschimke
318d838258 AudioOffload recovery.
Avoids disabling Offload on a write error, and instead relies on this being disabled on the AudioTrack init. It will no longer recover by disabling offload.

PiperOrigin-RevId: 465248917
(cherry picked from commit 2fbe1bbfb3c533c370c07a4f45068c00ea9c6efb)
2022-08-04 08:00:57 +00:00
leonwind
d7177ee733 Remove clamp function in contrast fragment shader.
* OpenGL automatically clamps the output colors to the [0, 1] interval.

PiperOrigin-RevId: 465071999
(cherry picked from commit 30fab8c00891b2a5423c169dd75ef0b7d40fe5b7)
2022-08-03 16:14:30 +00:00
andrewlewis
dce7c45cf0 Avoid encoder default color info when tone-mapping
The encoder color info [defaults](https://cs.android.com/android/platform/superproject/+/master:frameworks/av/media/libstagefright/foundation/ColorUtils.cpp;l=377;drc=891c19ccfa4953b5e5f7b87118e007b994d8074c) to a value that depends on the input resolution, but when tone-mapping is enabled we should always get BT.709 color space. Hard-code this constant for now to avoid behavior depending on the resolution. A future change should use the decoder output media format to populate the color info.

PiperOrigin-RevId: 465070378
(cherry picked from commit 40a28d5aeeb5f3c22e884690128182b68a9929f6)
2022-08-03 16:06:45 +00:00
Googler
8d1b91a413 Fix saving previous debugSurfaceView in FinalMatrixTPWrapper.
PiperOrigin-RevId: 465067306
(cherry picked from commit bbb7b1c0bc2dc004612d0644d862494fcdda294d)
2022-08-03 15:52:24 +00:00
claincly
19f6b5422b Clean up NOP constructor lines in RTP readers
PiperOrigin-RevId: 465067191
(cherry picked from commit 13e9ec9959b5dbd6f2f107f43d0a3a032ae8a717)
2022-08-03 15:51:48 +00:00
Googler
ff35958c54 Clean up FrameProcessor TODOs.
PiperOrigin-RevId: 465044342
(cherry picked from commit 245326a0433c82bf851e2fa556bb8399cf1ba2d6)
2022-08-03 13:53:53 +00:00
Googler
89a2685052 Move effects functionality out of transformer to effects module.
PiperOrigin-RevId: 465038852
(cherry picked from commit 707b0618384db17f6d9d4947a445c0eed1c9c630)
2022-08-03 13:19:15 +00:00
Googler
368d28268b Update Leanback library from androidx-platform-dev with build#8803384
TGP: https://fusion2.corp.google.com/presubmit/tap/459592967/OCL:459592967:BASE:464692555:1659412331108:1ed6eb4e/targets

If you need additional help investigating this issue, please consider using g/androidx-discuss to reach the wider Jetpack library owner and client community. For general questions about prebuilt drops, refer to go/androidx/g3_faq

PiperOrigin-RevId: 464852576
(cherry picked from commit a3de13c9a936691113325977924afe242dcbba31)
2022-08-02 19:01:58 +00:00
Googler
0b0475e81b Create effect module.
PiperOrigin-RevId: 464767396
(cherry picked from commit 26dcdcf1c01e1734cda5313487f27a19d4606513)
2022-08-02 12:36:47 +00:00
leonwind
5668c8a6a9 Implement RGBA color matrices processor
* Transform frame colors using a defined RGBA Matrix to apply filters.

PiperOrigin-RevId: 464523581
(cherry picked from commit 23f34f8d08855645b342a75b0adfc6c0d600c0ab)
2022-08-01 13:47:21 +00:00
leonwind
d354cd597b Migrate Contrast asset to emulator generated one.
PiperOrigin-RevId: 464519030
(cherry picked from commit ea213545e0ed3ae2ae7168a0c4ac791d95b594aa)
2022-08-01 13:14:49 +00:00
huangdarwin
153535a300 HDR: Have @C.ColorTransfer check consider NO_VALUE as SDR.
Format.NO_VALUE is a placeholder value for an invalid @C.ColorTransfer, used
for example when the decoder doesn't support this transfer function.

When encountering this invalid value, interpret this as COLOR_TRANSFER_SDR.

Confirmed locally that an exception is thrown when transcoding on p4head, and no exception is thrown when transcoding with this CL.

PiperOrigin-RevId: 464135080
(cherry picked from commit 1a22bcf1e59c1f8e1f8d1fb9d9208a916c92bdb2)
2022-07-29 19:33:44 +00:00
Googler
63db89793a Move FrameProcessor and related interfaces to common.
This will allow effects preview in ExoPlayer to use the
Effect and FrameProcessor interface (and the interfaces
they depend on) without depending on transformer or the
future effects module.

PiperOrigin-RevId: 464060047
(cherry picked from commit 06d41c2775137158f831a1b2f19f137efb1e08b0)
2022-07-29 12:54:30 +00:00
leonwind
21c0eb3d68 Add slider option for contrast in demo app
PiperOrigin-RevId: 464050072
(cherry picked from commit 9df0d40583f868ec923a066bbe2609c7ba862760)
2022-07-29 11:30:44 +00:00
huangdarwin
c09dccc8b0 Transformer: Improve misc javadocs and exception logs.
PiperOrigin-RevId: 463971447
(cherry picked from commit 810f451ec6ac83311f5ae902aba12428877bd809)
2022-07-29 01:16:26 +00:00
huangdarwin
6a3d7f6079 HDR: Centralize getting Colorinfo from MediaFormat
* Sets KEY_HDR_STATIC_INFO from MediaFormat in the DefaultCodec.
* Adds checks in mediaparser to ensure color space, range, and transfer are valid
  values.

PiperOrigin-RevId: 463921325
(cherry picked from commit 44c42fef2aaa65ba78c52883e3fcec94c8d7ad2d)
2022-07-28 21:07:43 +00:00
Marc Baechinger
6f3fe59936 Merge pull request #115 from ittiam-systems:rtp_vp9fix
PiperOrigin-RevId: 463852948
(cherry picked from commit 9ed04ef84223e2cc54aab8318b4b64be288d264a)
2022-10-19 15:19:39 +00:00
tonihei
f0e49e8c2c Ignore stale events in StreamEventCallbackV29.
Despite unregistering the callback and clearing pending Handler
messages, the callback may still receive pending calls if they
are already triggered by the AudioTrack. Instead of asserting
that the track is correct, we should gracefully ignore stale
events.

PiperOrigin-RevId: 463851393
(cherry picked from commit 3650c2970aebab16a1ced17f849631cea452085b)
2022-07-28 16:08:21 +00:00
claincly
9953b288c1 Fix VP8 reader fragment packet size
Merging c37a767fdf

PiperOrigin-RevId: 463826373
(cherry picked from commit 4d5d592c351c75acef5779dfd2f1c7da560eeda7)
2022-07-28 13:50:54 +00:00
christosts
d03163f172 Support ApplicationVersion = 1 for HDR10+
MediaCodecRenderer allows passing HDR10+ out-of-bound metadata
with ApplicationVersion = 1.

PiperOrigin-RevId: 463822315
(cherry picked from commit 81d1dafec60b1bacb28b61cda9ca74de1410ec0d)
2022-07-28 13:24:08 +00:00
Marc Baechinger
c262276686 Merge pull request #126 from stoyicker:cap_concurrent_remove_tasks
PiperOrigin-RevId: 463792127
(cherry picked from commit 3b5a53f1a618f698d476742ff7c88b45cb366d59)
2022-10-19 15:04:14 +00:00
Googler
44de468f63 Generalize frame processing error codes.
TransformationException error codes were previously tied to OpenGL
but other FrameProcessor implementations are possible. So this CL
renames the error codes.
Also, remove GL_INIT_FAILED error code, as FrameProcessor
implemenations may initialize resources on a background thread
after the factory method returns, so it's not obvious how to
distinguish between initialization failures and processing failures.

PiperOrigin-RevId: 463704902
(cherry picked from commit bac323d346c1d3118a0b904caf9926ecb96b912d)
2022-07-27 23:21:31 +00:00
Googler
5c7dcf42a0 Add Effect marker interface.
This allows non-GL effects to be passed to custom FrameProcessor
implementations.

PiperOrigin-RevId: 463696384
(cherry picked from commit 66dde42989dbc8fedeee59897a05644d86240cf6)
2022-07-27 22:40:20 +00:00
Googler
3fa0ce7faf Remove redundant interface from FinalMatrixTPWrapper.
PiperOrigin-RevId: 463646211
(cherry picked from commit 77f41d6fd4640e392fd04372d417050c3dc011da)
2022-07-27 19:08:58 +00:00
Googler
e674df7f12 Make FrameInfo and SurfaceInfo public.
Both are used in the public FrameProcessor interface, so they
should be public too.

PiperOrigin-RevId: 463454859
(cherry picked from commit 40e96d1534d34312611d8c603b1b7c92e3250938)
2022-07-26 23:34:30 +00:00
samrobinson
6e8e648ae3 Add 8 new videos, representing lower resolutions.
Downsampled from 3840x2160 resolution videos using ffmpeg:

`ffmpeg -i <inputFilename> -filter:v scale=<width>:<height> -c:a copy <outputFilename>`

PiperOrigin-RevId: 463454628
(cherry picked from commit 5f1ee86eb4655459ed0a8a706aeb44b8eeb9a46a)
2022-07-26 23:33:10 +00:00
samrobinson
127ad8c1ad Add H265 as a parameter to SsimMapperTest.
PiperOrigin-RevId: 463452893
(cherry picked from commit e1b6ed325244d906ac1aadd83517ac58dbc1e80d)
2022-07-26 23:24:03 +00:00
leonwind
65e040afb7 Rename ContrastProcessorPixelTest and make contexts final
PiperOrigin-RevId: 463450395
(cherry picked from commit 03ff5246e79b51e08b22b353138852813bd0dbd9)
2022-07-26 23:10:33 +00:00
samrobinson
de5bd046fd Add an SsimMapperTest, which binary searches for 95% ssim.
This is possible because SSIM increases monotonically with bitrate.

PiperOrigin-RevId: 463434373
(cherry picked from commit 63cddc901028434a9a565a0a8c605b46f223e724)
2022-07-26 21:56:33 +00:00
huangdarwin
abe4b23967 Rename findEncoderWithClosestFormatSupport.
Just a misc nit, since I found the name a bit confusing, and figured
findEncoderWithClosestSupportedFormat might be more descriptive.

PiperOrigin-RevId: 463433646
(cherry picked from commit 324fc5d7e88d9e4fdb1ecc7e70106d641f8236ec)
2022-07-26 21:53:18 +00:00
Googler
d8a47769b0 Allow FrameProcessor.Factory to be set on Transformer.Builder.
Extract a FrameProcessor.Factory interface from GlEffectsFrameProcessor
and allow it to  be customized using a setter on Transformer.Builder.

PiperOrigin-RevId: 463433438
(cherry picked from commit ecbe9a502cf62c92005a2ff045ab17988ea2838f)
2022-07-26 21:52:30 +00:00
hmzh
976efb3e9c Add seeking to arbitrary time points
PiperOrigin-RevId: 463328405
(cherry picked from commit 3c2b54b5e36faf6f0eb359b35724f8d087739104)
2022-07-26 14:12:07 +00:00
christosts
2218527ad3 ExtractorAsserts: add comments on method arguments
PiperOrigin-RevId: 463320634
(cherry picked from commit dc65aaef8e721894fbbfb7da4e8c8a11a36f303f)
2022-07-26 13:23:36 +00:00
Googler
95b0b9ccba DownloadService: Attempt to clarify the static map
PiperOrigin-RevId: 463315188
(cherry picked from commit 02eb6e96c58f104b9683f7f79fd47a7af6046406)
2022-07-26 12:49:34 +00:00
Googler
3483131a88 Replace Size with Pair in effects.
Size requires API 21. Using Pair instead will allow effects to be
used from API 18 during previewing once they are moved out of
transformer.

PiperOrigin-RevId: 463206474
(cherry picked from commit b994f8bfa06c82fbfe96044b986cd7b8d243acdd)
2022-07-25 23:39:59 +00:00
Googler
5ebc3dbe3b Only recreate output EGLSurface when Surface changed.
PiperOrigin-RevId: 463193768
(cherry picked from commit 4ac177c3379d673335d64df7f47890e04bfbfd7a)
2022-07-25 22:38:28 +00:00
olly
023bea5f99 DASH: Parse and use EventStream.presentationTimeOffset
Issue: google/ExoPlayer#10460
#minor-release
PiperOrigin-RevId: 463163839
(cherry picked from commit 628818211394d3783bec4398c8c9b9dbf335c486)
2022-07-25 21:28:20 +01:00