14940 Commits

Author SHA1 Message Date
leonwind
eb6cf356bb Add LUT functionalities to transformer.
* Adds SDR 3D LUT functionalities with OpenGL 2.0 support.

PiperOrigin-RevId: 474561060
(cherry picked from commit 702419dd227cec4b23cd6e723a6a15908313f7c9)
2022-09-15 14:49:19 +00:00
leonwind
b041e4dce6 Fix testId and match it to the test name.
PiperOrigin-RevId: 474363545
(cherry picked from commit 0e2b6a03b5f91eda6d307b63f49986dfdcc97bfe)
2022-09-14 19:41:11 +00:00
samrobinson
3adfa48f34 Add support for skipping windows in MssimCalculator.
By skipping every other row and column, SSIM calculation time reduces by 10-30%.

PiperOrigin-RevId: 474286702
(cherry picked from commit 6dd2a6dac655f538020a4057e3ab6d997449a9fe)
2022-09-14 14:35:12 +00:00
samrobinson
766b9cd385 Clarify the replaceOutputBuffer parameter because count is unclear.
PiperOrigin-RevId: 474279220
(cherry picked from commit 3e0ad6d8042c9e6604c281e283885b9e07eb8786)
2022-09-14 13:54:06 +00:00
leonwind
2576346e45 Change ContrastProcessor java doc for consistency.
PiperOrigin-RevId: 474002026
(cherry picked from commit 7c435621ae3b3ea870fe16524ff7aaa5bd54e931)
2022-09-13 13:28:30 +00:00
samrobinson
c4f4c42e1d Add MssimCalculatorTest to verify SSIM calculations.
As part of this change, MssimCalculator is moved from androidTest/ to main/

PiperOrigin-RevId: 473771344
(cherry picked from commit 20aa22c9fad2c1e2d237dc9a8bee81781a729445)
2022-09-12 16:45:36 +00:00
leonwind
5b084dd470 Add java docs for ContrastProcessor constructor.
* Add docs for the public constructor for consistency with all the
other frame processors.

PiperOrigin-RevId: 473726586
(cherry picked from commit 696ef2a5e718ac8df1edf54ad5359389686267b0)
2022-09-12 13:02:32 +00:00
leonwind
474a5571e2 Add rgb matrices to java docs for public constructors.
PiperOrigin-RevId: 473699927
(cherry picked from commit 75f920bf25bf052630a16d1d983516409e797363)
2022-09-12 09:52:09 +00:00
claincly
2fa9042058 Split decoding out of the test
This method is useful for other tests also.

PiperOrigin-RevId: 473574282
(cherry picked from commit f770324f31cd1d63f229b3d536d7f5a58a0fc511)
2022-09-11 13:01:26 +00:00
leonwind
7e810b50e0 Rename MatrixTransformationProcessor to MatrixTextureProcessor.
PiperOrigin-RevId: 473283967
(cherry picked from commit 40f1bd345a601648bac8f812b4e247140bc420b1)
2022-09-09 17:23:24 +00:00
samrobinson
d10dbc56d5 Rollback of eb6c1183b6
*** 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 8f9c9d0f88374573f32d76cf7d3a8fde9ca83f87)
2022-09-09 15:33:08 +00:00
samrobinson
c714b51c04 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: 473231779
(cherry picked from commit eb6c1183b69d319a610d79ef57028f62e74a7614)
2022-09-09 13:07:14 +00:00
huangdarwin
e725600b0c Decoder: Reduce max pending frame count limit down to 5.
PiperOrigin-RevId: 473212543
(cherry picked from commit 41963fce9b7ad7d2cd9d0fdb428c44eb2bddf5f1)
2022-09-09 10:56:03 +00:00
leonwind
7098d3b810 Add caching for compositeRgbMatrixArray.
* Refactor caching for matrix transformations to reuse it for rgb matrices.

PiperOrigin-RevId: 473042194
(cherry picked from commit 593370bb69ca5db1d693d42509da78ad496218db)
2022-09-08 18:31:11 +00:00
huangdarwin
8eab7391c2 HDR: Add fallback MH tests.
Test that HDR editing succeeds on devices supporting HDR editing, tone maps on
devices supporting tone mapping, and throws exceptions on all other devices.

Also, only restrict HDR editing and tone mapping support to API 31+ only when
transcoding, not for all transformations.

