607 Commits

Author SHA1 Message Date
christosts
6435ddb89e Create VideoFrameRenderControl
Split CompositingVideoSinkProvider.VideoSinkImpl in two classes:
- VideoSinkImpl now only receives input from MediaCodecVideoRenderer and
  forwards frames to its connected VideoFrameProcessor
- VideoFrameRenderControl takes composited frames out of the VideoGraph
  and schedules the rendering of those.
- CompositingVideoSinkProvider connects VideoSinkImpl with
  VideoFramesRenderer.

PiperOrigin-RevId: 584605078
2023-11-22 06:05:04 -08:00
huangdarwin
0b22a7a0d8 GL: Move private helper method next to the method that uses it.
In addition to being more readable, this will help future CLs that modify
these methods...

PiperOrigin-RevId: 584323686
2023-11-21 07:52:24 -08:00
tianyifeng
89bedf0fb5 Emit onPositionDiscontinuity event when silence is skipped
Issue: androidx/media#765
PiperOrigin-RevId: 584024654
2023-11-20 07:50:13 -08:00
tonihei
5eb6a889a7 Adjust Javadoc
PiperOrigin-RevId: 583965332
2023-11-20 02:54:57 -08:00
rohks
6df240877c Populate MediaMetadata.extras to MediaMetadataCompat
Ensures backward compatibility.

Issue: androidx/media#802
PiperOrigin-RevId: 583425114
2023-11-17 10:25:10 -08:00
ibaker
66c162dabd Fix examples in MediaLibraryInfo javadoc to be realistic
Bugfix releases don't have pre-release cycles.

PiperOrigin-RevId: 583295158
2023-11-17 00:52:10 -08:00
ibaker
bd7615c0b8 Update recommended way to suppress @UnstableApi errors in lint.xml
#minor-release

PiperOrigin-RevId: 582599098
2023-11-15 02:34:40 -08:00
tonihei
03a23bef8f Use full MediaItem to define ad playbacks
Currently, ads are only defined by a single URL, which makes it
impossible to define additional fields needed to play ads correctly.

This can be fixed by using a full MediaItem in AdPlaybackState,
replacing the previous Uri field.

PiperOrigin-RevId: 582331588
2023-11-14 08:35:14 -08:00
tonihei
b570c72588 Normalize MIME types when accepting user or media input
MIME types are case-insensitive, but none of the many existing
comparisons across our code base take this into account. The
code can be made more robust by normalizing all MIME types at the
moment they are first set into a class/builder and adding toLowerCase
as part of the normalization.

Most concretely, this fixes an issue with playing HLS streams via
the IMA SDK where the stream MIME type is indicated with all lower
case "application/x-mpegurl", which failed the MIME type comparison
in DefaultMediaSourceFactory.

PiperOrigin-RevId: 582317261
2023-11-14 07:40:15 -08:00
huangdarwin
28c095d8d0 Effect: Clarify threading for VideoFrameProcessor methods.
All methods in VideoFrameProcessor are expected to be called by the owning thread,
as far as I understand (vs. 10 threads each queuing frames/textures/streams, which
invalidates blocking done by registerInputStream and flush)

PiperOrigin-RevId: 582295240
2023-11-14 06:07:27 -08:00
andrewlewis
330713f687 Expand frame drop workaround to Realme C11
Based on on-device testing, this device seems to have the same issue as Moto G (20) where frames are dropped despite configuring the decoder not to drop frames.

PiperOrigin-RevId: 581943805
2023-11-13 06:47:12 -08:00
jbibik
3918d36200 Bump media3 versions to 1.2.0 (stable)
#minor-release

PiperOrigin-RevId: 580856330
2023-11-09 04:19:30 -08:00
samrobinson
76474684f9 Plumb audio through AudioGraph for Composition preview.
The dump file diff as part of this change is because using AudioGraph
means the 2nd item is automatically edited to match the AudioFormat of
the 1st item {44.1KHz mono}, rather than {48KHz stereo}.

Manually verified that for the 2nd item, data output:
* Before: 66936 bytes (16734 frames) output = 348_625us of audio.
* After: 30750 bytes (15375 frames) output = 348_639us of audio.

