19310 Commits

Author SHA1 Message Date
Googler
4c3ad641c0 Release StreamManager before calling AdsLoader.destroy()
PiperOrigin-RevId: 561678438
2023-08-31 09:37:27 -07:00
sheenachhabra
56acb3ee21 Move start export code into startInternal() method
For pause and resume we need to perform multiple intermediate exports.
So moved start() logic into a separate so that it can be reused from
different places with different Compositions and MuxerWrapper.

PiperOrigin-RevId: 561675472
2023-08-31 09:26:02 -07:00
ibaker
8af11a980a Remove duplication of various TestUtil methods
In most cases, the places that were trying to avoid a transitive
dependency on `lib-exoplayer` when this duplication was introduced [1]
are already depending on it again, except for `lib-container` where the
dep is added in this change.

In general it seems fine for the tests of module A to depend
(transitively or directly) on module B even where the prod code of
module A **does not** depend on module B.

[1] <unknown commit>

PiperOrigin-RevId: 561660371
2023-08-31 08:23:33 -07:00
samrobinson
6ecd3e9c2d Dump DumpableSamples list in track order.
Switch to SparseArray<List> rather than a Map<Integer, List>.

Track indices now determine sample list dumping, reducing flakiness.

PiperOrigin-RevId: 561658586
2023-08-31 08:15:41 -07:00
rohks
ab64e6f92d Fix remaining test_utils module nullness issues
#fixit

PiperOrigin-RevId: 561636758
2023-08-31 06:32:13 -07:00
Copybara-Service
bbfba27cac Merge pull request #594 from Tolriq:sink_format
PiperOrigin-RevId: 561611655
2023-08-31 04:08:54 -07:00
rohks
206a663dca Add functionality to transmit CMCD data using query parameters
Currently, we only support sending Common Media Client Data (CMCD) data through custom HTTP request headers, added capability to configure and transmit it as HTTP query parameters.

PiperOrigin-RevId: 561591246
2023-08-31 02:11:12 -07:00
ibaker
89f52dcb93 Rollback of 53b882d803
PiperOrigin-RevId: 561587445
2023-08-31 01:52:13 -07:00
rohks
3539b26e19 Add nullness annotations to SsMediaPeriod
#fixit

PiperOrigin-RevId: 561583025
2023-08-31 01:29:27 -07:00
ibaker
147cab89c3 Remove subtitle TODO from CapturingRenderersFactory
We're moving towards parsing subtitles before the `SampleQueue`, and we
already have subtitle playback assertions using `Player.Listener.onCues`
which is the most 'complete' place to assert subtitle output from. We
don't need to hook anything inside `TextRenderer`, so we can remove this
TODO.

PiperOrigin-RevId: 561418660
2023-08-30 12:38:48 -07:00
tonihei
ba4b96d2c1 Prevent forwarding of zero video size to Leanback
Leanback isn't prepared to handle these values and will throw
ArithmeticExceptions.

Issue: androidx/media#617
PiperOrigin-RevId: 561413740
2023-08-30 12:20:51 -07:00
Tolriq
4e93db4d0a Format passed to audioSink.configure is missing information.
AudioSink might require the identifying data and metadata to be able to take decisions.
2023-08-30 18:23:18 +01:00
ibaker
53b882d803 Add subsampleOffsetUs to Format.toLogString
This will help with debugging subtitle sync issues as it will show up in
track selection details emitted to logcat by `EventLogger`.

PiperOrigin-RevId: 561355836
2023-08-30 09:03:42 -07:00
ibaker
64792dfda2 Rollback of 25253698bc
PiperOrigin-RevId: 561352515
2023-08-30 08:53:49 -07:00
sheenachhabra
b37e37aa3c Pass MuxerWrapper to the TransformerInternal
For pause/resume feature, same MuxerWrapper needs to be
used across intermediate exports. So pass the MuxerWrapper
from Transformer.java
More specifically, when resume() is called
1. Create a MuxerWrapper and remux the previous
video samples (Export 1).
2. User the same MuxerWrapper and start processing
remaining video samples (Export 2).

PiperOrigin-RevId: 561325867
2023-08-30 06:45:39 -07:00
michaelkatz
cf3fd1f4dd Added condition to RtspMediaPeriod.isLoading to check RtspState
If a RtspMediaSource is used within a combining source like MergingMediaSource, then it could become stuck in a loop of calling continueLoading when the source has not actually started loading yet.

Issue: androidx/media#577
PiperOrigin-RevId: 561322900
2023-08-30 06:29:53 -07:00
ibaker
b4ee896847 Remove some spurious } from Player javadoc
Also use `@linkplain` in more places: If I was already touching a javadoc
block, I switched to `@linkplain` throughout the whole block.

PiperOrigin-RevId: 561320273
2023-08-30 06:16:37 -07:00
tofunmi
6a5d5aef92 Add limited ImageRenderer
At this stage, the image renderer is designed to be able to render one input stream containing one sample. The renderer supports seeking inside that stream, which is a no-op because the stream comprises for exactly one sample.

