mirror of
https://github.com/androidx/media.git
synced 2025-05-04 06:00:37 +08:00

1. SampleSource now has an explicit track selection state. This state is entered after the source is prepared, and also by calling startTrackSelection. 2. endTrackSelection commits selection changes, and is responsible for doing the right thing w.r.t starting/stopping/restarting load operations. 3. All sources now start or restart a load in the case of a new track selection. This fixes a problem where a source could be advanced by repeatedly disabling and re-enabling whilst paused. Some sources didn't restart a load in this case, since the position was unchanged, however the downstream renderer would then consume media up to the first keyframe in order to render something. Hence each disable/re-enable would advance by a keyframe. 4. This change will enable a subsequent change where we'll discard media for non-selected tracks earlier than we do currently (i.e. we'll hook the extractor to a dummy track output, so the samples will never be written to a rolling buffer). This will enable a further subsequent change where buffer contributions are per-renderer rather than per-source. Issue: #1041 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=118024436