1192 Commits

Author SHA1 Message Date
Patrik Aradi
52adaf8d26 implement top down approach for passing input source id 2024-05-08 00:07:38 +00:00
Patrik Aradi
177f1f33d0 Fix indeterminate z-order of EditedMediaItemSequences by passing sequenceIndex when registeringInput 2024-05-08 00:07:37 +00:00
Cedric T
de2bc944ca Fix ENCODING_DTS_UHD_P2 Issue 2024-05-07 12:05:37 +00:00
bachinger
4841f8f8b3 Run ExoPlayerTest with preloading enabled and disabled
Replace with parametrized test when  https://issuetracker.google.com/316040980
is resolved.

PiperOrigin-RevId: 631096883
2024-05-06 09:58:09 -07:00
bachinger
0ab6ea5668 Add preload pool to media period MediaPeriodQueue
The pool is created and the queue uses holder instances found
to enqueue. No preloading is done yet though.

PiperOrigin-RevId: 631053172
2024-05-06 08:07:49 -07:00
kimvde
4a54db7cc7 Remove VideoSinkProvider class member from MCVR
PiperOrigin-RevId: 631037709
2024-05-06 07:31:02 -07:00
kimvde
a03f30bea9 Add surface setters on VideoSink
PiperOrigin-RevId: 631025710
2024-05-06 06:31:39 -07:00
kimvde
506944dcfd Move effect setters to VideoSink
PiperOrigin-RevId: 631011252
2024-05-06 05:23:54 -07:00
kimvde
6add3a1dba Add release method to VideoSink
PiperOrigin-RevId: 630958612
2024-05-06 01:01:40 -07:00
jbibik
8a8dfbed71 Fix link typo with missing #
Without it, the DAC doesn't render the full sentence. And the link is not actually linking to the proper constructors.

#minor-release

PiperOrigin-RevId: 630395271
2024-05-03 08:22:10 -07:00
kimvde
000d1ff0a6 Always set effects surface and resolution together in MCVR
This change is for simplicity.

PiperOrigin-RevId: 630066664
2024-05-02 08:12:19 -07:00
claincly
2e3c3eb678 Fix wrong output timestamp in seeking
Set `VideoSink`'s offset during seeking in `MCVR.onPositionReset()`

This one is necessary in some cases, where `onProcessedStreamChange()` is not
invoked during a seek. For example, when seeking when playback has ended.

PiperOrigin-RevId: 630056723
2024-05-02 07:29:57 -07:00
kimvde
d059e97b28 Use VideoSink directly in MCVR where possible
PiperOrigin-RevId: 630030889
2024-05-02 05:24:13 -07:00
tonihei
0893275841 Add RendererCapabilities.isFormatSupported helper method
This makes the same method that currently exists as
DefaultTrackSelector.isSupported more widely available
as a utility.

PiperOrigin-RevId: 629991830
2024-05-02 02:06:56 -07:00
kimvde
ec9b38b817 Simplify VideoSinkProvider surface handling in MCVR
PiperOrigin-RevId: 629975032
2024-05-02 00:50:39 -07:00
kimvde
bdb8d8e329 Make VideoSink final in MCVR
This is to be able to set some values on the VideoSink before it's
initialized (for example, the effects)

PiperOrigin-RevId: 629966220
2024-05-02 00:06:39 -07:00
Copybara-Service
d3850722d3 Merge pull request #1300 from hakonschia:fix-dash-thumbnails-cropping
PiperOrigin-RevId: 629774942
2024-05-01 11:08:53 -07:00
microkatz
acc5a3bcd3 Updated non-Square thumbnail unit test to contain non-Square thumbnails 2024-05-01 16:26:58 +00:00
microkatz
6d62d3437c Format with google-java-format 2024-05-01 16:26:58 +00:00
Håkon Schia
cf41ba3a3d Create new ImageRenderer in render_tiledImageNonSquare_rendersAllImagesToOutput to allow it to use a separate bitmap from the other tests 2024-05-01 16:26:58 +00:00
Håkon Schia
e27f527ed1 Revert changes in ImageRenderTest from 3a030da83b49b9f6c0e414955b543433221d4c41 and create a new unit test for non square images instead 2024-05-01 16:26:58 +00:00
Håkon Schia
9ced27a030 Use inputFormat.tileCountHorizontal to calculate tileStartXCoordinate for cropping the correct tile from outputBitmap
To find the column of an index in a matrix the formula "column = index % width" should be used, not "column = index % height"

If inputFormat.tileCountVertical was equal to 1 then it would not throw an error, but instead result in the first tile of the bitmap always being returned. If inputFormat.tileCountVertical was larger than 1 then Bitmap.createBitmap() would throw an error as it would attempt to go outside the bounds of outputBitmap

