22178 Commits

Author SHA1 Message Date
Ian Baker
51eb4d6504 Keep the old MidiRenderer constructor deprecated for now 2025-02-25 14:34:15 +00:00
Ian Baker
4f08312ea5 Add release note 2025-02-25 14:24:19 +00:00
Ian Baker
c950f1c5e3 Format with google-java-format 2025-02-25 14:22:52 +00:00
nift4
5b97ad71f4 Make MIDI renderer respect custom audio sink 2025-02-25 14:22:52 +00:00
Googler
3b38a7a43b Add CookieHandler support to HttpEngineDataSource.
The original behaviour of the `handleSetCookieRequests` is preserved.
A bug is addressed, where it woulld set `Set-Cookie` header in the client request (as opposed to the expected `Cookies`).

PiperOrigin-RevId: 730857996
2025-02-25 06:19:20 -08:00
Copybara-Service
85467b9b57 Merge pull request #2145 from v-novaltd:dsparano-exo328
PiperOrigin-RevId: 730853667
2025-02-25 06:05:18 -08:00
tonihei
94e8a64938 Add more dump file changes 2025-02-25 12:50:20 +00:00
sheenachhabra
bdbcdf1660 Implement blank frame insertion when video track goes missing
If an sequence has both audio and video tracks running but then
the next media item has only audio, then insert blank frames to
continue video track.

PiperOrigin-RevId: 730828269
2025-02-25 04:34:17 -08:00
tianyifeng
a016adc6b1 Remove deprecated constructors in SegmentDownloader and its subclasses
PiperOrigin-RevId: 730828186
2025-02-25 04:32:39 -08:00
ibaker
fe19d8c9be Fix casting in ParsableByteArray.peekCharacterAndSize
This was introduced in 841bdc6efe.

There's no need to cast the `char` (2 bytes) down to a `byte` in order
to pack it into an `int` (4 bytes) alongside a short (2 bytes).

We also don't need to use `short` to track the character count (max 4
with UTF-8) - a single byte is enough. This change also uses
`Ints.fromBytes` to avoid having to reason about how casting &
bit-shifting interact.

This change introduces a test which reproduces the failure reported in
Issue: androidx/media#2167.

#cherrypick

PiperOrigin-RevId: 730809219
2025-02-25 03:18:30 -08:00
tonihei
3f493eaf9e Clarify that multiple LibraryParams fields can be set
Issue: androidx/media#2159
PiperOrigin-RevId: 730805485
2025-02-25 03:03:00 -08:00
bachinger
a75da2f5f3 Add withRemovedAdGroupCountBefore to AdPlaybackState
Adds a helper method to remove ad groups from the
ad playback state before a given period time.

PiperOrigin-RevId: 730804505
2025-02-25 02:58:39 -08:00
ivanbuper
ee6eb98d4b Rollback of 6e9a2cc0cd
PiperOrigin-RevId: 730482824
2025-02-24 09:32:45 -08:00
sheenachhabra
493e5a5eb1 Refactor common input feeding method into MuxerTestUtil
PiperOrigin-RevId: 730452200
2025-02-24 08:02:57 -08:00
claincly
2f5a72a165 Add javadoc to clarify using bitmap
PiperOrigin-RevId: 730441676
2025-02-24 07:25:13 -08:00
tonihei
5610cc8465 Do not change audio capabilities for error recovery without context
If the deprecated path without a context is used, the capabilities
are set externally and can't recover automatically back to the real
capabilities.

Issue: androidx/media#2168
PiperOrigin-RevId: 730427339
2025-02-24 06:33:23 -08:00
shahddaghash
c90ca4e86e Enable metrics collection by default
PiperOrigin-RevId: 730383523
2025-02-24 03:47:05 -08:00
bachinger
76df13d390 Avoid rare NPE in MediaSessionServiceTest
PiperOrigin-RevId: 730363453
2025-02-24 02:29:45 -08:00
dancho
67e99f4648 MCVR: limit the number of consecutive dropped input frame headers
Dropping too many consecutive input buffers reduces the update
frequency of MCVR.shouldDropDecoderInputBuffers and can lead to
dropping too many consecutive input buffers.

Discarding input buffers of type OBU_FRAME_HEADER with
show_existing_frame = 1 saves a smaller amount of resources
than discarding input buffers of type OBU_FRAME.
PiperOrigin-RevId: 730362707
2025-02-24 02:27:41 -08:00
bachinger
fbe186a70c Deflake MediaSessionServiceTest
`onConnect_controllerInfo_sameInstanceFromServiceToConnectedControllerManager`
was flaky because `onDestroy()` of `MockMediaSessionService` was cleaning
up the `TestServiceRegistry`. This includes releasing the session of the service
after which no further `MediaSession.Callback` methods are called. This created
a race between `Callback.onDisconnected` and the `Mediasession.release()` being
called.

`onDestroy()` is called unexpectedly early because the controller unbinds as the
last controller from the service that never was started (`onStartCommand` never
called). In such a case the service is immediately terminated by the system after
the last client unbinds from the service, which called `onDestroy()` on the mock
service.

This change making `MockMediaSessionService` optionally not clean up the
registry in `onDestroy()` prevents the session from being released too early.
Alternatively, starting playback and hence starting the service into the
foreground would prevent the problem as well for the purpose of the test.
Another alternative to fix the test would be removing the session from the
service before releasing the controller.

PiperOrigin-RevId: 730361199
2025-02-24 02:22:35 -08:00
claincly
4c3ac81873 Add a class wrapping GlTextureInfo and presentation time
The grouping is used in some places and will be used in dynamic effect update

