561 Commits

Author SHA1 Message Date
christosts
757247e2ae Release MIDI decoder module in open-source
PiperOrigin-RevId: 537034577
2023-06-02 09:18:09 +00:00
huangdarwin
20f90cb1bf ExoPlayer: set videoFrameProcessorFactory in MCVR ctor.
Also, move to using a Supplier<?> to load a singleton value.

PiperOrigin-RevId: 536733480
2023-05-31 18:01:35 +00:00
ibaker
0ddc024c69 Soften MediaCodecRenderer's assumptions about using framework DRM
#minor-release

PiperOrigin-RevId: 536724725
2023-05-31 17:58:49 +00:00
huangdarwin
e2821f10f5 Exoplayer: Suppress check to allow video to run ahead of Audio.
Otherwise, texture output errors out if video decoding decodes faster than audio,
hitting the end of the file, while audio is still in the middle of the file.

PiperOrigin-RevId: 536679568
2023-05-31 17:56:24 +00:00
huangdarwin
06908e1a86 Rollback of 438ae0ed6a
*** Original commit ***

ExoPlayer: Add setVideoFrameProcessorFactory().

This allows apps to use a custom VideoFrameProcessor implementation for video
playback. This may be useful, for example, when outputting to a texture.
***

PiperOrigin-RevId: 536391597
2023-05-30 14:26:39 +00:00
Tianyi Feng
730cfecd57 Make the API 34 check inline and refactor the comment 2023-05-25 09:58:07 +00:00
Tianyi Feng
fb34983bb7 Format with google-java-format 2023-05-25 09:58:07 +00:00
Tianyi Feng
48509df714 Quick return the capabilities for API29 TV case 2023-05-25 09:58:07 +00:00
Tianyi Feng
ea32f11292 Refactor the methods and reword the comments 2023-05-25 09:58:07 +00:00
Tianyi Feng
162f5e827a Add type argument when using ImmutableSet 2023-05-25 09:58:07 +00:00
Tianyi Feng
b9a53da121 Refactor AudioCapabilities.getCapabilities 2023-05-25 09:58:07 +00:00
Tianyi Feng
d0cd2f5f21 Refactor AudioCapabilities.getCapabilities 2023-05-25 09:58:07 +00:00
Tianyi Feng
47b0726ea9 Format with google-java-format 2023-05-25 09:55:10 +00:00
Cedric T
424b5d8d0e Add issue link for AudioCapabilities 2023-05-25 09:55:10 +00:00
Cedric T
cb29e8fb3d Construct AudioCapabilities with HDMI reported MaxChannelCount. 2023-05-25 09:55:10 +00:00
Cedric T
905ad1ce33 Fixed bug in HDMI reporting logic. 2023-05-25 09:55:10 +00:00
Cedric T
6b4cf4d362 Swap HDMI case and non-HDMI case in AudioCapabilities. 2023-05-25 09:55:10 +00:00
Cedric T
773d3c52f1 Swap empty line in AudioCapabilities.java 2023-05-25 09:55:10 +00:00
Cedric T
53f35f46f5 Use ImmutableSet to store discovered encodings in AudioCapabilities.java 2023-05-25 09:55:10 +00:00
Cedric T
924723d6b3 Additional changes to AudioCapabilities.java and Util.java 2023-05-25 09:55:10 +00:00
Cedric T
b1ac7685bd Add distinct encodings check before returning AudioCapabilities. 2023-05-25 09:55:10 +00:00
Cedric T
753257e454 Refactor Audio Capabilities 2023-05-25 09:55:10 +00:00
Cedric T
abc46d4319 Rename some variables and change to use ImmutableList.Builder. 2023-05-25 09:55:10 +00:00
Cedric T
f47930e587 Refactor getDirectPlaybackSupportedEncodings() 2023-05-25 09:55:10 +00:00
Cedric T
b069fb1283 Return Immutable List for getAllSurroundEncodingsMaybeSupported() 2023-05-25 09:55:09 +00:00
Cedric T
689451b0c6 Set AudioCapabilities.DEFAULT_MAX_CHANNEL_COUNT to 10 2023-05-25 09:55:09 +00:00
Cedric T
d01a93b94e Add getAllSurroundEncodingsMaybeSupported() 2023-05-25 09:55:09 +00:00
Cedric T
c0e03f14a8 Remove skip channelCount check for ENCODING_DTS 2023-05-25 09:55:09 +00:00
Cedric T
6823a2916a Add C.ENCODING_DTS_UHD_P2 2023-05-25 09:55:09 +00:00
Cedric T
22b45b75f7 Use getMaxSupportedChannelCountForPassthrough to assign channel Count 2023-05-25 09:55:09 +00:00
Cedric T
b73d2cc736 Add direct passthrough support for DTS audio. 2023-05-25 09:55:09 +00:00
tonihei
418b2a5f1b Don't check offload support for formats without defined sample rate.
Otherwise the Builder of AudioFormat will throw because we pass in
an invalid value.

