21347 Commits

Author SHA1 Message Date
tonihei
56c419c1b3 Run CronetDataSource contract test for all Cronet providers
The data source may behave differently, depending on the provider,
so we can extend the contract test to check all available providers.

PiperOrigin-RevId: 658457650
2024-08-01 10:49:37 -07:00
dancho
a98a37aa75 Initial Frame Extractor Transformer Factory
Package-private until API is more useable.

Similar to frame analyzer mode: uses ImageReader instead of an encoder,
and no muxer.

PiperOrigin-RevId: 658446675
2024-08-01 10:21:10 -07:00
dancho
ddc86686b7 Experimental flag to limit the number of frames in encoder
Transformer.experimentalSetMaxFramesInEncoder controls max number
of frames in encoder.

VideoFrameProcessor now allows delayed releasing of frames to Surface,
while still using the original presentation time.

VideoSampleExporter can now configure video graphs to not render frames
automatically to output surface.

VideoSampleExporter.VideoGraphWrapper tracks how many frames are ready
to be rendered to Surface, and how many frames are already in-use by encoder.

PiperOrigin-RevId: 658429969
2024-08-01 09:33:16 -07:00
tonihei
766902634e Define Glide version
PiperOrigin-RevId: 658378243
2024-08-01 06:18:28 -07:00
sheenachhabra
9d14b91d94 Dump auxiliaryTrackType in a string format
PiperOrigin-RevId: 658372776
2024-08-01 05:59:54 -07:00
sheenachhabra
bd399eb601 Refactor get editable track types from map logic
The new method will be reused when Mp4Extractor need to
parse this metadata.

PiperOrigin-RevId: 658372567
2024-08-01 05:56:24 -07:00
samrobinson
34d3dc926d Use getDecoderNames method, rather than duplicating logic.
PiperOrigin-RevId: 658368479
2024-08-01 05:38:30 -07:00
Googler
b951833aec Update list of supported video and audio mime type.
Add parameterized test for codecs supported by InAppMuxer.
Split TransformerWithInAppMuxerEndToEndParameterizedTest tests
between parameterized and non parameterized

This will be helpful for adding more tests which need not to
be parameterized.

PiperOrigin-RevId: 658353532
2024-08-01 04:31:04 -07:00
ktrajkovski
01593a9c1f Replace RuntimeException with IllegalStateException.
Refactor to replace instances of `RuntimeException` with `IllegalStateException`.
This change ensures exceptions can be handled more specifically without
unintended catches of unrelated exceptions.

PiperOrigin-RevId: 658337459
2024-08-01 03:20:54 -07:00
claincly
f3bf4ad5fe Disable frame dropping on sm-x200@API34
From debug trace when decoding a 30fps video, the decoder output

```
"0us",
"33366us",
"66733us",
"100100us",
"133466us",
"166833us",
"200200us",
```

But the frame processor only received, despite setting `ALLOW_FRAME_DROP`:

```
"0us",
"166833us",
"200200us",
```

PiperOrigin-RevId: 658079749
2024-07-31 11:30:18 -07:00
sheenachhabra
dc3a9cea3e Validate data before creating MdtaMetadataEntry object
For some predefined keys the type of value is already defined.
Early validation will help avoiding error when processing this data later.

PiperOrigin-RevId: 658060844
2024-07-31 10:42:11 -07:00
kimvde
ffc45820b9 Move playback tests outside of performance directory
PiperOrigin-RevId: 658055853
2024-07-31 10:29:39 -07:00
Copybara-Service
40de898b22 Merge pull request #1576 from colinkho:main
PiperOrigin-RevId: 657990422
2024-07-31 06:55:45 -07:00
dancho
6e678e511b Enable experimentalRepeatInputBitmapWithoutResampling
Speed up image to video export by default.

