583 Commits

Author SHA1 Message Date
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
ibaker
9edbfa974a Fix Util.scaleLargeValue/Timestamp to handle negative numbers
#minor-release

PiperOrigin-RevId: 570337535
2023-10-03 03:52:02 -07:00
claincly
34dddfe9d5 Add previewing specific video graph.
PiperOrigin-RevId: 569473178
2023-09-29 06:16:16 -07:00
bachinger
a3b1661513 Bump Media3 version numbers for 1.2.0-alpha02
PiperOrigin-RevId: 569269992
2023-09-28 13:15:46 -07:00
claincly
cd6f8a42a5 Move Single/MultiVideoGraph impl to effect
PiperOrigin-RevId: 569188658
2023-09-28 08:27:06 -07:00
claincly
42d9879d47 Add missing VideoGraph javadoc param
PiperOrigin-RevId: 567621861
2023-09-22 07:58:55 -07:00
tonihei
4f4335943c Cross-reference per-stream volume methods from device volume methods
The per-stream methods are generally preferred and having a reference
to them from the device-wide methods may help with discoverability.

Issue: google/ExoPlayer#11295
PiperOrigin-RevId: 567604785
2023-09-22 06:30:56 -07:00
claincly
d9563b133e Split VideoGraph interface and move VideoGraph to common
PiperOrigin-RevId: 567599249
2023-09-22 06:01:01 -07:00
tonihei
b2016cc484 Adjust externally loaded image URI MIME type definition
Adjust the Javadoc to highlight that data of this MIME type just contains a URI, not the actual image content.

And also remove the superfluous "key" part of the MIME type string that doesn't
really add information (and it's also really just an URI, not an URI key).

PiperOrigin-RevId: 567560238
2023-09-22 02:12:53 -07:00
Googler
2052be0f51 Add new setIntsUniform for setting ivec uniforms in shaders.
PiperOrigin-RevId: 567102956
2023-09-20 15:50:43 -07:00
Googler
bfd4b6a188 Move GlProgram.loadAsset to Util and make it public.
PiperOrigin-RevId: 567025091
2023-09-20 11:21:55 -07:00
tofunmi
234f7525f0 Add MimeTypes.EXTERNALLY_LOADED_IMAGE
PiperOrigin-RevId: 566915171
2023-09-20 03:55:36 -07:00
michaelkatz
3cf9c08dca Create AudioOffloadPreferences class
Move audio offload mode related interfaces and definitions from `TrackSelectionParameters` to a new `AudioOffloadModePreferences` class.

PiperOrigin-RevId: 566905017
2023-09-20 03:02:51 -07:00
ibaker
db7c33b01c Deprecate Util.getAudioContentTypeForStreamType
This method isn't used by the library (since <unknown commit>).

It doesn't really work well (e.g. arbitrarily defaults to `MUSIC` when
`UNKNOWN` would be a better default). There's no suggested replacement.

PiperOrigin-RevId: 566676744
2023-09-19 10:42:49 -07:00
jbibik
39c1ac7f3a Move setAudioAttributes from ExoPlayer to Player
PiperOrigin-RevId: 566607528
2023-09-19 06:08:37 -07:00
ibaker
2c0d9ba4c3 Rollback of d58f5fdf7d
PiperOrigin-RevId: 566258299
2023-09-18 04:12:21 -07:00
ibaker
d58f5fdf7d Upgrade Guava dependency to 32.1.2
Android's version of Guava was upgraded in http://r.android.com/2731599

PiperOrigin-RevId: 565396612
2023-09-14 09:50:10 -07:00
ibaker
f8b23da7af Add overflow tests for sample count to duration conversion methods
These methods were updated to use the new overflow-resistant
`scaleLargeValue` method in 885ddb167e.

PiperOrigin-RevId: 565059609
2023-09-13 08:38:14 -07:00
ibaker
d111976125 Change SubtitleParser interface to support incremental output
This change introduces two new types of method to `SubtitleParser`:
1. `parse()` methods that take a `Consumer<CuesWithTiming>` and return `void`
2. `parseToLegacySubtitle` method that returns `Subtitle`

(1) ensures that in the new 'parse before SampleQueue' world we can
write cues to the `SampleQueue` as soon as they're ready - this is
especially important when parsing monolithic text files, e.g. for a
whole movie.

