16848 Commits

Author SHA1 Message Date
claincly
47d63504c2 Destroy eglSurface in FrameProcessor
Previously, FrameProcessor never had the usecase in which the output surface
is replaced, while previewing introduced this usecase.

When switching output surfaces, we need to destroy the EGL Surface linked to the
surface that is being swapped out, because an EGL surface is linked to the EGL
display (which is not destroyed even when releasing FrameProcessor).

A GL exception will be thrown in the following scenario if we don't destroy the
EGL surface:

1. Creates a Surface, the surface is identified by address 0x11
2. Sets Surface(0x11) on FrameProcessor. Eventually an EGL surface is created
  to wrap Surface(0x11)
3. Release FrameProcess, this releases the EGL context
4. Instantiate a new FrameProcessor, sets Surface(0x11) as the output
5. When FrameProcessor creates an EGL surface to wrap Surface(0x11), GL throws
  an exception, becasue Surface(0x11) has previouly been connected to an EGL
  surface.

PiperOrigin-RevId: 489590072
2022-11-21 15:58:13 +00:00
tonihei
b81cd08271 Add remaining state and getters to SimpleBasePlayer
This adds the full Builders and State representation needed to
implement all Player getter methods and listener invocations.

PiperOrigin-RevId: 489503319
2022-11-21 15:52:36 +00:00
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
bachinger
4adfb5f50f Add pending sequence before sending the remote session task
#minor-release

PiperOrigin-RevId: 488885069
(cherry picked from commit e1eb8b6dd89fac48d62e80e95c0e959815720b35)
2022-11-17 10:06:29 +00:00
tonihei
8cc37db8e5 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 1143edc59ac96ec8524e8203d9445dbb0f006630)
2022-11-17 10:06:29 +00:00
christosts
c22c2bf0c0 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 491b13622e79f5c2ef84771b1a29e40f47aca653)
2022-11-17 10:06:29 +00:00
tonihei
dab5b3c152 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

PiperOrigin-RevId: 488645089
(cherry picked from commit 1def68bf3c00035aad0821d3997187317ce099dc)
2022-11-17 10:06:25 +00:00
tonihei
bf67d1cc11 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 7a7d08343af13a969744df2a70eb67adae3254b8)
2022-11-17 10:04:35 +00:00
ibaker
e4ff4a3b04 Reformat demo build.gradle file
PiperOrigin-RevId: 488376715
(cherry picked from commit adc993dc5713b92f40ada6683bfa0a532bfb75ed)
2022-11-17 10:04:35 +00:00
ibaker
50112671c0 Add @ForOverride to DecoderAudioRenderer protected methods
PiperOrigin-RevId: 487779266
(cherry picked from commit 9d6d30d81ddb7b34e8a54a7fa0f0f6a98655817a)
2022-11-17 10:04:35 +00:00
ibaker
dafbbf25e6 Reformat demo build.gradle file
PiperOrigin-RevId: 487539107
(cherry picked from commit 62d6c303c1a9fd56e27ffc7ad7cc39f92f957bd7)
2022-11-17 10:04:35 +00:00
tonihei
4296a8af88 Ensure listener invocations use final state variable.
The MediaControllerImplBase listener invocations currently use the
class member state that can change if one of the listener method
implementations changes the state recursively.

Updating the listener invocations to use a final local variable
ensures all listeners get consistent updates.

PiperOrigin-RevId: 487503373
(cherry picked from commit 33bea391d42cb5669e6d2c97c0553f3c0c63467b)
2022-11-17 10:04:25 +00: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
bachinger
e1eb8b6dd8 Add pending sequence before sending the remote session task
#minor-release

PiperOrigin-RevId: 488885069
2022-11-16 12:19:48 +00:00
tianyifeng
cfe36af847 Update targetSdkVersion of demo session app to appTargetSdkVersion
PiperOrigin-RevId: 488884403
2022-11-16 12:18:46 +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
claincly
b4efd20843 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:17:34 +00:00
huangdarwin
53cff556bf 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:16:21 +00:00
tonihei
1143edc59a 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:15:05 +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