PiperOrigin-RevId: 657958037
2024-07-31 04:40:29 -07:00
Ian Baker
c637774cc2 Take Executor instead of ExecutorService
This also avoids shutting down the externally-provided ExecutorService,
which we shouldn't do (since we don't really own it, and didn't create
it).
2024-07-31 10:37:14 +01:00
Googler
4a99dc4c94 Reserve space for the skip buttons in the media3 demo
This is to avoid the shuffle custom action jumping around when skipping to the first or last item of a playlist.

PiperOrigin-RevId: 657925696
2024-07-31 02:31:03 -07:00
Ian Baker
ff22838c0d Add javadoc summary fragment 2024-07-31 10:00:01 +01:00
Colin Kho
68e65ec884 Allow custom ExecutorService to be supplied to the Loader 2024-07-30 13:20:30 -07:00
dancho
3f49f5c157 Check for EGL_NO_SURFACE and similar in GlUtil
`== null` does not check for equality with
EGL_NO_SURFACE, EGL_NO_CONTEXT, or EGL_NO_DISPLAY.

PiperOrigin-RevId: 657651835
2024-07-30 10:49:06 -07:00
ktrajkovski
04bfeec751 Add decoding functions to IamfDecoder and LibiamfAudioRender.
PiperOrigin-RevId: 657621223
2024-07-30 09:33:31 -07:00
Copybara-Service
e9787c4196 Merge pull request #1566 from colinkho:main
PiperOrigin-RevId: 657571792
2024-07-30 06:42:22 -07:00
rohks
8b7b1b51a9 Add MediaDataSourceAdapter
Added a new data source which acts an adapter to read media data from platform `MediaDataSource`. This enables adding the `setDataSource(MediaDataSource)` API to `MediaExtractorCompat`.

PiperOrigin-RevId: 657564901
2024-07-30 06:16:30 -07:00
rohks
867e9ea2da Add APIs to set data source using content URI, file path or HTTP URL
Added three `setDataSource` APIs in `MediaExtractorCompat`:
- `setDataSource(Context context, Uri uri, @Nullable Map<String, String> headers)` to set data source with a content URI and optional headers.
- `setDataSource(String path)` to set data source using a file path or HTTP URL.
- `setDataSource(String path, @Nullable Map<String, String> headers)` to set data source using a file path or HTTP URL with optional headers.

PiperOrigin-RevId: 657563973
2024-07-30 06:12:56 -07:00
kimvde
ca5a26a409 Add frame count tests for preview
This is to ensure prewarming doesn't introduce any regression

PiperOrigin-RevId: 657559693
2024-07-30 06:04:41 -07:00
rohks
004b9d69fd Handle case where length is unset in FileDescriptorDataSource
- Modified the logic of `open()` and `read()` methods to handle scenarios where length is unset for the `FileDescriptor` provided.
- Added unit test and contract test to handle this case.

Also used `getDeclaredLength()` instead of `getLength()` to set the length of `AssetFileDescriptor` in unit tests and contract tests.

PiperOrigin-RevId: 657551343
2024-07-30 05:29:05 -07:00
ibaker
8360e44e07 Remove multidex config from iamf_decoder library's
`AndroidManifest.xml`. This doesn't have Gradle wiring yet, so was
probably missed as part of https://github.com/androidx/media/pull/1549.

PiperOrigin-RevId: 657549817
2024-07-30 05:22:49 -07:00
Ian Baker
335d5e7a1d Add some tests to TrackSelectionUtilTest 2024-07-29 15:12:23 +01:00
Colin Kho
0ead7bb221 Refactor getMaxVideoSizeInViewport into TrackSelectionUtil so it can be reused in external code 2024-07-29 15:12:23 +01:00
tofunmi
7d784d4067 Use FEATURE_HlgEditing to determine HDR support
PiperOrigin-RevId: 657174992
2024-07-29 06:11:48 -07:00
Copybara-Service
f1ed195c10 Merge pull request #1548 from kikoso:chore/fixed_links
PiperOrigin-RevId: 657138513
2024-07-29 03:36:26 -07:00
Googler
f6dc02fa6a Unsuppress/suppress playback on suitable media output updates
PiperOrigin-RevId: 657111555
2024-07-29 01:43:46 -07:00
Enrique López Mañas
debea15bdf chore: fixed links 2024-07-26 12:21:31 +00:00
Enrique López Mañas
b93cc68a67 chore: updated docs and broken links 2024-07-26 12:21:31 +00:00
rohks
32c9d62d39 Add DataSource contract tests to verify offset and position
These tests addresses two identified gaps in the contract:
 - Ensures that the output buffer offset passed to the `DataSource.read` method is correctly applied.
 - Verifies that the position within the input stream is properly incremented when reading in two parts.