#minor-release

PiperOrigin-RevId: 535169406
2023-05-25 10:40:20 +01:00
tonihei
2c07468908 Implement Player.replaceMediaItem(s)
This change moves the default logic into the actual Player
implementations, but does not introduce any behavior changes compared
to addMediaItems+removeMediaItems except to make the updates "atomic"
in ExoPlayerImpl, SimpleBasePlayer and MediaController. It also
provides backwards compatbility for cases where Players don't support
the operation.

Issue: google/ExoPlayer#8046

#minor-release

PiperOrigin-RevId: 534945089
2023-05-25 10:00:02 +01:00
ibaker
5c713feb60 Remove deprecated onSeekProcessed
This change removes it from `Player.Listener` and `AnalyticsListener`,
use `onPositionDiscontinuity` with `DISCONTINUITY_REASON_SEEK` instead.

#minor-release

PiperOrigin-RevId: 534757426
2023-05-24 16:06:05 +01:00
michaelkatz
4f0a256cc9 Set offload mode preference through TrackSelectionParameters
Added piping to present offload support from the audio sink to the renderer and track selection. Applications can set offload mode preference and with both sink support and compatible track selection, renderer will be configured for offload.

PiperOrigin-RevId: 534450534
2023-05-24 16:00:42 +01:00
tonihei
c73955a4cd Improve MediaSource threading constraints documentation
And fix violation of this in AdsMediaSource.

#minor-release

PiperOrigin-RevId: 534441648
2023-05-24 15:59:22 +01:00
ibaker
5a5c3ce3bd Remove four deprecated AnalyticsListener decoder methods
Use the audio or video specific variants instead.

#minor-release

PiperOrigin-RevId: 534436644
2023-05-24 15:58:19 +01:00
ibaker
48348df58a Remove deprecated OfflineLicenseHelper constructor
Use the non-deprecated constructor instead.

#minor-release

PiperOrigin-RevId: 534426655
2023-05-24 15:57:20 +01:00
ibaker
ff0f1c4e9c Remove deprecated DownloadManager constructor
Use the constructor that takes an `Executor` instead.

#minor-release

PiperOrigin-RevId: 534370613
2023-05-24 15:53:22 +01:00
ibaker
594e9ac50d Remove deprecated DefaultLoadControl.Builder.createDefaultLoadControl()
Use `build()` instead.

#minor-release

PiperOrigin-RevId: 534348979
2023-05-24 15:50:05 +01:00
ibaker
cad1ac2eb5 Remove deprecated ExoPlayer.setHandleWakeLock(boolean)
Use `setWakeMode(int)` instead.

#minor-release

PiperOrigin-RevId: 534344010
2023-05-24 15:49:01 +01:00
huangdarwin
438ae0ed6a ExoPlayer: Add setVideoFrameProcessorFactory().
This allows apps to use a custom VideoFrameProcessor implementation for video
playback. This may be useful, for example, when outputting to a texture.

PiperOrigin-RevId: 534044831
2023-05-24 15:41:46 +01:00
tonihei
1fa790348e Untangle PlayerInfo/PlaybackInfo updates
The methods in ExoPlayerImpl and MediaControllerImplBase that determine
the new PlayerInfo/PlaybackInfo currently have a hard-to-reason-about
setup where the method generating the new info accesses other methods
that rely on the existing class field instead of working with the
passed in PlayerInfo/PlaybackInfo. This prevents reuse of the util
methods (e.g. for replaceMediaItems) because they access potentially
stale state.

