9847 Commits

Author SHA1 Message Date
andrewlewis
3e5ae92bc6 Fix some minor nits
PiperOrigin-RevId: 509879029
2023-02-17 12:59:36 +00:00
tofunmi
5168a35654 Change FrameProcessor.create() inputTrackType parameter to a boolean
PiperOrigin-RevId: 509808913
2023-02-15 18:28:54 +00:00
andrewlewis
6d9baa6e99 Skip tests if muxing is unsupported
PiperOrigin-RevId: 509802784
2023-02-15 18:24:47 +00:00
tofunmi
f7621aacc3 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:31:27 +00:00
samrobinson
7497b1e003 Use MediaFormatUtil for creating MediaFormat from Format.
PiperOrigin-RevId: 509785247
2023-02-15 12:27:43 +00:00
andrewlewis
3b7cf8f003 Add missing import for ExoPlayer v2 codebase
Issue: google/ExoPlayer#10989
PiperOrigin-RevId: 509771687
2023-02-15 10:49:11 +00:00
samrobinson
bcbe3f1f80 Clarify the mime type used in EncoderUtilTest.
PiperOrigin-RevId: 509750806
2023-02-15 10:45:30 +00:00
samrobinson
d91afa063a 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 10:41:50 +00:00
samrobinson
ccd8856dac Preserve aspect ratio when scaling resolution is insufficient.
PiperOrigin-RevId: 509546771
2023-02-15 10:38:05 +00:00
huangdarwin
ccdb3b7028 Effect: Add leading zero to decimals in floats.
PiperOrigin-RevId: 509518734
2023-02-14 15:09:58 +00:00
christosts
b18dccde2a 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
cdd924503a Fix InternalTextureManager so that all frames are sent downstream
PiperOrigin-RevId: 509478455
2023-02-14 11:23:29 +00:00
Googler
08cf6db305 Add exception cause to thrown exception
PiperOrigin-RevId: 509473556
2023-02-14 10:54:01 +00:00
claincly
efcb7683e5 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
33d45c3c75 Add error codes to reflect failures in using effects.
PiperOrigin-RevId: 509461955
2023-02-14 09:54:32 +00:00
huangdarwin
f9fffc28be 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
samrobinson
dcd1f6bc6b Generalize getSupportedEncodersForHdr to return List<MediaCodecInfo>.
This now matches EncoderUtil.getSupportedEncoders return type.

PiperOrigin-RevId: 509222078
2023-02-13 15:33:02 +00:00
andrewlewis
77e651ad27 Update overlay test bitmap based on emulator output
PiperOrigin-RevId: 509210836
2023-02-13 14:35:38 +00:00
michaelkatz
711fa44d56 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
e159741a95 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
huangdarwin
15f0865d62 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
88a97fdb6f 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
117ce33af2 Add public API and render messages for setting effects.
PiperOrigin-RevId: 509165378
2023-02-13 10:15:28 +00:00
tofunmi
0e3a73fe07 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
a5f4651d55 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
5e3cd7a3c3 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
1c29131016 Document spatialization behavior constants.
PiperOrigin-RevId: 508602059
2023-02-10 10:08:46 +00:00
christosts
20a5e468f4 Merge pull request #10959 from balachandarlinks:handle-sql-exception-in-cached-content-index
PiperOrigin-RevId: 508323432
2023-02-14 16:10:55 +00:00
Googler
2eca261416 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 16:06:47 +00:00
kimvde
07ff48165a 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 16:02:45 +00:00
Googler
287cc3a570 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 15:58:45 +00:00
michaelkatz
2590dd5ef5 Encapsulate Opus frames in Ogg during audio offload
PiperOrigin-RevId: 508053559
2023-02-08 15:54:41 +00:00
kimvde
45c42ed373 Add an API entry point to pass a Composition
PiperOrigin-RevId: 508031337
2023-02-08 15:50:43 +00:00
tonihei
79b688ef30 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 15:42:50 +00:00
microkatz
08342ea9da Merge pull request #248 from lemondoglol:update-segment-size
PiperOrigin-RevId: 507784608
2023-02-08 15:38:48 +00:00
huangdarwin
01082a48f1 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 15:34:42 +00:00
kimvde
f39ae692c8 Rename TransformationResult to ExportResult
Also replace some usages of deprecated Transformer listeners with the new
ones.

PiperOrigin-RevId: 507743860
2023-02-08 15:30:40 +00:00
tonihei
4ede931c2a 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 15:26:39 +00:00
claincly
14881f0ef0 Remove debug print.
Checked there's no other occurrence.

PiperOrigin-RevId: 507534909
2023-02-08 15:22:37 +00:00
huangdarwin
659b107022 Effect: Rename TextureProcessor to ShaderProgram.
Also, replace instances of "texture processor" to "shader program", with capitalization retained.

PiperOrigin-RevId: 507515655
2023-02-08 15:18:38 +00:00
tofunmi
af259054af Update CompositeAssetLoader to override queueInputBitmap
PiperOrigin-RevId: 507515587
2023-02-08 15:14:39 +00:00
christosts
80dbaca0e5 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 15:10:37 +00:00
claincly
274617de17 Flush FrameProcessor when appropriate.
PiperOrigin-RevId: 507461550
2023-02-08 15:06:34 +00:00
kimvde
4631105fb3 Rename startTransformation to start
Also update some Javadoc in Transformer

PiperOrigin-RevId: 507395956
2023-02-08 14:58:38 +00:00
tofunmi
c32794f0cc Update sample pipelines and frame processors to handle image input.
PiperOrigin-RevId: 506965394
2023-02-08 14:54:39 +00:00
huangdarwin
7684949fa4 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 14:50:44 +00:00
tofunmi
d4db00e51a 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 14:46:49 +00:00
huangdarwin
557b7dcc71 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 14:42:52 +00:00
kimvde
87ff3157c9 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 14:38:57 +00:00
samrobinson
73d4b67e46 Expand createNoSupportedMimeTypeException for HDR ColorInfo case.
PiperOrigin-RevId: 506900817
2023-02-08 14:35:02 +00:00