The small final buffer is caused by SonicAudioProcessor outputting all
pending data when EOS queued, and is WAI.

PiperOrigin-RevId: 580494578
2023-11-08 05:13:08 -08:00
claincly
8d1663a57f Clarify GL texture creation
PiperOrigin-RevId: 580176027
2023-11-07 07:43:15 -08:00
andrewlewis
a7d47d4526 Add info about using SurfaceView instead of TextureView
PiperOrigin-RevId: 580145645
2023-11-07 05:35:09 -08:00
andrewlewis
63bda3b001 Fix typo
PiperOrigin-RevId: 580113633
2023-11-07 03:02:56 -08:00
claincly
414b72619b Remove unnecessary memory allocation in OpenGL
PiperOrigin-RevId: 579835031
2023-11-06 07:21:23 -08:00
huangdarwin
229d9713a4 Flush: Add javadoc for exception when no active stream.
PiperOrigin-RevId: 579225491
2023-11-03 10:28:25 -07:00
tonihei
312203d38b Deprecate Bundleable and Bundleable.Creator
Both interfaces are not really needed as the methods can be called
on the respective classes directly. This also avoid error-prone
situations where classes define to/fromBundle methods with parameters
that should be used instead of the parameter-less version.

Also deprecate all existing CREATOR static instances and make the
corresponding fromBundle method public where needed.

PiperOrigin-RevId: 579189766
2023-11-03 08:27:21 -07:00
ibaker
0a016b59f7 Remove Guava @Beta API warning suppressions
These are no longer needed now we've updated to 32.1.3 in 7a10435633

PiperOrigin-RevId: 579149808
2023-11-03 05:21:49 -07:00
ibaker
901f89c456 Add @CheckReturnValue to ParsableByteArray and ParsableBitArray
This helps encourage usages of `skipXXX()` methods instead of
`readXXX()`.

PiperOrigin-RevId: 578892379
2023-11-02 10:08:26 -07:00
tofunmi
3253f1b5cd Add microsecond precision to MediaItem.ClippingConfiguration
PiperOrigin-RevId: 578881990
2023-11-02 09:40:11 -07:00
tonihei
d4e5ab2c4d Make BundleableUtil more generic by taking Function parameters
BundleableUtil is the only class that really depends on the type
inheritence from Bundleable. However, it only needs this as a way
to define Function<T, Bundle> and Function<Bundle, T>, which could
just be passed in as parameters as it's already done for some of
these methods.

Also rename the class to BundleCollectionUtil accordingly.

PiperOrigin-RevId: 578791946
2023-11-02 03:17:17 -07:00
huangdarwin
8d87a27fb9 Remove deprecated ColorInfo constructor
This was first deprecated in a4bc0959be, submitted Dec 2022

PiperOrigin-RevId: 578152077
2023-10-31 05:46:39 -07:00
jbibik
97efa70852 Add DASH support for parsing standalone TTML files during extraction
This change applies to standalone TTML files linked directly from the manifest.

As a result, we no longer have the flakiness in the DashPlaybackTest which uses sidecar-loaded (standalone file) TTML subtitles. We experimentally opt into parsing subtitles during extraction and use SubtitleExtractor in hybrid mode.

PiperOrigin-RevId: 577457256
2023-10-28 06:59:45 -07:00
claincly
841b4fba9a Fix GL releasing surface that doesn't need releasing
PiperOrigin-RevId: 576545767
2023-10-25 09:05:11 -07:00
sheenachhabra
fe6305931d Add moto g(20) API 30 in the allowed frame dropping list
This is a workaround to avoid frame dropping.

PiperOrigin-RevId: 576467065
2023-10-25 03:07:08 -07:00
Googler
8796b2e21e Add isPrioritizeImageOverVideoEnabled to TrackSelectionParameters
This CL adds an isPrioritizeImageOverVideoEnabled flag to
TrackSelectionParameters and an API to set the flag value.

The flag will be used by DefaultTrackSelector to determine whether
to select an image track if both an image track and a video track are available.