ImageRenderTest has been updated to test for 2x3 images so that tileCountVertical != tileCountHorizontal. These tests passed previously because they were equal, so using tileCountVertical produced the same results as tileCountHorizontal
2024-05-01 16:26:57 +00:00
rohks
feb512544a Fix issue with updating the last rebuffer time
The last rebuffer time was being updated erroneously, even in the absence of rebuffering events, resulting in incorrect `bs` (buffer starvation) key in CMCD.

Issue: androidx/media#1124
PiperOrigin-RevId: 629731796
2024-05-01 08:35:02 -07:00
rohks
e25bd07a81 Parse initialization data from AV1 tracks
Initialization data is not passed to `MediaCodecRenderer` as it is not required for playing AV1 video.

See: https://developer.android.com/reference/android/media/MediaCodec#CSD
PiperOrigin-RevId: 629729301
2024-05-01 08:23:43 -07:00
tonihei
1af86d4c4d Fix issue where subtitles starting before a seek position are skipped
These subtitles were skipped because they are marked as shouldBeSkipped
based on their timestamps. The fix removes this flag entirely in
SimpleSubtitleDecoder because TextRenderer handles potential skipping
if needed.

PiperOrigin-RevId: 629717970
2024-05-01 07:34:40 -07:00
rohks
5805287620 Remove an extra call to updateRebufferingState method
`updateRebufferingState` is invoked immediately preceding this `if-else`, with no alteration of state occurring in between, making this invocation unnecessary.

PiperOrigin-RevId: 629694531
2024-05-01 05:13:15 -07:00
tonihei
703b9368c3 Add ExoPlayer.setPriority
This lets apps update the task manager priority and send the
priority message to all renderers so that they can adjust their
resources if needed.

PiperOrigin-RevId: 629426058
2024-04-30 08:49:16 -07:00
tonihei
a49b625cc5 Add renderer message to update priority
This can be used to set the new codec importance values.

