16333 Commits

Author SHA1 Message Date
kimvde
19bf020d84 Build TransformationResult only when transformation succeeded
PiperOrigin-RevId: 489442518
2022-11-21 15:46:56 +00:00
christosts
d9d716869b Pass correct frame size for passthrough playback
When estimating the AudioTrack min buffer size, we must use a PCM
frame of 1 when doing direct playback (passthrough). The code was
passing -1 (C.LENGTH_UNSET).

PiperOrigin-RevId: 489238392
2022-11-21 15:29:59 +00:00
tonihei
cbcdbfe021 Add additional codecs to the eosPropagationWorkaround list.
Issue: google/ExoPlayer#10756
PiperOrigin-RevId: 489236336
2022-11-21 15:24:23 +00:00
ibaker
d4c9199a61 Throw exception if a released player is passed to TestPlayerRunHelper
I considered moving this enforcement inside the ExoPlayerImpl
implementation, but it might lead to app crashes in cases that apps
(incorrectly) call a released player, but it wasn't actually causing a
problem.

PiperOrigin-RevId: 489233917
2022-11-21 15:18:37 +00:00
ibaker
058cba95d4 Remove @hide javadoc annotation from ExoPlayer GitHub
This tag is only understood by Dackka, which is used to generate the media3 javadoc.

PiperOrigin-RevId: 489233200
2022-11-21 15:12:52 +00:00
tofunmi
51e4a07b21 Reordering views for consistency in transformer demo app
PiperOrigin-RevId: 489216085
2022-11-21 15:07:21 +00:00
tofunmi
934536218c Fix video disappearing when the app is brought out of the background
PiperOrigin-RevId: 489212224
2022-11-21 15:01:43 +00:00
tonihei
c1fd03df74 Mark broadcast receivers as not exported
They are called from the system only and don't need to be exported
to be visible to other apps.

PiperOrigin-RevId: 489210264
2022-11-21 14:56:11 +00:00
michaelkatz
7e82d4ec44 Filter bogus AndroidX core jar file when creating javadoc
#minor-release

PiperOrigin-RevId: 489202167
2022-11-21 14:50:39 +00:00
kimvde
289a0e089e Make sure the AudioProcessors do not receive AP.EMPTY_BUFFER
PiperOrigin-RevId: 489174645
2022-11-21 14:46:26 +00:00
kimvde
59badba5fb Make sure Muxer is always accessed from playback thread
This thread will become the Transformer internal thread.

PiperOrigin-RevId: 489168435
2022-11-21 14:42:47 +00:00
kimvde
b23559456e Fix audio slow motion flattening
PiperOrigin-RevId: 488981968
2022-11-21 14:38:53 +00:00
Googler
79b809b556 Add setPlaybackLooper ExoPlayer builder method
The method allows clients to specify a pre-existing thread
to use for playback. This can be used to run multiple ExoPlayer
instances on the same playback thread.

PiperOrigin-RevId: 488980749
2022-11-21 14:35:11 +00:00
Googler
f52bb274b8 Fix NPE when listener is not set
PiperOrigin-RevId: 488970696
2022-11-21 14:31:26 +00:00
kimvde
ea7e8cff3a Refactor transformation completion
PiperOrigin-RevId: 488929446
2022-11-21 14:27:00 +00:00
Alexander Capehart
c96b55029d
Add ID3v2 multi-value tests
Add tests for ID3v2 multi-value text frames.
2022-11-20 18:28:46 -07:00
Alexander Capehart
4510210ad7
Merge branch 'multi-value-id3v2' into dev-v2 2022-11-20 18:05:45 -07:00
Alexander Capehart
d8729e552c
Fix second-order issues
Fix second-order issues stemming from the addition of multi-value tags.
2022-11-20 18:02:45 -07:00
tonihei
6108c053ce Rename getVideoSurfaceSize to getSurfaceSize
This better matches the callback name (onSurfaceSizeChanged) and
probably cause less confusion with getVideoSize.

PiperOrigin-RevId: 488669786
(cherry picked from commit 8438daca1f8cbea24aa414ee500044baf1a28367)
2022-11-17 10:03:11 +00:00
christosts
db2ab52f4f Set valid channel masks for 8 and 12 channels on all Android versions
Util.getAudioTrackChannelConfig() maps a channel count to a
channel mask that is passed to AudioTrack. The method expected that
playback of 8-channel audio is possible from Android 5.1 and playback of
12-channel audio is only possible from Android 12L. However, there is no
restriction on the upper number of channels that can be passed to the
AudioTrack. google/ExoPlayer#10701 is an example where the audio decoder
outputs 12 channels on an Android 10.

This change removes the restrictions for 8 and 12 channels. Note, we still
do not support playback of arbitrary number of channels as it would require
further changes to DefaultAudioSink.

