567 Commits

Author SHA1 Message Date
michaelkatz
6b7b97ccfe Requiring offload disables any tracks that are non-compatible
With `AudioOffloadModePreference` `AUDIO_OFFLOAD_MODE_PREFERENCE_REQUIRED`, the `DefaultTrackSelector` will select a single audio track that it finds is offload compatible. If not any audio track is supported in offload, then no track will be selected.

PiperOrigin-RevId: 537877183
2023-06-06 18:03:02 +00:00
Tofunmi Adigun-Hameed
c7a41a7b41 Merge pull request #426 from cedricxperi:dtsx-direct-playback-fix
PiperOrigin-RevId: 537835423
2023-06-06 17:58:57 +00:00
ibaker
7e6dae7b31 Remove exoplayer2-only javadoc machinery from media3
This introduces whitespace-only changes in exoplayer2 due to the way
copybara stripping works.

PiperOrigin-RevId: 537296933
2023-06-05 09:47:58 +00:00
Cedric T
b4ff9031c7 Split AudioOffloadSupport.DEFAULT_UNSUPPORTED check into 2 if statements. 2023-06-02 15:29:12 +00:00
Cedric T
8ab1a68939 Return offload unsupported for DTSX P2 and API < 34. 2023-06-02 15:29:12 +00:00
Cedric T
19676084e6 Fix DTS:X P2 offload playback. 2023-06-02 15:29:12 +00:00
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