17426 Commits

Author SHA1 Message Date
huangdarwin
77ea31e01c HDR: Add comment explaining force-SDR and AssetLoader interaction.
PiperOrigin-RevId: 510155318
2023-02-17 11:52:13 +00:00
huangdarwin
fb8bbce5f1 HDR: Put force HDR as SDR into AssetLoader
This allows us to fix usage of HDR_MODE_EXPERIMENTAL_FORCE_INTERPRET_HDR_AS_SDR.

Before, this was checked in the VideoSamplePipeline, which no longer decides on the decoder configuration input format.

PiperOrigin-RevId: 510142097
2023-02-17 11:51:23 +00:00
kimvde
221c5afb1b Rename occurrences of transform in lib-transformer
PiperOrigin-RevId: 510118760
2023-02-17 11:50:20 +00:00
andrewlewis
5d8a83f924 Remove Pixel watch check
It's unlikely anyone will try to use Transformer on watches.

PiperOrigin-RevId: 510115645
2023-02-17 11:49:29 +00:00
claincly
cec603393d Fix a missed rename.
PiperOrigin-RevId: 510100709
2023-02-17 11:48:39 +00:00
andrewlewis
2ed5819a19 Check capabilities for more tests
Some of the test methods in `TransformationTest` don't check
capabilities. Add a check just scoped to decoding (not checking
encoding, but the default encoder factory may fall back).

PiperOrigin-RevId: 510088562
2023-02-17 11:45:46 +00:00
kimvde
afb52627b6 Rename TransformationTest to ExportTest
PiperOrigin-RevId: 510087543
2023-02-17 11:44:57 +00:00
huangdarwin
ece49e3515 Effects: Update javadoc to link to method.
PiperOrigin-RevId: 510077348
2023-02-17 11:44:05 +00:00
kimvde
c2fdab847f Rename TransformationException to ExportException
PiperOrigin-RevId: 510062674
2023-02-17 11:42:50 +00:00
Googler
5410286955 Update instrumentation to avoid making all constructors public
Previously, any constructors instrumented by Robolectric were made public. This
caused two types of issues:

1) If Android classes had non-public constructors which were made public and
added to the Android API, Robolectric allowed tests to incorrectly use the
constructors on older SDK levels (where they were non-public). This most
commonly occurs for AccessibiltyEvent and AccessibilityNodeInfo.

2) When reflection was used to instantiate classes that were instrumented by
Robolectric, all constructors were accessible, which did not match what
happened when running on an Android test.

Update the instrumentation in Robolectric to prevent making all public
constructors.

PiperOrigin-RevId: 510049123
2023-02-17 11:41:53 +00:00
huangdarwin
cf768329e6 Effect: Rename FrameProcessor
Rename FrameProcessor to VideoFrameProcessor, and GlEffectsFrameProcessor to
DefaultVideoFrameProcessor.

Most changes are semi-mechanical, semi-manual find-replace, preserving case:
* "FrameProc" -> "VideoFrameProc" (ex. FrameProcessor -> VideoFrameProcessor, and
   FrameProcessingException -> VideoFrameProcessingException)
* "GlEffectsVideoFrameProc" -> "DefaultVideoFrameProc"

PiperOrigin-RevId: 509887384
2023-02-17 11:41:06 +00:00
andrewlewis
41a03dd8a6 Fix some minor nits
PiperOrigin-RevId: 509879029
2023-02-17 11:40:13 +00:00
tofunmi
7e33bdfc94 Change FrameProcessor.create() inputTrackType parameter to a boolean
PiperOrigin-RevId: 509808913
2023-02-15 18:17:52 +00:00
andrewlewis
f03a6ba0f0 Skip tests if muxing is unsupported
PiperOrigin-RevId: 509802784
2023-02-15 18:17:00 +00:00
tofunmi
83b7946130 Move inputExternalSurfaceTexture to the ExternalTextureManager
Now that the GLEffectFrameProcessor handles external (video) and internal (image) input, components used only for external input needs should be moved to the ExternalTextureManager for code clarity

PiperOrigin-RevId: 509787494
2023-02-15 12:15:00 +00:00
samrobinson
3608c2e831 Use MediaFormatUtil for creating MediaFormat from Format.
PiperOrigin-RevId: 509785247
2023-02-15 12:14:10 +00:00
samrobinson
79a3464014 Clarify the mime type used in EncoderUtilTest.
PiperOrigin-RevId: 509750806
2023-02-15 12:12:33 +00:00
samrobinson
ee8832ff21 Align ASP and VSP on findSupportedMimeTypeForEncoder/Muxer logic.
* Moved the logic to SamplePipeline.
* Pass the requested values via Format.
* Moved exception throwing inside the methods.
* Build up the mimeTypesToCheck as a set - removing possible duplicate
checks.
* Simplified logic that calls the findSupportedMimeType method.
* Improved javadoc.

