15340 Commits

Author SHA1 Message Date
tonihei
a069ebda47 Add setPreferredAudioDevice method to ExoPlayer
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
2022-09-30 18:18:17 +00:00
leonwind
5b3efa8ad9 Add example CLUT to demo.
PiperOrigin-RevId: 476390089
2022-09-30 18:17:21 +00:00
leonwind
44b9aec0b9 Store LUT bitmap as texture with processor creation.
* 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
2022-09-30 18:16:33 +00:00
Marc Baechinger
cac8c4f6e9 Merge pull request #123 from stoyicker:wrapping_media_source
PiperOrigin-RevId: 476376463
2022-09-30 18:15:30 +00:00
leonwind
7626f70cef Add HSL Adjustments to the demo.
PiperOrigin-RevId: 476373520
2022-09-30 18:14:22 +00:00
leonwind
7eb0ce623b Remove TODOs for merging RGB and MatrixTransformation processors.
PiperOrigin-RevId: 476362571
2022-09-30 18:12:29 +00:00
michaelkatz
ed79f4696f Try alternative decoder for Dolby Vision if display does not support
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
2022-09-30 18:11:25 +00:00
huangdarwin
87fd51a39b HDR: Assert output C.ColorTransfer for tests.
To confirm that tone mapping did or did not happen.

PiperOrigin-RevId: 476354606
2022-09-30 18:10:25 +00:00
leonwind
dc9fa4f463 Add HSL Adjustments to the effects module.
PiperOrigin-RevId: 476144167
2022-09-30 18:09:26 +00:00
leonwind
3433758c3b Add OETF and EOTF ES2 fragment shaders for non-HDR frames.
* 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
2022-09-30 18:08:30 +00:00
ibaker
715c948004 Work around a bug in the Android 13 ClearKey implementation
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
2022-09-30 18:07:17 +00:00
leonwind
9ccdd22e85 Add RGB Adjustments to transformer demo.
PiperOrigin-RevId: 476049125
2022-09-30 18:06:22 +00:00
samrobinson
9ec4e1340a Add file size to TransformationResult at the end of a Transformation.
Tested:
  * Manually using both path and file descriptor.
PiperOrigin-RevId: 475860978
2022-09-30 18:05:19 +00:00
leonwind
f00e43cf81 Use golden bitmaps in contrast pixel tests.
PiperOrigin-RevId: 475805421
2022-09-30 18:04:10 +00:00
rohks
c96e010d35 Fix instrumentation tests not working via Gradle
PiperOrigin-RevId: 475560401
2022-09-30 18:03:11 +00:00
leonwind
75141f3016 Fix outdated command in bitmap/README.md.
* The command changed after creating a custom effects module.

PiperOrigin-RevId: 474777823
2022-09-30 18:02:08 +00:00
yschimke
06230f19c7 Fix tracing under offload.
Currently doSomeWork is never closed and so tracing is deceiving.

See https://screenshot.googleplex.com/eZDzn5APpBNnhe5

PiperOrigin-RevId: 474755816
2022-09-30 18:00:55 +00:00
leonwind
f55a5146e0 Add LUT functionalities to transformer.
* Adds SDR 3D LUT functionalities with OpenGL 2.0 support.

PiperOrigin-RevId: 474561060
2022-09-30 17:59:58 +00:00
leonwind
ab6562e052 Fix testId and match it to the test name.
PiperOrigin-RevId: 474363545
2022-09-30 17:59:00 +00:00
samrobinson
314b312af1 Add support for skipping windows in MssimCalculator.
By skipping every other row and column, SSIM calculation time reduces by 10-30%.

PiperOrigin-RevId: 474286702
2022-09-30 17:58:04 +00:00
samrobinson
bca9c9b280 Clarify the replaceOutputBuffer parameter because count is unclear.
PiperOrigin-RevId: 474279220
2022-09-30 17:57:07 +00:00
leonwind
60ea64734b Change ContrastProcessor java doc for consistency.
PiperOrigin-RevId: 474002026
2022-09-30 17:55:20 +00:00
samrobinson
8ce42f0670 Add MssimCalculatorTest to verify SSIM calculations.
As part of this change, MssimCalculator is moved from androidTest/ to main/

PiperOrigin-RevId: 473771344
2022-09-30 17:54:22 +00:00
leonwind
7a460fa3bd Add java docs for ContrastProcessor constructor.
* Add docs for the public constructor for consistency with all the
other frame processors.

PiperOrigin-RevId: 473726586
2022-09-30 17:53:26 +00:00
leonwind
10cb5f17e0 Add rgb matrices to java docs for public constructors.
PiperOrigin-RevId: 473699927
2022-09-30 17:52:28 +00:00
claincly
7f42e19f09 Split decoding out of the test
This method is useful for other tests also.