PiperOrigin-RevId: 729569353
2025-02-21 10:11:52 -08:00
Copybara-Service
7c2e8c1c4b Merge pull request #2170 from wischnow:main
PiperOrigin-RevId: 729558029
2025-02-21 09:35:20 -08:00
sheenachhabra
b6aa21a427 Move video track extraction method to AndroidTestUtil
The method can be reused in other tests as well

PiperOrigin-RevId: 729528829
2025-02-21 07:56:56 -08:00
Copybara-Service
05c8a66dc2 Merge pull request #2149 from bubenheimer:util_postorrun_fix
PiperOrigin-RevId: 729495445
2025-02-21 05:40:11 -08:00
Copybara-Service
2b12a57447 Merge pull request #2139 from bubenheimer:handleReplaceMediaItems_removerangecodefix
PiperOrigin-RevId: 729490370
2025-02-21 05:18:57 -08:00
tianyifeng
d35fccef59 Propagate download byte range to ProgressiveDownloader
PiperOrigin-RevId: 729484044
2025-02-21 04:53:42 -08:00
Uli Bubenheimer
7cc97ddce2 Minor Util.postOrRun refactor: fix skipped reuse of variable created for reuse 2025-02-21 12:31:22 +00:00
Copybara-Service
378e70e15f Merge pull request #2136 from bubenheimer:handleReplaceMediaItems_docfix
PiperOrigin-RevId: 729474558
2025-02-21 04:15:28 -08:00
tonihei
e889632971 Add release notes 2025-02-21 11:59:54 +00:00
tonihei
6121445718 Remove gitattributes and some formatting changes 2025-02-21 11:57:20 +00:00
Daniele Sparano
da360a67cb Add fix from https://github.com/androidx/media/pull/2172 2025-02-21 11:46:09 +00:00
Daniele Sparano
d81321174e Fix CRLF mismatch failing tests in Windows 2025-02-21 11:46:09 +00:00
Daniele Sparano
c144420be8 Reset nal unit type after key frame determination 2025-02-21 11:46:09 +00:00
Daniele Sparano
07150b816f Fix h264 and h265 dumps 2025-02-21 11:46:09 +00:00
Daniele Sparano
7bbc7e03db Reset H264 nal unit type on end function to avoid stale state; add unspecified nal unit type constants 2025-02-21 11:46:09 +00:00
Daniele Sparano
277f969c5c Use end and start of dummy NAL unit as a more reliable way to end ts input 2025-02-21 11:46:09 +00:00
Daniele Sparano
82ba4060a4 Update H265 ts dump files 2025-02-21 11:46:08 +00:00
Daniele Sparano
8253530688 Avoid duplicated samples with at H265 ts end 2025-02-21 11:46:08 +00:00
Daniele Sparano
4015db57a5 Update dumps of ts tests 2025-02-21 11:46:08 +00:00
Daniele Sparano
4adbeed6f6 Handle 4 byte start code prefix, ensure non empty samples 2025-02-21 11:46:08 +00:00
Daniele Sparano
dbf864fd69 Handle 4 byte start code prefix, ensure non empty samples, fix timestamp on very last sample on synthesized empty pusi 2025-02-21 11:46:08 +00:00
tonihei
7a85cfb4bd Add {} 2025-02-21 11:38:33 +00:00
Uli Bubenheimer
a32c768ea1 handleReplaceMediaItems: filter invalid parameters for handleRemoveMediaItems 2025-02-21 11:36:05 +00:00
shahddaghash
23ebea7ab4 Update exporter and muxer name to match expected pattern
If the name does not match patten, it gets skipped when reporting.

PiperOrigin-RevId: 729463344
2025-02-21 03:35:04 -08:00
Uli Bubenheimer
26cf8e1e94 Fix permitted parameter range for handleReplaceMediaItems in javadoc 2025-02-21 11:30:14 +00:00
tonihei
72c85aa483 Ensure DataSource is closed in CacheWriter at non-IOException
We currently only catch IOExceptions to close the opened data source.
This means any other type of exception leaves the data source open,
which can caused SimpleCache to be blocked forever when another
data source tries to access the same cache area (which is still
locked by the open data source).

This problem was the cause for flakiness in DownloadManagerDashTest.

#cherrypick

Issue: google/ExoPlayer#9760
PiperOrigin-RevId: 729441817
2025-02-21 02:11:21 -08:00
tianyifeng
a5ffae17c3 Enable DownloadHelper to create DownloadRequest with byteRange
This change only enable the partial support for progressive stream. For now, creating `DownloadRequest` for partial adaptive media will result in an `IllegalStateException`.

PiperOrigin-RevId: 729100584
2025-02-20 07:15:51 -08:00
tianyifeng
daf8f9ff58 Mask ExoPlayer.isLoading when it transitions to IDLE or ENDED states
In some cases, the ExoPlayer immediately transitions to `STATE_IDLE` or `STATE_ENDED` on application thread, while `isLoading` can still remain as `true` before it is finally updated from playback thread.

Issue: androidx/media#2133

#cherrypick

PiperOrigin-RevId: 728724157
2025-02-19 10:31:43 -08:00
shahddaghash
ae3eed2343 Verify each export had its own session
This is done by getting the session ID for the `EditingSession` and making sure it's unique from the other session ID.

PiperOrigin-RevId: 728680628
2025-02-19 08:18:34 -08:00
sheenachhabra
462533219d Create muxer specific BufferInfo class
Muxer does not use `offset` field, hence not added.

PiperOrigin-RevId: 728625538
2025-02-19 05:11:04 -08:00