#minor-release

Issue: google/ExoPlayer#10701
PiperOrigin-RevId: 488659831
(cherry picked from commit 1b24e6fd14774d5c8b3e7b8084b30204581d13ce)
2022-11-17 10:03:11 +00:00
tonihei
88804ddf41 Mark iterationFinished when triggering release event.
When we currently trigger the iteration finished event during the
release, we don't mark the event as triggered. This means that
someone can trigger another release from within the callback,
which then tries to resend the event.

Issue: google/ExoPlayer#10758

#minor-release

PiperOrigin-RevId: 488645089
(cherry picked from commit 3e5103a3e55e2dc545b4a2442beaa49f307ecfdc)
2022-11-17 10:03:11 +00:00
tonihei
5def6e497d Calculate SSAI window duration for live periods with unset duration.
We currently skip this calculation entirely, but it can be added by
calculating the window duration using the wrapped window's duration
and the provided AdPlaybackState.

Issue: google/ExoPlayer#10764
PiperOrigin-RevId: 488614767
(cherry picked from commit 20151b9930f1b54d7894ec41465a2e85df92462d)
2022-11-17 10:03:11 +00:00
ibaker
54d3dbf014 Reformat demo build.gradle file
PiperOrigin-RevId: 488376715
(cherry picked from commit 30b73c85c53cce0d21e8df21ee680406aa0ad1d7)
2022-11-17 10:03:11 +00:00
ibaker
704e84f62d Add @ForOverride to DecoderAudioRenderer protected methods
PiperOrigin-RevId: 487779266
(cherry picked from commit a34fdcf168a3704babdb6b7d96c60344ab89c17c)
2022-11-17 10:03:11 +00:00
ibaker
dd49f2455f Reformat demo build.gradle file
PiperOrigin-RevId: 487539107
(cherry picked from commit 0383b723b7c26da107a719a16a05da459ae971ee)
2022-11-17 10:03:11 +00:00
psharma
0feace5faf Detect if less than 24 audio sampling frequency bits are present.
ISO ISO14496-3 allows setting of an arbitrary audio sampling frequency in compliant streams.
When samplingFrequencyIndex is set to 0xf (escape value) we expect no less than 24 bits
to read sampling informtion from (See section 1.6.2.1)
2022-11-16 14:18:01 -08:00
claincly
f2a63e9ddf Fix availableFrameCount semantic
`availableFrameCount` tracks the number of frames that is avilable on the
`SurfaceTexture`, but haven't been used (by `updateTexImage()`) yet. Thus
semantically this counter should only be decremented after calling
`updateTexImage()`, not before it.

Also reworded `getPendingFrameCount()` javadoc, "external texture" is an
internal state that is not publicised anywhere.

PiperOrigin-RevId: 488765174
2022-11-16 12:43:49 +00:00
huangdarwin
79cc8a5956 HDR: Use HdrMode IntDef to select HDR output mode.
This is a simpler API to use than the prior tone mapping, HDR editing, and
forceInterpretHdrAsSdr options

PiperOrigin-RevId: 488742391
2022-11-16 12:38:01 +00:00
tonihei
8438daca1f Rename getVideoSurfaceSize to getSurfaceSize
This better matches the callback name (onSurfaceSizeChanged) and
probably cause less confusion with getVideoSize.

PiperOrigin-RevId: 488669786
2022-11-16 12:32:35 +00:00
christosts
1b24e6fd14 Set valid channel masks for 8 and 12 channels on all Android versions
Util.getAudioTrackChannelConfig() maps a channel count to a
channel mask that is passed to AudioTrack. The method expected that
playback of 8-channel audio is possible from Android 5.1 and playback of
12-channel audio is only possible from Android 12L. However, there is no
restriction on the upper number of channels that can be passed to the
AudioTrack. google/ExoPlayer#10701 is an example where the audio decoder
outputs 12 channels on an Android 10.

This change removes the restrictions for 8 and 12 channels. Note, we still
do not support playback of arbitrary number of channels as it would require
further changes to DefaultAudioSink.

#minor-release

Issue: google/ExoPlayer#10701
PiperOrigin-RevId: 488659831
2022-11-16 12:28:48 +00:00
tonihei
3e5103a3e5 Mark iterationFinished when triggering release event.
When we currently trigger the iteration finished event during the
release, we don't mark the event as triggered. This means that
someone can trigger another release from within the callback,
which then tries to resend the event.

Issue: google/ExoPlayer#10758

#minor-release

PiperOrigin-RevId: 488645089
2022-11-16 12:25:08 +00:00
samrobinson
01e0db62f3 Utilize AudioProcessingPipeline in Transformer.
Provides an API for applications to set AudioProcessors for use
in Transformer.