PiperOrigin-RevId: 561307859
2023-08-30 05:15:38 -07:00
ibaker
9ee45fc938 Add TrackOutput field in PngExtractor
Also re-jig some `checkNotNull` calls to satisfy the nullness checker
(remove an unneeded one, and add a new one).

Follow-up to discussion in bb214b19f9

PiperOrigin-RevId: 561295724
2023-08-30 04:08:56 -07:00
claincly
b466b06ace Split out VideoGraph and VideoFrameProcessingWrapper
More specifically, this CL

- Defines a VideoGraph interface
  - Adds a factory method, to hide the constructors
  - Separate out an initialize method that does the real work (following that constructor should not do real work)
  - The VideoGraph takes in a list of composition effects. For now, we only use the `Presentation`, if there is one in the list. This means we can take any number of Presentations now, but only the first one will be used.
- Moves the VideoFrameProcessingWrapper to its own file

PiperOrigin-RevId: 561059653
2023-08-29 09:54:43 -07:00
tofunmi
bb214b19f9 Sample metadata in the png extractor
PiperOrigin-RevId: 561049410
2023-08-29 09:17:05 -07:00
tianyifeng
32e367fabf Set groupKey for media notification in DefaultMediaNotificationProvider
By doing so, the media notification sent from DefaultMediaNotificationProvider won't be auto-grouped (https://developer.android.com/develop/ui/views/notifications/group#automatic-grouping) with the regular notifications sent from the other places in the app. As the result, when the customer attempts to dismiss the regular notifications (by swiping away), the media notification won't be dismissed as being in the same group.

Issue: androidx/media#549
PiperOrigin-RevId: 561047571
2023-08-29 09:10:12 -07:00
tianyifeng
5a6b88d751 De-flake MediaSessionCompatCallbackWithMediaControllerTest.onStop test
The `controller.prepare()` call can trigger the callback `onPrepare()`, however, this will count down the latch by one before the callback `onStop()` is triggered.

PiperOrigin-RevId: 560988209
2023-08-29 04:28:16 -07:00
tofunmi
667103f2bd Fix SequenceAssetLoader signalling End Of Video Input twice
PiperOrigin-RevId: 560170216
2023-08-25 12:46:50 -07:00
huangdarwin
99ae44efa4 Overlays: Create OverlayMatrixProvider.
Split this logic out from `OverlayShaderProgram`, to share logic like
this with `VideoCompositor`.

Also, remove the unused `context` parameter from `OverlayShaderProgram`

`VideoCompositor` will reuse `OverlayMatrixProvider`'s storing of the matrices,
though it may generate the matrices differently, since `OverlayShaderProgram`
applies this in the fragment shader, whereas `VideoCompositor` applies this in the
vertex shader.

PiperOrigin-RevId: 560142164
2023-08-25 11:05:03 -07:00
huangdarwin
6da70c842e Overlay: Rename alpha to alphaScale.
The actual logic scales the alpha, instead of setting it, so rename
this to what it does.

We would also prefer alpha to be scaled here, to not lose alpha information
(for example for PNGs with transparent regions).

PiperOrigin-RevId: 560121708
2023-08-25 10:00:50 -07:00
sheenachhabra
1f013afea8 Add Mp4ExtractorWrapper into Transformer module
For pause and resume feature we need to find the timestamp of
the last sync sample in an MP4 file. The Mp4ExtractorWrapper
provides an easy to use API on top of Mp4Extractor.

PiperOrigin-RevId: 560113112
2023-08-25 09:29:28 -07:00
tianyifeng
86f919e7d4 Fix flaky tests in PlaylistPlaybackTest
If the loading thread of the second media item progresses slow, then when the playback of the first item approaches to the end before the second item is prepared, the stream will be set "final" and the renderers are disabled during such transition. In this case, `AudioSink.handleDiscontinuity` never gets called, which introduces the flakiness into the `test_bypassOffThenOn`.

Similarly for `test_subtitle`, if the loading thread of extracting the subtitle is slow, then when the renderer attempts to queue the input buffer, the data hasn't been available in the stream. And when the extracting finished, the renderer already advanced to the time after the subtitle end time.

To de-flake the tests, we have to make sure that the period of the second item has fully loaded before starting the playback.

PiperOrigin-RevId: 560080119
2023-08-25 07:04:26 -07:00
huangdarwin
dccbc7e459 ExoPlayer: Remove tone-mapping workaround.
PiperOrigin-RevId: 560069496
2023-08-25 06:07:44 -07:00
huangdarwin
9810d6ae92 Overlay: Improve alpha documentation and extract reused variables
PiperOrigin-RevId: 560064663
2023-08-25 05:43:02 -07:00
huangdarwin
01689ba2ec Compositor: Queue bitmaps by timestamp.
This allows us to manage timestamps in one list, instead of both via
offsets/framerates, and a list.

