17739 Commits

Author SHA1 Message Date
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
michaelkatz
4854e771d7 Encapsulate Opus frames in Ogg during audio offload
PiperOrigin-RevId: 508053559
2023-02-08 14:12:06 +00:00
kimvde
16db2bd0a1 Add an API entry point to pass a Composition
PiperOrigin-RevId: 508031337
2023-02-08 14:11:13 +00:00
tonihei
bbacb3cc70 Advance position across transition for readahead renderer error
If a renderer error happens while processing readahead data for the
next item in the playlist, we currently throw the error immediately
and only set the item id in the error details. This makes it harder
to associate the error to the right item. For example, the user
facing UI is likely not updated to show the failing item when the
error is reported.

This can be improved slighly by force setting the position to the
failing item. The playback still fails immediately, but this can't
be avoided because the renderer itself went into an error state.

PiperOrigin-RevId: 507808635
2023-02-08 14:09:30 +00:00
microkatz
ecd91d865c Merge pull request #248 from lemondoglol:update-segment-size
PiperOrigin-RevId: 507784608
2023-02-08 14:08:36 +00:00
huangdarwin
0c0c972ea0 Effect: Create GlEffect.isNoOp to simplify Transformer.
This will also allow us to skip transcodes in the future for other effects, like
cropping, color effects, etc.

PiperOrigin-RevId: 507765618
2023-02-08 14:07:41 +00:00
kimvde
c434cc0c9f Rename TransformationResult to ExportResult
Also replace some usages of deprecated Transformer listeners with the new
ones.

PiperOrigin-RevId: 507743860
2023-02-08 14:06:51 +00:00
tonihei
01d7bc7279 Fix AudioTrackPositionTracker logic for playback speed adjustments
The AudioTrackPositionTracker needs to correct positions by
the speed set on the AudioTrack itself whenever it makes
estimations based on real-time (=the real-time playout
duration is not equal to the media duration played).

This happens for the main playback path already, but not for
the mode in which the position is estimated from the playback
head position and also not in the phase after the track has
been stopped. Both cases are not very noticeable during
normal playback, but become relevant when playing in offload
mode.

PiperOrigin-RevId: 507736408
2023-02-08 14:05:56 +00:00
claincly
cccb2f07b7 Remove debug print.
Checked there's no other occurrence.

PiperOrigin-RevId: 507534909
2023-02-08 14:05:03 +00:00
huangdarwin
ca4d2be1fa Effect: Rename TextureProcessor to ShaderProgram.
Also, replace instances of "texture processor" to "shader program", with capitalization retained.

PiperOrigin-RevId: 507515655
2023-02-08 14:04:09 +00:00
tofunmi
9224a36add Update CompositeAssetLoader to override queueInputBitmap
PiperOrigin-RevId: 507515587
2023-02-08 14:03:17 +00:00
christosts
a50ea94525 Detect HEVC HDR10 codec profile more accurately
In MediaCodecUtil, use Format.colorInfo, besides the codec string,
to accurately map to a 10bit HEVC profile.

PiperOrigin-RevId: 507500071
2023-02-08 14:02:22 +00:00
claincly
f630315af5 Flush FrameProcessor when appropriate.
PiperOrigin-RevId: 507461550
2023-02-08 14:01:27 +00:00
bachinger
afa3c628c1 Create an AdEventListener for each supported stream type
This is a refactoring to separate and simplify the logic
of VOD and live streams when handling IMA ad events. An
additional listener will be required for DASH live stream
in a follow-up CL.

PiperOrigin-RevId: 507435741
2023-02-08 14:00:33 +00:00
kimvde
0eb11e269c Rename startTransformation to start
Also update some Javadoc in Transformer

PiperOrigin-RevId: 507395956
2023-02-08 13:59:41 +00:00
tofunmi
4e3c6c6167 Update sample pipelines and frame processors to handle image input.
PiperOrigin-RevId: 506965394
2023-02-08 13:58:50 +00:00
huangdarwin
c45859dde1 HDR: Move codec errors from VideoSamplePipeline
It doesn't actually make sense for them to be placed in the Transformer, because the error's root causes are actually only in codecs. Also, a few codec errors were
repeated, so deduplicate these instances

PiperOrigin-RevId: 506937695
2023-02-08 13:57:57 +00:00
tofunmi
f67569d2dd Update FrameProcessor.create() to accept an input track type.
Based on [this conversation thread](https://chat.google.com/room/AAAA--f88ao/76Rem_cRCK8), I've opted to update the existing FrameProcessor.create() rather than deprecate it, as it is unlikely to be in use by apps outside google3.

PiperOrigin-RevId: 506920930
2023-02-08 13:57:02 +00:00
huangdarwin
c4faae6b03 Demo: Request READ_MEDIA_VIDEO on API 33+
More info in: https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions

PiperOrigin-RevId: 506908079
2023-02-08 13:56:06 +00:00
kimvde
9cb2b6e196 Update Composition structure to take List instead of ImmutableList
This is more flexible for apps and more consitent with the Player API.

PiperOrigin-RevId: 506901645
2023-02-08 13:55:14 +00:00
samrobinson
e2adb567bf Expand createNoSupportedMimeTypeException for HDR ColorInfo case.
PiperOrigin-RevId: 506900817
2023-02-08 13:54:22 +00:00
kimvde
9fdc64785a Adapt TransformationResult for multi-asset
PiperOrigin-RevId: 506898392
2023-02-08 13:53:27 +00:00
samrobinson
2754529ce7 Refactor TransformationException.createForCodec method overloads.
* Overload added `(cause, errorCode, isVideo, isDecoder, details)`,
where `details` is a string of values to be added to the error message
of the `TransformationException`.
* Overload with `MediaFormat` and `mediaCodecName` moved to
`DefaultCodec`, because all usages of that overload were from
`DefaultCodec`, and this allows a simplified API because of internally
stored values.
* `mediaCodecName` removed from overload that takes a `Format`.
* Reordered `createForCodec` parameters.

PiperOrigin-RevId: 506895268
2023-02-08 13:52:32 +00:00
kimvde
dce83d70c5 Rename Transformer callbacks
PiperOrigin-RevId: 506890459
2023-02-08 13:51:40 +00:00
samrobinson
0b7679ed88 Implement a ChannelMixingAudioProcessor.
PiperOrigin-RevId: 506886903
2023-02-08 13:50:45 +00:00
claincly
3b7ebecf16 Prefer hardware encoders in EncoderSelector.
In encoding small and odd-numbered resolutions, like `316x61` ([this image](https://upload.wikimedia.org/wikipedia/commons/6/65/100winners.png)), the current fallback logic prefers a software encoder to hardware ones. The assumption was, the encoder factory applies the encoder size alignment and changes the resolution to `316x60` for SW encoders and `316x64` for HW ones. SW encoders is selected because the supported resolution 60 is closer to requested 61, than the hardware supported 64.

This change changes the default encoder selection process to only expose hardware encoders if there is any.

PiperOrigin-RevId: 506879983
2023-02-08 13:49:52 +00:00