PiperOrigin-RevId: 473574282
2022-09-30 17:51:31 +00:00
leonwind
5c78444bf8 Rename MatrixTransformationProcessor to MatrixTextureProcessor.
PiperOrigin-RevId: 473283967
2022-09-30 17:50:33 +00:00
samrobinson
d188babd2d Rollback of 3d5ddf0c42
*** 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
2022-09-30 17:49:31 +00:00
samrobinson
3d5ddf0c42 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
2022-09-30 17:48:34 +00:00
huangdarwin
4133bb6070 Decoder: Reduce max pending frame count limit down to 5.
PiperOrigin-RevId: 473212543
2022-09-30 17:46:40 +00:00
leonwind
55afa598e7 Add caching for compositeRgbMatrixArray.
* Refactor caching for matrix transformations to reuse it for rgb matrices.

PiperOrigin-RevId: 473042194
2022-09-30 17:45:37 +00:00
christosts
260aabb6e9 MediaControllerListenerTest: add bugs IDs in TODOs
PiperOrigin-RevId: 472974903
2022-09-30 17:43:45 +00:00
huangdarwin
0d8fd3d4fc 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
2022-09-30 17:42:50 +00:00
claincly
8b7638bed3 Remove conditional check for no-longer flaky API version
PiperOrigin-RevId: 472949850
2022-09-30 17:41:54 +00:00
claincly
5e2823bb1e Clarify GlTextureProcessor.InputListener contract
PiperOrigin-RevId: 472745311
2022-09-30 17:40:55 +00:00
Googler
15d3d74e16 Clarify exception message.
The exception fires when intent resolution fails to find a service which declares an appropriate intent-filter. The existing message is confusing; it's trying to say that the service couldn't be found but the double negative renders it incorrect.

#cleanup
#minor-release

PiperOrigin-RevId: 472736740
2022-09-30 17:39:56 +00:00
bachinger
70e82a29b7 Add withAvailableAd for server side inserted ad groups
#minor-release

PiperOrigin-RevId: 472714732
2022-09-30 17:38:58 +00:00
tonihei
310e0fec5c 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
2022-09-30 17:37:56 +00:00
claincly
c401fb9771 Remove redundant constant definition
PiperOrigin-RevId: 472522846
2022-09-30 17:36:33 +00:00
bachinger
9e1e0a1004 Bump IMA SDK version for gradle
PiperOrigin-RevId: 472500789
2022-09-30 17:35:36 +00:00
bachinger
0896c4dd36 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
2022-09-30 17:34:37 +00:00
Marc Baechinger
a18ab3745e Merge pull request #10549 from ferhatparmak:release-requirementswatcher
PiperOrigin-RevId: 472488921
2022-09-30 17:33:40 +00:00
Marc Baechinger
cec6f045ea Merge pull request #10570 from Artemych:fix/progressive_downloader_infinite_loop
PiperOrigin-RevId: 472475124
2022-09-30 17:32:37 +00:00
claincly
3f6a59f0f7 Include CamcorderProfile resolution in encoder capability test
PiperOrigin-RevId: 472459423
2022-09-30 17:31:35 +00:00
leonwind
5b556b3c33 Make MatrixTransformationsProcessor constructor to take in Lists.
* Replace ImmutableLists to List interface for constructors

PiperOrigin-RevId: 472433434
2022-09-30 17:30:41 +00:00
leonwind
91e1209e82 Use super class for toGlProcessor in RgbFilter.
PiperOrigin-RevId: 472405147
2022-09-30 17:29:42 +00:00
leonwind
672405afdf Merge RgbProcessor and MatrixTransformation.
PiperOrigin-RevId: 472325145
2022-09-30 17:28:47 +00:00
Googler
3a2e0d3717 Fix 4 ErrorProneStyle findings:
* Non-standard parameter comment; prefer `/* paramName= */ arg`
  (see http://go/bugpattern/ParameterComment) (2 times)
* This catch block catches an exception and re-throws another, but swallows the caught exception rather than setting it as a cause. This can make debugging harder.
  (see http://go/bugpattern/UnusedException)
* This comment contains Javadoc or HTML tags, but isn't started with a double asterisk (/**); is it meant to be Javadoc?
  (see http://go/bugpattern/AlmostJavadoc)

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: 472255768
2022-09-30 17:27:48 +00:00
Googler
573ad66f2f 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
2022-09-30 17:26:49 +00:00
Googler
83485bc509 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
2022-09-30 17:25:50 +00:00