media/libraries
tonihei 0a8ca18305 Create new AudioTrack without waiting for previous released tracks
We currently wait until a previous AudioTrack from the same
DefaultAudioSink is released on a background thread before attempting
to initialize a new AudioTrack. This is done to avoid issues where
the releasing track blocks some shared audio memory, preventing a new
track from being created.

The current solution has two main shortcomings:
 - In most cases, the system can easily handle multiple AudioTracks
   and waiting for the release just causes unnecessary delays (e.g.
   when seeking).
 - It only waits for a previous track from the same DefaultAudioSink,
   not accounting for any other tracks that may be in the process of
   being released from other players.

To improve on both shortcomings, we can
 (1) move the check for "is releasing tracks and thus may block shared
 memory" to the static release infrastructure to be shared across all
 player instances.
 (2) optimistically create a new AudioTrack immediately without waiting
 for the previous one to be fully released.
 (3) extend the existing retry logic that already retries failed
 attempts for 100ms to only start the timer when ongoing releases are
 done. This ensures we really waited until we have all shared resources
 we can get before giving up completely. This also acts as a replacement
 for change (2) to handle situations where creating a second track is
 genuinely not possible. Also increase threshold to 200ms as the new
 unit test is falky on a real device with just 100ms (highlighting that
 the device needed more than 100ms to clean up internal resources).

PiperOrigin-RevId: 654053123
2024-07-19 10:41:17 -07:00
..
cast Formatting fixes and additional plumbin in legacy controller 2024-06-14 17:47:03 +01:00
common Update media3 version for 1.4.0 stable release 2024-07-18 09:43:16 -07:00
container Allow negative presentation time in ReorderingSeiMessageQueue 2024-07-17 03:43:34 -07:00
database Do not trim audio samples by changing their timestamp 2023-06-29 22:50:04 +00:00
datasource Bump minSdk to 21 and remove resulting simple dead code 2024-07-12 08:11:01 -07:00
datasource_cronet Support multiple DataSource configurations in DataSourceContractTest 2024-07-10 05:01:33 -07:00
datasource_okhttp Remove OkHttpDataSource constructors & OkHttDataSourceFactory 2024-05-23 10:03:12 -07:00
datasource_rtmp Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
decoder MediaCodecVideoRenderer skips decoder inputs unused as reference 2024-07-09 03:43:06 -07:00
decoder_av1 Replace or suppress deprecated usages 2024-01-26 10:06:18 -08:00
decoder_ffmpeg Replace or suppress deprecated usages 2024-01-26 10:06:18 -08:00
decoder_flac Rollback of 8e2869278c 2024-02-15 02:35:12 -08:00
decoder_iamf/src Add skeleton of the IAMF JNI wrapper for the native decoder in libiamf. 2024-07-16 02:54:21 -07:00
decoder_midi Add missing module registrations 2024-05-23 04:50:01 -07:00
decoder_opus Rollback of 8e2869278c 2024-02-15 02:35:12 -08:00
decoder_vp9 Rollback of 8e2869278c 2024-02-15 02:35:12 -08:00
effect implement getDurationAfterEffectApplied in TimestampAdjustment Effect 2024-07-17 06:07:27 -07:00
exoplayer Create new AudioTrack without waiting for previous released tracks 2024-07-19 10:41:17 -07:00
exoplayer_dash Rollback of 9151dbf9e6 2024-07-17 05:08:52 -07:00
exoplayer_hls Rename DummyTrackOutput and DummyExtractorOutput 2024-06-25 05:07:56 -07:00
exoplayer_ima Guard timeline access in ImaSSAIMS against empty timelines 2024-07-19 04:27:36 -07:00
exoplayer_rtsp Add NAL unit parsing needed for stereo MV-HEVC playback. 2024-06-27 08:39:12 -07:00
exoplayer_smoothstreaming Default to parse subtitles while extracting, instead of while rendering 2024-05-16 01:42:56 -07:00
exoplayer_workmanager Remove exoplayer2-only javadoc machinery from media3 2023-06-05 09:47:58 +00:00
extractor Add H264_ prefix to NalUnitUtil.NAL_UNIT_TYPE_* constants 2024-07-12 08:02:24 -07:00
muxer Make Mp4MoovStructure.moov() method static 2024-07-18 06:50:42 -07:00
session Enable lint errors in session tests 2024-07-17 03:50:05 -07:00
test_data Add support for Opus audio codec. 2024-07-17 10:51:43 -07:00
test_exoplayer_playback Bump minSdk to 21 and remove resulting simple dead code 2024-07-12 08:11:01 -07:00
test_session_common Improve automatic error replication for legacy browsers 2024-07-01 09:47:25 -07:00
test_session_current Further unapplied rotation clean-up 2024-07-16 03:35:46 -07:00
test_utils Support detached surface mode from API 35 2024-07-18 02:29:57 -07:00
test_utils_robolectric Bump minSdk to 21 and remove resulting simple dead code 2024-07-12 08:11:01 -07:00
transformer CompositionPlayer: clip silence with media source 2024-07-18 10:17:29 -07:00
ui Further unapplied rotation clean-up 2024-07-16 03:35:46 -07:00
ui_leanback Bump effect and leanback minSdk to 19 2024-01-10 07:22:00 -08:00
lint.xml Update recommended way to suppress @UnstableApi errors in lint.xml 2023-11-15 02:34:40 -08:00