20523 Commits

Author SHA1 Message Date
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
690bb1ace3 Add release note for DASH non-square thumbnail grid fix 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
tonihei
fb982c2d54 Don't enforce SimpleDecoder skipping for samples before start time
We currently enforce the skipping if the sample has a timestamp less
than the start time. While this may be the default desired behavior
for most implementations, it prevents an implementation from outputting
a sample with such a timestamp.

This change updates the logic to pre-fill the shouldBeSkipped flag
based on the input timestamp, and only check this flag on the output
buffer. None of the implementations in our library change timestamps
of samples, so this is equivalent to the previous code.

PiperOrigin-RevId: 629708873
2024-05-01 06:42:36 -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
c9aab56d9c Add Mp4 object type for JPEG
PiperOrigin-RevId: 629683068
2024-05-01 04:05:42 -07:00
Copybara-Service
6e8f3a8f97 Merge pull request #1189 from v-novaltd:dsparano-exo245
PiperOrigin-RevId: 629476777
2024-04-30 11:31:53 -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
Rohit Singh
a09c2f1701 Add boolean input to MpeghReader 2024-04-30 16:36:51 +01:00
Rohit Singh
247cad934a Update dump files 2024-04-30 16:31:50 +01:00
Rohit Singh
0a436ad491 Use inclusive language 2024-04-30 16:31:50 +01:00
Rohit Singh
1ab91a64c2 Refactor and add release notes 2024-04-30 16:31:50 +01:00
Rohit Singh
e1294c0d5c Format with google-java-format 2024-04-30 16:31:50 +01:00
Daniele Sparano
838083e610 Update dump files 2024-04-30 16:31:50 +01:00
Daniele Sparano
029b8bad86 Fix H264 transformer test, fix H265 byterange case; re-enable file H262 case 2024-04-30 16:31:50 +01:00
Rohit Singh
3cafb08a32 Fix condition to send dummy end of input and update dump files 2024-04-30 16:31:50 +01:00
Rohit Singh
a7f5c3f5b6 Update dump files 2024-04-30 16:31:50 +01:00
Rohit Singh
4b14bc2c3e Format with google-java-format 2024-04-30 16:31:50 +01:00
Daniele Sparano
b82f4b8e28 Tidy up dummy pusi, do not apply to H262 streams 2024-04-30 16:31:50 +01:00
Daniele Sparano
85826ebc19 Fix dummy pusi solution for byte range and key frame only NAL stream cases 2024-04-30 16:31:49 +01:00
Tofunmi Adigun-Hameed
c002ff6a6f Merge pull request #419 from v-novaltd:vnova-104 2024-04-30 16:31:49 +01:00
sheenachhabra
72013446c4 Update error message to be more specific
PiperOrigin-RevId: 629405290
2024-04-30 07:28:35 -07:00
sheenachhabra
6956d8099a Rename Muxer.addMetadata to addMetadataEntry
This is to make it clear that the method adds a single metadata entry, not a collection of metadata entries.

PiperOrigin-RevId: 629398485
2024-04-30 06:55:50 -07:00
sheenachhabra
bc77cef403 Rollback of 08abc964ab
PiperOrigin-RevId: 629382753
2024-04-30 05:41:45 -07:00
tofunmi
28655d27a7 test: use Ascii.equalsIgnoreCase for device model matching
PiperOrigin-RevId: 629349367
2024-04-30 02:54:38 -07:00
Rohit Kumar Singh
43f098da0f Merge Issue: androidx/media#882: Extend MPEG2TS implementation with MPEG-H support
Imported from GitHub PR https://github.com/androidx/media/pull/882

Merge 27a4c43de6294a5482b85ff8e2b4501057f3e946 into a49b625cc585970843f27410b614c6470924e7e5

COPYBARA_INTEGRATE_REVIEW=https://github.com/androidx/media/pull/882 from androidx:ts_mpegh_reader_patch 27a4c43de6294a5482b85ff8e2b4501057f3e946
PiperOrigin-RevId: 629132035
2024-04-29 11:33:38 -07:00
ibaker
96bc9e9652 Propagate ID3 TCON frame to MediaMetada.genre
This change also includes mapping the numeric ID3v1 codes to their
string equivalents before setting them into `MediaMetadata`. This
mapping already existed, but it was previously only used when parsing
MP4 `gnre` atoms.

Issue: androidx/media#1305
PiperOrigin-RevId: 629113480
2024-04-29 10:38:51 -07:00
rohks
c6492e01e4 Remove redundant final in PesReader methods
Since the class is final, declaring the overridden methods as final is unnecessary.

PiperOrigin-RevId: 629103982
2024-04-29 10:12:05 -07:00
tonihei
74bb4ac98d Fix lint errors in shortform demo app
PiperOrigin-RevId: 629080780
2024-04-29 08:50:06 -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
tonihei
344fc8a8c0 Add IntDef for priority values
This makes it easier to reference these values in documentation
and method parameters.

PiperOrigin-RevId: 629072314
2024-04-29 08:14:20 -07:00
tianyifeng
e180e263a5 Refresh HlsMediaPlaylist with delivery directives when possible
When refreshing the media playlist, we should try to request via a url with [delivery directives](https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-6.2.5). However, when initially loading the media playlist or when the last loading with delivery directives encountered an error, we should not allow using those directives.

PiperOrigin-RevId: 629060177
2024-04-29 07:24:35 -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
tofunmi
7089253bef Effect:migrate setEnableColorTransfers to setSdrWorkingColorSpace
Part of a two stage change to remove the conversion to linear colors in the SDR effects pipeline by default. Changes the boolean to an intdef, introducing a third option that gets all sdr input into the same colorspace.

This is a planned API breaking change, but this change should not change the behavior of the pipeline.

PiperOrigin-RevId: 629013747
2024-04-29 03:26:58 -07:00
claincly
43de3b67cf Fix PassthroughShaderProgram flush
PiperOrigin-RevId: 629007018
2024-04-29 02:51:27 -07:00
ibaker
854e8aad32 Add Dumper.addIfNonDefault methods
Remove the duplicate implementations in `PlaybackOutput` and
`DumpableFormat`.

PiperOrigin-RevId: 628419737
2024-04-26 09:00:44 -07:00
ibaker
e759b44c45 Remove @Nullable from Dumper.add methods
`checkNotNull` was added to the `Object` variant in b83f12c4ba. It
doesn't seem to have caused any test failures, so I guess we never
pass `null` in here - and might as well update the annotation to match
reality. And then for consistency we should ban `null` from the
`byte[]` overload too.

PiperOrigin-RevId: 628419003
2024-04-26 08:56:56 -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