Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with ExoPlayer 1.3 release #18

Closed
wants to merge 676 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
676 commits
Select commit Hold shift + click to select a range
60c8273
Split Mp4Writer into an abstract class and DefaultMp4Writer
SheenaChhabra Dec 21, 2023
f36ab87
Fix DASH CEA-608 parsing during extraction
icbaker Dec 21, 2023
3081ceb
Remove the matchInitializationData option from TransformerInternal
tof-tof Dec 21, 2023
7d11ee7
Optionally notify codec init in default decoder factory
andrewlewis Dec 21, 2023
966b517
Merge pull request #914 from cemrich:366-forward-time-wrong
copybara-github Dec 21, 2023
57d00fc
Rename crow_emulator_transformer_output
tof-tof Dec 21, 2023
0ed1993
Test: Remove setInputColorInfo from VFP test runner.
dway123 Dec 21, 2023
5211ff0
Only append non-null exception messages in `UnexpectedLoaderException`
icbaker Dec 21, 2023
1845a4a
Expand operating rate workaround to T612 chipset
andrewlewis Dec 21, 2023
ef7842d
Fix typo
andrewlewis Dec 22, 2023
09bde80
Update method description for setEffects in Composition
droid-girl Dec 22, 2023
a496bbd
Add parentheses to fix `UnexpectedLoaderException` message logic
icbaker Dec 22, 2023
1632f37
Transformer: Add api to drop audio samples before the first video frame
tof-tof Dec 22, 2023
7e12b9e
Add rough progress updates in trim optimization
tof-tof Dec 22, 2023
64231ee
Tweak `SubtitleTranscodingTrackOutput.ensureSampleDataCapacity`
icbaker Dec 22, 2023
4fc11a9
ignore dropSamplesBeforeFirstVideoSample in audio-only streams
tof-tof Dec 22, 2023
e3056da
Rename Mp4MetadataInfo to mp4Info
tof-tof Dec 22, 2023
0ab7baf
Migrate Gaussian Blur Effect to media3.
tof-tof Dec 22, 2023
1609928
Throw exception when B-frames are written to Mp4Muxer
SheenaChhabra Dec 27, 2023
b0e00a7
Fix ByteBuffer.array() warning
SheenaChhabra Dec 28, 2023
e0257f4
Implement fragmented MP4 (fMP4) in the Mp4Muxer
SheenaChhabra Dec 29, 2023
27ae6d9
Allow creating fragmented MP4 file via InAppMuxer
SheenaChhabra Dec 29, 2023
846ace1
Allow creating fragmented MP4 file via demo app
SheenaChhabra Dec 29, 2023
426bc94
Don't set negative values to setWhen()
marcbaechinger Dec 29, 2023
5149cc6
Skip Mp4Muxer tests for unwanted input files
SheenaChhabra Dec 29, 2023
7b450f0
Fix limit calculation to include `offset` in `Cea6/708Parser.parse`
icbaker Jan 2, 2024
258ffa6
Add tests with out-of-order CEA-608 input buffers
icbaker Jan 3, 2024
b11c0c1
Declare demo service as MediaLibraryService
marcbaechinger Jan 3, 2024
3ecf873
Add comments for skipping input files in Mp4Muxer tests
SheenaChhabra Jan 3, 2024
c230414
Set the default audio encoder bitrate in DefaultEncoderFactory.
Samrobbo Jan 3, 2024
de772cf
Catch errors and OOM when decoding ID3 frames.
Tolriq May 1, 2023
820278c
Format with google-java-format
icbaker Jan 3, 2024
f935f59
Improve logging by including full stack trace, and add release note
icbaker Jan 3, 2024
8b39f7e
Ignore rowLock and columnLock values as specified by ANSI/CTA-708-E S…
datdoantelus Jan 2, 2024
28eb55c
Use skipBits(2) instead of readBits for ignored bits.
datdoantelus Jan 3, 2024
a58ddcf
Update test comment.
datdoantelus Jan 3, 2024
04751a1
Format with google-java-format
icbaker Jan 3, 2024
0b482ef
Remove columnLock, columnCount (unimplemented) and rowLock (always true)
icbaker Jan 3, 2024
5970d2d
Document and remove check for `C.TIME_UNSET` when consuming data in TS
rohitjoins Jan 4, 2024
8eda9f2
Merge pull request #369 from Tolriq:fix_invalid_frames
copybara-github Jan 4, 2024
1cb6865
Remove CEA-6/708 support from `DefaultSubtitleParserFactory`
icbaker Jan 4, 2024
5c50b27
Return null if media notification controller Future is not done
marcbaechinger Jan 4, 2024
95e7429
Clarify docs on `Player.setMediaItem(s)` and `replaceMediaItem(s)`
icbaker Jan 4, 2024
62f6c64
Rename `test.mp3` test asset to `test-cbr-info-header.mp3`
icbaker Jan 5, 2024
77f3119
Play clear samples in DRM content without keys by default
icbaker Jan 5, 2024
c6b5100
Effect: Allow updating inputColorInfo between streams in VFP.
dway123 Jan 8, 2024
6f82491
Merge pull request #942 from datdoantelus:CC_708_parser_fix
copybara-github Jan 9, 2024
4198f7e
Add utility testing Player.Listener in transformer tests
christosts Jan 9, 2024
dee2d3a
GlassianBlurTest: move golden images comment next to the test
tof-tof Jan 9, 2024
324e1be
Bump media3 version to 1.2.1 and update RELEASENOTES
microkatz Jan 9, 2024
e54abaa
Increase `minSdk` to 19
icbaker Jan 9, 2024
da724c8
Plumb SubtitleParser.Factory into FragmentedMp4Extractor
oceanjules Jan 9, 2024
320dd32
Add extractor test for an MP3 file with `Info` header
icbaker Jan 9, 2024
ba8f556
Set PCM encoding in Flac extractor
tonihei Jan 9, 2024
1c1d4d5
MP3: Correct duration calculation in `XingSeeker`
icbaker Jan 9, 2024
143d782
Add private `@SeekHeader` IntDef to `Mp3Extractor`
icbaker Jan 9, 2024
460501f
Log ExportResult information when running transformer demo app
a-googler Jan 10, 2024
4fde35c
MP3: Extract Xing/Info parsing code from `XingSeeker`
icbaker Jan 10, 2024
3596bc3
Use AudioAtributes when determining AudioCapabilities
tonihei Jan 10, 2024
51d60e1
GaussianBlur: make short constructor call the longer one
tof-tof Jan 10, 2024
d6ef48f
Plumb SubtitleParser.Factory into Mp4Extractor
oceanjules Jan 10, 2024
3f9e054
Remove non-progressive limitation from `DefaultMediaSourceFactory.exp…
icbaker Jan 10, 2024
1202f86
Bump effect and leanback minSdk to 19
icbaker Jan 10, 2024
d884f19
Add edit label
droid-girl Jan 10, 2024
733301d
Remove the parameter PlayerId from PreloadMediaSource.Factory
tianyif Jan 11, 2024
0f33ef3
Improve readability of constant numbers and documentation in `DtsUtil`
rohitjoins Jan 11, 2024
0332884
Fix typo of missing closing parentheses in RELEASENOTES
microkatz Jan 11, 2024
085bc6c
Upgrade robolectric version to 4.11
SheenaChhabra Jan 11, 2024
cd2d7f5
Forward getStreamKeys in ClippingMediaPeriod
tonihei Jan 11, 2024
e93188f
Crop and pass thumbnails to ImageOutput
leonarda-pribanic Jan 11, 2024
b4dfbed
Update javadoc param name to match argument name
dway123 Jan 11, 2024
c59711f
Effect: Remove unused arguments in DefaultShaderProgram factories.
dway123 Jan 11, 2024
a728ec8
Plumb SubtitleParser.Factory into TsExtractor
oceanjules Jan 11, 2024
f2be3fd
Trim Opt: Calculate duration based on sample rate from audio format
tof-tof Jan 11, 2024
59afb4f
Plumb SubtitleParser.Factory into WebvttExtractor
oceanjules Jan 11, 2024
78c419e
Extension to Gaussian Blur: support changing blur over time
tof-tof Jan 12, 2024
5056dfa
Regression fix of ExoPlayer.setVideoEffects()
christosts Jan 12, 2024
4061d47
MP3: Assume an Info header indicates CBR for seeking purposes
icbaker Jan 12, 2024
d4be30b
Mark `CompositeSequenceableLoader` `final`
icbaker Jan 12, 2024
09a5479
Update RELEASENOTES for 1.3.0-alpha01
SheenaChhabra Jan 12, 2024
6879698
Move setting bitmapFactory options from interface to implementation
tof-tof Jan 12, 2024
7f08724
Add supportsMimeType API to bitmapLoader
tof-tof Jan 12, 2024
4a07d13
Version bump to media3:1.3.0-alpha01
SheenaChhabra Jan 15, 2024
a88d8a4
Plumb SubtitleParser.Factory into AviExtractor
oceanjules Jan 15, 2024
be2f8c4
Fix typo in MediaSessionLegacyStub
marcbaechinger Jan 15, 2024
e51c293
Plumb SubtitleParser.Factory into MatroskaExtractor
oceanjules Jan 15, 2024
0155ae9
Gaussian Blur: support blurring without drawing sharp image on top
tof-tof Jan 15, 2024
520687a
Bump media1 dep to 1.7.0
icbaker Jan 16, 2024
2d89ffc
Annotate CompositingVideoSinkProvider with RestrictTo
christosts Jan 16, 2024
5488d33
Transformer: add api to cutomize image loading
tof-tof Jan 16, 2024
fc9900c
Document `setVideoEffects` surface limitation
andrewlewis Jan 16, 2024
0513a28
Remove initialization in declaration
andrewlewis Jan 16, 2024
e41b23d
Add thread-safe information & annotations to necessary fields.
Samrobbo Jan 16, 2024
27c021f
Merge Issue: androidx/media#275: MPEG2-TS: Support DTS, DTS-LBR and D…
rahulnmohan Jan 16, 2024
2c8ba50
Disable double-click detection for TV apps
marcbaechinger Jan 16, 2024
a83662b
Extract audio type from TS descriptors
jan-varecka-signageos-io Jan 14, 2024
286b1f5
Add test for MPEG audio with audio type
jan-varecka-signageos-io Jan 16, 2024
7e21da8
Format with google-java-format
rohitjoins Jan 17, 2024
80bfa81
Add method to `TextRenderer` to control whether decoding is done or not
icbaker Jan 17, 2024
32576be
Add release note
rohitjoins Jan 17, 2024
406c0a1
`CompositeSequenceableLoader`: Prefer buffered position of A/V tracks
icbaker Jan 17, 2024
666685b
Use 4 Byte size field in fMP4 mdat boxes
SheenaChhabra Jan 17, 2024
1ec1938
HDR: Propagate PQ to SDR OOTF to internal input.
dway123 Jan 17, 2024
e730feb
Add missing IntDef annotation
tonihei Jan 18, 2024
5eb1f40
disallow go links in Media3 open source code
tof-tof Jan 18, 2024
0e66197
Rename TimestampIterator argument name in queueInputBitmap()
christosts Jan 18, 2024
616cb94
Previewing: Allow inputColorInfo to change, from SDR to HDR.
dway123 Jan 18, 2024
59dc5b6
Add missing null and Bundle checks in MediaSession/ControllerStub
tonihei Jan 18, 2024
4b0ff48
Fix release notes
SheenaChhabra Jan 18, 2024
3e3c746
Add javadoc to the TransformerState's for pause & resume.
Samrobbo Jan 18, 2024
36e99f5
Remove unnecessary passing around of class variable
SheenaChhabra Jan 18, 2024
2e8a81c
Update `Util.moveItems` to explicitly `T extends @NonNull Object`
icbaker Jan 18, 2024
50385be
Changes based on internal review
rohitjoins Jan 17, 2024
34a08e1
Rollback of https://github.com/androidx/media/commit/406c0a15be6f0937…
icbaker Jan 18, 2024
c403df1
Merge pull request #973 from jan-varecka-signageos-io:feat/extractTsA…
copybara-github Jan 18, 2024
4ac9d44
Remove thread blocking for TransformerInternal#getProgress.
Samrobbo Jan 19, 2024
dcfa8c6
Previewing: set VideoFrameReleaseControl after CVSP is created.
dway123 Jan 19, 2024
432cde6
Use routed device in AudioCapabilities
tonihei Jan 22, 2024
1dc880c
Rollback of https://github.com/androidx/media/commit/e364510937ac1f3c…
christosts Jan 22, 2024
515d2e2
Skip 1080p test on Nexus 7, API 21
andrewlewis Jan 22, 2024
5b7b19c
Add TODO about known feature gap in ImageRenderer
tonihei Jan 22, 2024
da5e5db
Disable 'skip buffers with identical release times' in GTS tests
icbaker Jan 22, 2024
3e005e6
Check int and float parameters from external apps for validity
tonihei Jan 22, 2024
18617b8
Prevent using high profile on problematic devices
andrewlewis Jan 22, 2024
05b8e63
SimpleBasePlayer: add protected method for thread verification
christosts Jan 22, 2024
6632531
Catch exceptions when retrieving current device from audio manager
tonihei Jan 22, 2024
50e0072
Do not write empty track (with no samples) in a non fragmented MP4
SheenaChhabra Jan 22, 2024
5ac0c8b
Fix cleared metadata when repeating the same item
tonihei Jan 22, 2024
fce23d9
Trim optimization fix: check if audio is removed when comparing formats
tof-tof Jan 22, 2024
21e6c1c
Transformer demo: support selecting all media MIME types
tof-tof Jan 23, 2024
dd9f610
Release `MediaSession` and `ExoPlayer` in `MediaControllerStubTest`
icbaker Jan 23, 2024
eda2080
BaseGlShaderProgram: Remove redundant NoSuchElementException catching
tof-tof Jan 23, 2024
b8ff9cd
Update METADATA to add `clang-format` requirement for glsl files
tof-tof Jan 23, 2024
8e97895
Test parsing-during-extraction in `ClippedPlaybackTest`
icbaker Jan 23, 2024
3a22247
Internal change
tianyif Jan 23, 2024
236287a
Use Media3 MediaStyle instead of legacy one
tonihei Jan 23, 2024
193cb14
Change type of setCustomLayout in MediaSession.resultBuilder to List
Jan 23, 2024
a1280b1
Add setRemotePlaybackInfo to MediaStyle
tonihei Jan 23, 2024
081baa0
Process all tracks before writing fragment in fragmented MP4
SheenaChhabra Jan 23, 2024
426dd77
Suppress lint warning about missing POST_NOTIFICATIONS permission
SheenaChhabra Jan 23, 2024
733c982
Change the behaviour in MediaMetadata.Builder.populate
tianyif Jan 23, 2024
be0d531
Suppress nullability warnings
timpeut Jan 23, 2024
97b8f1a
Add proguard keep rules for `ExoPlayer.setVideoEffects`
icbaker Jan 24, 2024
a6756c6
MuxerWrapper rotation degree fix
tof-tof Jan 24, 2024
db0262e
Keep stream offset alive in ImageRenderer until stream transition
microkatz Jan 24, 2024
539a8f9
Write sample data offset related fields in tfhd and trun box
SheenaChhabra Jan 24, 2024
cfb676a
Add `Mp4ExtractorTest` for sample with edit list (edts box)
rohitjoins Jan 24, 2024
db42035
Remove SubtitleParser.Factory references from Hls/Ss/DashMediaPeriod
oceanjules Jan 24, 2024
9581af1
Write "stco" box instead of "co64" for fragmented MP4
SheenaChhabra Jan 24, 2024
0713d56
Add setters of SubtitleParser.Factory and experimental toggle
oceanjules Jan 24, 2024
55e3dd7
Rollback of https://github.com/androidx/media/commit/e364510937ac1f3c…
christosts Jan 24, 2024
748fec1
Add a setter of `SubtitleParser.Factory` to `MediaSource.Factory`
oceanjules Jan 24, 2024
8770286
Throw immediately from `ExoPlayer.setVideoEffects()` if dep not found
icbaker Jan 25, 2024
e29e775
Update release notes for Media3 1.3.0-beta01 release
SheenaChhabra Jan 25, 2024
4382aa0
Make `Cea608Parser` and `Cea708Parser` package-private
icbaker Jan 25, 2024
7822613
Version bump to media3:1.3.0-beta01
SheenaChhabra Jan 25, 2024
4570ee9
Fix link to 1.3.0-alpha01 release
SheenaChhabra Jan 25, 2024
ddca011
Update IMA README to include link to supported platforms
a-googler Jan 26, 2024
0886da4
Add a comment to suggest keeping JUnit version in sync with the Android
icbaker Jan 26, 2024
4a7442e
Replace or suppress deprecated usages
tonihei Jan 26, 2024
4560611
Remove misleading @CanIgnoreReturnValue
tonihei Jan 26, 2024
826f20d
Remove a redundant TODO in Util
oceanjules Jan 26, 2024
dfe4721
Update skip silence algorithm
tonihei Jan 29, 2024
a18d96c
Fix blank video when switching on/off screen
claincly Jan 29, 2024
3d87578
Merge pull request #1031 from garethfenn:hlschunkseek
copybara-github Jan 31, 2024
ad519e2
Merge pull request #1015 from kamaroyl:feat/PsshVersion1
copybara-github Jan 31, 2024
127d0b5
Merge pull request #1011 from cedricxperi:dts-lbr-hls-bitrate-unknown…
copybara-github Feb 1, 2024
7758e42
Render last image despite not receiving EoS
microkatz Feb 1, 2024
548c4ce
Fix HlsPlaybackTest flakiness
tonihei Feb 1, 2024
dd2e4a5
Merge `Cea708Parser` back into `Cea708Decoder`
icbaker Feb 5, 2024
4eea69d
Merge `Cea608Parser` back into `Cea608Decoder`
icbaker Feb 6, 2024
4a95217
Fix Kotlin 2.0 compilation error in session demo app
a-googler Feb 6, 2024
ad57b41
Clearly define the consistency requirements for `SequenceableLoader`
icbaker Feb 6, 2024
a294dc9
Include nullness of RequestMetadata.extras in equals method
tonihei Feb 6, 2024
ca2779e
Add source prefix to MergingMediaPeriod Format ids
tonihei Feb 6, 2024
dc8d3ea
Add constructor that takes only a Context
marcbaechinger Feb 6, 2024
7721f38
Check `sampleMimeType` rather than `containerMimeType` for images
icbaker Feb 6, 2024
bf8b874
JpegMotionPhotoExtractor: Don't emit an image track with no metadata
icbaker Feb 6, 2024
9f28e7d
Improve AudioCapabilities with AudioManager API in Android 13
tianyif Feb 6, 2024
74d0f93
Fix the regex used for validating custom CMCD key names
marcbaechinger Feb 6, 2024
245e623
Set correct track id when skipping empty tracks in Mp4Extractor
tonihei Feb 7, 2024
1dc4377
Stop double-encoding CMCD query parameters
icbaker Feb 7, 2024
dbb99fe
Rollback of https://github.com/androidx/media/commit/406c0a15be6f0937…
icbaker Feb 7, 2024
e492e37
Move release note to the right section
tonihei Feb 8, 2024
38d5635
Report the skipped silence more deterministically
tianyif Feb 8, 2024
43ee291
Update release notes for media3:1.3.0-rc01
SheenaChhabra Feb 9, 2024
fbf8ac3
Version bump to media3:1.3.0-rc01
SheenaChhabra Feb 9, 2024
ee0eac7
Fix nit issues in 1.3.0-rc01 release notes
SheenaChhabra Feb 20, 2024
c6a6b81
Update release notes section for 1.3.0 stable release
SheenaChhabra Feb 22, 2024
99e7156
Update media3 version for 1.3.0 stable release
SheenaChhabra Feb 23, 2024
d13a0f4
Merge branch 'release' into release-1.3.0
icbaker Mar 7, 2024
2dc2e5d
Composition: clarify javadoc to setTransmuxAudio\Video
tof-tof Mar 7, 2024
e556214
Add workarounds for `NoSuchMethodError` from DRM framework exceptions
icbaker Mar 7, 2024
4db96ac
Add opt-in flag for the MIDI module for apps with a local dependency
icbaker Mar 8, 2024
a72a232
Document MergingMediaSource tag contract
tonihei Mar 8, 2024
a85d9e2
Reorder audio capability checks
tonihei Mar 11, 2024
fffbf9a
Force external surround sound flag if requested by device
tonihei Mar 11, 2024
3f3d60e
Add device-specific opt-ins for async MediaCodecAdapter
tonihei Mar 11, 2024
c8ae6d1
Always set PARAMETER_KEY_TUNNEL_PEEK when tunneling
tonihei Mar 11, 2024
561dafc
Start playing period-enabled renderers when setting playWhenReady true
microkatz Mar 11, 2024
860f18f
Move `test-session-xxx` modules from `core_settings` to `settings`
icbaker Mar 12, 2024
6f0b70e
Add short form content demo to project
andrewlewis Mar 14, 2024
8a169d1
Merge pull request #1117 from loliball:dev_wav_align_fix
copybara-github Mar 14, 2024
d195b09
Don't emit a `CuesWithTiming` for zero-duration `Subtitle` events
icbaker Mar 15, 2024
961d204
Fix proguard rule for DefaultVideoFrameProcess.Factory.Builder.build()
icbaker Mar 15, 2024
b0adf2f
Don't set codec color info for default SDR
tonihei Mar 20, 2024
5fc9dda
Partial revert of https://github.com/androidx/media/commit/3a7d31a599…
tonihei Mar 20, 2024
06a4036
Remove unecessary re-setting of `group` from `session` Gradle files
icbaker Mar 25, 2024
3657831
Include nullness of MediaMetadata.extras in equals method
tonihei Mar 25, 2024
dca3c61
In-line versions only used by exoplayer-media2 extension
icbaker Mar 25, 2024
88ebc89
Plumb MP3 average bitrate from metadata frames into Format
icbaker Mar 26, 2024
a5d0cb5
Don't apply performance point workaround from API 35
tonihei Mar 26, 2024
26ce3f0
Fix javadoc on `PlayerView.setControllerVisibilityListener`
icbaker Mar 27, 2024
4caed3c
Add `PlayerView.setControllerAnimationEnabled(boolean)`
icbaker Mar 27, 2024
7b5522f
Merge pull request #1054 from jekopena:main
copybara-github Mar 27, 2024
5fe906f
Rollback of https://github.com/androidx/media/commit/e665e2aee8f4cb0a…
icbaker Mar 28, 2024
bfa492b
HDR: Don't assume that swapping between BT709 and BT601 needs tone-map.
dway123 Jan 31, 2024
ecaff24
Effect: Use element instead of peek, when throwing if null.
dway123 Feb 1, 2024
9825e21
Effect: Remove extra checkStateNotNull by reordering logic.
dway123 Feb 2, 2024
39f26e6
DefaultAssetLoaderFactory: Simplify file extension retrival
tof-tof Feb 8, 2024
2ec19a5
HDR: Add color-space conversion for PQ tone-map.
dway123 Feb 8, 2024
c4688fc
Fallback to including track language name if display name is not found
microkatz Feb 12, 2024
5fd1f61
Loosen the requirement to register every input frame
claincly Feb 12, 2024
c58adb0
Add release notes for recent transformer features
tof-tof Feb 13, 2024
879bcb5
Check whether the session activity pending intent is an activity
marcbaechinger Feb 13, 2024
61a3127
Demo app: Clarify that only Widevine DRM content can be downloaded
icbaker Feb 14, 2024
396ae86
Fix forward for https://github.com/androidx/media/commit/216f3fedb857…
claincly Feb 15, 2024
b218d91
Fix docs on `playUntilStartOfMediaItem` to match `playUntilPosition`
icbaker Feb 15, 2024
04ce836
Fix failure to write negative PTS sample
a-googler Feb 16, 2024
2f47151
Allow empty information attributes in RTSP Session Description
microkatz Feb 20, 2024
2ae7995
Fix a bug in retaining streams when preload a PreloadMediaPeriod again
tianyif Feb 21, 2024
ed71172
Allow renderer retry for audio track offload initialization failure
microkatz Feb 22, 2024
81e91c2
Use playing period TrackSelectorResult in track reselection update
microkatz Feb 22, 2024
25e8dc5
ForwardingAudioSink: add override for release()
christosts Feb 22, 2024
3c10b41
ExoPlayerImplInternal.releaseInternal(): unblock the app thread
christosts Feb 23, 2024
3521ccd
Fallback to legacy sizerate check if CDD H264 PerfPoint check fails
microkatz Feb 23, 2024
1d2116c
Add fps-awareness to `DefaultTrackSelector`
icbaker Feb 28, 2024
cf9ff4d
Avoid position jumping back when controller replaces the current item
tianyif Feb 29, 2024
e28d772
Merge pull request #1025 from v-novaltd:dsparano-exo209
copybara-github Mar 4, 2024
672d149
Remove invalid command comparison
tonihei Mar 5, 2024
b6cb9c1
Fix some invalid javadoc references caught by a new JDK version
icbaker Mar 5, 2024
3fdd3bd
Fix typo
andrewlewis Mar 6, 2024
1a710b0
Import string translations
SheenaChhabra Apr 4, 2024
71bfdd1
Start early-enabled renderers only after advancing the playing period
microkatz Mar 6, 2024
41771d7
Set `Format.frameRate` for single-frame MP4 tracks
icbaker Mar 7, 2024
1792723
Update release notes for 1.3.1 bug fix release
SheenaChhabra Apr 5, 2024
d833d59
Update Media3 version number
SheenaChhabra Apr 5, 2024
9b96eae
Merge remote-tracking branch 'origin/release' into update_exo
jdtremblay Apr 19, 2024
be5d499
Adjust change for Exo 1.3
jdtremblay Apr 22, 2024
1d0b373
Add missing logs
jdtremblay Apr 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests with out-of-order CEA-608 input buffers
The `Cea608DecoderTest` added here fails if re-ordering is removed from
`CeaDecoder`.

The `Cea608ParserTest` is added with `@Ignore` because there's currently
no re-ordering support in this part of the subtitle handling pipeline
(partly because there's no concept of 'current playback time', meaning
it's hard to know **when** to re-order).

PiperOrigin-RevId: 595320205
  • Loading branch information
icbaker authored and copybara-github committed Jan 3, 2024
commit 258ffa68b5575cd1a55ac12f21860b19434f1260
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,52 @@ public void paintOnEmitsSubtitlesImmediately() throws Exception {
createPacket(0xFC, 'p', 'l'),
createPacket(0xFC, 'e', 's'));

Subtitle firstSubtitle = checkNotNull(decodeSampleAndCopyResult(decoder, sample1));
Subtitle secondSubtitle = checkNotNull(decodeSampleAndCopyResult(decoder, sample2));
Subtitle firstSubtitle =
checkNotNull(decodeSampleAndCopyResult(decoder, /* timeUs= */ 123, sample1));
Subtitle secondSubtitle =
checkNotNull(decodeSampleAndCopyResult(decoder, /* timeUs= */ 456, sample2));

assertThat(getOnlyCue(firstSubtitle).text.toString()).isEqualTo("test subtitle, spa");
assertThat(getOnlyCue(secondSubtitle).text.toString())
.isEqualTo("test subtitle, spans 2 samples");
}

@Test
public void paintOnEmitsSubtitlesImmediately_reordersOutOfOrderSamples() throws Exception {
Cea608Decoder decoder =
new Cea608Decoder(
new Cea608Parser(
MimeTypes.APPLICATION_CEA608,
/* accessibilityChannel= */ 1,
Cea608Parser.MIN_DATA_CHANNEL_TIMEOUT_MS));
byte[] sample1 =
Bytes.concat(
// 'paint on' control character
createPacket(0xFC, 0x14, 0x29),
createPacket(0xFC, 't', 'e'),
createPacket(0xFC, 's', 't'),
createPacket(0xFC, ' ', 's'),
createPacket(0xFC, 'u', 'b'),
createPacket(0xFC, 't', 'i'),
createPacket(0xFC, 't', 'l'),
createPacket(0xFC, 'e', ','),
createPacket(0xFC, ' ', 's'),
createPacket(0xFC, 'p', 'a'));
byte[] sample2 =
Bytes.concat(
createPacket(0xFC, 'n', 's'),
createPacket(0xFC, ' ', '2'),
createPacket(0xFC, ' ', 's'),
createPacket(0xFC, 'a', 'm'),
createPacket(0xFC, 'p', 'l'),
createPacket(0xFC, 'e', 's'));

queueSample(decoder, /* timeUs= */ 456, sample2);
queueSample(decoder, /* timeUs= */ 123, sample1);
Subtitle firstSubtitle =
checkNotNull(decodeToPositionAndCopyResult(decoder, /* positionUs= */ 123));
Subtitle secondSubtitle =
checkNotNull(decodeToPositionAndCopyResult(decoder, /* positionUs= */ 456));

assertThat(getOnlyCue(firstSubtitle).text.toString()).isEqualTo("test subtitle, spa");
assertThat(getOnlyCue(secondSubtitle).text.toString())
Expand Down Expand Up @@ -120,9 +164,12 @@ public void rollUpEmitsSubtitlesImmediately() throws Exception {
createPacket(0xFC, 'n', 'e'),
createPacket(0xFC, 's', 0x0));

Subtitle firstSubtitle = checkNotNull(decodeSampleAndCopyResult(decoder, sample1));
Subtitle secondSubtitle = checkNotNull(decodeSampleAndCopyResult(decoder, sample2));
Subtitle thirdSubtitle = checkNotNull(decodeSampleAndCopyResult(decoder, sample3));
Subtitle firstSubtitle =
checkNotNull(decodeSampleAndCopyResult(decoder, /* timeUs= */ 123, sample1));
Subtitle secondSubtitle =
checkNotNull(decodeSampleAndCopyResult(decoder, /* timeUs= */ 456, sample2));
Subtitle thirdSubtitle =
checkNotNull(decodeSampleAndCopyResult(decoder, /* timeUs= */ 789, sample3));

assertThat(getOnlyCue(firstSubtitle).text.toString()).isEqualTo("test subtitle, spa");
assertThat(getOnlyCue(secondSubtitle).text.toString())
Expand Down Expand Up @@ -163,8 +210,10 @@ public void onlySelectedFieldIsUsed() throws Exception {
createPacket(0xFC, 'e', 0x0),
createPacket(0xFD, 0x0, 0x0));

Subtitle firstSubtitle = checkNotNull(decodeSampleAndCopyResult(decoder, sample1));
Subtitle secondSubtitle = checkNotNull(decodeSampleAndCopyResult(decoder, sample2));
Subtitle firstSubtitle =
checkNotNull(decodeSampleAndCopyResult(decoder, /* timeUs= */ 123, sample1));
Subtitle secondSubtitle =
checkNotNull(decodeSampleAndCopyResult(decoder, /* timeUs= */ 456, sample2));

assertThat(getOnlyCue(firstSubtitle).text.toString()).isEqualTo("test sub");
assertThat(getOnlyCue(secondSubtitle).text.toString()).isEqualTo("test subtitle");
Expand Down Expand Up @@ -246,11 +295,16 @@ public void onlySelectedChannelIsUsed() throws Exception {
createPacket(0xFC, 'e', 0x0),
createPacket(0xFD, 0x0, 0x0));

Subtitle firstSubtitle = /*checkNotNull(*/ decodeSampleAndCopyResult(decoder, sample1) /*)*/;
Subtitle secondSubtitle = checkNotNull(decodeSampleAndCopyResult(decoder, sample2));
Subtitle thirdSubtitle = checkNotNull(decodeSampleAndCopyResult(decoder, sample3));
Subtitle fourthSubtitle = checkNotNull(decodeSampleAndCopyResult(decoder, sample4));
Subtitle fifthSubtitle = checkNotNull(decodeSampleAndCopyResult(decoder, sample5));
Subtitle firstSubtitle = /*checkNotNull(*/
decodeSampleAndCopyResult(decoder, 123, sample1) /*)*/;
Subtitle secondSubtitle =
checkNotNull(decodeSampleAndCopyResult(decoder, /* timeUs= */ 456, sample2));
Subtitle thirdSubtitle =
checkNotNull(decodeSampleAndCopyResult(decoder, /* timeUs= */ 789, sample3));
Subtitle fourthSubtitle =
checkNotNull(decodeSampleAndCopyResult(decoder, /* timeUs= */ 1234, sample4));
Subtitle fifthSubtitle =
checkNotNull(decodeSampleAndCopyResult(decoder, /* timeUs= */ 5678, sample5));

assertThat(getOnlyCue(firstSubtitle).text.toString()).isEqualTo("te");
assertThat(getOnlyCue(secondSubtitle).text.toString()).isEqualTo("test");
Expand Down Expand Up @@ -284,7 +338,8 @@ public void serviceSwitchOnField1Handled() throws Exception {
createPacket(0xFC, 'X', 'X'),
createPacket(0xFD, 0x0, 0x0));

Subtitle firstSubtitle = checkNotNull(decodeSampleAndCopyResult(decoder, sample1));
Subtitle firstSubtitle =
checkNotNull(decodeSampleAndCopyResult(decoder, /* timeUs= */ 123, sample1));

assertThat(getOnlyCue(firstSubtitle).text.toString()).isEqualTo("test");
}
Expand Down Expand Up @@ -315,7 +370,8 @@ public void serviceSwitchOnField2Handled() throws Exception {
createPacket(0xFC, 0x0, 0x0),
createPacket(0xFD, 'X', 'X'));

Subtitle firstSubtitle = checkNotNull(decodeSampleAndCopyResult(decoder, sample1));
Subtitle firstSubtitle =
checkNotNull(decodeSampleAndCopyResult(decoder, /* timeUs= */ 123, sample1));

assertThat(getOnlyCue(firstSubtitle).text.toString()).isEqualTo("test");
}
Expand All @@ -336,17 +392,39 @@ private static byte ensureUnsignedByteOddParity(int input) {
}

/**
* Queues {@code sample} to {@code decoder} and dequeues the result, then copies and returns it if
* it's non-null.
* Queues {@code sample} to {@code decoder} with {@code timeUs}, sets {@link
* Cea608Decoder#setPositionUs(long)} to {@code timeUs} and dequeues the result, then copies and
* returns it if it's non-null.
*
* <p>Fails if {@link Cea608Decoder#dequeueInputBuffer()} returns {@code null}.
*/
@Nullable
private static Subtitle decodeSampleAndCopyResult(Cea608Decoder decoder, byte[] sample)
private static Subtitle decodeSampleAndCopyResult(
Cea608Decoder decoder, long timeUs, byte[] sample) throws SubtitleDecoderException {
queueSample(decoder, timeUs, sample);
return decodeToPositionAndCopyResult(decoder, timeUs);
}

/**
* Queues {@code sample} to {@code decoder}. Fails if {@link Cea608Decoder#dequeueInputBuffer()}
* returns {@code null}.
*/
private static void queueSample(Cea608Decoder decoder, long timeUs, byte[] sample)
throws SubtitleDecoderException {
SubtitleInputBuffer inputBuffer = checkNotNull(decoder.dequeueInputBuffer());
inputBuffer.data = ByteBuffer.wrap(sample);
inputBuffer.timeUs = timeUs;
decoder.queueInputBuffer(inputBuffer);
}

/**
* Sets {@link Cea608Decoder#setPositionUs(long)} then dequeues the result, and copies and returns
* it if it's non-null.
*/
@Nullable
private static Subtitle decodeToPositionAndCopyResult(Cea608Decoder decoder, long positionUs)
throws SubtitleDecoderException {
decoder.setPositionUs(positionUs);
@Nullable SubtitleOutputBuffer outputBuffer = decoder.dequeueOutputBuffer();
if (outputBuffer == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.google.common.primitives.UnsignedBytes;
import java.util.ArrayList;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand Down Expand Up @@ -122,6 +123,45 @@ public void paintOnEmitsSubtitlesImmediately_respectsOffsetAndLimit() throws Exc
.isEqualTo("test subtitle, spans 2 samples");
}

@Test
@Ignore("Out-of-order CEA-608 samples are not yet supported (internal b/317488646).")
public void paintOnEmitsSubtitlesImmediately_reordersOutOfOrderSamples() throws Exception {
Cea608Parser cea608Parser =
new Cea608Parser(
MimeTypes.APPLICATION_CEA608,
/* accessibilityChannel= */ 1,
Cea608Parser.MIN_DATA_CHANNEL_TIMEOUT_MS);
byte[] sample1 =
Bytes.concat(
// 'paint on' control character
createPacket(0xFC, 0x14, 0x29),
createPacket(0xFC, 't', 'e'),
createPacket(0xFC, 's', 't'),
createPacket(0xFC, ' ', 's'),
createPacket(0xFC, 'u', 'b'),
createPacket(0xFC, 't', 'i'),
createPacket(0xFC, 't', 'l'),
createPacket(0xFC, 'e', ','),
createPacket(0xFC, ' ', 's'),
createPacket(0xFC, 'p', 'a'));
byte[] sample2 =
Bytes.concat(
createPacket(0xFC, 'n', 's'),
createPacket(0xFC, ' ', '2'),
createPacket(0xFC, ' ', 's'),
createPacket(0xFC, 'a', 'm'),
createPacket(0xFC, 'p', 'l'),
createPacket(0xFC, 'e', 's'));

CuesWithTiming secondCues = checkNotNull(parseSample(cea608Parser, sample2));
CuesWithTiming firstCues = checkNotNull(parseSample(cea608Parser, sample1));

assertThat(Iterables.getOnlyElement(firstCues.cues).text.toString())
.isEqualTo("test subtitle, spa");
assertThat(Iterables.getOnlyElement(secondCues.cues).text.toString())
.isEqualTo("test subtitle, spans 2 samples");
}

@Test
public void rollUpEmitsSubtitlesImmediately() throws Exception {
Cea608Parser cea608Parser =
Expand Down