14723 Commits

Author SHA1 Message Date
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
rohks
0e7227df23 Fix missing id error
PiperOrigin-RevId: 469750922
(cherry picked from commit 2c70383d38a50482df57f6558b55b2057cbe56c7)
2022-08-24 16:40:39 +00:00
huangdarwin
c827c80b22 HDR: Add PQ support.
Use the PQ OETF and EOTF to ensure that intermediate fragment shader operations
using PQ are in linear BT.2020 rather than PQ and HLG-1 BT.2020.

Also, swap the OETF and EOTF in shaders, as they were used incorrectly before

Manually tested by verifying transformer demo HLG and PQ videos look the same with and without this CL, including with a BitmapOverlayProcessor enabled to test flows both with one MatrixTransformationProcessor that skips HDR TFs, and with one that doesn't.

PiperOrigin-RevId: 469736067
(cherry picked from commit a2139109e3e67d830be8fd5a342687a569009270)
2022-08-24 15:44:22 +00:00
claincly
8fe0cd34a7 Fix outdated RtpDataLoadable javadoc
PiperOrigin-RevId: 469443086
(cherry picked from commit 5cf166c15767eaac16ce29df9d08d589946d6cae)
2022-08-23 13:41:49 +00:00
leonwind
d2fb190dc9 Bind contrastFactor in constructor instead of drawFrame method.
PiperOrigin-RevId: 469438747
(cherry picked from commit 9a1e7fbdf41e9de1f5d69590a305ebfafaa3ad07)
2022-08-23 13:16:17 +00:00
rohks
2af7d877d7 Replace usage of android_binary with build_test for libraries
`android_binary` is only required when building an application.

PiperOrigin-RevId: 469413752
(cherry picked from commit f01896af156efdafeaef6a5eb13e9d251a2e1d57)
2022-08-23 10:24:29 +00:00
claincly
218e97fadf Handle initial RTSP seek
PiperOrigin-RevId: 469143613
(cherry picked from commit c611435521a868d6675556f05bd2e325355b7e02)
2022-08-22 10:39:48 +00:00
Googler
5bdb165943 Reassign TODO to new bug.
PiperOrigin-RevId: 468672505
(cherry picked from commit 010ecec89dcaf74d9536f92a5b99152d99816dfa)
2022-08-19 11:30:19 +00:00
bachinger
f9336663b6 Add device info to CastPlayer
Issue: androidx/media#142
PiperOrigin-RevId: 468666737
(cherry picked from commit d6442f63fa9cb3e5197109d11cadcd482ef5c6a4)
2022-08-19 10:45:11 +00:00
Googler
60d3e8e26b Change onOutputFrameAvailable timestamp from nanos to micros.
Upstream timestamps from the decoder are also in microseconds,
so using microseconds here is consistent with that.

PiperOrigin-RevId: 468659099
(cherry picked from commit 4e7f9c575d9ff003f1cc4d4a9f464c6df6b4077a)
2022-08-19 09:47:28 +00:00
hmzh
5c95b41d3c Fix the command sample size given to trackOutput.
Remove the manual overwriting of Note ON events that have 0 velocity with Note OFF. JSyn handles this already.

- The implementation of "running status" means that the amount of bytes read from the file differ from the size of the sample that ends up in the decoder. The decoder sample contains the applied running status (status of previous event), which the file bytes don't contain.

PiperOrigin-RevId: 468537659
(cherry picked from commit 53218b50d465939b74a64fdc87ecaca5f1a95b57)
2022-08-18 20:44:21 +00:00
Googler
884e37633e Allow frame release to be controlled outside FrameProcessor.
Adds a method to FrameProcessor.Listener to be called when an
output frame is available and a method releaseOutputFrame in
FrameProcessor allowing the caller to trigger release of the
oldest available output frame at a given timestamp. Late frames
or frames with unset release times are dropped in the
FinalMatrixTransformationProcessorWrapper.

More than one output frame can become available before they are
released if the penultimate GlTextureProcessor is capable of producing
multiple output frames. Processing continues while waiting for
releaseOutputFrame to be called. Frame release tasks are prioritized
over other tasks.

PiperOrigin-RevId: 468473072
(cherry picked from commit 2c063546a1ac8607eb4632acb88506b9a0d46b9e)
2022-08-18 16:10:48 +00:00
huangdarwin
4c36dae9bb HDR: Clamp YUV to RGB conversion.
Manually tested using transformer demo HLG videos. Before this CL, RGB values after the YUV to RGB conversion reached up to 1.025. After this CL, RGB values correctly clamp at 1.0.

PiperOrigin-RevId: 468426092
(cherry picked from commit 32ee44805b33d3fedf9d36905fa22d20a2800d78)
2022-08-18 11:31:03 +00:00
Googler
c65acc04d6 Defensively cancel frame processing tasks on error.
FrameProcessingTaskExecutor should be released on error.
There can be a delay until this happens, so
FrameProcessingTaskExecutor will cancel any pending tasks
and drop new tasks until it is released.

PiperOrigin-RevId: 468171820
(cherry picked from commit d11c3be952d4a5cd31b7f629b427bdddcbf3f15c)
2022-08-17 12:25:53 +00:00
leonwind
f555ed46e8 Fix typo
PiperOrigin-RevId: 468152718
(cherry picked from commit c6a10ad2270ecf295dc06ac338eae6367b7887ca)
2022-08-17 10:15:21 +00:00
leonwind
a4175b8607 Compact a RGB Matrix chain into a singular RGB Matrix.
PiperOrigin-RevId: 468013019
(cherry picked from commit 977370e9db8fda16388a56f8979df9f6f6737b60)
2022-08-16 20:39:42 +00:00
tonihei
d5710d3171 Define CueGroup.EMPTY_TIME_ZERO for convenience
We create an empty CueGroup in many places as default or
where none is needed. Instead, we can define a constant
for this purpose and reuse it.

PiperOrigin-RevId: 467944841
(cherry picked from commit 29208ec1ed4d78fa86af33b81a2b32f3151b9004)
2022-08-16 16:27:56 +00:00
huangdarwin
c5b4cbed75 HDR: Update limited range and add full range YUV to RGB color transforms.
PiperOrigin-RevId: 467910378
(cherry picked from commit 130a536287f705ea823c9351d053f01512bf7e3c)
2022-08-16 13:33:32 +00:00