This change untangles these methods a bit by making the util methods
either static or at least ensure that they don't rely on existing
class fields of PlayerInfo/PlaybackInfo. Overall, the change is a
complete no-op.

#minor-release

PiperOrigin-RevId: 534036633
2023-05-24 15:39:31 +01:00
ibaker
2b409da881 Remove deprecated zero-arg DefaultTrackSelector constructor
Use `DefaultTrackSelector(Context)` instead.

#minor-release

PiperOrigin-RevId: 533985937
2023-05-24 15:31:41 +01:00
sheenachhabra
b382a7c2da Move MdtaMetadataEntry class into container module
This class is to be shared between extractor, transformer
and muxer module.

PiperOrigin-RevId: 533490888
2023-05-24 15:29:23 +01:00
bachinger
2a6f893fba Set video size to 0/0 when video render is disabled
In terms of MCVR with a `VideoRendererEventListener`, the video size is set to
0/0 right after `onVideoDisabled()` is called and is set to the actual size as
soon as the video size is known after 'onVideoEnabled()`.

For ExoPlayer and in terms of the `Player` interface, `Player.getVideoSize()`
returns a video size of 0/0 when `Player.getCurrentTracks()` does not support
`C.TRACK_TYPE_VIDEO`. This is ensured by the masking behavior of
`ExoPlayerImpl` that sets an empty track selection result when the playing
period changes due to a seek or timeline removal.

When transitioning playback from a video media item to the next, or when
seeking within the same video media item, the renderer is not disabled.

#minor-release

PiperOrigin-RevId: 533479600
2023-05-24 15:28:20 +01:00
ibaker
d5f9cf4f19 Add singleVariant publishing config to all published gradle files
Docs:
* https://developer.android.com/build/publish-library/configure-pub-variants#single-pub-var
* https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/dsl/PublishingOptions

This resolves the following warning from Android Gradle Plugin 7.2.2 and
helps unblock the upgrade to AGP 8.0.1:

> Software Components will not be created automatically for Maven
> publishing from Android Gradle Plugin 8.0. To opt-in to the future
> behavior, set the Gradle property
> `android.disableAutomaticComponentCreation=true` in the
> `gradle.properties` file or use the new publishing DSL.
>
> Affected Modules: `lib-cast`, `lib-common`, `lib-container`,
> `lib-database`, `lib-datasource`, `lib-datasource-cronet`,
> `lib-datasource-okhttp`, `lib-datasource-rtmp`, `lib-decoder`,
> `lib-effect`, `lib-exoplayer`, `lib-exoplayer-all (legacy)`,
> `lib-exoplayer-dash`, `lib-exoplayer-hls`, `lib-exoplayer-ima`,
> `lib-exoplayer-rtsp`, `lib-exoplayer-smoothstreaming`,
> `lib-exoplayer-workmanager`, `lib-extractor`, `lib-media2 (legacy)`,
> `lib-mediasession (legacy)`, `lib-muxer`, `lib-session`,
> `lib-transformer`, `lib-ui`, `lib-ui-leanback`, `test-utils`,
> `test-utils-robolectric`

Issue: androidx/media#409
PiperOrigin-RevId: 533464133
2023-05-19 17:22:21 +01:00
ibaker
50112c685b Remove deprecated ExoPlayer.retry(), use prepare() instead.
#minor-release

PiperOrigin-RevId: 533463348
2023-05-19 17:21:17 +01:00
ibaker
b3db85133a Add android.namespace to all build.gradle files
This is a pre-requisite for the Android Studio upgrade assistant to
upgrade from AGP 7.2.2 to 8.0.1, otherwise it fails and complains
this is missing.

Issue: androidx/media#409
PiperOrigin-RevId: 533463246
2023-05-19 17:19:15 +01:00
tonihei
c44b3828ca Add FilteringMediaSource that only provides tracks of given types
This is useful for cases where only certain types (e.g. only video)
from a source are needed and other tracks should be filtered out
completely to avoid later track selection issues.

#minor-release

PiperOrigin-RevId: 533394658
2023-05-19 17:12:52 +01:00