PiperOrigin-RevId: 472958965
(cherry picked from commit 8ee2121627c2702419402b514fa93dbe8ac19b8b)
2022-09-08 12:03:40 +00:00
claincly
ce4ba2b6de Remove conditional check for no-longer flaky API version
PiperOrigin-RevId: 472949850
(cherry picked from commit caefa565f76912922011155cc580d45243e86ecc)
2022-09-08 11:02:51 +00:00
claincly
240ca99ced Clarify GlTextureProcessor.InputListener contract
PiperOrigin-RevId: 472745311
(cherry picked from commit 32a21641a2de5fe1fac1c6f1d1a0d644101a4c0b)
2022-09-07 16:33:44 +00:00
bachinger
b47c7a37ac Add withAvailableAd for server side inserted ad groups
#minor-release

PiperOrigin-RevId: 472714732
(cherry picked from commit 072f376b4839b6d4e71bcd09366695b3b9fc2c02)
2022-09-07 14:01:26 +00:00
tonihei
8df931b1fe Discard backbuffer before playback gets stuck.
If the back buffer is using too much memory, there is a risk
playback could get stuck because LoadControl refuses to load
further data. This eventually results in a stuck-buffering
playback error.

We can detect this case, clear the back buffer and then ask
the LoadControl again to avoid failing playback in such a case.

PiperOrigin-RevId: 472679797
(cherry picked from commit 125646e4c98e80b35d1a8b195300d324a9aaf2b5)
2022-09-07 10:09:29 +00:00
claincly
7acffcfe34 Remove redundant constant definition
PiperOrigin-RevId: 472522846
(cherry picked from commit 9a9baa54a5cdf701695556a91436b2778868cddd)
2022-09-06 19:06:17 +00:00
bachinger
018ea9a44e Bump IMA SDK version for gradle
PiperOrigin-RevId: 472500789
(cherry picked from commit 60a3ea48b8abf3949a87a2b3bc930ce83cf4ce3f)
2022-09-06 17:43:37 +00:00
bachinger
d7d75a0157 Update presentation time of metadata when the stream offset changes
The stream offset is used to calculate the presentation time of
a metadata object when reading and later when playing, to calculate
the current presentation time to decide whether to send the metadata
to the output.

Accordingly, the presentation time of a pending metadata that has been
calculated with a given offset needs to be recalculated when the
stream offset changes.

#minor-release

PiperOrigin-RevId: 472499943
(cherry picked from commit 5a1223777c4d4ee2faa4043be2079971e44093a9)
2022-09-06 17:40:52 +00:00
Marc Baechinger
d2623dda9b Merge pull request #10549 from ferhatparmak:release-requirementswatcher
PiperOrigin-RevId: 472488921
(cherry picked from commit 92cfa7467b8f74daab22276c6db4e885b76e7c28)
2022-10-19 21:14:45 +00:00
Marc Baechinger
0a0df93334 Merge pull request #10570 from Artemych:fix/progressive_downloader_infinite_loop
PiperOrigin-RevId: 472475124
(cherry picked from commit 9c56b2c4b631062731ccfc0d8e5b5c105449074c)
2022-10-19 21:10:57 +00:00
claincly
912da2910c Include CamcorderProfile resolution in encoder capability test
PiperOrigin-RevId: 472459423
(cherry picked from commit 6e45824992c8fe72ffd2f4edb726aa0cd8f8c29e)
2022-09-06 15:05:46 +00:00
leonwind
7477eb6656 Make MatrixTransformationsProcessor constructor to take in Lists.
* Replace ImmutableLists to List interface for constructors