(2) ensures that during the transition, the legacy 'parse after
SampleQueue' behaviour doesn't see any regressions in 'time to first
cue being shown'. Previously we had a single implementation to convert
from `List<CuesWithTiming>` to `Subtitle`, but this relies on the
complete list of cues being available, which can take a long time for
large files in some formats (with ExoPlayer's current parsing logic).
By allowing implementations to customise the way they create a
`Subtitle`, we can directly re-use the existing logic, so that the
'time to first cue being shown' should stay the same.

This change migrates all **usages** to the new methods, but doesn't
migrate any **implementations**. I will migrate the implementations in
follow-up CLs before deleting the old list-returning `parse()` methods.

PiperOrigin-RevId: 565057945
2023-09-13 08:33:29 -07:00
ibaker
abaf3e7aa1 Add Format.cueReplacementBehavior
Previously any `CuesWithTiming.durationUs` could be `TIME_UNSET`,
meaning it should be replaced by the next `CuesWithTiming` instance
(instead of being merged if the durations overlap, which is currently
the expected behavior for all `CuesWithTiming` with a 'real' duration).

This technically allowed a single subtitle track to include a mixture of
`CuesWithTiming` that should be merged, and some that should be
replaced. This is not actually needed for any of the subtitle formats
currently supported by ExoPlayer - in all cases a format expects either
all cues to be merged, or each cue to replace the previous one.

Supporting this mixture of merging and replacing in `TextRenderer` ended
up being very complicated, and it seemed a bit pointless since it's not
actually needed. This change means a given subtitle track either merges
**all** cues (meaning `CuesWithTiming.durationUs = C.TIME_UNSET` is not
allowed), or **every** cue is replaced by the next one (meaning
`CuesWithTiming.durationUs` may be set (to allow for cues to 'time out',
needed for CEA-608), or may be `TIME_UNSET`).

This value will be used in a subsequent change that adds cue-merging
support to `TextRenderer`.

PiperOrigin-RevId: 565028066
2023-09-13 06:09:45 -07:00
ibaker
885ddb167e Add general-purpose overflow-resistant divide+multiply util method
This is equivalent to the existing `scaleLargeTimestamp` method with the
following changes/improvements:
* No longer specific to timestamps (there was nothing inherently
  time-specific about the logic in `scaleLargeTimestamp`, but the name
  and docs suggested it shouldn't be used for non-timestamp use-cases).
* Additional 'perfect division' checks between `value` and `divisor`.
* The caller can now provide a `RoundingMode`.
* Robust against `multiplier == 0`.
* Some extra branches before falling through to (potentially lossy)
  floating-point math, including trying to simplify the fraction with
  greatest common divisor to reduce the chance of overflowing `long`.

This was discussed during review of 6e91f0d4c5

This change also includes some golden test file updates - these
represent a bug fix where floating-point maths had previously resulted
in a timestamp being incorrectly rounded down to the previous
microsecond. These changes are due to the 'some more branches' mentioned
above.

PiperOrigin-RevId: 564760748
2023-09-12 10:22:57 -07:00
ibaker
fe10f5ae18 Add tests for Util.scaleLargeTimestamp
This ensures we don't regress this behaviour when introducing
`scaleLargeValue`.

PiperOrigin-RevId: 564708566
2023-09-12 07:00:22 -07:00
michaelkatz
3742f6b1f5 Allow renderer recovery with disabling offload if failed at first write
If offload fails at first write with [ERROR_DEAD_OBJECT](https://developer.android.com/reference/android/media/AudioTrack#ERROR_DEAD_OBJECT), then try disabling offload mode and try again. This allows recovery in a state where AudioTrack succeeds init in offload mode but writing is failing.

Issue: androidx/media#627
PiperOrigin-RevId: 564402181
2023-09-11 09:04:17 -07:00
huangdarwin
19878b0b8b Effect: Clearly state what callers must do onError.
Instead of invoking "undefined behavior" may occur when a class is used
incorrectly, which is clear but not very helpful to callers, specify what Apps
or users of a class should do when issues occur.

Apply this to Compositor as well, where this otherwise might seem unclear.

PiperOrigin-RevId: 563406219
2023-09-07 06:02:09 -07:00
tofunmi
535af35511 Add heif extractor
PiperOrigin-RevId: 563340591
2023-09-07 00:31:04 -07:00