PiperOrigin-RevId: 560053888
2023-08-25 04:44:48 -07:00
tonihei
7899241daf Fix period indexing for multi-period DASH DAI live streams
The period index was calculated relative to the contentTimeline
of the DAI stream, but then used with the full timeline of the
player. This means it currently only works when the stream is the
only or first item in the playlist.

Issue: androidx/media#571
PiperOrigin-RevId: 560023412
2023-08-25 02:05:46 -07:00
claincly
feae0245b9 Remove the textureReleaseCallback from textureOutputListerner
PiperOrigin-RevId: 559817280
2023-08-24 11:33:11 -07:00
sheenachhabra
d5f8487fe2 Add pause and resume button in demo app
Currently the resume button will restart the export from
the beginning.

PiperOrigin-RevId: 559787856
2023-08-24 10:05:51 -07:00
claincly
28fd43617e Factor out VideoFrameProcessor logic
PiperOrigin-RevId: 559780905
2023-08-24 09:42:21 -07:00
huangdarwin
cd0b7d9e29 Transformer: Document not supporting setTextureOutput on VFP Factory.
PiperOrigin-RevId: 559760003
2023-08-24 08:25:33 -07:00
claincly
8c1bedb483 Remove unnecessary types in lambda
PiperOrigin-RevId: 559745329
2023-08-24 07:21:52 -07:00
sheenachhabra
a6f9fefb88 Add setSequences method to Composition.Builder
For pause and resume feature, we need to buildUpon the
original composition and then set the modified sequences.

PiperOrigin-RevId: 559723694
2023-08-24 05:35:06 -07:00
ibaker
2eafa570e9 Update README with instructions for Gradle Kotlin DSL
Put the Kotlin option first, with Groovy as a a second alternative.

Issue: google/ExoPlayer#11275

#minor-release

PiperOrigin-RevId: 559714938
2023-08-24 04:47:37 -07:00
claincly
930e538aca Allow re-configuring DVFP in a (mostly) non-blocking manner
The first call to method `registerInputStream` doesn't block.

Later successive calls to the method blocks until the previous register call
finishes.

PiperOrigin-RevId: 559694490
2023-08-24 02:55:54 -07:00
rohks
80495ddf9c Add nullness annotations to Representation
#fixit

PiperOrigin-RevId: 559690973
2023-08-24 02:38:11 -07:00
sheenachhabra
5276f797e5 Add buildUpon() and setMediaItem() method in EditedMediaItem
For pause/resume feature we need to build upon original EditedMediaItem
and set a modified MediaItem to it.

PiperOrigin-RevId: 559484129
2023-08-24 09:32:09 +01:00
rohks
e2ee8ae1b0 Add nullness annotations to DefaultDashChunkSource
#fixit

PiperOrigin-RevId: 559405572
2023-08-24 09:28:36 +01:00
rohks
2ad37d2e37 Add nullness annotations to MediaPeriodQueue
#fixit

PiperOrigin-RevId: 559395027
2023-08-24 09:27:43 +01:00
tofunmi
404a259295 Remove queueInputBitmap by framerate and duration interfaces
PiperOrigin-RevId: 559384011
2023-08-24 09:25:49 +01:00
samrobinson
64c2406c1e Use TestUtil value for frame count.
PiperOrigin-RevId: 559380901
2023-08-24 09:21:32 +01:00
tonihei
25cd13b3a2 Remove unused values
PiperOrigin-RevId: 559357691
2023-08-24 09:20:33 +01:00
rohks
bfa32b3998 Add nullness annotations to MediaCodeAudioRenderer
#fixit

PiperOrigin-RevId: 559175846
2023-08-24 09:19:34 +01:00
samrobinson
ff39726368 Remove redundant "aac" tag for dump file.
PiperOrigin-RevId: 559147235
2023-08-24 09:17:32 +01:00
ibaker
9533f5cd1c RtspMediaPeriod: Use a new ExtractorOutput for each SampleQueue
This removes concurrent access from `rtspLoaderWrappers`. Previously
there was a race between the playback thread clearing & re-adding
entries to this list in `retryWithRtpTcp()`, and the loading thread
accessing the entries in `InternalListener.track()` (implemented from
`ExtractorOutput`).

This change means each `ExtractorOutputImpl` uses exactly one
`SampleQueue` for its one `TrackOutput`. When the `RtspLoaderWrapper`
instances are replaced in `retryWithRtpTcp()`, any stale instances will
only be able to access their own (also stale) `SampleQueue` instances
(vs before, where the stale `ExtractorOutput` could accidentally access
'new' `SampleQueue` instances via the `rtspLoaderWrappers` field).

As well as fixing a race condition in the prod code, this also de-flakes
`RtspPlaybackTest`.

#minor-release

PiperOrigin-RevId: 559130479
2023-08-24 09:16:36 +01:00