PiperOrigin-RevId: 472433434
(cherry picked from commit ce0e3a4fa3e829c987e541f30694a73d8abbc25b)
2022-09-06 12:37:47 +00:00
leonwind
6ed69e3d4f Use super class for toGlProcessor in RgbFilter.
PiperOrigin-RevId: 472405147
(cherry picked from commit c0ad9f51faa5b61e281178666c2cad75329b37f6)
2022-09-06 09:31:05 +00:00
leonwind
e61c876548 Merge RgbProcessor and MatrixTransformation.
PiperOrigin-RevId: 472325145
(cherry picked from commit daa77da17de156ea9921914aad791882c4393b84)
2022-09-05 21:51:11 +00:00
Googler
ec91dfc693 Fix 3 ErrorProneStyle findings:
* Non-standard parameter comment; prefer `/* paramName= */ arg`
  (see http://go/bugpattern/ParameterComment) (3 times)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if there's an issue with the CL content.
* File a bug under go/rosie-bug if there's an issue with how the CL was managed.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/media/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

Tested:
    Local presubmit tests passed.
PiperOrigin-RevId: 472254253
(cherry picked from commit 83966478960ae6c0f882e523d73848edab95fd3a)
2022-09-05 12:08:04 +00:00
Googler
bdba124aa9 Fix 1 ErrorProneStyle finding:
* Non-standard parameter comment; prefer `/* paramName= */ arg`
  (see http://go/bugpattern/ParameterComment)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if there's an issue with the CL content.
* File a bug under go/rosie-bug if there's an issue with how the CL was managed.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/media/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

Tested:
    Local presubmit tests passed.
PiperOrigin-RevId: 472252461
(cherry picked from commit dfdcf76daf7762fd40f593662bbb1f5141db1da7)
2022-09-05 11:54:50 +00:00
huangdarwin
fdffdfeeb6 Minor javadoc and scoping cleanup.
No functional changes.

PiperOrigin-RevId: 472245797
(cherry picked from commit 8e14611d60d40f0db41063a5e537638b76c2d46a)
2022-09-05 11:06:21 +00:00
leonwind
7cb2b54bab Add sepia, grayscale, and inverted filters to the demo app.
PiperOrigin-RevId: 471782565
(cherry picked from commit 87926f0ba8480f39baeb9f9d0ccf8f3576e4fd0e)
2022-09-02 13:10:29 +00:00
huangdarwin
f52a3c2240 Rename shouldPassthrough to shouldTranscode
shouldPassthrough's internal checks seem to be check whether we should *not*
pass through, which seemed a bit like a confusing double-negative to me.

shouldTranscode is slightly more clear, by instead returning true when we do
want to transcode.

No functional changes intended.

PiperOrigin-RevId: 471753771
(cherry picked from commit 1a4cd549a426881474014a02b595382b375864ee)
2022-09-02 09:49:26 +00:00
Googler
61374d1698 Skip transcoding if HDR video does not need encoding.
3b0d2c1586 made `shouldPassthrough` always return false for `enableHdrVideoEditing`:

>We force using `FrameEditor` (no passthrough) to avoid the need to select another edit operation, and use the new shaders. The `EGLContext` and `EGLSurface` also need to be set up differently for this path.

However, this was introduced before the `videoNeedsEncoding` setting was introduced in 3f615040c0. That setting should apply to HDR videos as much as SDR videos.

PiperOrigin-RevId: 471569853
(cherry picked from commit 94713a8ffb6ba4e83a05bb50921b4cf2ab2eab75)
2022-09-01 17:37:30 +00:00
Googler
4d4af37637 Fix 3 ErrorProneStyle findings:
* Non-standard parameter comment; prefer `/* paramName= */ arg`
  (see http://go/bugpattern/ParameterComment) (3 times)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if there's an issue with the CL content.
* File a bug under go/rosie-bug if there's an issue with how the CL was managed.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/media/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

Tested:
    Local presubmit tests passed.
PiperOrigin-RevId: 471198016
(cherry picked from commit bac7d697c3620195f8895068369099466fb7bd1c)
2022-08-31 08:29:19 +00:00
Googler
ba01d04ed5 Add @SuppressWarnings to nullness errors detected by a newer version of the Checker Framework
PiperOrigin-RevId: 471137219
(cherry picked from commit 90e684a6dcd5d92470780060feb2099c2f905bbd)
2022-08-31 01:09:09 +00:00
huangdarwin
53b1cabef8 Effect: Add some FrameProcessor javadoc.
In particular, make it a bit more clear that "rendering" and "releasing" frames are
related concepts, and how they differ from one another in conjunction with frame
dropping.

PiperOrigin-RevId: 471037733
(cherry picked from commit e6a1936ba9e210555eaa61a9b6d206bdfa753f09)
2022-08-30 18:01:11 +00:00
huangdarwin
4c8d22fe0f HDR: Use factory for MatrixTransformationProcessor.
Separate MatrixTransformationProcessor constructors by color input and output.

PiperOrigin-RevId: 471034768
(cherry picked from commit a8e814abbd435755077b2f92cf709d5417494db7)
2022-08-30 17:50:21 +00:00
Googler
fc8edfcd48 Fix 19 ErrorProneStyle findings:
* Non-standard parameter comment; prefer `/* paramName= */ arg`
  (see http://go/bugpattern/ParameterComment) (19 times)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if there's an issue with the CL content.
* File a bug under go/rosie-bug if there's an issue with how the CL was managed.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/media/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

Tested:
    Local presubmit tests passed.
PiperOrigin-RevId: 471022923
(cherry picked from commit 674b3d4575ae6fdb59ae9db58be52151bbcae3a6)
2022-08-30 17:07:31 +00:00
leonwind
8e90496df5 Add static Grayscale and Inverted RGB Filter.
PiperOrigin-RevId: 471017440
(cherry picked from commit 9f67ce4e4c1d6e26a0920bf9bed89c38cecbdaeb)
2022-08-30 16:47:02 +00:00
huangdarwin
2e4ec7a681 Update first frame instructions.
PiperOrigin-RevId: 471008623
(cherry picked from commit cb60f506d1f6283e2790ee631c01c5c4128967a2)
2022-08-30 16:08:16 +00:00
ibaker
b6fecfc18a Remove media3-only line from exoplayer2 build.gradle file
#minor-release

PiperOrigin-RevId: 470999044
(cherry picked from commit e285e7078545435e86e3d43219ad9f6fc8373755)
2022-08-30 15:27:12 +00:00
Googler
1071a91d34 Fix 1 ErrorProneStyle finding:
* Non-standard parameter comment; prefer `/* paramName= */ arg`
  (see http://go/bugpattern/ParameterComment)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if there's an issue with the CL content.
* File a bug under go/rosie-bug if there's an issue with how the CL was managed.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/media/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

Tested:
    Local presubmit tests passed.
PiperOrigin-RevId: 470953422
(cherry picked from commit f26e5d4c21d34da840152452f648051322d505eb)
2022-08-30 11:23:53 +00:00
andrewlewis
585dfaf55b Update color info mismatch test
This should now expect transformation to succeed.

PiperOrigin-RevId: 470950411
(cherry picked from commit 1023254d8e8b9bab6001ab550676adac96ae0c50)
2022-08-30 11:02:46 +00:00
andrewlewis
179eafb247 Log instead of throwing for transfer mismatch
PiperOrigin-RevId: 470354448
(cherry picked from commit f1a3a40eb1d8a640fed0d7735088a30d00038234)
2022-08-26 23:08:53 +00:00
claincly
0f271c20b5 Fix ExternalTextureManager: repeated queueing input frame in preview
TL;DR: we should check if there are new frames available to queue to the
ExternalTextureProcessor before actually queueing a frame.

The overall flow on the external texture processor:

- `SurfaceTexture.onFrameAvailable` is called on `ExtTexMgr`, and
  - it calls `updateTexImage()`, and sets `frame`
  - it calls `maybeQueueFrameToExtTexProc()`
    - the frame is queued to `ExtTexProc` if `frame` is set

  - From `ExtTexProc.queueInputFrame()`:
    - notifies the `frameProcessorListener` of available frame
    - notifies the `inputListener` of `onReadyToAcceptInputFrame`
      - (`ExtTexMgr` is the listener), it calls `maybeQueueFrameToExtTexProc()`
       again

-- Parallelly --
- `ExtTexProc` calls `inputListener.onInputFrameProcessed`, when the frame is
released
  - (`ExtTexMgr` is the listener), sets `frame` to `null`

*Problem*

This logic relies on `frame` to be cleared at the right time.

In transformer, it's OK b/c `ExtTexProc` release the frame immediately in
`queueInputFrame()` and calls `onInputFrameProcessed` which also reset `frame`

But in previewing, the frame is not released for a while, up to 10 ms.
In this case, `frame` will not reset in this 10 ms, and
`maybeQueueFrameToExtTexProc()` is repeatedly queueing the same input frame.

PiperOrigin-RevId: 470211620
(cherry picked from commit a8c54dd378577cc472a1e56fff062b7959e00268)
2022-08-26 11:03:54 +00:00
rohks
e56f59514f Switch incorrectly configured native multidex to legacy for demos
Native multidex can only be used for binaries with minSdkVersion of 21 or higher, but minSdkVersion was specified to 16.

PiperOrigin-RevId: 470004102
(cherry picked from commit a395b23d985dd4a118b125c3d121a7e39e2e5435)
2022-08-25 16:09:00 +00:00
rohks
e74584e6a0 Switch incorrectly configured native multidex to legacy
Native multidex can only be used for binaries with minSdkVersion of 21 or higher, but minSdkVersion was specified to 16.

PiperOrigin-RevId: 470003836
(cherry picked from commit 142d1c062c4ed4fba450465588217ae5506fece3)
2022-08-25 16:07:42 +00:00
leonwind
e8b5976d87 Delete glPrograms in Contrast and RgbMatrix.
Remove unecessary null checks.

PiperOrigin-RevId: 469999952
(cherry picked from commit f454c9aa7490e40d0ea5fdda6aa5698e7e6f6065)
2022-08-25 15:49:13 +00:00
huangdarwin
2d65ab1cca HDR: Rename GL_COLOR_TRANSFER instances to COLOR_TRANSFER
PiperOrigin-RevId: 469959215
(cherry picked from commit 0f48c89f1f500d211cf6b118214d4bcbf9ef3e13)
2022-08-25 11:43:40 +00:00