PiperOrigin-RevId: 576175162
2023-10-24 10:01:22 -07:00
rohks
9d3d7abdc6 Bump Media3 version numbers for 1.2.0-rc01
#minor-release

PiperOrigin-RevId: 575805495
2023-10-23 06:57:55 -07:00
tonihei
c0759a4e62 Rollback of 4ebe630a80
PiperOrigin-RevId: 574530273
2023-10-18 11:05:49 -07:00
Googler
ff330bd8e9 Rollback of 4ebe630a80
PiperOrigin-RevId: 574308136
2023-10-17 17:16:01 -07:00
Copybara-Service
009d48a75e Merge pull request #491 from v-novaltd:dsparano-exo128
PiperOrigin-RevId: 574129451
2023-10-17 06:35:19 -07:00
microkatz
716240776e Updated golden file tests and readded constructor 2023-10-17 11:42:33 +00:00
microkatz
212e138bcf Removed deprecated ColorInfo constructor call and fixed formatting 2023-10-17 11:42:33 +00:00
microkatz
d206be74ef Updated to use ColorInfo.Builder() and formatting issues 2023-10-17 11:42:33 +00:00
microkatz
bbcf37dc9e Format with google-java-format 2023-10-17 11:42:33 +00:00
Daniele Sparano
f14732873f Change isColorValid with isDataSpaceValid 2023-10-17 11:42:33 +00:00
Daniele Sparano
1fe9c3303e Resume toLogString() in ColorInfo; revert DebugTextViewHelper 2023-10-17 11:42:33 +00:00
microkatz
ee1b1500e2 Format with google-java-format 2023-10-17 11:42:33 +00:00
Daniele Sparano
f8d98861ea Move luma and chroma bitdepths to ColorInfo class 2023-10-17 11:42:33 +00:00
Daniele Sparano
c7fe0662ce Set bitdepths in test Format 2023-10-17 11:42:32 +00:00
Daniele Sparano
e71ca5a740 Add luma and chroma bit depths to Format, set them as signalled in containers and parameter sets 2023-10-17 11:42:32 +00:00
tonihei
4ebe630a80 Split available command filtering and bundling
A few methods in PlayerInfo and related classes combine filtering
information with bundling in one method. This makes it impossible
to use just the filtering for example and it's also easier to reason
about than two dedicated methods. This change splits these methods
into two parts accordingly.

PiperOrigin-RevId: 572592458
2023-10-11 09:09:11 -07:00
ibaker
7009c53c79 Update @UnstableApi docs to include a package-info.java example
#minor-release

PiperOrigin-RevId: 572229092
2023-10-10 06:35:24 -07:00
tonihei
0bddd06938 Make BundleListRetriever local Binder aware
When used within the same process, we don't have to go via the
onTransact method (which includes marshalling and unmarhsalling
the data), but can directly return the list.

#minor-release

PiperOrigin-RevId: 572179846
2023-10-10 02:22:56 -07:00
jbibik
97645a200d Bump Media3 version numbers for 1.2.0-beta01 release
#minor-release

PiperOrigin-RevId: 572003628
2023-10-09 12:06:00 -07:00
tonihei
89d01981bc Deprecate decode-only flag.
The flag is no longer used by our components and only set and checked
in a few places to guarantee compatiblity with existing renderers and
decoders that still use it.

The flag will be removed in the future due to its design limitations.

#minor-release

PiperOrigin-RevId: 571291168
2023-10-06 03:44:14 -07:00
huangdarwin
40b990f5fa GL: Use only the index location returned by glGetAttribLocation
location and index are mostly equivalent, except that it's possible that location is more up-to-date than index, so we can just always use location.

PiperOrigin-RevId: 570950407
2023-10-05 02:35:11 -07:00
tonihei
9ef1c20e7a Replace ENCODING_DTS_UHD_P2 value by reference to platform constant
#minor-release

PiperOrigin-RevId: 570696505
2023-10-04 08:09:04 -07:00
jbibik
b83f12c4ba Add Dumper support for outputting multiline strings
PiperOrigin-RevId: 570348425
2023-10-03 04:47:31 -07:00