PiperOrigin-RevId: 509594062
2023-02-15 12:11:42 +00:00
samrobinson
ccc349abfd Preserve aspect ratio when scaling resolution is insufficient.
PiperOrigin-RevId: 509546771
2023-02-15 12:10:48 +00:00
huangdarwin
b7d68fb62e Effect: Add leading zero to decimals in floats.
PiperOrigin-RevId: 509518734
2023-02-15 12:09:53 +00:00
christosts
20eae0e041 Version bump for ExoPlayer 2.18.3 & media3-1.0.0-rc01
#minor-release

PiperOrigin-RevId: 509501665
2023-02-14 13:49:22 +00:00
tofunmi
74a307fc71 Fix InternalTextureManager so that all frames are sent downstream
PiperOrigin-RevId: 509478455
2023-02-14 11:23:29 +00:00
Googler
56803bf1ad Add exception cause to thrown exception
PiperOrigin-RevId: 509473556
2023-02-14 10:54:01 +00:00
claincly
3aca3ad170 Use ColorInfo.Builder in transformer and common.
Because the ColorInfo constructor is deprecated.

PiperOrigin-RevId: 509468663
2023-02-14 10:28:33 +00:00
claincly
749c10ad1e Add error codes to reflect failures in using effects.
PiperOrigin-RevId: 509461955
2023-02-14 09:54:32 +00:00
huangdarwin
3e2c6797bb Effect: Implement brightness convenience class.
It can be confusing how to use RgbMatrix for app devs not comfortable with image
manipulation, so add a helper class that simply translates rgb values the same
constant brightness value, to update the brightness values.

PiperOrigin-RevId: 509287229
2023-02-13 19:34:34 +00:00
huangdarwin
38dd1489ba Test: Update emulator version from 31 to 33.
For all end-to-end tests, we currently run on a generic API 26 and newer API 31 emulator. Due to some issues on API 31, update to use an API 33 emulator.

Also, update documentation to mention issues on different emulator versions.

PiperOrigin-RevId: 509242743
2023-02-13 17:01:44 +00:00
christosts
a90728fdc6 Minor fixes in release notes
#minor-release

PiperOrigin-RevId: 509222489
2023-02-13 15:34:53 +00:00
samrobinson
c94adf9041 Generalize getSupportedEncodersForHdr to return List<MediaCodecInfo>.
This now matches EncoderUtil.getSupportedEncoders return type.

PiperOrigin-RevId: 509222078
2023-02-13 15:33:02 +00:00
christosts
7390922270 Prepare media3 release notes for rc01
#minor-release

PiperOrigin-RevId: 509218510
2023-02-13 15:15:02 +00:00
andrewlewis
5c30165c28 Update overlay test bitmap based on emulator output
PiperOrigin-RevId: 509210836
2023-02-13 14:35:38 +00:00
michaelkatz
a8c87453db Catch IllegalArgumentExceptions in RTSP Response parsing
In parsing Describe RTSP response messages, IllegalArgumentExceptions are thrown for invalid parameters and values. These exceptions were not caught and crashed the Playback thread. Now these exceptions will be caught and their errors forwarded to the proper error handling listeners.

#minor-release

Issue: google/ExoPlayer#10971
PiperOrigin-RevId: 509207881
2023-02-13 14:18:53 +00:00
huangdarwin
fdf636bc7e Test: Move FileUtil to mh from mh.analysis.
FileUtil is only ever used in mh, and never in mh.analysis

PiperOrigin-RevId: 509206721
2023-02-13 14:12:46 +00:00
andrewlewis
93066b3b2d Remove extra Extractors heading
PiperOrigin-RevId: 509196594
2023-02-13 13:10:36 +00:00
bachinger
51929625cf Add ad event listeners in the Looper event of the ad manager callback
#minor-release

PiperOrigin-RevId: 509189206
2023-02-13 12:26:04 +00:00
huangdarwin
cf089b34f0 HDR: Remove HDR-specific error codes.
It may be confusing for 3P apps, for us to have separate error codes for (1) if
encoding HDR is not supported at all by the device, and (2) if encoding the
format, which happens to be HDR, is not supported by the device. Instead, we can
communicate this in the error message.

PiperOrigin-RevId: 509188666
2023-02-13 12:22:55 +00:00
andrewlewis
68f44915a5 Fix audio generation in silence skipping test
Tests in `SilenceSkippingAudioProcessorTest` used half as many short integers as needed for channel values when generating alternating silence/noise input. Fix this by passing left and right channel input.