PiperOrigin-RevId: 629073176
2024-04-29 08:17:37 -07:00
ibaker
b0e48175f0 Add ID3 TCON genre to MP3 test samples
This change adds a 'free-form' text genre to the existing
`bear-id3.mp3` sample, and adds a new sample with a 'numeric' genre ([9
is Metal](https://mutagen-specs.readthedocs.io/en/latest/id3/id3v2.4.0-frames.html#appendix-a-genre-list-from-id3v1)).

The samples were modified with:

```shell
$ id3edit --set-genre "Gorpcore" bear-id3.mp3
$ id3edit --set-genre "9" bear-id3-numeric-genre.mp3
```

Reading the numeric genre with `exiftool` shows the mapping back to
'Metal':

```
$ exiftool bear-id3-numeric-genre.mp3 | grep Genre
Genre                           : Metal
```

The playback dumps don't contain the genre because it's not yet
propagated to `MediaMetadata.genre`. That is done in a follow-up
change.

Issue: androidx/media#1305
PiperOrigin-RevId: 629043506
2024-04-29 06:03:39 -07:00
bachinger
d292f80926 Remove MSG_DO_SOME_WORK when requesting playlist update
This removes a window of inconsistency between the timeline
known to the player and the most recent timeline in the
`MediaSourceList` by removing the `MSG_DO_SOME_WORK` when
sending `MSG_PLAYLIST_UPDATE_REQUESTED`. `MSG_DO_SOME_WORK`
is then sent again when the playlist update is requested.

PiperOrigin-RevId: 629021752
2024-04-29 04:06:13 -07:00
bachinger
38813dd30e Migrate DefaultAnalyticsCollectorTest to use the playlist API
Some test cases are still using `ConcatenatingMediaSource`
even if they do not test specific features of the concatenating
source. Apparently these test have a slightly different timing
behavior when it comes to updating the `MediaPeriodQueue` and
emitting change events with analytics.

Using the playlist API ensures testing the future-proof code path.

PiperOrigin-RevId: 628413460
2024-04-26 08:35:58 -07:00
claincly
4be30bb308 Support seeking when playing back a composition
PiperOrigin-RevId: 628382976
2024-04-26 06:06:23 -07:00
ibaker
d76ee54ca6 Add two MP4 samples with metadata
The first has a string genre, and various other values set, generated
from `sample.mp4` with the command below [1].

The second has a numeric genre, to test `gnre` atom parsing. This
parsing is currently broken, the fix is in a follow-up change. This
file was also generated from `sample.mp4` with the command below [2].

This change also includes `CommentFrame.text` in its `toString`
representation, otherwise there's no difference between e.g. different
levels of `ITUNESADVISORY` in the extractor dump files.

Issue: androidx/media#1305

-----

[1]

```shell
$ AP_PADDING="DEFAULT_PAD=0" \
    AtomicParsley sample.mp4 \
    --artist "Test Artist" \
    --album "Test Album" \
    --tracknum 2/12 \
    --disk 2/3 \
    --year 2024  \
    --genre "Gorpcore" \
    --bpm 120 \
    --compilation true \
    --advisory clean \
    --gapless true \
    --sortOrder artist "Sorting Artist" \
    --sortOrder album "Sorting Album" \
    --preventOptimizing \
    -o sample_with_metadata.mp4
```

[2]
```shell
$ AP_PADDING="DEFAULT_PAD=0" \
    AtomicParsley sample.mp4 \
    --genre "Metal" \
    --preventOptimizing \
    -o sample_with_numeric_genre.mp4
```

PiperOrigin-RevId: 628345458
2024-04-26 02:53:33 -07:00
kimvde
bf266c96a9 Set stream offset on video sink
PiperOrigin-RevId: 628084729
2024-04-25 08:32:23 -07:00
kimvde
a6eef7b8d8 Set clock on VideoSink
PiperOrigin-RevId: 628083794
2024-04-25 08:28:14 -07:00
kimvde
00ce572a4f Always reconfigure video sink for video after image
Before this CL, the video sink was not reconfigured for the second video
in a sequence with video-image-video. For example, the stream offset
and listener were not set for the second video.

PiperOrigin-RevId: 628065991
2024-04-25 07:19:07 -07:00
tonihei
ed1cf35f30 Extend async crypto flag to audio
This is only supported from API 35

PiperOrigin-RevId: 628014091
2024-04-25 03:07:44 -07:00
tonihei
f9ea4f0444 Fix error-prone warning comparing CharSequence with String
PiperOrigin-RevId: 627679923
2024-04-24 04:11:56 -07:00
kimvde
579386ff27 Set VideoFrameMetadataListener on VideoSink
PiperOrigin-RevId: 627652670
2024-04-24 02:04:23 -07:00
tonihei
bf9f8a3719 Treat playback after stop as a new playback
This implies we should report it as STATE_JOINING_FOREGROUND
instead of STATE_BUFFERING.

PiperOrigin-RevId: 627406584
2024-04-23 09:09:15 -07:00
kimvde
8da6938782 Always initialize VideoSink in renderer
Instead of initializing the video sink outside the renderer with an
empty format for composition preview, we initialize it in the renderer
with the input format for video.

PiperOrigin-RevId: 627313708
2024-04-23 02:20:18 -07:00
kimvde
e3caed1441 Move VideoSinkProvider.initialize to VideoSink
PiperOrigin-RevId: 627290721
2024-04-23 00:37:01 -07:00
claincly
716aedd019 Fix image up-side-down in when playing a Composition
When playing a Composition, the color transfer of an image is incorrectly
passed down to be SMPTE170M, but it should be SRGB.

PiperOrigin-RevId: 626425396
2024-04-19 11:37:15 -07:00
bachinger
09f2cda43c Promote IMA DAI API to stable
PiperOrigin-RevId: 626064956
2024-04-18 09:49:48 -07:00
andrewlewis
2f8ce053b9 Avoid crash when testing spatialization of high channel count audio
For audio with more than 12 channels, no channel mask was determined, which
meant that the code to check spatializability would throw because of creating
an invalid audio format.

Return early if the channel mask was invalid instead (and assume spatialization
isn't possible).

PiperOrigin-RevId: 625618683
2024-04-17 03:03:01 -07:00
Ian Baker
e13d7e632e Fix javadoc link reference 2024-04-16 11:49:06 +01:00
Ian Baker
001ebb68f3 Formatting, nullness and javadoc rewording 2024-04-16 11:42:31 +01:00
Steve Mayhew
566c0b3eea Allows setting LoadErrorHandlingPolicy for DRM
The `DefaultDrmSessionManager` allows setting this policy.  This change
simply plumbs the setting up to the `DefaultDrmSessionManagerProvider`
2024-04-16 11:42:31 +01:00
kimvde
1c0345e69f Make VideoSinkImpl non-static
PiperOrigin-RevId: 624999257
2024-04-15 10:13:25 -07:00
kimvde
41d5571660 Allow sink provider to be flushed before initialized
VideoSink.initialize will be added in a next CL and we want to allow
flush to be called before and after initialize.

PiperOrigin-RevId: 624946957
2024-04-15 07:05:28 -07:00