PiperOrigin-RevId: 488621242
2022-11-16 12:21:36 +00:00
tonihei
20151b9930 Calculate SSAI window duration for live periods with unset duration.
We currently skip this calculation entirely, but it can be added by
calculating the window duration using the wrapped window's duration
and the provided AdPlaybackState.

Issue: google/ExoPlayer#10764
PiperOrigin-RevId: 488614767
2022-11-16 12:17:47 +00:00
kimvde
4477eec38a Move progress computation to TransformerInternal
AssetLoader will have multiple implementations and be customizable. We
want to remove the responsibility of computing the progress from this
class and centralize the logic in TransformerInternal.

PiperOrigin-RevId: 488608890
2022-11-16 12:14:07 +00:00
samrobinson
52f3ee81d4 Handle buffers in DefaultAudioSink with AudioProcessingPipeline.
PiperOrigin-RevId: 488412695
2022-11-16 12:10:21 +00:00
huangdarwin
095c52e7ba GL: Rename getEglSurface to createEglSurface.
Per documentation, eglCreateWindowSurface creates a new EGL window surface.

getEglSurface suggests instead that a pre-existing surface is returned.

https://registry.khronos.org/EGL/sdk/docs/man/html/eglCreateWindowSurface.xhtml

PiperOrigin-RevId: 488377423
2022-11-14 18:08:57 +00:00
ibaker
30b73c85c5 Reformat demo build.gradle file
PiperOrigin-RevId: 488376715
2022-11-14 17:36:35 +00:00
huangdarwin
53978104e6 HDR: For HDR videos, enableHdrEditing by default.
Previously, tone-mapping was the default.

PiperOrigin-RevId: 488362209
2022-11-14 17:31:08 +00:00
huangdarwin
afb7926ab6 Docs: Update broken bitmap test README link.
Also, update API level per the test now using API 31

PiperOrigin-RevId: 488359535
2022-11-14 17:26:12 +00:00
huangdarwin
680f0c3af7 HDR: Add public HLG test file.
Add an HLG Pixel 7 Pro video and its associated format for testing.

PiperOrigin-RevId: 488353926
2022-11-14 17:22:26 +00:00
kimvde
6d266bfc0d Remove asyncErrorListener
PiperOrigin-RevId: 488310077
2022-11-14 17:18:45 +00:00
samrobinson
3f1b1b70ed Remove checkNotNull from Transformer build method.
PiperOrigin-RevId: 487811903
2022-11-14 17:15:01 +00:00
huangdarwin
681de4e763 HDR: Require transcoding when forceInterpretHdrVideoAsSdr is set.
PiperOrigin-RevId: 487786326
2022-11-14 17:11:18 +00:00
michaelkatz
1eb8a6b36e Changed decoder list sort to order by functional support of format
Added new method to check if codec just functionally supports a format. Changed getDecoderInfosSortedByFormatSupport to use new function to order by functional support. This allows decoders that only support functionally and are more preferred by the MediaCodecSelector to keep their preferred position in the sorted list.

UnitTests included
-Two MediaCodecVideoRenderer tests that verify hw vs sw does not have an effect on sort of the decoder list, it is only based on functional support

Issue: google/ExoPlayer#10604
PiperOrigin-RevId: 487779284
2022-11-14 17:07:34 +00:00
ibaker
a34fdcf168 Add @ForOverride to DecoderAudioRenderer protected methods
PiperOrigin-RevId: 487779266
2022-11-14 17:03:50 +00:00
ibaker
0383b723b7 Reformat demo build.gradle file
PiperOrigin-RevId: 487539107
2022-11-14 16:59:48 +00:00
Dong Van Hung
0d2e4377ef Added a method in DownloadService to support for Clear all DownloadManagerHelper to restart the new service. 2022-11-14 09:34:27 +09:00
kimvde
acfea39235 Fix bug where streamOffsetUs is passed instead of streamPositionUs
Also make order of streamStartPositionUs and streamOffsetUs consistent

PiperOrigin-RevId: 487511633
2022-11-10 16:17:50 +00:00
ibaker
4949fbe5ed Add missing IntDef on MediaSource.Factory.getSupportedTypes overrides
Without this the annotation isn't shown in javadoc (same in Dackka)

No annotation:
https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/source/DefaultMediaSourceFactory.html#getSupportedTypes()

Annotation present:
https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/source/MediaSource.Factory.html#getSupportedTypes()

#minor-release

PiperOrigin-RevId: 487498450
2022-11-10 16:12:02 +00:00
ibaker
7cb2e11303 Configure Dackka to generate javadoc for protected methods
#minor-release

PiperOrigin-RevId: 487497923
2022-11-10 16:06:27 +00:00