PiperOrigin-RevId: 509188074
2023-02-13 12:19:31 +00:00
claincly
519209feac Add public API and render messages for setting effects.
PiperOrigin-RevId: 509165378
2023-02-13 10:15:28 +00:00
sheenachhabra
31d04748ef Improve Audio box test and video box test
Following changes are included:
1. Added missing color information in HDR test case.
2. Corrected few namings in AudioBoxesTest.java.
3. Updated corresponding dump files.

PiperOrigin-RevId: 508745206
2023-02-10 21:46:12 +00:00
tianyifeng
e1d12fc395 Update notification play/pause button with matching player state
Issue: androidx/media#192
PiperOrigin-RevId: 508649684
2023-02-10 14:57:53 +00:00
tofunmi
574424f626 Update frame & texture processors to handle SDR image input
GLEffectsFrameProcessor, MatrixShaderProgram and FinalMatrixShaderProgramWrapper are currently setup to handle the input frames coming from an external input (i.e. a video decoder). Image input is loaded into Bitmap objects at the start of the pipeline, so they are not produced externally. The changes provide a way for the frame processing pipeline to handle this "internal" (i.e. non-external) input.

PiperOrigin-RevId: 508645244
2023-02-10 14:32:07 +00:00
christosts
706431059c AsynchronousMediaCodecAdapter: surface queueing errors sooner
The AsynchronousMediaCodecAdapter's queuing thread stores any exceptions
raised by MediaCodec and re-throws them on the next call to
queueInputBuffer()/queueSecureInputBuffer(). However, if MediaCodec
raises and error while queueing, it goes into a failed state and does
not announce available input buffers. If there is no input available
input buffer, the MediaCodecRenderer will never call
queueInputBuffer()/queueSecureInputBuffer(), hence playback is stalled.

This change surfaces the queueing error through the adapter's dequeueing
methods.

PiperOrigin-RevId: 508637346
2023-02-10 13:44:34 +00:00
ibaker
a6dfcf7799 Add null check to ExoPlayerImpl.isTunnelingEnabled
`TrackSelectorResult.rendererConfigurations` can contain null elements:
> A null entry indicates the corresponding renderer should be disabled.

This wasn't caught by the nullness checker because `ExoPlayerImpl` is
currently excluded from analysis.

#minor-release

Issue: google/ExoPlayer#10977
PiperOrigin-RevId: 508619169
2023-02-10 11:44:14 +00:00
tonihei
6066ce43f6 Document spatialization behavior constants.
PiperOrigin-RevId: 508602059
2023-02-10 10:08:46 +00:00
sheenachhabra
ae17da6e97 Move VideoBoxesTest.java
The existing implementation depends on an internal library (Mp4Slicer) to assert the output. We have removed the dependency on internal library and used golden data to compare the output.

PiperOrigin-RevId: 508401527
2023-02-09 17:52:56 +00:00
christosts
1249dcdc47 Merge pull request #10959 from balachandarlinks:handle-sql-exception-in-cached-content-index
PiperOrigin-RevId: 508323432
2023-02-14 14:24:36 +00:00
Googler
e0ad4ed828 Update SampleQueue.sourceId to be a long rather than an int.
This simplifies usage of 64-bit sequence numbers.

PiperOrigin-RevId: 508107588
2023-02-14 14:23:40 +00:00
kimvde
fedb74907e Handle when some MediaItems require transcoding but others don't
- For single-asset, the behavior stays the same. Transcode if and only
  if it's necessary,
- For constrained multi-asset, always transcode, except if the setter to
  transmux is set. This is to avoid failing if a MediaItem that doesn't
  require transcoding is followed by a MediaItem that does require
  transcoding.

PiperOrigin-RevId: 508097798
2023-02-14 14:22:52 +00:00
Googler
6c7dddbd7f Fix tests affected by Robolectric's constructor visibility bug
Previously, Robolectric's instrumentation updated all constructors to be
public. This caused two main types of problems:

1) When non-public constructors were made public and added to the Android API,
Robolectric allowed tests to incorrectly use the constructors on older SDK
levels (where they were non-public). This most commonly occurs for
AccessibiltyEvent and AccessibilityNodeInfo.

2) When reflection was used to instantiate classes that were instrumented by
Robolectric, all constructors were accessible.

Fix issues across Google3 Robolectric tests that were affected by this issue.
A forthcoming change will fix the instrumentation in Robolectric to prevent
this type of issue from occurring.

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:507861075:BASE:507805409:1675803313108:f2128fa4
PiperOrigin-RevId: 508087822
2023-02-14 14:21:57 +00:00
sheenachhabra
a39b9d9175 Move AudioBoxesTest.java to third_party/.../muxer/...
PiperOrigin-RevId: 508062795
2023-02-14 14:21:09 +00:00