mirror of
https://github.com/androidx/media.git
synced 2025-05-09 08:30:43 +08:00

BatchBuffer has three different clear methods (clear, flush, batchWasConsumed), and it's not hugely clear what each of them does. In general, BatchBuffer owning the sample buffer seems more complicated than having the caller own it, particularly when it can be "pending" inside of the batch buffer. This change moves ownership of the sample buffer to the caller. BatchBuffer is simplified as a result. There are also two behaviour changes: 1. The buffer's timeUs field is now set to the first sample's timestamp, rather than the last sample's. 2. A key-frame in the middle of the batch no longer causes the batch buffer to be considered a key-frame. Which seems like the right thing to do, because the batched data cannot be decoded independently of whatever came before it. PiperOrigin-RevId: 350921306
ExoPlayer library
The ExoPlayer library is split into multiple modules. See ExoPlayer's top level README for more information about the available library modules and how to use them.