818 Commits

Author SHA1 Message Date
kimvde
3248b7962a Add clipFloatOutput parameter to AudioMixer
PiperOrigin-RevId: 615720340
2024-03-14 03:44:37 -07:00
christosts
6f109ffa6a Composition preview: play multiple images
PiperOrigin-RevId: 614690669
2024-03-11 09:28:40 -07:00
christosts
e399ea19bb Composition preview: move audio and video components
PiperOrigin-RevId: 614673253
2024-03-11 08:29:38 -07:00
tofunmi
a975c75748 SpeedChangingAudioProcessor: fix outputTime calculation
minor fix for arithmetic error in calculated added in f4c60c52b9 (speed is outputTime (change in y) divided by inputTime (change in x), this calculation is inverted in code).

Changed test to cover the case.

PiperOrigin-RevId: 613966027
2024-03-08 10:01:55 -08:00
tofunmi
f4c60c52b9 Calculate outputTime based on inputTime and audio speed change
PiperOrigin-RevId: 613894863
2024-03-08 04:47:12 -08:00
ibaker
7f5b1a98e9 Use Guava's toByteArray & fromByteArray methods where possible
Also remove intermediate object allocations in
`Util.toByteArray(int...)`.

`Util.toByteArray(InputStream)` is kept (but deprecated) because it's
been part of the library for a while and might be in use by some apps.
The others are much newer, so the chance of usages outside the library
is very low, so we just remove them directly.

PiperOrigin-RevId: 613878453
2024-03-08 03:27:29 -08:00
ibaker
5b48ef4e53 Add tests for Util.toByteArray
The implementation of these methods is changed in a follow-up CL, and
these tests help to ensure nothing breaks.

This doesn't include tests for `toByteArray(InputStream)` or
`toByteArray(int)` because these implementations are fully replaced by
Guava equivalents in a follow-up CL.

PiperOrigin-RevId: 613581845
2024-03-07 07:51:04 -08:00
claincly
0f72126c20 Add getLastTimestampUs() method
PiperOrigin-RevId: 613579674
2024-03-07 07:44:58 -08:00
Googler
08993b6fb1 Have VideoSampleExporter output orientation match input
This should enable trim optimization to work correctly in more cases.

PiperOrigin-RevId: 611096958
2024-02-28 07:40:53 -08:00
sheenachhabra
9be7a7ab7f Update media3 version for 1.3.0 stable release
PiperOrigin-RevId: 609745599
2024-02-23 09:10:23 -08:00
michaelkatz
9046f2edb6 Allow renderer retry for audio track offload initialization failure
If render error occurs due to AudioTrack initialization failure in offload mode, then ExoPlayer should allow retry as subsequent attempt will be with DefaultAudioSink disabling offload.

PiperOrigin-RevId: 609304897
2024-02-22 03:00:10 -08:00
Copybara-Service
fb7438378d Merge pull request #983 from MGaetan89:min_api_19
PiperOrigin-RevId: 607319987
2024-02-15 07:00:17 -08:00
Ian Baker
e24febf1e2 Small clean-ups and added @InlineMe annotation 2024-02-13 14:48:15 +00:00
Ian Baker
205c8734cc In-line more V19 methods in TrackSelectionParameters, AudioTimestampPoller and CaptionStyleCompat 2024-02-13 10:26:20 +00:00
Ian Baker
c4d9df970c Format with google-java-format 2024-02-13 10:26:20 +00:00
Ian Baker
c0c1c315c5 In-line GlUtil.Api18 and VideoFrameReleaseHelper.DisplayHelperV16/17
Also put back a comment in DownloadTracker that is still relevant on API 19.

Also deprecate PlaceholderSurface.newInstanceV17() in favour of just
newInstance()
2024-02-13 10:26:20 +00:00
Gaëtan Muller
d327cb4795 Code cleanup 2024-02-13 10:26:20 +00:00
Gaëtan Muller
963e517a5a Remove unnecessary RequiresApi annotation 2024-02-13 10:26:19 +00:00
Gaëtan Muller
973b717914 Remove unnecessary SDK_INT checks 2024-02-13 10:26:19 +00:00
huangdarwin
2594691950 Clarify speedchange javadoc to mention duration.
The speed is that value only until the next one

PiperOrigin-RevId: 606258937
2024-02-12 08:25:39 -08:00
tofunmi
1a5eb4eecd Support segment-specific speed changes in SpeedChangeEffect
PiperOrigin-RevId: 606204479
2024-02-12 04:03:23 -08:00
sheenachhabra
a31a384393 Version bump to media3:1.3.0-rc01
#minor-release

