media/libraries
kimvde 3a5c4277a7 Fix and simplify timestamps handling
Handling of the stream offset and start position was unnecessarily
complex and even incorrect. It was going to be an issue for
concatenation of video and image input.

The stream offset is the offset added before decoding/encoding to
make sure it doesn’t fail in case of negative timestamps (which do
rarely occur).
The start position is equal to the stream offset, plus the clipping
start time if the media is clipped.

Before this change:
- Samples were offset by the start position before decoding, and this
offset was removed before muxing.
- The startPosition of the first MediaItem in a sequence was used for
all the MediaItems in this sequence (which is incorrect).
- The stream offset was removed before applying the GL effects and
added back before encoding so that it was not visible to the OpenGL
processing.

After this change:
- The start position is subtracted in the AssetLoader, so that the
downstream components don’t have to deal with the stream offsets and
start positions.
- Decoded samples with negative timestamps are not passed to the
SamplePipelines. The MediaMuxer doesn’t handle negative timestamps
well. If a stream is 10 secondes long and starts at timestamp -2
seconds, the output will only contain the samples corresponding to the
first 8 (10 - 2) seconds. It won’t contain the last 2 seconds of the
stream. It seems acceptable to remove the first 2 seconds instead.

PiperOrigin-RevId: 520916464
2023-04-05 15:38:27 +01:00
..
cast Fix javadoc links in media README files 2023-03-30 17:26:40 +00:00
common Temporarily use exoplayer2-hosted SVGs in media3 javadoc 2023-03-30 17:27:20 +00:00
database Fix javadoc links in media README files 2023-03-30 17:26:40 +00:00
datasource Fix javadoc links in media README files 2023-03-30 17:26:40 +00:00
datasource_cronet Fix javadoc links in media README files 2023-03-30 17:26:40 +00:00
datasource_okhttp Fix javadoc links in media README files 2023-03-30 17:26:40 +00:00
datasource_rtmp Fix javadoc links in media README files 2023-03-30 17:26:40 +00:00
decoder Fix javadoc links in media README files 2023-03-30 17:26:40 +00:00
decoder_av1 Add media3 guide entries in README files 2023-03-30 17:28:03 +00:00
decoder_ffmpeg Add media3 guide entries in README files 2023-03-30 17:28:03 +00:00
decoder_flac Add media3 guide entries in README files 2023-03-30 17:28:03 +00:00
decoder_opus Add media3 guide entries in README files 2023-03-30 17:28:03 +00:00
decoder_vp9 Add media3 guide entries in README files 2023-03-30 17:28:03 +00:00
effect Fix javadoc links in media README files 2023-03-30 17:26:40 +00:00
exoplayer Add warning logs if DefaultDrmSessionManager is used on wrong thread 2023-04-05 15:36:09 +01:00
exoplayer_dash Remove mediaTimeOffsetMs from EventDispatcher 2023-04-05 15:34:35 +01:00
exoplayer_hls Remove mediaTimeOffsetMs from EventDispatcher 2023-04-05 15:34:35 +01:00
exoplayer_ima Add media3 guide entries in README files 2023-03-30 17:28:03 +00:00
exoplayer_rtsp Add media3 guide entries in README files 2023-03-30 17:28:03 +00:00
exoplayer_smoothstreaming Remove mediaTimeOffsetMs from EventDispatcher 2023-04-05 15:34:35 +01:00
exoplayer_workmanager Fix javadoc links in media README files 2023-03-30 17:26:40 +00:00
extractor Fix javadoc links in media README files 2023-03-30 17:26:40 +00:00
session Remove deprecated stop(boolean) 2023-03-30 17:24:35 +00:00
test_data Remove adjustable ftyp functionality from Mp4Muxer 2023-04-05 15:37:39 +01:00
test_exoplayer_playback Fix instrumentation tests not working via Gradle 2022-09-30 18:03:11 +00:00
test_session_common Exclude test_session_{common,current} from API and Javadoc tests 2023-03-07 11:48:38 +00:00
test_session_current Remove deprecated stop(boolean) 2023-03-30 17:24:35 +00:00
test_utils Remove mediaTimeOffsetMs from EventDispatcher 2023-04-05 15:34:35 +01:00
test_utils_robolectric Fix javadoc links in media README files 2023-03-30 17:26:40 +00:00
transformer Fix and simplify timestamps handling 2023-04-05 15:38:27 +01:00
ui Add media3 guide entries in README files 2023-03-30 17:28:03 +00:00
ui_leanback Fix (another) LeanbackPlayerAdapter param name mismatch 2023-02-01 10:41:50 +00:00