PiperOrigin-RevId: 656358935
2024-07-26 05:14:51 -07:00
Copybara-Service
ccf704b30b Merge pull request #1549 from MGaetan89:min_sdk_21
PiperOrigin-RevId: 656358426
2024-07-26 05:11:46 -07:00
dancho
940e28e4db Refactor threading in FinalShaderProgramWrapper
Public methods either assert they're running GL thread, or
submit a task to run on GL thread.

Move methods to keep interface implementations together.

Add javadoc to VideoFrameProcessingTaskExecutor to clarify which
thread can call each public method.

PiperOrigin-RevId: 655978796
2024-07-25 09:23:41 -07:00
Googler
300453820c Selectable builtin speaker support for Wear OS
The builtin speaker is to be supported as a suitable output when that is deliberately selected for the media playback by the user in Wear OS.

PiperOrigin-RevId: 655950824
2024-07-25 07:42:31 -07:00
tofunmi
685ea1e616 create and use SpeedProviderMediaPeriod in CompositionPlayer
PiperOrigin-RevId: 655945332
2024-07-25 07:21:31 -07:00
Ian Baker
4af220a2ac Clarify javadoc in controller test app 2024-07-25 15:12:07 +01:00
tofunmi
043de45763 Store the speed provider in timestamp adjustment
PiperOrigin-RevId: 655928480
2024-07-25 06:09:02 -07:00
Ian Baker
8c79a8fed2 Remove tools:replace="android:name" from manifests where multidex config has been removed 2024-07-25 13:12:10 +01:00
Googler
aaa6561aa9 Rename tests in Boxestest
Replace the box name with Codec name in the test.

PiperOrigin-RevId: 655915063
2024-07-25 05:09:43 -07:00
kimvde
3211f38ebc Add tests for image seeking in CompositionPlayer
This is to make sure prewarming won't introduce any regression when it
will be implemented.

PiperOrigin-RevId: 655879558
2024-07-25 02:27:45 -07:00
rohks
80202bc9f2 Use getDeclaredLength() for setting length of AssetFileDescriptor
Should have been part of the change: 0ac90855b4.

PiperOrigin-RevId: 655873821
2024-07-25 02:05:14 -07:00
Googler
d160aa2520 Modify tests in BoxesTest
Replace the string with the field from MimeType class

PiperOrigin-RevId: 655783812
2024-07-24 19:37:43 -07:00
tianyifeng
edd3a3f349 Fix bug where BasePreloadManager.Listener invokes from incorrect thread
The DefaultPreloadManagerTest didn't to catch this because we use main looper as the preload looper in the tests. This CL also improves the tests by assigning the preload looper with one that corresponds to a different thread.

PiperOrigin-RevId: 655664189
2024-07-24 12:41:21 -07:00
Gaëtan Muller
ed15ab012f Revert changes to androidx.media3.session.legacy 2024-07-24 16:17:02 +01:00
Gaëtan Muller
b90f00c774 Revert erroneous changes 2024-07-24 16:17:02 +01:00
Gaëtan Muller
eefb37a0ba Simplify VolumeProviderCompat.getVolumeProvider() 2024-07-24 16:17:01 +01:00
Gaëtan Muller
0593b36dad Remove MediaSessionImplBase, MediaSessionImplApi18, and MediaSessionImplApi19 2024-07-24 16:17:01 +01:00