PiperOrigin-RevId: 605573991
2024-02-09 02:44:25 -08:00
tofunmi
4d29d8f012 DefaultAssetLoaderFactory: Simplify file extension retrival
Change the file extension retrieval back to how it was before 5488d33da8 to reduce the change of false negatives in `isImage()`

PiperOrigin-RevId: 605281186
2024-02-08 05:01:03 -08:00
tianyifeng
ccd603acb0 Improve AudioCapabilities with AudioManager API in Android 13
PiperOrigin-RevId: 604700601
2024-02-06 11:57:09 -08:00
tonihei
766a15a51e Include nullness of RequestMetadata.extras in equals method
This ensures RequestMetadata with just non-null extras is not
considered equal to RequestMetadata.EMPTY. This makes sure the
contents are bundled when a controller sets the extras in a
new MediaItem.

PiperOrigin-RevId: 604632788
2024-02-06 06:58:51 -08:00
huangdarwin
1bd04cb5d9 Add support for GlProgram GL_FLOAT_VEC4.
https://github.com/androidx/media/issues/1039

PiperOrigin-RevId: 603684630
2024-02-02 07:46:04 -08:00
tofunmi
c79f950d26 ultra HDR: send gainmap downstream if HDR output requested
removing the useHdr parameter from queueInputBitmap() it suggests we support changing between HDR and SDR within a stream, which we don't support. instead, identifying whether to use HDR from the shaderprogram which is informed by the inputColorInfo when the stream is registered.

PiperOrigin-RevId: 603681736
2024-02-02 07:33:15 -08:00
huangdarwin
a27511cc50 Effect: Remove inputColorInfo from create() methods.
Transformer export and ExoPlayer previewing both read inputColorInfo from
registerInputStream now, instead of maintaining a consistent input color
throughout multiple streams in a sequence.

Therefore, we can remove inputColor-related arguments and methods now.

PiperOrigin-RevId: 603423509
2024-02-01 11:09:57 -08:00
jbibik
eb3173aa90 Remove a redundant TODO in Util
PiperOrigin-RevId: 601820851
2024-01-26 11:34:43 -08:00
tonihei
2fc5590e7a Remove misleading @CanIgnoreReturnValue
The return value of onConfigure must not be ignored as it specifies
the output format of the processor, which may be different from the
input format.

#minor-release

PiperOrigin-RevId: 601799440
2024-01-26 10:19:40 -08:00
tonihei
ed5b7004b4 Replace or suppress deprecated usages
Many usages are needed to support other deprecations and some
can be replaced by the recommended direct alternative.

Also replace links to deprecated/redirected dev site

PiperOrigin-RevId: 601795998
2024-01-26 10:06:18 -08:00
sheenachhabra
21ab474260 Version bump to media3:1.3.0-beta01
#minor-release

PiperOrigin-RevId: 601441910
2024-01-25 07:28:43 -08:00
tianyifeng
35ac46b92e Change the behaviour in MediaMetadata.Builder.populate
Populate both `artworkUri` and `artworkData` in
`MediaMetadata.Builder.populate(MediaMetadata)` when at least one of them is non-null.

Issue: androidx/media#964
PiperOrigin-RevId: 600826103
2024-01-23 10:08:33 -08:00
christosts
9e9c3cbe5e SimpleBasePlayer: add protected method for thread verification
Add protected method in SimpleBasePlayer for thread verification to help
subclasses verify thread access for additional methods they define and
still report the same message to the user.

Also, remove the DAC link pointing to the ExoPlayer-specific
documentation from the exception message. Users who extend
SimpleBasePlayer have access to the class' javadoc.

PiperOrigin-RevId: 600426692
2024-01-22 05:20:34 -08:00
ibaker
2e8a81cd4d Update Util.moveItems to explicitly T extends @NonNull Object
PiperOrigin-RevId: 599516707
2024-01-18 08:35:04 -08:00
tonihei
59dc5b6692 Add missing null and Bundle checks in MediaSession/ControllerStub
PiperOrigin-RevId: 599477547
2024-01-18 05:29:39 -08:00
christosts
0e66197419 Rename TimestampIterator argument name in queueInputBitmap()
#minor-release

PiperOrigin-RevId: 599460771
2024-01-18 04:01:27 -08:00
tofunmi
5eb1f4043b disallow go links in Media3 open source code
PiperOrigin-RevId: 599455204
2024-01-18 03:28:31 -08:00
tonihei
e730feb98a Add missing IntDef annotation
PiperOrigin-RevId: 599414024
2024-01-18 00:16:59 -08:00
rahulnmohan
27c021fd7b Merge Issue: androidx/media#275: MPEG2-TS: Support DTS, DTS-LBR and DTS:X Profile2
Imported from GitHub PR https://github.com/androidx/media/pull/275

Added below mentioned features.

- Support for extracting DTS LBR(DTS Express) and DTS UHD Profile 2(DTS:X) descriptor ID from PSI PMT
- The DTSReader class is updated for extracting a DTS LBR.
- Newly added DtsUhdReader class for extracting DTS UHD frame.
- The DTSUtil class is updated to parse the DTS LBR or DTS UHD frame and report the format information.

Feature request for ExoPlayer: https://github.com/google/ExoPlayer/issues/11075
Merge 21efa0810db31550d6b215639f9ca2af6a32139a into 104cfc322c095b40f88e705eb4a6c2f029bacdd6

COPYBARA_INTEGRATE_REVIEW=https://github.com/androidx/media/pull/275 from rahulnmohan:dts-mpeg2ts-update 21efa0810db31550d6b215639f9ca2af6a32139a
PiperOrigin-RevId: 598854998
2024-01-16 08:54:43 -08:00
tofunmi
5488d33da8 Transformer: add api to cutomize image loading
PiperOrigin-RevId: 598793134
2024-01-16 03:56:08 -08:00
sheenachhabra
4a07d13838 Version bump to media3:1.3.0-alpha01
#minor-release

PiperOrigin-RevId: 598588547
2024-01-15 05:44:03 -08:00
tofunmi
7f087243bb Add supportsMimeType API to bitmapLoader
PiperOrigin-RevId: 597942459
2024-01-12 13:49:38 -08:00
tofunmi
6879698d7e Move setting bitmapFactory options from interface to implementation
Moves setting bitmapFactory options from BitmapLoader to DatasourceBitmapLoader

BitmapLoader is a general interface for bitmap loading that could use loading implementations other that BitmapFactory, with the rise of Glide being a loader of choice. It's best to correct this interface so that it remains generic

We can't deprecate easily because the other loadBitmap method in that case has a default implementation that relies on the first one, so the change is still breaking. BitmapLoader is public api in common, but it's @UnstableAPI and hasn't been around for very long (be38670391 added it), so it seems this is the best way forward.

PiperOrigin-RevId: 597897098
2024-01-12 11:21:48 -08:00
michaelkatz
324e1beef2 Bump media3 version to 1.2.1 and update RELEASENOTES
#minor-release

PiperOrigin-RevId: 596916027
2024-01-09 06:39:56 -08:00
ibaker
77f311917f Play clear samples in DRM content without keys by default
This behavior was previously available as opt-in via
`MediaItem.DrmConfiguration.Builder.setPlayClearContentWithoutKey` and
`DefaultDrmSessionManager.Builder.setPlayClearSamplesWithoutKeys`. This
change flips the default of both these properties to true.

This should speed up the time for playback to start when playing DRM
content with a 'clear lead' of unencrypted samples at the start.
Previously playback would wait until the keys for the later encrypted
samples were ready. The new behaviour could result in mid-playback
stalls/rebuffers if the keys are not ready yet by the transition from
clear to encrypted samples, but this is not really a regression since
previously playback wouldn't have started at all at this point.

PiperOrigin-RevId: 595992727
2024-01-05 07:46:25 -08:00
ibaker
95e742948c Clarify docs on Player.setMediaItem(s) and replaceMediaItem(s)
These methods sound similar, but have different behaviour. This change
tries to make the distinction clearer, and sign-post from one to the
other.

#minor-release

Issue: androidx/media#910
PiperOrigin-RevId: 595701540
2024-01-04 07:41:34 -08:00
tonihei
59f01388a6 Use platform constants for PCM 24/32 bit encoding
These constants are used when setting up the AudioTrack
and should match the definition in the platform.

PiperOrigin-RevId: 592564644
2023-12-20 08:16:35 -08:00
ibaker
6853ffccae Add container to Format.toLogString
While investigating Issue: androidx/media#887 I naively assumed the CEA-608
captions were in a TS file, but they're actually in an MP4 (which is
possibly obvious given DASH only supports MP4). This change includes
container info in the `EventLogger` `tracks` output.

PiperOrigin-RevId: 592192752
2023-12-19 04:33:58 -08:00
huangdarwin
7579693739 Effect: Move VideoFrameProcessor inputColorInfo interface to FrameInfo.
Move `inputColorInfo` from `VideoFrameProcessor`'s `Factory.create` to `FrameInfo`,
input via `registerInputStream`.

Also, manually tested on exoplayer demo that setVideoEffects still works.

PiperOrigin-RevId: 591273545
2023-12-15 09:17:39 -08:00