Compare commits

...

612 commits

Author SHA1 Message Date
shahddaghash
76088cd6af Bump Media3 version to 1.5.1
PiperOrigin-RevId: 707576152
(cherry picked from commit c3b58f2434)
2024-12-18 09:26:54 -08:00
shahddaghash
7ae9ddf166 Update release notes for Media3 1.5.1 release
PiperOrigin-RevId: 707558817
(cherry picked from commit 896bd0d330)
2024-12-19 11:21:58 +00:00
tonihei
e4e59cd929 Switch default of async crypto mode to disabled
There are reproducible issues with codec timeouts when using
this API, so we disable it entirely until we know more about
potential fixes and where they are available.

Issue: androidx/media#1641
PiperOrigin-RevId: 707025950
(cherry picked from commit 71f82df57f)
2024-12-17 03:22:51 -08:00
tonihei
508a4258a3 Switch play FGS exemption to use custom action instead of commands
Custom actions are more naturally associated with a user intent
than commands (that are meant to be used for automated inter-app
communication without user interaction).

PiperOrigin-RevId: 705797057
(cherry picked from commit 3bce3af1a3)
2024-12-13 01:41:20 -08:00
Googler
52f9761796 Don't check codec's profile for MV-HEVC video.
Currently as there is no formal support for MV-HEVC within Android framework, the profile is not correctly specified by the underlying codec; just assume the profile obtained from the MV-HEVC sample is supported.

PiperOrigin-RevId: 705164738
(cherry picked from commit 3936c27b6d)
2024-12-11 10:56:06 -08:00
ibaker
de91ebc6ae Add vorbis comment support for track/disc numbering fields, and genre
Only `TRACKNUMBER` and `GENRE` are listed here:
https://xiph.org/vorbis/doc/v-comment.html

The rest are derived from the example in Issue: androidx/media#1958.

It's possible that other formats exist in the wild:
https://hydrogenaud.io/index.php/topic,69292.msg613808.html#msg613808

Issue: androidx/media#1958
PiperOrigin-RevId: 704308788
(cherry picked from commit 12546070ee)
2024-12-09 09:09:53 -08:00
rohks
5d9badcb50 Fix ReplacingCuesResolver.discardCuesBeforeTimeUs to retain active cue
The method previously discarded the cue that was active at `timeUs`,
meaning it had started before but had not ended by `timeUs`.

Issue: androidx/media#1939

PiperOrigin-RevId: 702707611
(cherry picked from commit e927d7b986)
2024-12-04 06:48:43 -08:00
Copybara-Service
121b79ae96 Merge pull request #1943 from DolbyLaboratories:dlb/ac4-ajoc/dev
PiperOrigin-RevId: 702281314
(cherry picked from commit e4993779db)
2024-12-03 04:04:52 -08:00
ibaker
fa9689ef9a Clarify CommandButton javadoc around iconResId and ICON_UNDEFINED
PiperOrigin-RevId: 701898620
(cherry picked from commit 77d33645cc)
2024-12-02 02:56:34 -08:00
Copybara-Service
f5bbb39e90 Merge pull request #1823 from MGaetan89:remove_outdated_sdk_check
PiperOrigin-RevId: 700706152
(cherry picked from commit bff5523bb6)
2024-11-27 08:16:02 -08:00
ibaker
fd0c04b3a0 Recommend ForwardingSimpleBasePlayer in ForwardingPlayer javadoc
Also add an explicit warning about how fiddly `ForwardingPlayer` can be
to use correctly.

PiperOrigin-RevId: 700698032
(cherry picked from commit 60133b0c7e)
2024-11-27 07:40:13 -08:00
ibaker
8a1e6e59b0 Bump IMA dependency to 3.35.1
The previous version (3.33.0) is known to have some bugs, and the latest
version (3.36.0) is also known to be buggy.

PiperOrigin-RevId: 700657484
(cherry picked from commit 6cf3004d62)
2024-11-27 04:53:38 -08:00
ibaker
f91d5208b5 MP3: Use bytes field from VBRI frame instead of deriving from ToC
The previous code assumed that the `VBRI` Table of Contents (ToC)
covers all the MP3 data in the file. In a file with an invalid VBRI ToC
where this isn't the case, this results in playback silently stopping
mid-playback (and either advancing to the next item, or continuing to
count up the playback clock forever). This change considers the `bytes`
field to determine the end of the MP3 data, in addition to deriving it
from the ToC. If they disagree we log a warning and take the max value.
This is because we handle accidentally reading non-MP3 data at the end
(or hitting EoF) better than stopping reading valid MP3 data partway
through.

Issue: androidx/media#1904

#cherrypick

PiperOrigin-RevId: 700319250
(cherry picked from commit 46578ee0a6)
2024-12-18 14:19:41 +00:00
ibaker
989c8f4fdb MP3: Exclude VBRI frame from ToC position calculations
The current code assumes that the first Table of Contents segment
includes the `VBRI` frame, but I don't think this is correct and it
should only include real/audible MP3 ata - so this change updates the
logic to assume the first ToC segment starts at the frame **after** the
`VBRI` frame.

Issue: androidx/media#1904

PiperOrigin-RevId: 700269811
(cherry picked from commit f257e5511f)
2024-11-26 02:32:09 -08:00
ibaker
7abfa764e1 Add MP3 test asset with VBRI frame
This was hand-crafted with a 4-entry ToC by modifying
`bear-vbr-xing-header.mp3` in a hex editor.

The output difference from 117 samples to 116 samples is due to the
calculation in `VbriSeeker` assuming that the ToC includes the VBRI
frame itself, which I don't think is correct (fix is in a follow-up
change).

Issue: androidx/media#1904

#cherrypick

PiperOrigin-RevId: 700254516
(cherry picked from commit 3eb36d67bd)
2024-11-26 01:29:40 -08:00
ibaker
f34abbb29f Add pixel aspect ratio to Format.toLogString
#cherrypick

PiperOrigin-RevId: 698770714
(cherry picked from commit 827966b7a4)
2024-12-17 18:24:31 +00:00
michaelkatz
8d791fd836 Rollback of 854566dbfe
PiperOrigin-RevId: 698730105
(cherry picked from commit 5282fe3125)
2024-12-17 18:24:29 +00:00
sheenachhabra
05921514b7 Manage all color value conversions in ColorInfo class
This CL also aligns supported color space in `media3 common` and `media3 muxer`.

Earlier `muxer` would take even those values which are considered invalid
in `media3` in general.

Earlier muxer would throw if a given `color standard` is not recognized
but with the new change, it will rather put default `unspecified` value.

#cherrypick

PiperOrigin-RevId: 698683312
(cherry picked from commit 407bc4fec9)
2024-12-17 18:24:14 +00:00
Copybara-Service
6fbd3be9c5 Merge pull request #1277 from consp1racy:patch-1
PiperOrigin-RevId: 694095488
(cherry picked from commit 19d71266ec)
2024-12-17 18:24:14 +00:00
sheenachhabra
92166828e1 Make error messages unique in Boxes.java
PiperOrigin-RevId: 692920946
(cherry picked from commit c3e72a87e5)
2024-12-17 18:24:14 +00:00
sheenachhabra
0ceaa17bf5 Add an API to disable sample batching in Mp4Muxer
Mp4Muxer caches the samples and then writes them in batches.
The new API allows disabling the batching and writing sample
immediately.

PiperOrigin-RevId: 689352771
(cherry picked from commit f181855c5e)
2024-12-17 18:24:14 +00:00
Shahd AbuDaghash
df887a9422 Merge branch 'release' into release-1.5.0 2024-11-25 14:47:51 +00:00
tianyifeng
c35a9d62ba Bump media3 version to 1.4.1
PiperOrigin-RevId: 666347191
(cherry picked from commit 829cad6912)
2024-08-22 15:16:35 +00:00
tianyifeng
517762c087 Update release notes for 1.4.1 bug fix release
PiperOrigin-RevId: 666328660
(cherry picked from commit 1994ccdea8)
2024-08-22 15:13:14 +00:00
tianyifeng
88b640136a Allow playback regardless buffered duration when loading fails
It is possible for playback to be stuck when there is failure in loading further data, while the player is required to load more due to the buffered duration being under `DefaultLoadControl.bufferForPlayback`. Therefore, we check if there is any loading error in `isLoadingPossible`, so that the player will allow the playback of the existing data rather than waiting forever for the data that can never be loaded.

Issue: androidx/media#1571
PiperOrigin-RevId: 665801674
(cherry picked from commit 351593a250)
2024-08-21 11:38:36 +00:00
tianyifeng
9b39e3514f Update translations
#cherrypick

PiperOrigin-RevId: 663705597
(cherry picked from commit 1ffc962fde)
2024-08-21 11:35:55 +00:00
ibaker
b184677b7b Check WV version before relying on MediaDrm.requiresSecureDecoder
This method was added in API 31 (S) but it's non-functional
(incorrectly, silently, returns `false`) on the Widevine plugin version
(`16.0`) from R (API 30), which some devices up to at least API 34 are
still using.

This results in ExoPlayer incorrectly selecting an insecure decoder for
L1 secure content, and subsequently calling
`MediaCodec.queueInputBuffer` instead of `queueSecureInputBuffer`,
which is not supported and generates the following error:
> Operation not supported in this configuration: ERROR_DRM_CANNOT_HANDLE

Issue: androidx/media#1603

#cherrypick

PiperOrigin-RevId: 662852176
(cherry picked from commit ca455ee858)
2024-08-21 11:35:55 +00:00
tianyifeng
f139d709c7 Handle preload callbacks asynchronously in PreloadMediaSource
When there is an exception thrown from the `LoadTask`, the `Loader` will call `Loader.Callback.onLoadError`. Some implementations of `onLoadError` method may call `MediaPeriod.onContinueLoadingRequested`, and in the `PreloadMediaSource`, its `PreloadMediaPeriodCallback` will be triggered and then it can further call `continueLoading` if it finds needed. However the above process is currently done synchronously, which will cause problem. By calling `continueLoading`, the `Loader` is set with a `currentTask`, and when that long sync logic in `Loader.Callback.onLoadError` ends, the `Loader` will immediately retry, and then a non-null `currentTask` will cause the `IllegalStateException`.

Issue: androidx/media#1568

PiperOrigin-RevId: 662550622
(cherry picked from commit cd532c5fb2)
2024-08-21 11:35:51 +00:00
ibaker
07e9c659d7 Handle HEADSETHOOK as 'play' in MediaButtonReceiver.onReceive
Issue: androidx/media#1581

PiperOrigin-RevId: 662515428
(cherry picked from commit c48c051ce2)
2024-08-21 11:30:14 +00:00
ibaker
eebf081528 Pass missing length into SubtitleParser from SubtitleExtractor
If the length of the `ExtractorInput` is not known then the
`subtitleData` field is re-sized by 1kB each time
(`SubtitleExtractor.DEFAULT_BUFFER_SIZE`), so the end of the array is
often not populated. This change ensures that `length` is propagated to
`SubtitleParser`, so that implementations don't try and parse the
garbage/zero bytes at the end of the array.

Discovered while investigating Issue: androidx/media#1516

#cherrypick

PiperOrigin-RevId: 661195634
(cherry picked from commit f37f9690f4)
2024-08-21 11:23:53 +00:00
michaelkatz
c773789edb Skip invalid media description in SessionDescriptionParser
Some RTSP servers may provide media descriptions for custom streams that are not supported. ExoPlayer should skip the invalid media description and continues parsing the following media descriptions.

To start, ExoPlayer will still error on malformed SDP lines for media descriptions, but will now skip media descriptions with "non-parsable" formats as described by [RFC 8866 Section 5.14](https://datatracker.ietf.org/doc/html/rfc8866#section-5.14).

Issue: androidx/media#1472
PiperOrigin-RevId: 660826116
(cherry picked from commit 8b33ad5811)
2024-08-21 11:23:53 +00:00
ibaker
bf934495df Fix IndexOutOfBoundsException in LegacySubtitleUtil
This is caused when the requested "output start time" is equal to or
larger than the last event time in a `Subtitle` object.

This resolves the error in Issue: androidx/media#1516, but subtitles are still not
renderered (probably because the timestamps aren't what we expect
somewhere, but I need to investigate this part further).

#cherrypick

PiperOrigin-RevId: 660462720
(cherry picked from commit 3763e5bc1d)
2024-08-21 11:23:53 +00:00
claincly
cd2a36f705 Add a method to disallow VFP destroying shared eglContext
Previously in MultiInputVideoGraph, each VFP would destroy the shared
eglContext, such that the same eglContext object is destroyed multiple times.

Adding a flag to disallow this.

The alternative being we could add a flag on the VFP constructor, but I think
that is too subscriptive (meaning if we later might want to add another boolean
to control another GL behaviour, multiple booleans would make the class less
reason-able), and would incur a lot of code changes at places.

PiperOrigin-RevId: 660354367
(cherry picked from commit 8f8e48731e)
2024-08-21 11:23:49 +00:00
Googler
efb79472ff Fixes README instructions for depending on modules locally
#cherrypick

PiperOrigin-RevId: 659504142
(cherry picked from commit e7eef0ce34)
2024-08-21 11:22:24 +00:00
ibaker
eb19aefa57 Implement MP3 ConstantBitrateSeeker.getDataEndPosition()
This is needed to correctly handle files with trailing non-MP3 data
(which is indicated by the length in the `Info` frame being shorter than
the overall length of the file).

The test file was generated by appending 150kB of `DEADBEEF` onto the
end of `test-cbr-info-header.mp3`, and the test asserts that the
extracted samples are identical.

Issue: androidx/media#1480

PiperOrigin-RevId: 658727595
(cherry picked from commit b09cea9e3a)
2024-08-21 11:22:20 +00:00
Copybara-Service
3dfe43b498 Merge pull request #1548 from kikoso:chore/fixed_links
PiperOrigin-RevId: 657138513
(cherry picked from commit f1ed195c10)
2024-08-21 11:21:02 +00:00
Googler
692ab33640 Add support for Audio Vorbis codec in Mp4Muxer.
Update esdsBox to support muxing of files encoded with Vorbis audio codec .

PiperOrigin-RevId: 655159074
(cherry picked from commit b77f1d0f99)
2024-08-21 11:21:02 +00:00
dancho
c2d7417ec8 Destroy EGLSurface immediately by focusing a placeholder surface
eglDestroySurface only destroys the surface when it's made not current.
Pass the placeholder surface in FinalShaderProgramWrapper and use it
when destroying eglSurface.

PiperOrigin-RevId: 655139661
(cherry picked from commit 1797359950)
2024-08-21 11:21:02 +00:00
dancho
b6e78f0b2f Ensure EGLSurface is released on GL thread
Add VideoFrameProcessingTaskExecutor.invoke() method that blocks until
Task has executed on GL thread.
Use that for FinalShaderProgramWrapper.setOutputSurfaceInfo

PiperOrigin-RevId: 655119768
(cherry picked from commit 9c075b692e)
2024-08-21 11:21:01 +00:00
bachinger
d44500e0fb Add EXTRAS_KEY_DOWNLOAD_STATUS to MediaContants
This was used in media1 `MediaItemDescription` to indicate the download
status of a media item. When connected to a legacy
`MediaBrowserServiceCompat` the Media3 browsers converts the legacy
media item to a Media3 `MediaItem` and converts the extras of
`MediaDescriptionCompat.extras` to `MediaMetadata.extras`.

#cherrypick

PiperOrigin-RevId: 654625502
(cherry picked from commit 225ad482b1)
2024-08-21 11:21:01 +00:00
Googler
818e015e05 Add support for Opus audio codec.
Implement dOpsBox to provide support for Opus audio codec

PiperOrigin-RevId: 653288049
(cherry picked from commit 01dda6d3e5)
2024-08-21 11:21:01 +00:00
Googler
66e977a810 Add support for 3gpp h263 codec in Mp4Muxer.
Implement d263Box to provide support for muxing video encoded with the h263 codec.

PiperOrigin-RevId: 653188633
(cherry picked from commit 951f296851)
2024-08-21 11:21:01 +00:00
Googler
a153d26d8f Add support for 3gpp amr-nb audio codec.
To support AMR audio codec(audio/3gpp) add `0x81FF` mode to create damrBox.

Add unit test and an Android end to end test.

PiperOrigin-RevId: 652438693
(cherry picked from commit 11ca78761e)
2024-08-21 11:21:01 +00:00
ibaker
4070535ba9 Remove stray parenthesis from MediaSession.ControllerInfo.toString()
#cherrypick

PiperOrigin-RevId: 651760391
(cherry picked from commit 2c7f2686b7)
2024-08-21 11:21:01 +00:00
ibaker
09b6e8fd04 Transform double-tap of HEADSETHOOK to skip-to-next
As reported in Issue: androidx/media#1493 we already use `HEADSETHOOK` to start
waiting for a double-tap, but we don't consider it for the second tap.

Similarly, we previously considered `PLAY` for the second tap, but not the first.
Only `HEADSETHOOK` and `PLAY_PAUSE` are
[documented](https://developer.android.com/reference/androidx/media3/session/MediaSession#media-key-events-mapping)
to transform double-tap to `seekToNext`. So this change removes the
`PLAY` detection from the second tap.

PiperOrigin-RevId: 651017522
(cherry picked from commit c64dacf3df)
2024-08-21 11:20:56 +00:00
Googler
0e75a0a5e1 Add support to MPEG4 codec in Mp4Muxer.
Add support for MPEG4 codec to enable muxing video encoded with the mp4v-es codec. Use esdsBox method to generate esds box required for Mp4v box.

PiperOrigin-RevId: 651000744
(cherry picked from commit 34a802ef38)
2024-08-21 11:20:10 +00:00
Googler
70e8e1bf45 Support for Large CodecSpecificData in ESDS box
Some external media files have CodecSpecificData greater than 128 bytes. Currently, that size
isn't fitting in one byte. Hence, added support to store large CodecSpecificDataSize, as per
ISO standard, by extending to more than one byte as required.

PiperOrigin-RevId: 650972472
(cherry picked from commit cf90d2624d)
2024-08-21 11:20:10 +00:00
dancho
0b6249b8ae Destroy eglSurface as soon as Surface changes
eglDestroySurface now unbinds surface from the GL
thread to ensure quick release of resources.

PiperOrigin-RevId: 650938712
(cherry picked from commit 70a6b5d50d)
2024-08-21 11:20:10 +00:00
Googler
c4bb43517d Add support for amr-wb audio codec.
Implement damrBox to provide support for amr-wb audio codec.

Add unit test and an Android end to end test.

PiperOrigin-RevId: 650210732
(cherry picked from commit 6e18cb0053)
2024-08-21 11:20:10 +00:00
Googler
f2d3072d1a Refactor audioEsdsBox to esdsBox
Since the muxer supported only AAC audio codec, the esdsBox was unconditionally created within the audioSampleEntry. This CL refactors the box creation logic by moving it to the codecSpecificBox method. This is to make adding support for new audio codecs easier.

PiperOrigin-RevId: 650130935
(cherry picked from commit a269355369)
2024-08-21 11:20:10 +00:00
ibaker
ae5a7e54ae Fix TTML handling of inherited percentage tts:fontSize values
The percentage should be interpreted as relative to the size of a parent
node.

This change makes this inheritance work correctly for percentages in
both the parent and child. It does not fix the case of a non-percentage
parent size with a percentage child size.

PiperOrigin-RevId: 649631055
(cherry picked from commit bb2fd002ae)
2024-08-21 11:20:07 +00:00
bachinger
4dc21fd743 Count down three playback states to match the assertion
PiperOrigin-RevId: 648629427
(cherry picked from commit ec3a58f8db)
2024-08-21 11:18:57 +00:00
Tianyi Feng
b01c6ffcb3 Merge branch 'release' into release-1.4.0 2024-07-25 14:42:08 +00:00
tianyifeng
9fb7316696 Fix the release notes for 1.4.0 stable release
#cherrypick

PiperOrigin-RevId: 655558346
(cherry picked from commit d70ff7e4d2)
2024-07-24 14:45:25 +00:00
tianyifeng
4e6a643d88 Update media3 version for 1.4.0 stable release
PiperOrigin-RevId: 653654999
(cherry picked from commit 3c9332bb48)
2024-07-19 13:20:28 +00:00
tianyifeng
18a1582e8c Fix the release notes for 1.4.0 stable release
#cherrypick

PiperOrigin-RevId: 653640574
(cherry picked from commit 1cbcd20851)
2024-07-19 13:15:34 +00:00
tianyifeng
1dfab4f73a Merge release notes for media3 1.4.0 stable release
#cherrypick

PiperOrigin-RevId: 653261278
(cherry picked from commit 68e8d9cb68)
2024-07-19 13:15:34 +00:00
tianyifeng
567204e986 Version bump to 1.4.0-rc01
#cherrypick

PiperOrigin-RevId: 648982615
(cherry picked from commit b531d93b90)
2024-07-03 10:25:39 +00:00
tianyifeng
75dadeaa9e Update release notes for 1.4.0-rc01
PiperOrigin-RevId: 648745388
(cherry picked from commit 9277a34253)
2024-07-02 16:57:58 +00:00
tianyifeng
d97ec132b9 Suppress the lint "WrongConstant" error
Lint somehow complains that the integer resulting from the bit-manipulation shouldn't be passed as an @IntDef parameter.

#cherrypick

PiperOrigin-RevId: 648687698
(cherry picked from commit afe3826d7c)
2024-07-02 14:12:52 +00:00
tianyifeng
6946f49997 Add OptIn annotation to method declaration in demo app file
#cherrypick

PiperOrigin-RevId: 648641357
(cherry picked from commit 0510370bd2)
2024-07-02 14:12:52 +00:00
ibaker
5b60f6c67d Fix index out of bounds exception when a Subtitle is empty
Issue: androidx/media#1516

#cherrypick

PiperOrigin-RevId: 648416119
(cherry picked from commit 711d18de03)
2024-07-02 14:12:52 +00:00
bachinger
035c943219 Improve automatic error replication for legacy browsers
This change extends the error replication to a given set of
error codes (not only authentication error), but only
replicates an error if the caller of the service `Callback`
is a legacy controller. It also makes error replication
configurable so that apps can opt-out and report errors
manually instead, or define the error codes for which
replication is enabled.

The change also removes the restriction of `sendError` only
being available for Media3 controllers. Instead, sending an
error to a legacy controller updates the platform playback
state in the same way as sending the error to the media
notification controller.

#cherrypick

PiperOrigin-RevId: 648399237
(cherry picked from commit 70c063905c)
2024-07-02 14:12:52 +00:00
tianyifeng
4a319f19e3 Update translations
#cherrypick

PiperOrigin-RevId: 648385733
(cherry picked from commit 6bf2461f80)
2024-07-02 14:12:52 +00:00
simakova
0df98407d3 Update the composition README file
PiperOrigin-RevId: 648282532
(cherry picked from commit 16ef63cdfc)
2024-07-02 14:12:52 +00:00
michaelkatz
bd1704904e Cache audio timestamp frame position across track transition reset
Upon track transition of offloaded playback of gapless tracks, the framework will reset the audiotrack frame position. The `AudioTrackPositionTracker`'s `AudioTimestampPoller` must be made to expect the reset and cache accumulated sum of `AudioTimestamp.framePosition`.

#cherrypick

PiperOrigin-RevId: 647294360
(cherry picked from commit a58e77a5a6)
2024-07-02 14:12:52 +00:00
tonihei
adeef60c14 Send pending updates before adding discontinuity for error
When handling a playback error that originates from a future item in
the playlist, we added support for jumping to that item first,
ensuring the errors 'happen' for the right 'current item'.
See 79b688ef30.

However, when we add this new position discontinuity to the
playback state, there may already be other position discontinuities
pending from other parts of the code that executed before the
error. As we can't control that in this case (because it's part
of a generic try/catch block), we need to send any pending
updates first before handling the new change.

Issue: androidx/media#1483
PiperOrigin-RevId: 646968309
(cherry picked from commit 727645179b)
2024-07-02 14:12:47 +00:00
Copybara-Service
708dc6cab9 Merge pull request #1487 from colinkho:main
PiperOrigin-RevId: 646917527
(cherry picked from commit 6244d8605f)
2024-07-02 14:11:38 +00:00
rohks
0b87e176fd Use removeKey method instead of setting null for KEY_CODECS_STRING
Setting a `null` value doesn't remove the key as expected per the `MediaFormat` API documentation, using the `removeKey` method instead which is only available starting API level 29.

PiperOrigin-RevId: 646462402
(cherry picked from commit 12c42585d2)
2024-07-02 14:11:38 +00:00
ibaker
0f0a20bc1c Use MediaCodec.stop() before release() for surface switching bug
ExoPlayer used to call `stop()` before `release()`. This was removed in
<unknown commit>.

A framework bug introduced in Android 11 (API 30) resulted in some
DRM -> clear transitions failing during `MediaCodec.configure()`. An
investigation in Issue: google/ExoPlayer#8696 and b/191966399 identified that this was
due to `release()` returning 'too early' and the subsequent
`configure()` call was then trying to re-use a `Surface` that hadn't
been fully detached from the previous codec. This was fixed in
Android 13 (API 33) with http://r.android.com/2094347.

ExoPlayer worked around the framework bug by adding an arbitrary 50ms
sleep after a failed codec initialization, followed by retrying. This
was enough to resolve the problem in the test scenario on a OnePlus
AC2003.

Issue: androidx/media#1497 points out that 50ms might not be the appropriate delay
for all devices, so it's an incomplete fix. They suggested re-adding the
`MediaCodec.stop()` call instead. This also reliably resolves the issue
on the OnePlus AC2003 (with neither workaround in place, the problem
repros almost immediately).
PiperOrigin-RevId: 646461943

(cherry picked from commit 5fcc7433a1)
2024-07-02 14:11:38 +00:00
tonihei
a73d32a795 Rename DummyTrackOutput and DummyExtractorOutput
#cherrypick

PiperOrigin-RevId: 646434450
(cherry picked from commit 867410fece)
2024-07-02 14:11:38 +00:00
tonihei
0f18fd87ac Add guard against additional tracks reported by Extractors
Extractors should not report additional tracks once they called
ExtractorOutput.endTracks. This causes thread safety issues in
ProgressiveMediaPeriod where the array of sample queues is
extended while the playback thread accesses the arrays.

Detecting this problem early is beneficial to avoid unexplained
exceptions later one. In most cases where this may happen (namely
TS extractors finding new tracks), it's better to ignore the new
tracks instead of failing completely. So this change adds a
warning log message and assigns a placeholder output.

Note: The same workaround already exists in HlsSampleStreamWrapper
and MediaExtractorCompat.

Issue: androidx/media#1476
#cherrypick
PiperOrigin-RevId: 646427213
(cherry picked from commit 18e631ff79)
2024-07-02 14:11:38 +00:00
Copybara-Service
aa508b1aaf Merge pull request #1479 from dryganets:sdryanets/fix-handler-usage
PiperOrigin-RevId: 646402268
(cherry picked from commit 0466728497)
2024-07-02 14:11:38 +00:00
Copybara-Service
53bb87b7d6 Merge pull request #1416 from khouzam:customFormat
PiperOrigin-RevId: 646121082
(cherry picked from commit b026271c84)
2024-07-02 14:11:38 +00:00
tonihei
f49fa99aab Add fail-early checks for TrackSelectorResult correctness
The two arrays need to have the same length and the selection
must match in their nullness (unless for TYPE_NONE
renderers). Clarify this more clearly in the docs and add
new asssertions for it. This avoids that the player is failing
in obscure ways much later.

Issue: androidx/media#1473
#cherrypick
PiperOrigin-RevId: 646086833
(cherry picked from commit 71ef848ec3)
2024-07-02 14:11:38 +00:00
okunhardt
ddf188552e In DemoUtil, don't set cookie handler when using HttpEngineDataSource.
HttpEngine does not support cookie storage.

#cherrypick

PiperOrigin-RevId: 646084702
(cherry picked from commit bb568b5150)
2024-07-02 14:11:38 +00:00
tonihei
3a5e367b93 Fix flakiness in MediaCodecVideoRendererTest
The test is flaky because the decoding process in the renderer
depends on some timing from MediaCodec beyond our control and
the new keyframe added in the test is sometimes 'dropped' when
it arrives too late.

We can fix this by controlling the test progress a bit more
tightly: first rendering with the same current time until the
key frame is processed and then start increasing the time
until we've reached the end.

#cherrypick

PiperOrigin-RevId: 646064352
(cherry picked from commit ada4dc982f)
2024-07-02 14:11:38 +00:00
okunhardt
b433bf928b Use HttpEngineDataSource when supported in demo app.
HttpEngineDataSource is the recommended HttpDataSource when it is available. It uses the [HttpEngine](https://developer.android.com/reference/android/net/http/HttpEngine).

#cherrypick

PiperOrigin-RevId: 646051562
(cherry picked from commit e591c37b1e)
2024-07-02 14:11:37 +00:00
ibaker
9b713907ce Add null-check to PlayerView to avoid NPE in edit mode
Previously we assumed that `surfaceSyncGroupV34` was always non-null on
API 34, but this isn't true in edit mode. Instead we add an explicit
null-check before accessing it. We don't need to null-check it at the
other usage site because we are already null-checking `surfaceView` (via
`instanceof` check).

Issue: androidx/media#1237

#cherrypick

PiperOrigin-RevId: 645008049
(cherry picked from commit 99803066ea)
2024-07-02 14:11:37 +00:00
ibaker
f645e9ccdc Remove direct AspectRatioFrameLayout usage from session demo
This class is a lower-level UI component that isn't directly needed if
apps are using `PlayerView` to handle their video output (it is used as
an implementation detail of `PlayerView`).

Removing its unecessary usages from this demo avoids developers copying
this as an example when building their own apps.

#cherrypick

PiperOrigin-RevId: 644972454
(cherry picked from commit cb8f87e05e)
2024-07-02 14:11:37 +00:00
tonihei
c14110cdbf Fix audio focus handling in ExoPlayerImpl
Some cases are not handled correctly at the moment:
 - Pausing during suppressed playback should not clear the
   suppression state.
 - Transient focus loss while paused should be reported as
   a playback suppression.

Issue: androidx/media#1436
#cherrypick
PiperOrigin-RevId: 644971218
(cherry picked from commit e84bb0d21c)
2024-07-02 14:11:37 +00:00
tonihei
05571b3e0d Clarify that onPlayWhenReadyChanged can be called again with new reason
Sometimes the reason for the current state may change. If we don't
report this again, users have no way of knowing that the reason
changed.

Also adjust ExoPlayerImpl and MediaControllerImplBase accordingly.
SimpleBasePlayer already adheres to this logic.

#cherrypick

PiperOrigin-RevId: 644970236
(cherry picked from commit 1d26d1891e)
2024-07-02 14:11:37 +00:00
tonihei
2fd6b60daa Move playWhenReadyChangeReason inside PlaybackInfo
This helps to keep the reason always together with the state it
is referring to, avoiding any side channels and making sure there
are no accidental inconsistencies.

#cherrypick

PiperOrigin-RevId: 644969317
(cherry picked from commit c0abd6f91e)
2024-07-02 14:11:37 +00:00
ibaker
30cb76269a Use SurfaceSyncGroup to ensure resize transaction isn't dropped
This workaround is only applied on API 34, because the problem isn't
present on API 33 and it is fixed in the platform for API 35 onwards.

Issue: androidx/media#1237

#cherrypick

PiperOrigin-RevId: 644729909
(cherry picked from commit 968f72fec6)
2024-07-02 14:11:37 +00:00
bachinger
4330d6a952 Use a localized fallback message for known error codes
In the case of a legacy session app providing an error
code different to `ERROR_UNKNOWN` without an error
message, a localized fallback message is provided
instead of ignoring the error.

#cherrypick

PiperOrigin-RevId: 644704680
(cherry picked from commit 6cc6444dd9)
2024-07-02 14:11:37 +00:00
bachinger
56ae85fa3c Allow session activity to be set per controller
PiperOrigin-RevId: 644693533
(cherry picked from commit 856d394c28)
2024-07-02 14:11:31 +00:00
tonihei
bd5f99cb09 Audio focus player command clean up
The 'player commands' returned to ExoPlayerImpl instruct the
player on how to treat the current audio focus state.

The current return value when playWhenReady==false is misleading
because it implies we are definitely not allowed to play as if
we've lost focus. Instead, we should return the actual player
command corresponding to the focus state we are in.

This has no practical effect in ExoPlayerImpl as we already
ignore the 'player command' completely  when playWhenReady=false.

To facilitate this change, we also introduce a new internal
state for FOCUS_NOT_REQUESTED to distinguish it from the state
in which we lost focus.

#cherrypick

PiperOrigin-RevId: 644416586
(cherry picked from commit 66c19390e2)
2024-07-02 14:10:12 +00:00
tonihei
d76316a1f7 Improve audio focus handling tests with ExoPlayer
There are a lot of tests for AudioFocusManager in isolation,
but almost none for the handling in ExoPlayer.

Add test coverage for all the common cases, including some
currently broken behavior that is indicated by TODOs.

PiperOrigin-RevId: 644319251
(cherry picked from commit e20e94fde2)
2024-07-02 14:10:12 +00:00
michaelkatz
023e9d1479 Version bump to media3:1.4.0-beta01
PiperOrigin-RevId: 644352776
(cherry picked from commit c07bbd333c)
2024-06-27 09:34:04 +00:00
michaelkatz
cfeee5b34e Update release notes for 1.4.0-beta01
#cherrypick

PiperOrigin-RevId: 644351958
(cherry picked from commit 794731607d)
2024-06-18 13:43:30 +00:00
michaelkatz
32bedfa93e Fix linter errors in DemoMediaLibrarySessionCallback.kt
PiperOrigin-RevId: 644002147
(cherry picked from commit ed07ac5d7d)
2024-06-17 14:57:01 +00:00
Copybara-Service
f36395ae66 Merge pull request #1437 from MGaetan89:add_exoplayer_setMaxSeekToPreviousPosition
PiperOrigin-RevId: 643987403
(cherry picked from commit 67a7b41fa7)
2024-06-17 14:57:01 +00:00
sheenachhabra
d833d59124 Update Media3 version number
PiperOrigin-RevId: 622211426
(cherry picked from commit 2a5b9afb88)
2024-04-05 10:09:43 -07:00
sheenachhabra
1792723be2 Update release notes for 1.3.1 bug fix release
PiperOrigin-RevId: 622189733
(cherry picked from commit 5fc35a6045)
2024-04-08 16:56:58 +00:00
sheenachhabra
1a710b06d0 Import string translations
#minor-release

PiperOrigin-RevId: 621828038
(cherry picked from commit d57229ad15)
2024-04-04 05:34:46 -07:00
ibaker
5fe906f1e9 Rollback of e665e2aee8
PiperOrigin-RevId: 619871653
(cherry picked from commit b60cd2c033)
2024-03-28 04:00:11 -07:00
Copybara-Service
7b5522fc58 Merge pull request #1054 from jekopena:main
PiperOrigin-RevId: 619573181
(cherry picked from commit 8fe70332ee)
2024-03-27 10:24:32 -07:00
ibaker
4caed3cfb2 Add PlayerView.setControllerAnimationEnabled(boolean)
Issue: androidx/media#1227
PiperOrigin-RevId: 619558900
(cherry picked from commit d684cdb330)
2024-03-27 09:36:22 -07:00
ibaker
26ce3f012a Fix javadoc on PlayerView.setControllerVisibilityListener
#minor-release

PiperOrigin-RevId: 619536799
(cherry picked from commit ebfd540817)
2024-03-27 08:17:03 -07:00
tonihei
a5d0cb51bc Don't apply performance point workaround from API 35
The workaround check is now part of CTS and we should be able
to rely on the PerformancePoints values (or at least can be sure
that they cover all CDD requirements)

#minor-release

PiperOrigin-RevId: 619201331
(cherry picked from commit 737bf08314)
2024-03-26 08:38:31 -07:00
ibaker
88ebc89da2 Plumb MP3 average bitrate from metadata frames into Format
Issue: androidx/media#1081

PiperOrigin-RevId: 619185083
(cherry picked from commit d00ca1e343)
2024-03-26 07:36:46 -07:00
ibaker
dca3c61c5b In-line versions only used by exoplayer-media2 extension
Also remove an unused `androidxTestServicesStorageVersion` version.

Issue: androidx/media#1216
PiperOrigin-RevId: 618990983
(cherry picked from commit 6cb25119fb)
2024-03-25 16:18:02 -07:00
tonihei
3657831923 Include nullness of MediaMetadata.extras in equals method
This ensures MediaMetadata with just non-null extras is not
considered equal to MediaMetadata.EMPTY. This makes sure the
contents are bundled when a controller sets the extras in a
new MediaItem

Issue: androidx/media#1176

PiperOrigin-RevId: 618876642
(cherry picked from commit ab0391167c)
2024-03-25 10:02:23 -07:00
ibaker
06a4036539 Remove unecessary re-setting of group from session Gradle files
These TODOs precede <unknown commit> when the group was set in the top-level
`build.gradle` file.

Issue: androidx/media#1215
PiperOrigin-RevId: 618835040
(cherry picked from commit fd268eed46)
2024-03-25 07:30:24 -07:00
tonihei
5fc9ddab0b Partial revert of 3a7d31a599
The original change did not set the color info in the codec
for standard SDR infos. This was meant to help with consistency
to avoid a situation where the information is partially set and
later the bitstream provides slightly different values (all in
standard SDR though).

We can revert this part because the bitstream may change anyway
and the decoder needs to handle this internally. And more
importantly, it also avoids removing this information when encoding
the format again in Transformer.

PiperOrigin-RevId: 617582066
(cherry picked from commit ed505df2ca)
2024-03-20 11:48:23 -07:00
tonihei
b0adf2fe43 Don't set codec color info for default SDR
Some media can read color info values from the bitstream
and may partially set some of the SDR default values in
Format.ColorInfo. Setting these default values for SDR can
confuse some codecs and may also prevent adaptive ABR
switches if not all ColorInfo values are set in exactly the
same way.

We can avoid any influence of HDR color info handling by
disabling setting the color info MediaFormat keys for SDR
video and also avoid codec reset at format changes if both
formats are SDR with slightly different ColorInfo settings.

To identify "SDR" ColorInfo instances, we need to do some
fuzzy matching as many of the default values are assumed to
match the SDR profile even if not set.

Issue: androidx/media#1158
PiperOrigin-RevId: 617473937
(cherry picked from commit 3a7d31a599)
2024-03-20 04:55:06 -07:00
ibaker
961d204c2c Fix proguard rule for DefaultVideoFrameProcess.Factory.Builder.build()
Issue: androidx/media#1187

#minor-release

PiperOrigin-RevId: 616112879
(cherry picked from commit 48cffc849a)
2024-03-15 06:46:53 -07:00
ibaker
d195b094b4 Don't emit a CuesWithTiming for zero-duration Subtitle events
It's a bit arguable whether the `Subtitle` implementation supports
zero-duration events, since `getEventTimeCount` is documented as
effectively "the number of times the cues returns by `getCues(long)`
changes", and zero-duration events violate that. However, the current
`WebvttSubtitle` impl **does** produce zero-duration events, so it
seems safer to handle them gracefully here and then, as a possible
follow-up, fix the `WebvttSubtitle` impl (or remove it completely).

Issue: androidx/media#1177

PiperOrigin-RevId: 616095798
(cherry picked from commit e9ed874e51)
2024-03-15 05:22:47 -07:00
Copybara-Service
8a169d104f Merge pull request #1117 from loliball:dev_wav_align_fix
PiperOrigin-RevId: 615820438
(cherry picked from commit e9a28beb44)
2024-03-14 10:17:49 -07:00
andrewlewis
6f0b70ea78 Add short form content demo to project
#minor-release

PiperOrigin-RevId: 615756117
(cherry picked from commit 9da878956a)
2024-03-14 06:25:23 -07:00
ibaker
860f18f29c Move test-session-xxx modules from core_settings to settings
This ensures these modules are only configured when directly working
on the library, rather than when depending on it locally. These modules
only contain tests, they shouldn't be depended on by any apps (and are
not published via Maven).

PiperOrigin-RevId: 615004801
(cherry picked from commit c41213c273)
2024-03-12 05:30:06 -07:00
michaelkatz
561dafcdea Start playing period-enabled renderers when setting playWhenReady true
Renderers may be enabled for subsequent media items as soon as the current media item's renderer's isEnded() returns true. Currently, when a player is set to pause, it stops all renderers that are `STATE_STARTED`. When a player is set to play, it starts all renderers that are enabled. This would include renderers that were enabled early for the subsequent media item. The solution is to only start renderers that are enabled by the current playing period.

Issue: androidx/media#1017
PiperOrigin-RevId: 614734437
(cherry picked from commit 8b219b0ae6)
2024-03-11 11:27:26 -07:00
tonihei
c8ae6d1142 Always set PARAMETER_KEY_TUNNEL_PEEK when tunneling
This should already be the default, but some devices seem
to not adhere to this contract and assume the default is unset.

Issue: androidx/media#1169
PiperOrigin-RevId: 614697283
(cherry picked from commit cbed80ecf3)
2024-03-11 09:46:07 -07:00
tonihei
3f3d60eb6a Add device-specific opt-ins for async MediaCodecAdapter
Some devices just don't work very well with the synchronous
model, but are currently still excluded from our approximate
API 31 check. This change allows to include additional devices
or device groups by passing in the Context to the default
adapter.

It also adopts the workaround added in ebceee08c6
for Fire TV Smart devices that exhibit this issue.

PiperOrigin-RevId: 614642545
(cherry picked from commit e4a55844d0)
2024-03-11 06:27:15 -07:00
tonihei
fffbf9ac4e Force external surround sound flag if requested by device
Some FireOS6 devices ask to force the external surround global
flag and ignore any signals from the HDMI connection.

This is the equivalent change of e341944d1e

PiperOrigin-RevId: 614634499
(cherry picked from commit 410c0492cc)
2024-03-11 05:52:52 -07:00
tonihei
a85d9e251c Reorder audio capability checks
Using the more accurate check available on later API versions
first is likely better than falling back to a fallback solution
from older API versions.

PiperOrigin-RevId: 614612628
(cherry picked from commit 18cbbf3850)
2024-03-11 04:14:31 -07:00
tonihei
a72a23266b Document MergingMediaSource tag contract
Issue: androidx/media#883

#minor-release

PiperOrigin-RevId: 613970048
(cherry picked from commit eb6f607717)
2024-03-08 10:11:55 -08:00
ibaker
4db96acee6 Add opt-in flag for the MIDI module for apps with a local dependency
PiperOrigin-RevId: 613938538
(cherry picked from commit 4bca1ac47b)
2024-03-08 08:13:55 -08:00
ibaker
e55621496c Add workarounds for NoSuchMethodError from DRM framework exceptions
Issue: androidx/media#1145

PiperOrigin-RevId: 613573868
(cherry picked from commit a604600126)
2024-03-07 07:13:01 -08:00
tofunmi
2dc2e5daf1 Composition: clarify javadoc to setTransmuxAudio\Video
Document that assoicated effects are ignored if these setters are set

PiperOrigin-RevId: 613518167
(cherry picked from commit 5b7774fcaf)
2024-03-07 02:55:30 -08:00
ibaker
41771d7fa3 Set Format.frameRate for single-frame MP4 tracks
Issue: androidx/media#1051
PiperOrigin-RevId: 613516802
(cherry picked from commit afacf2cdb7)
2024-03-07 02:49:59 -08:00
michaelkatz
71bfdd1bce Start early-enabled renderers only after advancing the playing period
Renderers may be enabled for subsequent media items as soon as the current media item's renderer's isEnded() returns true. When a renderer is being enabled and the player is 'playing', that renderer is also started. When playing a mixed playlist of images and content with audio & video, the player may skip some image items because the early-starting of the audio renderer causes a clock update.

A solution is to only start the "early-enabled" renderers at the point of media transition and add a condition on DefaultMediaClock to use the standalone clock when reading-ahead and the renderer clock source is not in a started state.

Issue: androidx/media#1017
PiperOrigin-RevId: 613231227
(cherry picked from commit 638b2a3c86)
2024-04-05 13:05:36 +00:00
andrewlewis
3fdd3bdb7a Fix typo
PiperOrigin-RevId: 613156951
(cherry picked from commit a90a7049e8)
2024-03-06 03:47:22 -08:00
ibaker
b6cb9c1b90 Fix some invalid javadoc references caught by a new JDK version
PiperOrigin-RevId: 612808322
(cherry picked from commit 3a43bd7687)
2024-04-02 18:43:29 +00:00
tonihei
672d149a73 Remove invalid command comparison
The removed check searched for a player command inside a list of
session commands, which is not allowed by the IntDef definition
and only worked because both types map to a Java int.

PiperOrigin-RevId: 612758442
(cherry picked from commit c79ac5ba21)
2024-04-02 18:36:27 +00:00
Copybara-Service
e28d772423 Merge pull request #1025 from v-novaltd:dsparano-exo209
PiperOrigin-RevId: 612485043
(cherry picked from commit bbdaf2b092)
2024-04-02 18:36:27 +00:00
tianyifeng
cf9ff4de45 Avoid position jumping back when controller replaces the current item
When the controller replaces the current item, the masking position will be changed to the default position of the new item for a short while, before the correct position comes from the session. This will interrupt the current position fetched from the controller when the playback doesn't interrupted by the item replacing.

Issue: androidx/media#951

PiperOrigin-RevId: 611417539
(cherry picked from commit 1bdc58de0b)
2024-04-02 18:36:22 +00:00
ibaker
1d2116c53a Add fps-awareness to DefaultTrackSelector
This change aims to prioritise tracks that have a 'smooth enough for
video' frame rate, without always selecting the track with the highest
frame rate.

In particular MP4 files extracted from motion photos sometimes have two
HEVC tracks, with the higher-res one having a very low frame rate (not
intended for use in video playback). Before this change
`DefaultTrackSelector` would pick the low-fps, high-res track.

This change adds a somewhat arbitrary 10fps threshold for "smooth video
playback", meaning any tracks above this threshold are selected in
preference to tracks below it. Within the tracks above the threshold
other attributes are used to select the preferred track. We deliberately
don't pick the highest-fps track (over pixel count and bitrate), because
most users would prefer to see a 30fps 4k track over a 60fps 720p track.

This change also includes a test MP4 file, extracted from the existing
`jpeg/pixel-motion-photo-2-hevc-tracks.jpg` file by logging
`mp4StartPosition` in
[`MotionPhotoDescription.getMotionPhotoMetadata`](b930b40a16/libraries/extractor/src/main/java/androidx/media3/extractor/jpeg/MotionPhotoDescription.java (L123))
and then using `dd`:

```
mp4StartPosition=2603594

$ dd if=jpeg/pixel-motion-photo-2-hevc-tracks.jpg \
    of=mp4/pixel-motion-photo-2-hevc-tracks.mp4 \
    bs=1 \
    skip=2603594
```

----

This solution is in addition to the `JpegMotionPhotoExtractor` change
made specifically for these two-track motion photos in
5266c71b3a.
We will keep both changes, even though that change is not strictly
needed after this one, because adding the role flags helps to
communicate more clearly the intended usage of these tracks. This
change to consider FPS seems like a generally useful improvement to
`DefaultTrackSelector`, since it seems unlikely we would prefer a 5fps
video track over a 30fps one.

Issue: androidx/media#1051
PiperOrigin-RevId: 611015459
(cherry picked from commit c7e00b12b4)
2024-04-02 18:34:46 +00:00
michaelkatz
3521ccda9b Fallback to legacy sizerate check if CDD H264 PerfPoint check fails
Some devices supporting Performance Points for decoder coverage are missing coverage over the CDD requirements for H264. For these cases ExoPlayer should fall back to legacy resolution and frame rate support checks. If there is a stream evaluated as a PerformancePointCoverageResult of COVERAGE_RESULT_NO, then ExoPlayer checks for coverage of the 720p H264 CDD requirement.

Issue: google/ExoPlayer#10898

Issue: androidx/media#693

Issue: androidx/media#966
PiperOrigin-RevId: 609740128
(cherry picked from commit 23a301fc5d)
2024-04-02 18:30:13 +00:00
christosts
3c10b41ffa ExoPlayerImplInternal.releaseInternal(): unblock the app thread
This change makes ExoPlayerImplInternal.releaseInternal() unblock the
app thread if a runtime exception is thrown while releasing components
from the playback thread.

Before this change, if a runtime exception occurred during releasing
components in the playback thread, ExoPlayer.release() would wait for
`releaseTimeoutMs` and then raise a player error. With this change,
the player error is reported only when the playback thread is blocked
but if there is a runtime exception, the application thread is
unblocked.

The impact of this change is potentially fewer ANRs on
ExoPlayer.release() at the expense of less error reporting.

PiperOrigin-RevId: 609702549
(cherry picked from commit 0480eff6a1)
2024-04-02 18:27:25 +00:00
christosts
25e8dc5e8b ForwardingAudioSink: add override for release()
We forgot to add it when we added AudioSink.release(). The commit
includes a test that ensures ForwardingAudioSink overrides all the
methods defined in the AudioSink interface.

PiperOrigin-RevId: 609402258
(cherry picked from commit 440d2ab162)
2024-04-02 18:24:37 +00:00
michaelkatz
81e91c25f1 Use playing period TrackSelectorResult in track reselection update
If the reading period has already advanced and a track reselection procs that only affects the reading period media, then ExoPlayer may try and apply the reading period's track selection incorrectly unto the playing period. ExoPlayer should apply the playing period's track selection to the playing period instead.

PiperOrigin-RevId: 609375077
(cherry picked from commit 4192924622)
2024-04-02 18:24:37 +00:00
michaelkatz
ed71172ade Allow renderer retry for audio track offload initialization failure
If render error occurs due to AudioTrack initialization failure in offload mode, then ExoPlayer should allow retry as subsequent attempt will be with DefaultAudioSink disabling offload.

PiperOrigin-RevId: 609304897
(cherry picked from commit 9046f2edb6)
2024-04-02 18:24:33 +00:00
tianyifeng
2ae79959ef Fix a bug in retaining streams when preload a PreloadMediaPeriod again
The `PreloadMediaPeriod.selectTracksForPreloading` can be called for multiple times at the preloading stage (before the period is being played). For example, when the period resumes preloading. This change fix the assertion failure in `ProgressiveMediaPeriod.selectTracks` caused by the wrong implementation of `PreloadMediaPeriod.selectTracksForPreloading` when it is trying to retain the previously preloaded streams.

Also the `TrackSelectorResult` parameter is changed to a list of `ExoTrackSelection`. We should compare the selections only rather than considering the `RendererConfiguration` in the `TrackSelectorResult` to decide whether to retain the streams, as for preloading case the renderers haven't consumed the samples yet.

PiperOrigin-RevId: 609126868
(cherry picked from commit d952a06214)
2024-04-02 18:21:05 +00:00
michaelkatz
2f47151131 Allow empty information attributes in RTSP Session Description
Issue: androidx/media#1087
PiperOrigin-RevId: 608534659
(cherry picked from commit 52c1d60d39)
2024-04-02 17:08:26 +00:00
Googler
04ce83691e Fix failure to write negative PTS sample
Fixes an issue caused by no support for negative audio PTS and edit lists
in FrameworkMuxer, Android versions before 11

PiperOrigin-RevId: 607690507
(cherry picked from commit e43f96687c)
2024-04-02 16:57:22 +00:00
ibaker
b218d910ad Fix docs on playUntilStartOfMediaItem to match playUntilPosition
The behaviour and docs of `playUntilPosition` were changed in
00c7a9bcbb.

This change also affects `playUntilStartOfMediaItem` (since it delegates
to `playUntilPosition`), so the same doc change should also be made
here.

#minor-release

PiperOrigin-RevId: 607364897
(cherry picked from commit fa3212e73e)
2024-04-02 16:41:12 +00:00
claincly
396ae86fdd Fix forward for 216f3fedb8
The original change missed copying the newly added flag in `buildUpon()`, which
caused some test flakes.

PiperOrigin-RevId: 607232373
(cherry picked from commit ae0da442b1)
2024-04-02 16:41:12 +00:00
ibaker
61a3127468 Demo app: Clarify that only Widevine DRM content can be downloaded
Issue: androidx/media#1085
PiperOrigin-RevId: 606921440
(cherry picked from commit a0727fe4d7)
2024-04-02 16:41:12 +00:00
bachinger
879bcb5d99 Check whether the session activity pending intent is an activity
PiperOrigin-RevId: 606613694
(cherry picked from commit 89571c0a92)
2024-04-02 16:41:11 +00:00
tofunmi
c58adb097a Add release notes for recent transformer features
PiperOrigin-RevId: 606565385
(cherry picked from commit caf584152d)
2024-04-02 16:41:03 +00:00
claincly
5fd1f61c84 Loosen the requirement to register every input frame
VideoFrameProcessor requires every input frame to be registered before they are
rendered to its input Surface. This CL adds the option to register the input
frame only once. This is useful for camera inputs where not all input frames
come with changing FrameInfo.

PiperOrigin-RevId: 606294894
(cherry picked from commit 216f3fedb8)
2024-04-02 16:14:01 +00:00
michaelkatz
c4688fc557 Fallback to including track language name if display name is not found
Issue: androidx/media#988
PiperOrigin-RevId: 606193299
(cherry picked from commit 0b0c419c73)
2024-04-02 16:13:56 +00:00
huangdarwin
2ec19a5da5 HDR: Add color-space conversion for PQ tone-map.
Previously, we missed the BT2020->BT709 color-space conversion.

A user-visible impact of this is that red and green channels used to be
undersaturated, but now are more correctly saturated.

PiperOrigin-RevId: 605411926
(cherry picked from commit a5e47982f4)
2024-04-02 16:12:42 +00:00
tofunmi
39f26e6041 DefaultAssetLoaderFactory: Simplify file extension retrival
Change the file extension retrieval back to how it was before 5488d33da8 to reduce the change of false negatives in `isImage()`

PiperOrigin-RevId: 605281186
(cherry picked from commit 4d29d8f012)
2024-04-02 16:11:10 +00:00
huangdarwin
9825e21a71 Effect: Remove extra checkStateNotNull by reordering logic.
PiperOrigin-RevId: 603660773
(cherry picked from commit ae85ba9ee9)
2024-04-02 16:11:10 +00:00
huangdarwin
ecaff24e46 Effect: Use element instead of peek, when throwing if null.
If nullness should result in an exception, we should throw as soon as possible,
so that stack traces are easier to follow.

Did a quick scan of media3.effect+transformer and this covers all uses of
peek that immediately throw there.

PiperOrigin-RevId: 603393366
(cherry picked from commit dd7846ee1c)
2024-04-02 16:11:10 +00:00
huangdarwin
bfa492bf4f HDR: Don't assume that swapping between BT709 and BT601 needs tone-map.
VideoFrameProcessor treats BT601 and BT709 as roughly equivalent now, so we
shouldn't be making checks that assume BT709 <-> requires tone-mapping.

Also, the color transfer is a better determinant for tone-mapping than color range, so use just the transfer to determine if tone-mapping is required.

PiperOrigin-RevId: 603083100
(cherry picked from commit cebe6d8ba5)
2024-04-02 16:11:10 +00:00
Ian Baker
d13a0f4ec6 Merge branch 'release' into release-1.3.0 2024-03-07 09:25:30 +00:00
sheenachhabra
99e7156561 Update media3 version for 1.3.0 stable release
PiperOrigin-RevId: 609745599
(cherry picked from commit 9be7a7ab7f)
2024-02-26 12:15:21 +00:00
sheenachhabra
c6a6b81d96 Update release notes section for 1.3.0 stable release
PiperOrigin-RevId: 609407248
(cherry picked from commit 82065e699a)
2024-02-26 12:15:05 +00:00
sheenachhabra
ee0eac7e31 Fix nit issues in 1.3.0-rc01 release notes
PiperOrigin-RevId: 608580903
(cherry picked from commit ebcb4e8b21)
2024-02-20 16:31:17 +00:00
sheenachhabra
fbf8ac37c3 Version bump to media3:1.3.0-rc01
PiperOrigin-RevId: 605573991
(cherry picked from commit a31a384393)
2024-02-09 11:39:45 +00:00
sheenachhabra
43ee291172 Update release notes for media3:1.3.0-rc01
#minor-release

PiperOrigin-RevId: 605561427
(cherry picked from commit c4605b3c90)
2024-02-09 11:34:02 +00:00
tianyifeng
38d5635818 Report the skipped silence more deterministically
Issue: androidx/media#1035
#minor-release
PiperOrigin-RevId: 605361126
(cherry picked from commit 9b0cdde7d2)
2024-02-08 19:09:41 +00:00
tonihei
e492e37baa Move release note to the right section
#minor-release

PiperOrigin-RevId: 605310711
(cherry picked from commit e56e27e725)
2024-02-08 17:30:17 +00:00
ibaker
dbb99fef19 Rollback of 406c0a15be
PiperOrigin-RevId: 605015994
(cherry picked from commit 3a7a665d5d)
2024-02-08 17:30:17 +00:00
ibaker
1dc4377a4b Stop double-encoding CMCD query parameters
`Uri.appendQueryParameter` is documented to encode its arguments, so
calling `Uri.encode` beforehand results in double-encoding.

Issue: androidx/media#1075

#minor-release

PiperOrigin-RevId: 604995441
(cherry picked from commit 7ebfed505c)
2024-02-08 17:30:17 +00:00
tonihei
245e6231d9 Set correct track id when skipping empty tracks in Mp4Extractor
The track id must be the index in the list of published tracks
as it's used as such elsewhere. This is currently not true if we
skip an empty track as all subsequent tracks get a wrong or even
invalid id.

#minor-release

PiperOrigin-RevId: 604929178
(cherry picked from commit 5f9c96ab53)
2024-02-08 17:30:17 +00:00
bachinger
74d0f93dd4 Fix the regex used for validating custom CMCD key names
Relax the regex to only check for hyphen which is required by the specification.

Issue: androidx/media#1028
#minor-release
PiperOrigin-RevId: 604719300
(cherry picked from commit 138532e3fd)
2024-02-08 17:30:17 +00:00
tianyifeng
9f28e7d81b Improve AudioCapabilities with AudioManager API in Android 13
PiperOrigin-RevId: 604700601
(cherry picked from commit ccd603acb0)
2024-02-08 17:30:17 +00:00
ibaker
bf8b8749fe JpegMotionPhotoExtractor: Don't emit an image track with no metadata
The current implementation of `JpegMotionPhotoExtractor.sniff` returns
`true` for any image with Exif data (not just motion photos). Improving
this is tracked by b/324033919. In the meantime, when we 'extract' a
non-motion photo with `JpegMotionPhotoExtractor`, the result is
currently a single empty image track and no video track (since there's
no video, since this isn't a motion photo). This 'empty' image track
is usually used to transmit metadata about the video parts of the
image file (in the form of `MotionPhotoMetadata`), but this metadata is
also (understandably) absent for non-motion photos. Therefore there's
no need to emit this image track at all, and it's clearer to emit no
tracks at all when extracting a non-motion photo using
`JpegMotionPhotoExtractor`.

This change also removes a `TODO` that is misplaced, since there's no
image bytes being emitted here (and never was).

PiperOrigin-RevId: 604688053
(cherry picked from commit 7ae3d69e00)
2024-02-08 17:30:16 +00:00
ibaker
7721f387ca Check sampleMimeType rather than containerMimeType for images
These are often the same for image tracks, since we usually drop the
whole image file (both the container and actual encoded image bytes)
into a single sample, but there are cases where we emit a track with
`containerMimeType=image/jpeg` but **no** samples (from
`JpegMotionPhotoExtractor`, to carry some metadata about the image +
video byte offsets).

It's therefore more correct to implement the `supportsFormat` check
based on `sampleMimeType`, so that these 'empty' image tracks are not
considered 'supported' by `ImageRenderer`.

#minor-release

PiperOrigin-RevId: 604672331
(cherry picked from commit eabba49610)
2024-02-08 17:30:16 +00:00
bachinger
dc8d3eaf30 Add constructor that takes only a Context
#minor-release

PiperOrigin-RevId: 604659845
(cherry picked from commit c2273345c5)
2024-02-08 17:30:16 +00:00
tonihei
ca2779e774 Add source prefix to MergingMediaPeriod Format ids
This was already done for the TrackGroup ids in <unknown commit>,
but in some scenarios only the Format instances are known and
it's helpful to be able to identify where they came from.

Issue: androidx/media#883

#minor-release

PiperOrigin-RevId: 604644039
(cherry picked from commit f8f6d80477)
2024-02-08 17:30:16 +00:00
tonihei
a294dc9bc5 Include nullness of RequestMetadata.extras in equals method
This ensures RequestMetadata with just non-null extras is not
considered equal to RequestMetadata.EMPTY. This makes sure the
contents are bundled when a controller sets the extras in a
new MediaItem.

PiperOrigin-RevId: 604632788
(cherry picked from commit 766a15a51e)
2024-02-08 17:30:16 +00:00
ibaker
ad57b41da1 Clearly define the consistency requirements for SequenceableLoader
Add a test for this consistency in `CompositeSequenceableLoaderTest`,
and also make the
`CompositeSequenceableLoaderTest.FakeSequenceableLoader` implementation
more realistic.

#minor-release

PiperOrigin-RevId: 604604103
(cherry picked from commit db74bb9609)
2024-02-08 17:30:16 +00:00
Googler
4a952170a2 Fix Kotlin 2.0 compilation error in session demo app
Since Kotlin 2.0 the compiler became better at detecting incorrect
annotation applications. The @OptIn annotation can't be applied to an
expression, so when compiling with Kotlin 2.0 it results in an error.

PiperOrigin-RevId: 604596657
(cherry picked from commit 718cf1299b)
2024-02-08 17:30:16 +00:00
ibaker
4eea69dd46 Merge Cea608Parser back into Cea608Decoder
This reverses 27caeb8038

Due to the re-ordering of packets done in `CeaDecoder`, there's no way
to use the current implementation to correctly parse these subtitle
formats during extraction (the `SubtitleParser` interface), so we have
to keep the `SubtitleDecoder` implementations.

#minor-release

PiperOrigin-RevId: 604594837
(cherry picked from commit 25498b151b)
2024-02-08 17:30:16 +00:00
ibaker
dd2e4a5978 Merge Cea708Parser back into Cea708Decoder
This reverses 94e45eb4ad

Due to the re-ordering of packets done in `CeaDecoder`, there's no way
to use the current implementation to correctly parse these subtitle
formats during extraction (the `SubtitleParser` interface), so we have
to keep the `SubtitleDecoder` implementations.

#minor-release

PiperOrigin-RevId: 604350951
(cherry picked from commit 51b4fa2cc8)
2024-02-08 17:30:16 +00:00
tonihei
548c4ce799 Fix HlsPlaybackTest flakiness
The new test introduced in 45bd5c6f0a is flaky because we only
wait until the media is fully buffered. However, we can't fully
control how much of this data is initially read by the Robolectric
codec and thus the output dump files (containing these codec
interactions) are flaky.

This can be fixed by fully playing the media once and then seeking
back instead.

#minor-release

PiperOrigin-RevId: 603324068
(cherry picked from commit e3e57c9b99)
2024-02-08 17:30:16 +00:00
michaelkatz
7758e422aa Render last image despite not receiving EoS
If seeking between last image sample and end of the file where the current stream is not final, then EoS sample will not be provided to `ImageRenderer`. ImageRenderer must still produce the last image sample.

PiperOrigin-RevId: 603312090
(cherry picked from commit 62c7ee0fb0)
2024-02-08 17:30:16 +00:00
Copybara-Service
127d0b5f3c Merge pull request #1011 from cedricxperi:dts-lbr-hls-bitrate-unknown-fix
PiperOrigin-RevId: 603302863
(cherry picked from commit f85860c041)
2024-02-08 17:30:16 +00:00
Copybara-Service
ad519e2e7e Merge pull request #1015 from kamaroyl:feat/PsshVersion1
PiperOrigin-RevId: 603016920
(cherry picked from commit dfcc2cb41d)
2024-02-08 17:30:16 +00:00
Copybara-Service
3d87578779 Merge pull request #1031 from garethfenn:hlschunkseek
PiperOrigin-RevId: 603008793
(cherry picked from commit 45bd5c6f0a)
2024-02-08 17:30:04 +00:00
claincly
a18d96c320 Fix blank video when switching on/off screen
This happens when using `ExoPlayer.setVideoEffects()`.

This CL also fixes the first frame not rendered problem, originally solved in
7e65cce967, but rolled back in 5056dfaa2b because the solution introduces
the flash that is observed in b/292111083.

Before media3 1.1 release, the output size of `VideoFrameProcessor` is not
reported to the app. This was changed later after introducing
`CompositingVideoSinkProvider`, where the video size after processing **is**
reported to the app. After this CL, the size is again, not reported.

PiperOrigin-RevId: 602345087
(cherry picked from commit dcae49a561)
2024-02-08 17:29:13 +00:00
tonihei
dfe47219f9 Update skip silence algorithm
The updated algorithm has two main improvements:
 - The silence padding is not constant but a ratio of the original
   silence (up to a defined max) to more naturally represent the
   original gaps.
 - The silence is not instantly going to zero, but uses a ramp down
   and up for a smooth volume transition and also retains a small
   percentage of the original noise for more natural "silences" that
   still contain some background noise.

#minor-release

Issue: google/ExoPlayer#7423
PiperOrigin-RevId: 602322442
(cherry picked from commit bb533332f4)
2024-02-08 17:29:12 +00:00
jbibik
826f20dbbd Remove a redundant TODO in Util
PiperOrigin-RevId: 601820851
(cherry picked from commit eb3173aa90)
2024-02-08 17:29:12 +00:00
tonihei
4560611bd0 Remove misleading @CanIgnoreReturnValue
The return value of onConfigure must not be ignored as it specifies
the output format of the processor, which may be different from the
input format.

#minor-release

PiperOrigin-RevId: 601799440
(cherry picked from commit 2fc5590e7a)
2024-02-08 17:29:12 +00:00
tonihei
4a7442ef3a Replace or suppress deprecated usages
Many usages are needed to support other deprecations and some
can be replaced by the recommended direct alternative.

Also replace links to deprecated/redirected dev site

PiperOrigin-RevId: 601795998
(cherry picked from commit ed5b7004b4)
2024-02-08 17:29:12 +00:00
ibaker
0886da450d Add a comment to suggest keeping JUnit version in sync with the Android
source tree - to make importing GTS tests easier.

PiperOrigin-RevId: 601725811
(cherry picked from commit 373822ce45)
2024-02-08 17:29:12 +00:00
Googler
ddca0116b2 Update IMA README to include link to supported platforms
PiperOrigin-RevId: 601720412
(cherry picked from commit 807d98a3d6)
2024-02-08 17:29:12 +00:00
sheenachhabra
4570ee9275 Fix link to 1.3.0-alpha01 release
PiperOrigin-RevId: 601469906
(cherry picked from commit 605689a020)
2024-01-26 11:15:09 +00:00
sheenachhabra
7822613cc6 Version bump to media3:1.3.0-beta01
PiperOrigin-RevId: 601441910
(cherry picked from commit 21ab474260)
2024-01-25 16:23:46 +00:00
ibaker
4382aa0b34 Make Cea608Parser and Cea708Parser package-private
It's likely that we will merge these back into their `XXXDecoder`
implementations, but this smaller change allows us to avoid including
these public symbols in the upcoming release.

#minor-release

PiperOrigin-RevId: 601432629
(cherry picked from commit 12157a6b1a)
2024-01-25 16:20:26 +00:00
sheenachhabra
e29e775732 Update release notes for Media3 1.3.0-beta01 release
#minor-release

PiperOrigin-RevId: 601408404
(cherry picked from commit 79b0b8090c)
2024-01-25 16:20:26 +00:00
ibaker
8770286a8e Throw immediately from ExoPlayer.setVideoEffects() if dep not found
This method works by reflectively loading classes from the `lib-effect`
module, in order to avoid a hard dependency on this module for ExoPlayer
users that don't want video effect functionality. This change ensures
that a failure to load the necessary classes fails immediately, instead
of on a later thread inside `MediaCodecVideoRenderer` when the
reflection currently happens.

Also update the javadoc to make the dependency requirement clear.

#minor-release

PiperOrigin-RevId: 601387957
(cherry picked from commit a6812156e6)
2024-01-25 11:42:44 +00:00
jbibik
748fec1ac6 Add a setter of SubtitleParser.Factory to MediaSource.Factory
DASH: `DashMediaSource.Factory` would only propagate it to `DashChunkSource.Factory` -> `BundledChunkExtractor.Factory`

SS: `SSMediaSource.Factory` -> `SsChunkSource.Factory`

HLS: `HlsMediaSource.Factory` -> `HlsExtractorFactory`

Remove nullability of SubtitleParser.Factory across the stack

#minor-release

PiperOrigin-RevId: 601250013
(cherry picked from commit f103a2dcf5)
2024-01-25 11:42:44 +00:00
christosts
55e3dd77c6 Rollback of e364510937
PiperOrigin-RevId: 601187997
(cherry picked from commit 85db94782a)
2024-01-25 11:42:44 +00:00
jbibik
0713d56efc Add setters of SubtitleParser.Factory and experimental toggle
The `SubtitleParser.Factory` is no longer @Nullable and the experimenting toggle is used to enable/disable the use of this factory for subtitle parsing during extraction.

The three places that will hold the "truth" for the `SubtitleParser.Factory` are: BundledChunkExtractor.Factory, SsChunkSource.Factory, DefaultHlsExtractorFactory

DASH: `DashMediaSource.Factory` would only propagate it to `DashChunkSource.Factory` -> `BundledChunkExtractor.Factory`

SS: `SSMediaSource.Factory` -> `SsChunkSource.Factory`

HLS: `HlsMediaSource.Factory` -> `HlsExtractorFactory`

#minor-release

PiperOrigin-RevId: 601151615
(cherry picked from commit 4d7b23f0d1)
2024-01-25 11:42:44 +00:00
sheenachhabra
9581af110a Write "stco" box instead of "co64" for fragmented MP4
As per MP4 spec ISO 14496-12: 8.7.5 Chunk Offset Box, Both "stco" and
"co64" can be used to store chunk offsets. While "stco" supports 32-bit
offsets, "co64" supports 64-bit offsets.
In non fragmented MP4, the mdat box can be extremely large, hence muxer
uses "co64" box.
But for fragmented MP4, muxer does not write any data in this chunk offset
box (present in "moov" box) because all sample related info is present in
"moof" box.
Technically, "co64" box should also work in fragmented MP4because
its empty only but QuickTime player fails to play video if "co64"
box is present in fragmented MP4 output file.

Testing: Verified that QuickTime player does not play video when "co64"
box is present but is able to play when "stco" box is present.

#minor-release

PiperOrigin-RevId: 601147046
(cherry picked from commit 0acf6902e5)
2024-01-25 11:42:44 +00:00
jbibik
db420350f8 Remove SubtitleParser.Factory references from Hls/Ss/DashMediaPeriod
Those classes only needed to have access to a `SubtitleParser.Factory` to get a potentially updated `Format` for TrackGroups. The `SubtitleParser.Factory` was only used to check the support for the `mimeType` and getting some cue-related behaviour.

This introduced complexity in a way that both Periods and Extractors needed to have the same `SubtitleParser.Factory` in their individual stacks. To ensure that the sample queue would get the same transcoded/original format.

Instead, now we expose `getOutputTextFormat` methods on `ChunkExtractor.Factory`, `SsChunkSource.Factory` and `HlsExtractorFactory`. Those are the dependencies that Hls/Ss/DashMediaPeriod can make use of to delegate the format-updating logic to.

#minor-release

PiperOrigin-RevId: 601130714
(cherry picked from commit 966b710897)
2024-01-25 11:42:44 +00:00
rohks
cfb676adaf Add Mp4ExtractorTest for sample with edit list (edts box)
The sample has multiple sync frames for video track.

PiperOrigin-RevId: 601129350
(cherry picked from commit f8dbbc82e2)
2024-01-25 11:42:44 +00:00
sheenachhabra
539a8f9a24 Write sample data offset related fields in tfhd and trun box
This fix makes output playable on VLC player.
The output does not play on QuickTime player which is being fixed in
a separate CL.

#minor-release

PiperOrigin-RevId: 601118813
(cherry picked from commit 806f90922b)
2024-01-25 11:42:44 +00:00
michaelkatz
db0262efdb Keep stream offset alive in ImageRenderer until stream transition
Fix modeled after OutputStreamInfo usage for stream offset in `MediaCodecRenderer`

PiperOrigin-RevId: 601109900
(cherry picked from commit 688622eb47)
2024-01-25 11:42:44 +00:00
tofunmi
a6756c6d40 MuxerWrapper rotation degree fix
Allow setAdditionalRotationDegrees to be called with same rotation after tracks added. This is needed for processes that mux files partially trim optimization so they don't error out after hitting the check state

Manually tested to ensure trim optimization succeeds, automated test added here as well

PiperOrigin-RevId: 601081778
(cherry picked from commit b94c7d08c1)
2024-01-25 11:42:44 +00:00
ibaker
97b8f1add9 Add proguard keep rules for ExoPlayer.setVideoEffects
These symbols in `lib-effect` are referenced via reflection from
`CompositingVideoSinkProvider` in `lib-exoplayer` in order to avoid
a hard dependency from `lib-exoplayer` to `lib-effect`. Without this
keep rule, the symbols can get renamed by R8 resulting in the
invocations failing.

#minor-release

PiperOrigin-RevId: 601074636
(cherry picked from commit e5621cc709)
2024-01-25 11:42:44 +00:00
timpeut
be0d531857 Suppress nullability warnings
PiperOrigin-RevId: 600891113
(cherry picked from commit 9c1aaa7c43)
2024-01-25 11:42:44 +00:00
tianyifeng
733c982a21 Change the behaviour in MediaMetadata.Builder.populate
Populate both `artworkUri` and `artworkData` in
`MediaMetadata.Builder.populate(MediaMetadata)` when at least one of them is non-null.

Issue: androidx/media#964
PiperOrigin-RevId: 600826103
(cherry picked from commit 35ac46b92e)
2024-01-25 11:42:44 +00:00
sheenachhabra
426dd77ac0 Suppress lint warning about missing POST_NOTIFICATIONS permission
For media session related notifications, permission is not required.
https://developer.android.com/develop/ui/views/notifications/notification-permission#exemptions-media-sessions

#minor-release

PiperOrigin-RevId: 600819251
(cherry picked from commit b98e5ac0d4)
2024-01-25 11:42:44 +00:00
sheenachhabra
081baa03b9 Process all tracks before writing fragment in fragmented MP4
Earlier implementation processed each track (pending sample's buffer info)
individually when writing their corresponding "traf" box in a fragment.
The change involves processing all tracks before start writing "traf" boxes.

#minor-release

PiperOrigin-RevId: 600811093
(cherry picked from commit 4c1581a175)
2024-01-25 11:42:44 +00:00
tonihei
a1280b1a23 Add setRemotePlaybackInfo to MediaStyle
This method is needed for some system apps to override the
output switcher when MediaRouter2 can't be used.

PiperOrigin-RevId: 600807119
(cherry picked from commit b64d754670)
2024-01-25 11:42:44 +00:00
siroberts
193cb143ff Change type of setCustomLayout in MediaSession.resultBuilder to List
PiperOrigin-RevId: 600801528
(cherry picked from commit 1f78aa5b2a)
2024-01-25 11:42:44 +00:00
tonihei
236287a513 Use Media3 MediaStyle instead of legacy one
The default notification provider was still using the legacy
compat MediaStyle instead of our own Media3 one. They are fully
equivalent in their implementation and API and can be swapped out
easily.

PiperOrigin-RevId: 600797920
(cherry picked from commit 9448f939f4)
2024-01-25 11:42:43 +00:00
tianyifeng
3a222473e9 Internal change
PiperOrigin-RevId: 600784733
(cherry picked from commit 0c0b19e26e)
2024-01-25 11:42:43 +00:00
ibaker
8e97895e9f Test parsing-during-extraction in ClippedPlaybackTest
We keep the previous parsing-during-rendering tests, even though they
can be a bit flaky, because this is an important regression test. The
regression risk is lower for this instrumentation test compared to
robolectric tests with different `ShadowLooper` behaviour.

#minor-release

PiperOrigin-RevId: 600781035
(cherry picked from commit a53f3451dd)
2024-01-25 11:42:43 +00:00
tofunmi
b8ff9cd715 Update METADATA to add clang-format requirement for glsl files
also ran clang-format for good measure

PiperOrigin-RevId: 600759938
(cherry picked from commit acc78125d2)
2024-01-25 11:42:43 +00:00
tofunmi
eda2080279 BaseGlShaderProgram: Remove redundant NoSuchElementException catching
PiperOrigin-RevId: 600738198
(cherry picked from commit cc62f0556c)
2024-01-25 11:42:43 +00:00
ibaker
dd9f61005e Release MediaSession and ExoPlayer in MediaControllerStubTest
Due to poor isolation between the session tests, in particular the
static state in `MediaSession.SESSION_ID_TO_SESSION_MAP`, an unreleased
session at the end of one test can cause subsequent tests to fail with
obscure errors like `Session ID must be unique`.

#minor-release

PiperOrigin-RevId: 600737697
(cherry picked from commit ca61ac6ca3)
2024-01-25 11:42:43 +00:00
tofunmi
21e6c1c43e Transformer demo: support selecting all media MIME types
It's useful for development and debugging to select a local image
or audio (only) file as well as a video file in the transformer demo
app.

I tested manually that you can select a local video, audio and image
but not e.g. a pdf with the main "choose local file" picker and only
an image with the choose local image picker for the bitmap overlay
demo.

PiperOrigin-RevId: 600722622
(cherry picked from commit 94ce356bc1)
2024-01-25 11:42:43 +00:00
tofunmi
fce23d9d4e Trim optimization fix: check if audio is removed when comparing formats
#minor-release

PiperOrigin-RevId: 600493390
(cherry picked from commit 5863ce7dd5)
2024-01-25 11:42:43 +00:00
tonihei
5ac0c8beee Fix cleared metadata when repeating the same item
Issue: androidx/media#1007

#minor-release

PiperOrigin-RevId: 600477540
(cherry picked from commit c6bf380d50)
2024-01-25 11:42:43 +00:00
sheenachhabra
50e0072dac Do not write empty track (with no samples) in a non fragmented MP4
PiperOrigin-RevId: 600453680
(cherry picked from commit 94bf9fa81d)
2024-01-25 11:42:43 +00:00
tonihei
6632531c4a Catch exceptions when retrieving current device from audio manager
We can just continue to assume that we don't know the current device.
This case happens on the latest Robolectric release where this method
call isn't implemented yet. As we not generally assume that the
method can throw, this workaround can be removed once Robolectric
is updated again.

#minor-release

PiperOrigin-RevId: 600426851
(cherry picked from commit 81615dd5b5)
2024-01-25 11:42:43 +00:00
christosts
05b8e633e3 SimpleBasePlayer: add protected method for thread verification
Add protected method in SimpleBasePlayer for thread verification to help
subclasses verify thread access for additional methods they define and
still report the same message to the user.

Also, remove the DAC link pointing to the ExoPlayer-specific
documentation from the exception message. Users who extend
SimpleBasePlayer have access to the class' javadoc.

PiperOrigin-RevId: 600426692
(cherry picked from commit 9e9c3cbe5e)
2024-01-25 11:42:43 +00:00
andrewlewis
18617b8a60 Prevent using high profile on problematic devices
[Android best
practices](https://developer.android.com/media/optimize/sharing#android_8_81_and_9)
recommend disabling B-frames on API 27, but some devices output B-frames anyway
when H.264/AVC High profile is selected. Add a workaround to force these
devices not to use high profile, to prevent B-frames being output.

`MediaMuxer` likely handles B-frames on these specific devices, but this change
allows the migration to default to in-app muxing to take place without
introducing errors, and it's a temporary workaround until B-frames are properly
supported in the in-app muxer.

PiperOrigin-RevId: 600422238
(cherry picked from commit 6029521898)
2024-01-25 11:42:43 +00:00
tonihei
3e005e62dc Check int and float parameters from external apps for validity
Some player method calls sent from MediaControllers accept int
or float values with a very clear API contract that disallows
some values. Filtering by these values early avoids calling a
Player implementation with invalid values.

PiperOrigin-RevId: 600413993
(cherry picked from commit c64b271f07)
2024-01-25 11:42:43 +00:00
ibaker
da5e5db3d2 Disable 'skip buffers with identical release times' in GTS tests
This optimization always reports buffers as 'skipped' (i.e. deliberately
not shown), which makes sense for the target case of high FPS content on
a lower refresh rate screen, when lots of the frames will **never** be
shown.

However the optimization also results in reporting buffers as 'skipped'
when decoding is a bit slow, resulting in a frame being released one
vsync late, which then means we have two frames to release in the same
vsync (when the previous vsync was empty). In this case, it would be
more correct to report this as a 'dropped' frame (since it was due to
slow decoding).

Until we can change the logic to distinguish these cases and report them
separately, this CL disables the optimization completely in GTS tests.
This is needed because we often assert there were zero skipped frames,
so slight decoding slowness can cause spurious/flaky test failures (our
threshold for dropped frames is non-zero).

#minor-release

PiperOrigin-RevId: 600406443
(cherry picked from commit 999e154b2a)
2024-01-25 11:42:43 +00:00
tonihei
5b7b19cf3c Add TODO about known feature gap in ImageRenderer
PiperOrigin-RevId: 600404546
(cherry picked from commit b84104e7a1)
2024-01-25 11:42:43 +00:00
andrewlewis
515d2e2578 Skip 1080p test on Nexus 7, API 21
This device doesn't seem to be capable of simultaneous encode/decode at this
resolution. We don't have a good way to check the capability (we are already
checking separate decode/encode capability) so just skip this test to save time
triaging its failures.

PiperOrigin-RevId: 600399564
(cherry picked from commit e82393ed41)
2024-01-25 11:42:43 +00:00
christosts
1dc880cb3b Rollback of e364510937
PiperOrigin-RevId: 600393114
(cherry picked from commit d1d03189eb)
2024-01-25 11:42:43 +00:00
tonihei
432cde6051 Use routed device in AudioCapabilities
From API 23, we may have a preferred device that is most likely used
as the output device.
From API 24, the AudioTrack tells us the actual routed device that is
used for output and we can listen to changes happening mid-playback.
From API 33, we can directly query the default device that will
be used for audio output for the current attributes.

If the routed device is known by any of the methods above, we can add
more targeted checks in methods like isBluetoothConnected to avoid
iterating over all devices that are not relevant.

The knowledge about the routed device will also be useful to check
advanced output capabilities in the future (e.g. for lossless
playback)

PiperOrigin-RevId: 600384923
(cherry picked from commit b1c954fa84)
2024-01-25 11:42:43 +00:00
huangdarwin
dcfa8c60ce Previewing: set VideoFrameReleaseControl after CVSP is created.
This allows us to inject a videoFrameProcessorFactory into
MediaCodecVideoRenderer, without issues about creating the
VideoFrameReleaseControl in the MediaCodecVideoRenderer.

Unfortunately, this does result in more complex CVSP state, where
VideoFrameReleaseControl is no longer final, may be null, and may potentially
change. However, this tries to be careful with assertions to guarantee good
state, and is cleaner than modifying the long-standing MediaCodecVideoRenderer
interface.

Tested that this works on the ExoPlayer demo with setVideoEffects applied, and
using a playlist with SDR->HDR and HDR->SDR items.

PiperOrigin-RevId: 599823412
(cherry picked from commit cb0f5a7fff)
2024-01-25 11:42:43 +00:00
samrobinson
4ac9d449d3 Remove thread blocking for TransformerInternal#getProgress.
Thread-safe interactions with state and value.

PiperOrigin-RevId: 599810672
(cherry picked from commit e364510937)
2024-01-25 11:42:43 +00:00
Michael Katz
b930b40a16
Fix merge error with ffmpeg_jni.cc
Fix merge error with ffmpeg_jni.cc where cherry-pick process included code from nonselected commit.
2024-01-17 17:04:10 +00:00
michaelkatz
0ae7a6bd60 Fix typo of missing closing parentheses in RELEASENOTES
PiperOrigin-RevId: 597496311
2024-01-11 10:48:31 +00:00
michaelkatz
1f79a0ad93 Bump media3 version to 1.2.1 and update RELEASENOTES
PiperOrigin-RevId: 596916027
(cherry picked from commit 324e1beef2)
2024-01-09 14:46:23 +00:00
microkatz
f0d24cbf58 Fix BitmapOverlay to have public constructor 2024-01-09 12:26:11 +00:00
ibaker
d55b33474e Clarify docs on Player.setMediaItem(s) and replaceMediaItem(s)
These methods sound similar, but have different behaviour. This change
tries to make the distinction clearer, and sign-post from one to the
other.

#minor-release

Issue: androidx/media#910
PiperOrigin-RevId: 595701540
(cherry picked from commit 95e742948c)
2024-01-09 12:17:49 +00:00
bachinger
141f9b760d Return null if media notification controller Future is not done
When the media notification controller is requested for a session
with `getConnectedControllerForSession` and the `Future` is not null
but not yet completed, the `Future` was returned either way. This was
reported as creating a race condition between the notification
being requested for update the very first time, and the media
notification controller having completed connecting to the session.

Returning null from `getConnectedControllerForSession` when the
`Future` is available but not yet done fixes the problem. This is
safe because for the case when a notification update is dropped,
the media notification controller will trigger the update as soon
as the connection completes.

Issue: androidx/media#917
#minor-release
PiperOrigin-RevId: 595699929
(cherry picked from commit 5c50b27e8f)
2024-01-09 12:17:49 +00:00
Copybara-Service
77d220c507 Merge pull request #369 from Tolriq:fix_invalid_frames
PiperOrigin-RevId: 595650068
(cherry picked from commit 8eda9f2ed2)
2024-01-09 12:17:48 +00:00
bachinger
d1b882ae56 Don't set negative values to setWhen()
When the 'when' timer of the notification is disabled
`DefaultMediaNotificationProvider` may set `C.TIME_UNSET`
as the time. Users reported problems on some devices with
this and the docs ask for an event time that probably
shouldn't be a negative number.

This change sets `0L` instead of `C.TIME_UNSET` when the
timer is disabled.

Issue: androidx/media#903

#minor-release

PiperOrigin-RevId: 594451074
(cherry picked from commit 426bc94090)
2024-01-09 12:17:48 +00:00
andrewlewis
b9d205ba0f Expand operating rate workaround to T612 chipset
PiperOrigin-RevId: 592916187
(cherry picked from commit 1845a4ae69)
2024-01-09 12:17:48 +00:00
Copybara-Service
b68173aae4 Merge pull request #914 from cemrich:366-forward-time-wrong
PiperOrigin-RevId: 592871532
(cherry picked from commit 966b5178b6)
2024-01-09 12:17:48 +00:00
ibaker
1da24b2875 Add container to Format.toLogString
While investigating Issue: androidx/media#887 I naively assumed the CEA-608
captions were in a TS file, but they're actually in an MP4 (which is
possibly obvious given DASH only supports MP4). This change includes
container info in the `EventLogger` `tracks` output.

PiperOrigin-RevId: 592192752
(cherry picked from commit 6853ffccae)
2024-01-09 12:17:48 +00:00
ibaker
5d7c9142ba Add Widevine license renewal example to demo app
PiperOrigin-RevId: 592182371
(cherry picked from commit 0b8a9a2ca4)
2024-01-09 12:17:48 +00:00
rohks
6236fd38d0 Fix sending negative bufferedDurationUs to CmcdData.Factory
When track is changed during playback, `playbackPositionUs` may be in middle of a chunk and `loadPositionUs` should be the start of that chunk. In this situation `loadPositionUs` can be less than the current `playbackPositionUs`, resulting into negative `bufferedDurationUs`. It translates to having no buffer and hence we should send `0` for `bufferedDurationUs` when creating new instances of `CmcdData.Factory`.

Issue: androidx/media#888

#minor-release

PiperOrigin-RevId: 591099785
(cherry picked from commit 7f6596bab2)
2024-01-09 12:17:48 +00:00
tonihei
4231a1d183 Use different wraparound assumptions for duration readers
The timestamp adjuster also estimates the number of wraparounds
of the 90Khz TS timestamp. It does that by assuming that a new
timestamp is always close to the previous one (in either direction).

This logic doesn't always work for duration estimates because the
timestamp at the end of the media is not close to the one at the
beginning and it may also never be less than the one at the beginning.

This can be fixed by introducing a new estimation model that assumes
the new timestamp is strictly greater than the previous one without
making the assumption that it has to be close to it.

Issue: androidx/media#855

#minor-release

PiperOrigin-RevId: 590936953
(cherry picked from commit 01578780a6)
2024-01-09 12:17:48 +00:00
bachinger
09d30a160e Fix broadcasting notifyChildrenChanged for legacy controllers
When broadcasting a notifyChildrenChanged event, the task for legacy
controllers was sent to the broadcasting callback. This would
technically work, but because the subscription list is maintained
with specific controllers, the broadcast controller isn't subscribed
and hence the call wasn't executed.

This change calls the overloaded method for a specific controller
for each connected controller. Making sure (only) subscribed
controllers are notified.

Issue: androidx/media#644
PiperOrigin-RevId: 590904037
(cherry picked from commit 4974f960e7)
2024-01-09 12:17:48 +00:00
Copybara-Service
c8a403edcf Merge pull request #753 from stevemayhew:p-fix-issue-9347
PiperOrigin-RevId: 590862514
(cherry picked from commit ab296ef686)
2024-01-09 12:17:39 +00:00
ibaker
33a51906f9 Combine 'matching' versions in media3 bug template
#minor-release

PiperOrigin-RevId: 590586491
(cherry picked from commit 9a766161ee)
2024-01-09 12:11:49 +00:00
Copybara-Service
7d564f8571 Merge pull request #864 from v-novaltd:dsparano-exo129_2
PiperOrigin-RevId: 590234505
(cherry picked from commit f465efeefd)
2024-01-09 12:11:49 +00:00
ibaker
5001f70b3d Fix VorbisComment.populateMediaMetadata key comparison to ignore case
Issue: androidx/media#876

#minor-release

PiperOrigin-RevId: 590215918
(cherry picked from commit 5580b78b13)
2024-01-09 12:11:49 +00:00
Copybara-Service
504bcd804f Merge pull request #867 from equeim:ndk-r26
PiperOrigin-RevId: 590142275
(cherry picked from commit 27f437b65a)
2024-01-09 12:11:49 +00:00
samrobinson
89baa96e32 Fix handling of repeated EOS in SilenceSkippingAudioProcessor.
Issue: androidx/media#712
PiperOrigin-RevId: 589882412
(cherry picked from commit 90a0cbdf3d)
2024-01-09 12:11:49 +00:00
ibaker
e509db273d Fix handling of multiple HEVC tracks in JPEG motion photos
The MP4 data in JPEG motion photos can contain multiple `video/hevc` tracks, but only the first is at a playable frame rate while the others are low-fps, high-res tracks designed for specific use-cases (not direct video playback).

ExoPlayer currently selects the unplayable track by default, because it
has a higher resolution. This change introduces a flag to
`Mp4Extractor` that results in the first video track being marked as
`ROLE_FLAG_MAIN`, and all subsequent video tracks `ROLE_FLAG_ALTERNATE`
- this then results in the playable lower-res track being selected by
default.

PiperOrigin-RevId: 589832072
(cherry picked from commit 5266c71b3a)
2024-01-09 12:11:46 +00:00
tofunmi
7df03f381d TransformerEndToEndTest: replace /*testId=*/ with variable
PiperOrigin-RevId: 589765715
(cherry picked from commit 00d5b6ec99)
2024-01-09 12:08:20 +00:00
ibaker
482d5d69d5 Add extractor and playback tests for Pixel JPEG motion photo
This image has two video tracks in the MP4 data, one is a 'real' video
which we want to play by default, and the other is a low-fps video track
which isn't intended to be directly played, it's encoded in HEVC for
compression and decoding efficiency.

This test demonstrates ExoPlayer's current behaviour default extraction
and playback, which results in selecting the high-res, low-fps track
(actually single sample in this example), instead of playing the actual
video.

PiperOrigin-RevId: 588068908
(cherry picked from commit 6360082b87)
2024-01-09 11:03:33 +00:00
ibaker
ea72856ac8 Add Robolectric e2e test support for HEVC content
PiperOrigin-RevId: 588055594
(cherry picked from commit d4fe3fe318)
2024-01-09 11:03:33 +00:00
Googler
c314123298 Fix nullability issue in MediaControllerImplLegacy
PiperOrigin-RevId: 588035411
(cherry picked from commit e0f1783a54)
2024-01-09 11:03:33 +00:00
michaelkatz
03eae4f9ac Limit processing Opus decode-only frames by seek-preroll in offload
As Opus decoders skip some bytes prior to playback during a seek, the renderer for bypass playback should send samples to the decoder even if they would be decode-only. However, the renderer should not send samples with time preceding that range. This change adds that constraint.

#minor-release

PiperOrigin-RevId: 588014983
(cherry picked from commit d1e38abf93)
2024-01-09 10:48:33 +00:00
tonihei
57187aa899 Map VORBIS channel layout to Android layout
Both the extension OPUS decoder and the OMX/C2 MediaCodec
implementations for OPUS and VORBIS decode into the channel
layout defined by VORBIS. See
https://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-140001.2.3

While this is technically correct for a stand-alone OPUS or VORBIS
decoder, it doesn't match the channel layout expected by Android.
See https://developer.android.com/reference/android/media/AudioFormat#channelMask

The fix is to apply the channel mapping after decoding if needed.
Also add e2e tests with audio dumps for the extension renderer,
including a new 5.1 channel test file.

Issue: google/ExoPlayer#8396

PiperOrigin-RevId: 588004832
(cherry picked from commit b1541b096f)
2024-01-09 10:48:31 +00:00
ibaker
483426ad7b MCR: Ensure mediaCrypto and codec are atomically non-null
`mediaCrypto` is initialized before `codec` in
`maybeInitCodecOrBypass`. Before this change, it was possible for
`maybeInitCodecOrBypass` to complete with `mediaCrypto != null` and
`codec == null`, in particular if it was run as part of clearing the
player surface (since in that case, no video codec is initialized).
This inconsistent state then causes issues during a later invocation of
`maybeInitCodecOrBypass`, when `mediaCrypto` is still non-null, and
`mediaCryptoRequiresSecureDecoder = true`, but the
content has been changed to unencrypted with no associated DRM session.
This results in a playback error, because a secure decoder is
initialized but there's no DRM session available to work with it.

This change ensures that when `maybeInitCodecOrBypass` completes,
either both `mediaCrypto != null` and `codec != null` (i.e. codec
initialization was completed) or `mediaCrypto == null` and
`codec == null` (i.e. codec initialization was not completed). We also
ensure that when nulling out `mediaCrypto` we also set
`maybeInitCodecOrBypass = false`. A later change should be able to
demote `maybeInitCodecOrBypass` from a field to a local in order to
remove any risk of that part of state becoming out of sync. This
resolves the issue, because during the second invocation of
`maybeInitCodecOrBypass` an insecure decoder is now (correctly)
initialized and the unencrypted content is successfully played.

#minor-release

PiperOrigin-RevId: 587713911
(cherry picked from commit 913f6da083)
2024-01-08 16:40:28 +00:00
ibaker
fa268cf84d Don't include null text or bitmaps in Cue.toBundle()
`fromBundle` doesn't distinguish between `FIELD_BITMAP` and `FIELD_TEXT`
being present with a null value, or being absent, so we might as well
avoid including them when the value is null.

I've separated this from a later change to add
`Cue.toSerializableBundle` which will also skip setting a bitmap value
into the `Bundle` if `this.bitmap == null`. This is partly because it
results in changes to a lot of extractor test dump files, and it's
easier to review that as a separate change.

PiperOrigin-RevId: 586626141
(cherry picked from commit 28c210686f)
2024-01-08 16:16:21 +00:00
christosts
3f3287aba3 Exit early progressive loads if the load task is canceled
Add an check when loading progressive media in case the load
is canceled. If the player is released very early, the progressive
media period may carry on with the initial loading unnecessarily.

PiperOrigin-RevId: 586288385
(cherry picked from commit 3d1d8f4439)
2024-01-08 15:55:36 +00:00
tofunmi
d68c36e082 Update emulator device names
PiperOrigin-RevId: 585682881
(cherry picked from commit b598c96c2f)
2024-01-08 15:55:36 +00:00
Copybara-Service
db648316ed Merge pull request #837 from superjohan:fix/android-14-clearkey
PiperOrigin-RevId: 585639025
(cherry picked from commit 5f27b18210)
2024-01-08 15:33:26 +00:00
andrewlewis
19ee78729c Restrict operating rate workaround to SM8550
PiperOrigin-RevId: 585613041
(cherry picked from commit e84a13fb54)
2024-01-08 15:33:26 +00:00
andrewlewis
710c1b9053 Work around codec frame rate issues in Redmi Note 9 Pro
The decoder and encoder won't accept high values for frame rate, so avoid
setting the key when configuring the decoder, and set a default value for the
encoder (where the key is required).

Also skip SSIM calculation for 4k, where the device lacks concurrent decoding
support.

PiperOrigin-RevId: 585604976
(cherry picked from commit 8b38b34b9f)
2024-01-08 15:33:26 +00:00
andrewlewis
97c9e234d2 Avoid value close to overflow for KEY_OPERATING_RATE
Using `Integer.MAX_VALUE` risks causing arithmetic overflow in the codec
implementation.

Issue: androidx/media#810

PiperOrigin-RevId: 585104621
(cherry picked from commit ad40db4489)
2024-01-08 15:33:24 +00:00
ibaker
36f634d8d1 Fix typo in DashManifestParser
PiperOrigin-RevId: 585017285
(cherry picked from commit 479344d74e)
2024-01-08 15:31:29 +00:00
tonihei
4234bc7091 Remove redundant ) in Javadoc
PiperOrigin-RevId: 584910697
(cherry picked from commit 85a54e2e19)
2024-01-08 15:31:29 +00:00
Copybara-Service
33484b0239 Merge pull request #707 from equeim:ffmpeg-6.0
PiperOrigin-RevId: 584893190
(cherry picked from commit 45b51d8c97)
2024-01-08 15:31:27 +00:00
bachinger
5e86c4c20b Add session extras to the state of the controller
This change adds `MediaController.getSessionExtras()` through
which a controller can access the session extras.

The session extras can be set for the entire session when
building the session. This can be overridden for specific
controllers in `MediaSession.Callback.onConnect`.

PiperOrigin-RevId: 584430419
(cherry picked from commit a063d137b4)
2024-01-08 15:26:08 +00:00
christosts
124eb31fd2 MidiExtractor: mark only the first sample as key-frame
This change fixes a bug with seeking forward in MIDI. When seeking forward,
the progressive media period attempts to seek within the sample queue, if a
key-frame exists before the seeking position. With MIDI, however, we can
only skip Note-On and Note-Off samples and all other samples must be sent
to the MIDI decoder.

When seeking outside the sample queue, the MidiExtractor already
instructs the player to start from the beginning of the MIDI input. With
this change, only the first output sample is a key-frame, thus the
progressive media period can no longer seek within the sample queue and
is forced to seek from the MIDI input start always.

Issue: androidx/media#704

PiperOrigin-RevId: 584321443
(cherry picked from commit ec08db458e)
2024-01-08 15:26:03 +00:00
tonihei
c9f6ad0398 Avoid clipping live offset override to min/max offsets
The live offset override is used to replace the media-defined
live offset after user seeks to ensure the live adjustment adjusts
to the new user-provided live offset and doesn't go back to the
original one.

However, the code currently clips the override to the min/max
live offsets defined in LiveConfiguration. This is useful to
clip the default value (in case of inconsistent values in the media),
but the clipping shouldn't be applied to user overrides as
the player will then adjust the position back to the min/max
and doesn't stay at the desired user position.

See 2416d99857 (r132871601)

PiperOrigin-RevId: 584311004
(cherry picked from commit af0282b9db)
2024-01-08 15:21:28 +00:00
bachinger
ea642a41e9 Add test case to test position conversion when POSITION_UNKNOWN
PiperOrigin-RevId: 584261559
(cherry picked from commit ec478138ba)
2024-01-08 15:18:39 +00:00
bachinger
5752a09a40 Return empty timeline when media info is null
Issue: androidx/media#708
PiperOrigin-RevId: 584054624
(cherry picked from commit 167f50a9ca)
2024-01-08 15:18:39 +00:00
rohks
0038355590 Use .test top level domain for test URI
PiperOrigin-RevId: 583951327
(cherry picked from commit ffbaa090aa)
2024-01-08 15:18:38 +00:00
rohks
aab1c9ada1 Populate MediaMetadata.extras to MediaMetadataCompat
Ensures backward compatibility.

Issue: androidx/media#802
PiperOrigin-RevId: 583425114
(cherry picked from commit 6df240877c)
2024-01-08 15:18:38 +00:00
tonihei
69884e764e Workaround layout problems with Material Design
In some contexts (e.g. BottomSheetDialogFrament), Material Design
themes will override the default of singleLine=false to true. This
causes layout problems because the forward/rewind buttons are no
longer visible with singleLine=true.

This problem can be avoided by explicitly requesting the default
value of false in our layout files.

Issue: androidx/media#511

#minor-release

PiperOrigin-RevId: 582604131
(cherry picked from commit 310e2edcca)
2024-01-08 15:18:38 +00:00
ibaker
b9722764ac Update recommended way to suppress @UnstableApi errors in lint.xml
#minor-release

PiperOrigin-RevId: 582599098
(cherry picked from commit bd7615c0b8)
2024-01-08 15:18:38 +00:00
andrewlewis
7901d1cc0a Expand frame drop workaround to Realme C11
Based on on-device testing, this device seems to have the same issue as Moto G (20) where frames are dropped despite configuring the decoder not to drop frames.

PiperOrigin-RevId: 581943805
(cherry picked from commit 330713f687)
2024-01-08 15:18:36 +00:00
tianyifeng
21461abc1c Parse "f800" as channel count of 5 for Dolby in DASH manifest
Issue: androidx/media#688
PiperOrigin-RevId: 581908905
(cherry picked from commit 79711ebd3f)
2024-01-08 15:08:53 +00:00
Googler
2db9da5c1d Don't crash when receiving a bad playback state
PiperOrigin-RevId: 580942377
(cherry picked from commit e79809616c)
2024-01-08 14:54:21 +00:00
jbibik
f189af5632 Remove old pre-releases from the github bug template
PiperOrigin-RevId: 580554963
(cherry picked from commit 508582d56c)
2024-01-08 14:54:21 +00:00
tonihei
d8d552af59 Fix proguard rule to also keep referenced class name
PiperOrigin-RevId: 579234050
(cherry picked from commit bce82bdc75)
2024-01-08 14:54:17 +00:00
tonihei
40094273ea Fix access to stale ByteBuffer in FfmpegAudioDecoder
The native code can now reallocate the buffer if it needs to grow
its size, so we have to reacquire a reference in the Java code to
avoid accessing a stale instance.

This fixes a bug introduced by 8750ed8de6.

PiperOrigin-RevId: 578799862
(cherry picked from commit ae6f83d298)
2024-01-08 14:51:05 +00:00
ibaker
2f4d475b5c Split media1/media3 conversion methods out of MediaUtils
Android Studio removed some nested imports, but I think the extra
qualification at the usage site is actually mostly helpful, so I'm
leaving it as-is.

PiperOrigin-RevId: 578518880
(cherry picked from commit 72b7019578)
2024-01-08 14:51:05 +00:00
ibaker
07258aa373 Add warning log if DASH manifest contains incomplete ClearKey info
Unfortunately we can't fail any more obviously at this point, because
manifests often contain config for multiple DRM schemes, and when
parsing the manifest we don't know which scheme is going to be used for
playback. It would be unreasonable to fail playback due to incomplete
ClearKey config if playback was otherwise going to succeed using e.g.
Widevine.

* Issue: androidx/media#777
* Issue: androidx/media#563
* Issue: google/ExoPlayer#9169

#minor-release

PiperOrigin-RevId: 578491484
(cherry picked from commit d42c23706b)
2024-01-08 14:51:05 +00:00
tianyifeng
2237f4902d Put the custom keys in MediaMetadataCompat to MediaMetadata.extras
PiperOrigin-RevId: 578473874
(cherry picked from commit 84022eacc5)
2024-01-08 14:51:05 +00:00
ibaker
fe8bbcaa12 Remove stray parentheses from release notes
PiperOrigin-RevId: 577809964
(cherry picked from commit db1ab1dcf3)
2024-01-08 14:50:26 +00:00
ibaker
a017080353 Bump okhttp dependency to 4.12
Issue: androidx/media#768
PiperOrigin-RevId: 577208115
(cherry picked from commit e8cca688ad)
2024-01-08 13:56:59 +00:00
michaelkatz
79ce4f1c73 Fallback to legacy sizerate check for H264 if CDD PerfPoint check fails
Some devices supporting Performance Points for decoder coverage are missing coverage over the CDD requirements for H264. For these cases ExoPlayer should fall back to legacy resolution and frame rate support checks. If there is an H264 stream evaluated as a `PerformancePointCoverageResult` of `COVERAGE_RESULT_NO`, then ExoPlayer checks for coverage of the [720p CDD requirement](https://source.android.com/docs/compatibility/10/android-10-cdd#5_3_4_h_264).

Issue: google/ExoPlayer#10898

Issue: androidx/media#693
PiperOrigin-RevId: 575768836
(cherry picked from commit 4515a0c3f2)
2024-01-08 13:56:42 +00:00
ibaker
f6fe90f30b Clean-up multi-line strings in YAML issue templates
* If we don't want any newlines in the result, it's better to use `>`
* If we want newlines (e.g. for markdown) then we should ensure the
  string **only** contains the newlines we want, because GitHub (unlike
  other markdown renderers) preserves single newlines in the output,
  leading to ugly newlines dictated by the source.

Also remove a markdown-style link that isn't renderered as markdown.

PiperOrigin-RevId: 590309749
(cherry picked from commit 6aeaad26ad)
2023-12-13 09:49:13 +00:00
Ian Baker
4f5038bc07 Merge branch 'release' into release-1.2.0 2023-11-17 16:13:40 +00:00
ibaker
2cc8afecc6 Remove recommendation to pin annotation-experimental to version 1.2.0
This was intended to avoid bringing in a transitive dependency on the
Kotlin standard library, but Gradle no longer flags lint errors on
`@RequiresOptIn` violations with `annotation-experimental:1.2.0` (1.3.0
is needed), making this recommendation dangerous. See also
https://issuetracker.google.com/310651921.

PiperOrigin-RevId: 582276430
(cherry picked from commit aa1ec981a3)
2023-11-17 10:07:23 +00:00
ibaker
1b83c59759 Add @OptIn to fields in demo PlayerActivity now this is supported
This is possible now we use `annotation-experimental:1.3.1`.

#minor-release

PiperOrigin-RevId: 582315579
(cherry picked from commit 8d83d491f1)
2023-11-17 10:07:23 +00:00
jbibik
f90726a78d Merge release notes for media3 1.2.0 stable release
PiperOrigin-RevId: 580923121
(cherry picked from commit 7ee07a5ff5)
2023-11-17 10:07:20 +00:00
jbibik
a2679fba54 Bump media3 versions to 1.2.0 (stable)
#minor-release

PiperOrigin-RevId: 580856330
(cherry picked from commit 3918d36200)
2023-11-12 20:52:00 +00:00
ibaker
7991838326 Rollback of a19f577976
PiperOrigin-RevId: 577139027
(cherry picked from commit dd6306e1ba)
2023-11-06 16:51:08 +00:00
rohks
3d6ac7f6f4 Add com.github.philburk:jsyn to JAR list
#minor-release

PiperOrigin-RevId: 576148893
(cherry picked from commit 00943a0a73)
2023-10-24 17:07:47 +01:00
rohks
1c54c393a0 Reorder RELEASENOTES to move unreleased changes to correct section
PiperOrigin-RevId: 575807109
(cherry picked from commit 105bdf57d8)
2023-10-23 07:03:35 -07:00
rohks
7a2d80d87e Bump Media3 version numbers for 1.2.0-rc01
#minor-release

PiperOrigin-RevId: 575805495
(cherry picked from commit 9d3d7abdc6)
2023-10-23 06:55:40 -07:00
rohks
c997c71258 Update RELEASENOTES for 1.2.0-rc01 release
PiperOrigin-RevId: 575795800
(cherry picked from commit 7202f5d4de)
2023-10-23 06:07:35 -07:00
bachinger
f2cf43ccd5 Use MediaSessionImpl.onMediaButtonEvent() to dispatch key events
This change moves the handling of any media button event into
`MediaSessionImpl.onMediaButtonEvent(intent)`. This includes
the double click handling from `MediaSessionLegacyStub`.

The advantage is that everything is in one place which allows
to offer `MediaSession.Callback.onMediaButtonEvent` with which
an app can override the default implementation and handle media
buttons in a custom way.

Media button events can originate from various places:

- Delivered to `MediaSessionService.onStartCommand(Intent)`
  - A `PendingIntent` from the notification below API 33
  - An `Intent` sent to the `MediaButtonReceiver` by the system dispatched
    to the service
- Delivered to `MediaSessionCompat.Callback.onMediaButtonEvent(Intent)`
  implemented by `MediaSessionLegacyStub` during the session is active
  - Bluetooth (headset/remote control)
  - Apps/system using `AudioManager.dispatchKeyEvent(KeyEvent)`
  - Apps/system using `MediaControllerCompat.dispatchKeyEvent(keyEvent)`

Issue: androidx/media#12
Issue: androidx/media#159
Issue: androidx/media#216
Issue: androidx/media#249

#minor-release

PiperOrigin-RevId: 575231251
(cherry picked from commit a79d44edc5)
2023-10-20 08:52:55 -07:00
rohks
47a451abf7 Update translations in the ui module
#minor-release

PiperOrigin-RevId: 575161190
(cherry picked from commit a8ab9e2c70)
2023-10-20 02:49:23 -07:00
simakova
9ac6f89fd7 Remove CompositionPlayer activity from the transformer demo app
The CompositionPlayer is not ready yet.

Issue: androidx/media#741
PiperOrigin-RevId: 574859927
(cherry picked from commit beb1711d4c)
2023-10-19 07:17:02 -07:00
tonihei
e1ad106453 Add missing command checks to playback resumption flow
Player methods shouldn't be called if they are not available and the
entry point to the playback resumption flow only checks
COMMAND_PLAY_PAUSE.

#minor-release

PiperOrigin-RevId: 574834148
(cherry picked from commit bfd1a2724c)
2023-10-19 05:36:49 -07:00
Copybara-Service
cb67b16cac Merge pull request #728 from lawadr:audio-capabilities-fix
PiperOrigin-RevId: 574829263
(cherry picked from commit 5f80a47081)
2023-10-19 05:18:21 -07:00
bachinger
a8b0bd712a Do not hide System UI when app rejects connection
If an app rejects the connection of the internal media notification manager
the session should behave like without the the media notification controller.
The legacy System UI controller should not be hidden or even rejected to
connect in such a case.

#minor-release

PiperOrigin-RevId: 574807901
(cherry picked from commit 54d5810fc3)
2023-10-19 03:48:16 -07:00
tonihei
2ae6b1e832 Rollback of 64bd3bcad3
PiperOrigin-RevId: 574766164
(cherry picked from commit f0cab4d03e)
2023-10-19 01:03:49 -07:00
Googler
4c778edd4d Rollback of eafe2e35f0
PiperOrigin-RevId: 574755143
(cherry picked from commit cf3733765c)
2023-10-19 00:18:56 -07:00
tonihei
21cb3a6bea Rollback of 4ebe630a80
PiperOrigin-RevId: 574530273
(cherry picked from commit c0759a4e62)
2023-10-23 13:15:17 +01:00
ibaker
5d6fefe410 Add formatting to scheme list in DefaultDataSource javadoc
The current formatting makes the 'scheme' part of the list blend into
the definition, especially when the definition is multi-line.

https://developer.android.com/reference/androidx/media3/datasource/DefaultDataSource

I considered adding another level of nesting, but I think bold will
help distinguish the structure of the list without adding too much HTML
or visual whitespace.

#minor-release

PiperOrigin-RevId: 574514208
(cherry picked from commit aec6db77fa)
2023-10-23 13:15:17 +01:00
michaelkatz
111ac63695 Send decode-only Opus samples in bypass mode for seekPreRoll skip
As Opus decoders skip some bytes prior to playback during a seek, the renderer for bypass playback should send samples to the decoder even if they would be decode-only.

#minor-release

PiperOrigin-RevId: 574494666
(cherry picked from commit 00193e0304)
2023-10-23 13:15:17 +01:00
tonihei
fe60d0d7b4 Use DataSourceBitmapLoader by default
This replaces the SimpleBitmapLoader that can now be deprecated
as it's fully unused and doesn't provide any additional functionality.

#minor-release

PiperOrigin-RevId: 574454636
(cherry picked from commit db86932781)
2023-10-23 13:15:17 +01:00
christosts
5a4adc9b25 Fix MIDI decoder build.gradle
Issue: androidx/media#734

#minor-release

PiperOrigin-RevId: 574425269
(cherry picked from commit ff4ff76990)
2023-10-23 13:15:17 +01:00
Googler
9ace4855e0 Rollback of 4ebe630a80
PiperOrigin-RevId: 574308136
(cherry picked from commit ff330bd8e9)
2023-10-23 13:15:17 +01:00
Googler
fcb3315edc Rollback of 64bd3bcad3
PiperOrigin-RevId: 574290408
(cherry picked from commit 1a43aa3602)
2023-10-23 13:15:17 +01:00
christosts
ee83baf92e Publish MIDI decoder module on Maven repository
Issue: androidx/media#734

#minor-release

PiperOrigin-RevId: 574182702
(cherry picked from commit 61770f8a61)
2023-10-23 13:15:17 +01:00
Copybara-Service
29846d0167 Merge pull request #491 from v-novaltd:dsparano-exo128
PiperOrigin-RevId: 574129451
(cherry picked from commit 009d48a75e)
2023-10-23 13:15:17 +01:00
ibaker
f290d0ef86 Move DASH subtitle parsing release note to correct section
#minor-release

PiperOrigin-RevId: 574090381
(cherry picked from commit df19097e22)
2023-10-23 13:15:17 +01:00
bachinger
8e48433be3 Send media button events from service directly using MediaSessionImpl
Media button event coming from the `MediaSessionService` are delegated
to the `MediaSessionImpl` and then sent to the session by using the
`MediaSessionStub` directly instead of using the `MediaController`
API.

Splitting the `MediaController.Listener` and `Player.Listener` in
`MediaNotificationManager` got reverted, and both listener are set to the
controller as before. This reverts the change that introduced a
different timing behaviour. It still holds, that a listener
registered on a `MediaController` that calls a method like `play()` is
called immediately and before the call has arrived at the player. This
change works around this behaviour from the library side by calling
`MediaSessionStub` directly with a `ControllerInfo`.

#minor-release

PiperOrigin-RevId: 573918850
(cherry picked from commit 64bd3bcad3)
2023-10-23 13:15:17 +01:00
bachinger
85167f175a Send ConnectionState as in-process bundle if possible
#minor-release

PiperOrigin-RevId: 573849858
(cherry picked from commit d5f093f43c)
2023-10-23 13:15:17 +01:00
bachinger
386d2239eb Only set the queue when COMMAND_GET_TIMELINE is available
Android Auto shows a queue button when the queue is not empty.
Apps were able to remove this queue button with the legacy API
by not setting the queue of the session.

After this change, removing `COMMAND_GET_TIMELINE` from the commands
of the media notification controller or the session player sets the
queue in the platform session to null.

#minor-release
Issue: androidx/media#339
PiperOrigin-RevId: 573813558
(cherry picked from commit f53e1bc6f6)
2023-10-23 13:15:17 +01:00
tonihei
e46ee01c00 Expand MediaItems in session demo instead of just replacing them
When MediaItems are added from the controller, we currently completely
replace the item with the one from our database, overriding any
potential additional information the controller may have set.

Also forward the onAddMediaItems/onSetMediaItems callbacks to common
helper methods instead of redirecting them through super methods

#minor-release
Issue: androidx/media#706
PiperOrigin-RevId: 573799351
(cherry picked from commit 00425dbe80)
2023-10-23 13:15:17 +01:00
tianyifeng
2a7d85e065 Calculate HLS live playlist refresh interval accurately
Previously, we calculated the next playlist reload time by adding the target duration (or half of it, depending on whether there is a real update in the new playlist snapshot) from the last load completion time, which makes the reload interval as long as `targetDuration(or half of it) + lastLoadDuration`. While still complying to the standard that "the client MUST wait for at least the target duration before attempting to reload the Playlist file again", this could cause buffering when the playback position is close to the end of live window. This change is to calculate the reload interval accurately by not adding the term `lastLoadDuration`.

Issue: androidx/media#663

#minor-release

PiperOrigin-RevId: 573300009
(cherry picked from commit 58a63c82aa)
2023-10-23 13:15:16 +01:00
Googler
b65136e292 Remove deprecated DownloadNotificationHelper.buildProgressNotification
Use a non deprecated method that takes a `notMetRequirements` parameter
instead.

PiperOrigin-RevId: 573252909
(cherry picked from commit 8b7ebc7032)
2023-10-23 13:15:12 +01:00
ibaker
3244318d28 Test more URI forms in RawResourceDataSourceContractTest
PiperOrigin-RevId: 573220915
(cherry picked from commit 40459f7212)
2023-10-23 13:14:42 +01:00
ibaker
f77f3dfa1a Migrate SubtitleParser implementations to incremental parse()
All production and test callers of the non-incremental methods are
already migrated, so we can remove them in this change too.

#minor-release

PiperOrigin-RevId: 573207318
(cherry picked from commit ecd24646cb)
2023-10-23 13:14:42 +01:00
ibaker
74277b14c8 Remove the 'super speed' SmoothStreaming PlayReady stream from demo
This content is no longer available, the manifest is returning a 404.

Issue: google/ExoPlayer#11309

#minor-release

PiperOrigin-RevId: 573202175
(cherry picked from commit a19f577976)
2023-10-23 13:14:42 +01:00
ibaker
b77a2530af Change LegacySubtitleUtil handling of SubtitleParser.OutputOptions
If the `Subtitle` has 'active' cues at `OutputOptions.startTimeUs`, this
change ensures these are emitted in a `CuesWithTiming` with
`CuesWithTiming.startTimeUs = OutputOptions.startTimeUs`. If
`OutputOptions.outputAllCues` is also set, then another `CuesWithTiming`
is emitted at the end that covers the 'first part' of the active cues,
and  ends at `OutputOptions.startTimeUs`.

As well as adding some more tests to `LegacySubtitleUtilWebvttTest`,
this change also adds more tests for `TtmlParser` handling of
`OutputOptions`, which transitively tests the behaviour of
`LegacySubtitleUtil`.

#minor-release

PiperOrigin-RevId: 573151016
(cherry picked from commit f9ece88a25)
2023-10-23 13:14:42 +01:00
Copybara-Service
c7186c9400 Merge pull request #650 from cedricxperi:dts-lbr-buffer-underflow-fix
PiperOrigin-RevId: 572864175
(cherry picked from commit 2421ba4d8f)
2023-10-23 13:14:42 +01:00
ibaker
24c39b6a78 Migrate SubtitleParser tests to incremental parse() methods
All the production code is already calling these new incremental
methods, migrating the tests allows us to remove the old
`List`-returning methods in a follow-up change.

#minor-release

PiperOrigin-RevId: 572822828
(cherry picked from commit a12bde4f57)
2023-10-23 13:14:42 +01:00
tonihei
d7044c7b83 Avoid bundling PlayerInfo for in-process calls
PlayerInfo bundling is costly and we can add a shortcut for
in-process binder calls where we store the direct object
reference in a live Binder object that can be written to the
Bundle instead of the individual data fields.

#minor-release

PiperOrigin-RevId: 572816784
(cherry picked from commit d1fc15f207)
2023-10-23 13:14:42 +01:00
tonihei
7d6146170f Split available command filtering and bundling
A few methods in PlayerInfo and related classes combine filtering
information with bundling in one method. This makes it impossible
to use just the filtering for example and it's also easier to reason
about than two dedicated methods. This change splits these methods
into two parts accordingly.

PiperOrigin-RevId: 572592458
(cherry picked from commit 4ebe630a80)
2023-10-23 13:14:42 +01:00
bachinger
0255f3be16 Check whether a session is still managed before removing
When the controller of the `MediaNotificationManager` is disconnected,
the session is removed from the service without checking whether the
session hasn't already been removed. This caused flakiness in `MediaSessionServiceTest.addSession()`.

Because there is a public API `MediaSessionService.removeSession()`,
the controller can't make an assumption whether the session is still
contained in the service when being disconnected.

#minor-release

PiperOrigin-RevId: 572568350
(cherry picked from commit 7fdc5b22ba)
2023-10-23 13:14:42 +01:00
michaelkatz
ec21b9e634 Update release notes to mention AudioOffloadPreference class changes
Issue: androidx/media#721
PiperOrigin-RevId: 572565009
(cherry picked from commit cef85be40f)
2023-10-23 13:14:42 +01:00
ibaker
de3eb672a5 Request notification permission when starting session demo app
#minor-release

PiperOrigin-RevId: 572556101
(cherry picked from commit c7a091a973)
2023-10-23 13:14:41 +01:00
bachinger
4b85207621 Add MediaSession.Builder().setPeriodicPositionUpdateEnabled()
This allows to disable periodic position updates when building
the session.

#minor-release

PiperOrigin-RevId: 572531837
(cherry picked from commit 4dc3db4da3)
2023-10-23 13:14:41 +01:00
ibaker
03a3f77340 Add experimental opt-in to parse DASH subtitles during extraction
This currently only applies to subtitles muxed into mp4 segments, and
not standalone text files linked directly from the manifest.

Issue: androidx/media#288

#minor-release

PiperOrigin-RevId: 572263764
(cherry picked from commit 66fa591959)
2023-10-23 13:14:41 +01:00
tonihei
7254f5aca5 Do not interrupt controller thread without a good reason
Interrupting the main thread in particular may be dangerous
as the flag is not cleared after handling the current message.

#minor-release

PiperOrigin-RevId: 572259422
(cherry picked from commit 846117399f)
2023-10-23 13:14:41 +01:00
ibaker
2ec24ac55f Update @UnstableApi docs to include a package-info.java example
#minor-release

PiperOrigin-RevId: 572229092
(cherry picked from commit 7009c53c79)
2023-10-23 13:14:41 +01:00
ibaker
292701ba55 Add SubtitleParser.Factory.getCueReplacementBehavior()
This gives access to the replacement behavior for a particular subtitle
format without needing to instantiate a `SubtitleParser`.

#minor-release

PiperOrigin-RevId: 572226084
(cherry picked from commit e366c3d419)
2023-10-23 13:14:41 +01:00
tonihei
d078baf435 Remove unneccessary method parameter
The value already exists as a class field.

#minor-release

PiperOrigin-RevId: 572200771
(cherry picked from commit e5fa0c2ce9)
2023-10-23 13:14:41 +01:00
tonihei
69749c59cc Align audio adaptive support checks with video
In particular:
 - Add allowAudioNonSeamlessAdaptiveness parameter (default true, same
   as video and as already implemented by default)
 - Forward mixedMimeTypeAdaptation support to AudioTrackScore
   (as for VideoTrackScore) and adapt mixed MIME type adaptive
   support accordingly
 - Check adaptive support when deciding whether a track is allowed for
   adaptation (also same check as for video). This takes the new
   parameter into account.

PiperOrigin-RevId: 572191308
(cherry picked from commit f20d18e6ca)
2023-10-23 13:14:39 +01:00
ibaker
bd24e788b3 Use package-level @OptIn for demo apps
This demonstrates that `@OptIn` can now be used at the package-level
(since [`androidx.annotation:annotation-experimental:1.3.0`](https://developer.android.com/jetpack/androidx/releases/annotation#annotation-experimental-1.3.0)).

PiperOrigin-RevId: 572187729
(cherry picked from commit d60596cfca)
2023-10-23 13:13:46 +01:00
tonihei
77bccf0dd1 Make BundleListRetriever local Binder aware
When used within the same process, we don't have to go via the
onTransact method (which includes marshalling and unmarhsalling
the data), but can directly return the list.

#minor-release

PiperOrigin-RevId: 572179846
(cherry picked from commit 0bddd06938)
2023-10-23 13:13:46 +01:00
tonihei
7d063e9aab Add missing Future cancellation checks
Future.isDone and getDone doesn't imply the Future was successful
and it may have been cancelled or failed.

In case where we handle failure, we should also handle cancellation
to avoid CancellationException to bubble up unchecked.

In demo app code where we use isDone for field initialization, we
want to crash in the failure case (usually security exception where
the connection is disallowed), but we want to gracefully handle
cancellation. Cancellation of these variables usually happens in
Activity.onDestroy/onStop, but methods may be called after this point.

#minor-release

PiperOrigin-RevId: 572178018
(cherry picked from commit fe7c62afe0)
2023-10-23 13:13:46 +01:00
Googler
c913237e92 Fix the resumption of playback when suitable device is connected.
With this change the playback will resume as soon as the suitable device is connected and suppression reason is cleared (within set time out).

#minor-release

PiperOrigin-RevId: 572140309
(cherry picked from commit dc859eae82)
2023-10-23 13:13:46 +01:00
Googler
f799259a14 ...Update metalava library and Reformat api.txt...
PiperOrigin-RevId: 572013340
(cherry picked from commit da49a02b44)
2023-10-23 13:13:46 +01:00
tonihei
fdaf9b47df Use more targeted listening in session PlayerActivity
The current metadata updates are triggered by item transitions,
but depending on the speed of loading the playlist, the first
metadata may only be known later via metadata-change callbacks.

Slow playlist loading also means the UI stays empty and it's
beneficial to show a placeholder to avoid the impressions the
UI hangs.

Finally, clean-up by removing unused string constants and merging
all listeners into onEvents

#minor-release

PiperOrigin-RevId: 571951529
(cherry picked from commit fd81c904e1)
2023-10-23 13:13:46 +01:00
ibaker
99ea703455 Fix the asset and dump file names for the standalone TTML DASH test
#minor-release

PiperOrigin-RevId: 571941997
(cherry picked from commit 33c151eb5b)
2023-10-23 13:13:46 +01:00
christosts
3ba8459624 Report dropped frames from the VideoSink
After 4fad529433, MediaCodecVideoRenderer does not report if frames
are dropped from the VideoSink. This commit fixes this.

#minor-release

PiperOrigin-RevId: 571905721
(cherry picked from commit 05b17b5430)
2023-10-23 13:13:46 +01:00
ibaker
1818d46077 Return true from CuesResolver.addCues if the output changed
This belongs in the resolver, because it depends on the resolution
algorithm (and therefore the logic can't live in `TextRenderer`).

This also fixes a bug in `TextRenderer` where we were doing arithmetic
with `cues.durationUs` without checking if it was `TIME_UNSET` first.

#minor-release

PiperOrigin-RevId: 571332750
(cherry picked from commit 272428734b)
2023-10-23 13:13:46 +01:00
ibaker
6ad54d72ad Update TextRenderer to handle CuesWithTiming instances directly
The existing `Subtitle` handling code is left intact to support the
legacy post-`SampleQueue` decoding path for now.

This also includes full support for merging overlapping `CuesWithTiming`
instances, which explains the test dump file changes, and which should
resolve the following issues (if used with the
decoder-before-`SampleQueue` subtitle logic added in
5d453fcf37):

* Issue: google/ExoPlayer#10295
* Issue: google/ExoPlayer#4794

It should also help resolve Issue: androidx/media#288, but that will also require
some changes in the DASH module to enable pre-`SampleQueue` subtitle
parsing (which should happen soon).

PiperOrigin-RevId: 571021417
(cherry picked from commit 002ee0555d)
2023-10-23 13:13:42 +01:00
jbibik
c16accb816 Update RELEASENOTES.md for 1.2.0-beta01 release
PiperOrigin-RevId: 571941830
(cherry picked from commit 62ad1dfdf5)
2023-10-17 15:57:14 +01:00
jbibik
ef013c04ab Bump Media3 version numbers for 1.2.0-beta01 release
#minor-release

PiperOrigin-RevId: 572003628
(cherry picked from commit 97645a200d)
2023-10-09 22:47:37 +01:00
michaelkatz
f776021dcc Deflake RTSP keep-alive monitor test
Alters RTSP KeepAlive monitor test to just make sure that keep-alive message is sent.

The test was added in 42c1846984

#minor-release

PiperOrigin-RevId: 571349013
(cherry picked from commit 417970f713)
2023-10-06 19:20:13 +01:00
jbibik
efb8c70a4b Add multidex Gradle dependency to test-session-current
#minor-release

PiperOrigin-RevId: 571347856
(cherry picked from commit e63be0317f)
2023-10-06 19:20:13 +01:00
michaelkatz
f43d0f187a Update cached playbackHeadPosition when pausing after AudioTrack.stop()
In some streaming scenarios, like offload, the sink may finish writing buffers a bit before playback reaches the end of the track. In this case a player may pause while in this 'stopping' state.

The AudioTrackPositionTracker needs to update the cached values it uses to calculate position in the `PLAYSTATE_STOPPED`/`PLAYSTATE_STOPPING` states if pause/play are called during this period.

PiperOrigin-RevId: 571345914
(cherry picked from commit a789db5b41)
2023-10-06 19:20:13 +01:00
michaelkatz
5d0d30a280 Allow pause if in offload mode after writing all buffers
In offload mode, `AudioTrack#stop()` will put the track in `PLAYSTATE_STOPPING` rather than `PLAYSTATE_STOPPED`. The difference in state means that `AudioTrack` can be paused and played during this 'stopping' period.

Currently, if `AudioTrackPositionTracker#handleEndOfStream()` has been called then `DefaultAudioSink` in `pause()` won't call `AudioTrack#pause()`. `AudioTrack#pause()` should be called in this case if in offload mode.

#minor-release

PiperOrigin-RevId: 571335108
(cherry picked from commit ab42d64d6d)
2023-10-06 19:20:12 +01:00
bachinger
da5a743175 Add MEDIA_PLAY_FROM_SEARCH to manifest of session demo app
This is required to make GMS send voice commands to the app.

#minor-release

PiperOrigin-RevId: 571326122
(cherry picked from commit 78f403aa7b)
2023-10-06 15:57:25 +01:00
tonihei
7e9ca0bf74 Deprecate decode-only flag.
The flag is no longer used by our components and only set and checked
in a few places to guarantee compatiblity with existing renderers and
decoders that still use it.

The flag will be removed in the future due to its design limitations.

#minor-release

PiperOrigin-RevId: 571291168
(cherry picked from commit 89d01981bc)
2023-10-06 15:57:25 +01:00
tonihei
03008b966d Remove release notes lines added by merge conflict
#minor-release

PiperOrigin-RevId: 571005643
(cherry picked from commit 49b1e0bbc2)
2023-10-06 15:57:25 +01:00
ibaker
dad362b414 Add tests for CuesWithTiming.endTimeUs
#minor-release

PiperOrigin-RevId: 570988195
(cherry picked from commit 6057b59723)
2023-10-06 15:57:25 +01:00
tofunmi
a4582be2c1 Change equalTo check in ImagePlaybackTest to atLeast
The aim of this test is to make sure the image is onscreen for the right amount of time, so to drive down flakes from the decoder taking too long, change this to an atLeast check

#minor-release

PiperOrigin-RevId: 570988044
(cherry picked from commit 9cc75ca52e)
2023-10-06 15:57:25 +01:00
tonihei
3c414fcde4 Update documentation wrongly referencing the decode-only flag
#minor-release

PiperOrigin-RevId: 570973457
(cherry picked from commit 87f1b4252e)
2023-10-06 15:57:25 +01:00
samrobinson
fbb64e2db2 Remove experimental keepAudioTrackOnSeek.
PiperOrigin-RevId: 570966027
(cherry picked from commit 068d420ba2)
2023-10-06 15:57:25 +01:00
michaelkatz
21c714d8d4 Use RTSP Setup response timeout value in KeepAliveMonitor intervalMs
Set KeepAliveMonitor to send a keep-alive message at half the timeout value, if provided, by the RTSP Setup response.

Issue: androidx/media#662
PiperOrigin-RevId: 570946237
(cherry picked from commit 42c1846984)
2023-10-06 15:57:25 +01:00
ibaker
1a0000db1d Add CuesWithTiming.endTimeUs
In most cases this is more useful than `durationUs`.

We will keep `durationUs`, and the constructor will continue to take
`startTimeUs` and `durationUs`, to allow for use-cases where we don't
know the start time but still want to indicate a duration (this will be
used to implement CEA-608 timeout).

#minor-release

PiperOrigin-RevId: 570944449
(cherry picked from commit bf7b91e57e)
2023-10-06 15:57:25 +01:00
tonihei
df85a996ba Add Decoder.setOutputStartTimeUs and use it in extension decoders
This gets rid of the reliance on the decode only flag that is still
set on input buffers to the decoder if they are less than the start
time.

We still need to set and check the decode-only flag in SimpleDecoder
to ensure compatbility with custom decoders that use the flag while
it's not fully removed.

PiperOrigin-RevId: 570736692
(cherry picked from commit a03e20fe6c)
2023-10-06 15:57:25 +01:00
tonihei
7bfddf9558 Remove wrong Javadoc
The corresponding logic has been removed in 796781d4c3

#minor-release

PiperOrigin-RevId: 570729509
(cherry picked from commit 64fe863f31)
2023-10-06 15:57:25 +01:00
tonihei
889739d33e Replace ENCODING_DTS_UHD_P2 value by reference to platform constant
#minor-release

PiperOrigin-RevId: 570696505
(cherry picked from commit 9ef1c20e7a)
2023-10-06 15:57:25 +01:00
tofunmi
c99c71b5a4 Update getName of BitmapFactoryImageDecoder
cleanup from 8f5835c51c

#minor-release

PiperOrigin-RevId: 570663437
(cherry picked from commit 572fb4676c)
2023-10-06 15:57:25 +01:00
tonihei
6d2bf513fb Add onAudioTrackInitialized/Released events
This is useful for analytics and understanding player behavior
during transitions.

#minor-release

PiperOrigin-RevId: 570623227
(cherry picked from commit 8e2bf21011)
2023-10-06 15:57:25 +01:00
rohks
55633658c6 Add nullness annotations to DecoderVideoRenderer
Also fixed a bug where format queue was polled with wrong timestamp value.

#fixit

PiperOrigin-RevId: 570420304
(cherry picked from commit a879bae1ee)
2023-10-06 15:57:25 +01:00
rohks
7957554442 Add nullness annotations to MediaCodecRenderer
#fixit

PiperOrigin-RevId: 570403923
(cherry picked from commit 7a91474af9)
2023-10-06 15:57:25 +01:00
tonihei
0480b70f36 Move decode-only handling out of MetadataDecoder interface logic
The interface requires the implementation to return null if the
decode-only flag is set. So instead of setting the flag and returning
null, we can simply not call the method and assume it's null.

The only reason where this wouldn't work is if the metadata format
has keyframe-like logic and requires previous metadata to decode
the next one. This is not something we came across before and it seems
ignorable. If that feature is needed in the future, we should instead
add a method to MetadataDecoder to set the first output timestamp.

#minor-release

PiperOrigin-RevId: 570399838
(cherry picked from commit 796781d4c3)
2023-10-06 15:57:25 +01:00
michaelkatz
2564c11834 Disable offload scheduling at set up for track transition
While sleeping for offload, position is estimated based on time playing. If asleep and AudioTrack is reused, then the position will keep incrementing as the subsequent item plays. That is until wakeup when playing position is updated to the timestamp of the second item. Offload scheduling should be disabled until track transitions fully.

PiperOrigin-RevId: 570397140
(cherry picked from commit da06bf057a)
2023-10-06 15:57:24 +01:00
jbibik
e4637d82b7 Add DashPlayback test with sideloaded TTML subtitles
The test is hidden behind the Ignore annotation due to some flakiness just like `webvttInMp4`. However, it will be removed when the subtitle parsing is moved to a pre-sample-queue architecture.

#minor-release

PiperOrigin-RevId: 570376275
(cherry picked from commit bd5a3920b8)
2023-10-06 15:57:24 +01:00
jbibik
484339e3e6 Add Dumper support for outputting multiline strings
PiperOrigin-RevId: 570348425
(cherry picked from commit b83f12c4ba)
2023-10-06 15:57:24 +01:00
tonihei
bc3dded868 Explicitly mark DecoderOutputBuffer as shouldBeSkipped if needed
In some cases, SimpleDecoder output needs to be skipped for rendering
because the decoder produces no data. This is one of the remaining
usages of BUFFER_FLAG_DECODE_ONLY at the moment and can be more
directly solved without using the flag. SimpleDecoder still needs to
check the flag though for backwards compatbility with custom decoders
while the flag is not completely removed.

PiperOrigin-RevId: 570345233
(cherry picked from commit c8aac24ffd)
2023-10-06 15:57:24 +01:00
samrobinson
27d6a9bcbd Deprecate experimental keepAudioTrackOnSeek methods.
#minor-release

PiperOrigin-RevId: 570340714
(cherry picked from commit 1bb501ab50)
2023-10-06 15:57:24 +01:00
ibaker
ffe65b358f Fix Util.scaleLargeValue/Timestamp to handle negative numbers
#minor-release

PiperOrigin-RevId: 570337535
(cherry picked from commit 9edbfa974a)
2023-10-06 15:57:24 +01:00
Copybara-Service
948491f665 Merge pull request #574 from hugohlln:main
PiperOrigin-RevId: 570037211
(cherry picked from commit b06d823238)
2023-10-06 15:57:24 +01:00
christosts
ecfddb9aeb MediaCodeVideoRenderer: flush video sink before codec
When seeking, we must first flush the video sink so it stops
using any SurfaceTextures before flushing MediaCodec.

#minor-release

PiperOrigin-RevId: 570015998
(cherry picked from commit 144bd72236)
2023-10-06 15:57:24 +01:00
ibaker
1c7b426ccb Mark test_session_current support app as MultiDexApplication
PiperOrigin-RevId: 570015354
(cherry picked from commit e9bf41ca04)
2023-10-06 15:57:24 +01:00
bachinger
4acce9bcae Update playlist UI when playlist is updated
When changing the playlist on Android Auto the UI of the
activity needs to be kept in sync.

PiperOrigin-RevId: 569528785
(cherry picked from commit 52d9fbff73)
2023-10-06 15:57:24 +01:00
oceanjules
12332a4afc Remove FfmpegVideoRenderer from Media3 1.2.0 release 2023-10-04 13:13:58 +01:00
tianyifeng
3f366109b7 Fix Media3 1.1.1 release notes
PiperOrigin-RevId: 556735572
(cherry picked from commit dca4f1a9db)
2023-08-14 12:05:48 +00:00
tianyifeng
9c7cf224e5 Bump version numbers to Media3 1.1.1 and ExoPlayer 2.19.1
PiperOrigin-RevId: 555987303
(cherry picked from commit 1e2a5cd06a)
2023-08-14 10:22:43 +00:00
tianyifeng
a842e62991 Update release notes for Media3 1.1.1
PiperOrigin-RevId: 555951054
(cherry picked from commit b24f7678bb)
2023-08-14 10:22:38 +00:00
jbibik
2fb3a45b6c Fix Gradle Lint with @RequiresApi and SDK version
Gradle Lint doesn't recognise `checkState` assertion and TargetApi should only ever be used for suppressing a bug in Android Lint. Hence, we keep @RequiresApi and add an if-statement explicitly. Also, fixes >26 to >=26 for the version check.

PiperOrigin-RevId: 555144577
(cherry picked from commit f7c31bd3ef)
2023-08-09 13:31:48 +00:00
rohks
4af6fcb838 Bump IMA SDK version to 3.30.3
PiperOrigin-RevId: 555130308
(cherry picked from commit 38eabdc9fc)
2023-08-09 12:16:14 +00:00
tonihei
bab04ebf2c Verify source is not released before updating ad playback state
Updates to the ad playback state are posted on the main handler,
so they may arrive after the source has already been released
(=the internal MediaSource is null). This can cause NPEs.

PiperOrigin-RevId: 555102426
(cherry picked from commit 20d2ce7ce8)
2023-08-09 09:51:56 +00:00
jbibik
136f0876d5 Fix PlayerWrapper's creation of VolumeProviderCompat
When hardware buttons are used to control the volume of the remote device, the call propagates to `MediaSessionCompat.setPlaybackToRemote(volumeProviderCompat)`. However, `volumeProviderCompat` was created incorrectly when the new device volume commands were present (COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS and COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS), i.e. with volumeControlType = `VOLUME_CONTROL_FIXED`. This resulted in `VolumeProviderCompat` which doesn't call `onSetVolumeTo` or `onAdjustVolume` and hence doesn't propagate the calls to the `Player`. Instead, it only worked with the deprecated commands which ensured the volumeControlType was `VOLUME_CONTROL_ABSOLUTE`.

This bug was introduced in c71e4bf1ff (1.0 media 3 release) when `PlayerWrapper`'s call to `createVolumeProviderCompat` was mostly rewritten to handle the new commands, but the two if-statements were not amended. Note: this change fixes the bug only for Android 11 and below. For 12 and above, there is a tracking bug for the regression that was introduced: https://issuetracker.google.com/issues/201546605

http://Issue: androidx/media#554

PiperOrigin-RevId: 554966361
(cherry picked from commit dedccc596e)
2023-08-08 22:51:53 +00:00
Tianyi Feng
294fa261b7 Merge pull request #528 from zgzong:patch-2
PiperOrigin-RevId: 554869426
(cherry picked from commit ef54364478)
2023-08-10 12:09:43 +00:00
rohks
57c73d51da Add field object type (ot)
Added this CMCD-Object field to Common Media Client Data (CMCD) logging.

PiperOrigin-RevId: 554843305
(cherry picked from commit 3ec462d1cf)
2023-08-08 16:09:07 +00:00
ibaker
7e58fde18e Use ceiling divide logic in AudioTrackPositionTracker.hasPendingData
This fixes a bug with playing very short audio files, introduced by
fe710871aa

The existing code using floor integer division results in playback never
transitioning to `STATE_ENDED` because at the end of playback for the
short sample clip provided `currentPositionUs=189937`,
`outputSampleRate=16000` and `(189937 * 16000) / 1000000 = 3038.992`,
while `writtenFrames=3039`. This is fixed by using `Util.ceilDivide`
so we return `3039`, which means
`AudioTrackPositionTracker.hasPendingData()` returns `false` (since
`writtenFrames ==
durationUsToFrames(getCurrentPositionUs(/* sourceEnded= */ false))`).

Issue: androidx/media#538
PiperOrigin-RevId: 554481782
(cherry picked from commit 6e91f0d4c5)
2023-08-07 15:17:31 +00:00
kimvde
4b3a4b3395 Check command availability before getting tracks in PlayerView
#minor-release

PiperOrigin-RevId: 554451569
(cherry picked from commit 117b18f54c)
2023-08-07 13:01:49 +00:00
tianyifeng
c0c67dd5e6 Update translations
PiperOrigin-RevId: 554439196
(cherry picked from commit ff3902debb)
2023-08-07 11:54:19 +00:00
rohks
46c757b008 Simplify and accurately compute chunk duration
Refactored `CmcdLog` to `CmcdHeadersFactory` for improved representation of its purpose and updated implementations.

#minor-change

PiperOrigin-RevId: 552831995
2023-08-01 16:48:19 +00:00
rohks
e8a4894a31 Fix wrong documentation and add missing annotations
#minor-release

PiperOrigin-RevId: 552749407
(cherry picked from commit 267d4164a9)
2023-08-01 11:21:33 +01:00
andrewlewis
50db5207cb Fix parsing of H.265 sequence parameter sets
Fix short term reference picture list parsing. Before this change, `deltaPocS0`
was derived by adding one to the value of the syntax element
`delta_poc_s0_minus1`, but (maybe surprising) the specification actually says
that `DeltaPocS0[stRpsIdx][i]` should be assigned the negation
`-(delta_poc_s0_minus1[i] + 1)` on the first iteration, then that value added
to the previous value on previous iterations. See equations (7-67) to (7-70) in
the 2021-08 version of the H.265/HEVC specification.

Also read the number of long term reference pictures once rather than on every
loop iteration (subsection 7.3.2.2.1).

PiperOrigin-RevId: 551852999
(cherry picked from commit ddb0f86604)
2023-07-28 16:00:13 +01:00
bachinger
ab2505d1a9 Only use result.sendError where supported by legacy media library
`MediaLibraryServiceLegacyStub` handles various edge cases by calling
`result.sendError(null)` with the intention to send back an error to
the legacy browser [1].

`MediaBrowserServiceCompat` of the legacy media1 Compat library has an
inner base class `Result` that has a default implementation of
`onErrorSent` that throws an `UnsupportedOperationException` [2].
However, most anonymous inner classes for `Result` created in
`MediaBrowserServiceCompat` do not override `onErrorSent` [3].

Hence Media3 must not call `sendError` in these cases. Instead we call
`sendResult(null)` according to what the default implementation of
the callbacks in `MediaBrowserServiceCompat` do ([4] as an example).

Issue: androidx/media#78
Issue: androidx/media#334

[1] https://github.com/androidx/media/blob/release/libraries/session/src/main/java/androidx/media3/session/MediaLibraryServiceLegacyStub.java#L200
[2] https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:media/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java;l=872
[3] https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:media/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java;l=578-604?q=MediaBrowserServiceCompat&ss=androidx
[4] https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:media/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java;l=1395

PiperOrigin-RevId: 551210137
(cherry picked from commit 17ee5277d5)
2023-07-26 16:14:39 +01:00
tonihei
ac175a9c37 Fix ms to us conversion bug in DecoderVideoRenderer
The current code multiplies the value by 1000 twice,
effectively converting to nanoseconds.

#minor-release

PiperOrigin-RevId: 551129750
(cherry picked from commit f766936140)
2023-07-26 09:43:03 +01:00
ibaker
db336d5c74 Add comment about out-of-order timestamps in AtomParsers.parseStbl
PiperOrigin-RevId: 550596173
(cherry picked from commit 449cf55523)
2023-07-24 18:05:04 +01:00
ibaker
eaf4a2b448 Tighten the demo app's handling of DrmInitData for downloads
This code is Widevine specific. `OfflineLicenseHelper.downloadLicense`
requires the passed `Format` to have a `DrmInitData.SchemeData` with
Widevine UUID and non-null `data` field. The demo app tries to check
this in advance (to avoid an exception later), but its checks are
looser than those made by `OfflineLicenseHelper`. This change tightens
the checks to match.

Issue: androidx/media#512
PiperOrigin-RevId: 549587506
(cherry picked from commit 1ccedf8414)
2023-07-20 12:03:36 +01:00
rohks
7352a1be0a Add field measured throughput (mtp)
Updated `ExoTrackSelection` to provide the most recent bitrate estimate, enabling the inclusion of measured throughput (mtp) as a CMCD-Request field in Common Media Client Data (CMCD) logging.

Additionally, made changes to the `checkArgument` methods in `CmcdLog` to prevent the use of default values in certain cases.

PiperOrigin-RevId: 549369529
(cherry picked from commit cdb174c91a)
2023-07-19 19:10:56 +01:00
rohks
6443614020 Add fields top bitrate(tb) and object duration(d)
Added these CMCD-Object fields to Common Media Client Data (CMCD) logging.

PiperOrigin-RevId: 548950296
(cherry picked from commit 1b2a2fcde0)
2023-07-18 11:24:34 +01:00
tonihei
3931c28697 Fix race condition in clipped sample streams
The streams return end-of-input if they read no samples, but know that
they are fully buffered to at least the clipped end time. This helps to
detect the end of stream even if there are no new buffers after the end
of the clip (e.g. for sparse metadata tracks).

The race condition occurs because the buffered position is evaluated
after reading the sample. So between reading "no sample" and checking
the buffered position, the source may have loaded arbitrary amounts
of data. This may lead to a situation where the source has not read
all samples, reads NOTHING_READ (because the queue is empty) and then
immediately returns end-of-stream (because the buffered position
jumped forward), causing all remaining samples in the stream to be
skipped. This can fixed by moving the buffered position check to
before reading the sample, so that it never exceeds the buffered
position at the time of reading "no sample".

#minor-release

PiperOrigin-RevId: 548646464
(cherry picked from commit c64d9fd6da)
2023-07-17 12:17:17 +01:00
tonihei
d4c66e549a Remove duplicated release note entry
Issue: androidx/media#515

#minor-release

PiperOrigin-RevId: 548111465
(cherry picked from commit 42998d6400)
2023-07-14 14:36:33 +01:00
michaelkatz
09835006f4 Prepend Ogg ID and Comment Header Pages to offloaded Opus stream
Add Ogg ID Header and Comment Header Pages to the Ogg encapsulated Opus for offload playback. This further matches the RFC 7845 spec and provides initialization data to decoders.

PiperOrigin-RevId: 548080222
(cherry picked from commit 847f6f24d3)
2023-07-14 11:41:56 +01:00
rohks
57d0c197cc Add tests for DefaultSsChunkSource
Added tests for Common Media Client Data (CMCD) logging in SmoothStreaming(SS)

PiperOrigin-RevId: 548072725
2023-07-14 11:03:05 +01:00
rohks
88e34017a3 Fix dependencies for UI module
PiperOrigin-RevId: 548063325
(cherry picked from commit 4d40f2e7dd)
2023-07-14 10:12:32 +01:00
rohks
77fb6525b1 Replace Dummy with Placeholder
`Dummy` is a non inclusive language.

PiperOrigin-RevId: 547815680
(cherry picked from commit ca10204b2d)
2023-07-13 16:55:49 +01:00
rohks
272c844abd Add fields streaming format(sf), stream type(st) and version(v)
Added these CMCD-Session fields to Common Media Client Data (CMCD) logging.

PiperOrigin-RevId: 547435498
(cherry picked from commit 0412a36564)
2023-07-12 10:25:50 +01:00
bachinger
7d35f18732 Add custom layout to the state of the MediaController
This change also marks the buttons of the custom layout as
enabled/disabled according to available commands in the controller.
Accordingly, `CommandButton.Builder.setEnabled(boolean)` is deprecated
because the value is overridden by the library.

Issue: androidx/media#38

PiperOrigin-RevId: 547272588
(cherry picked from commit ea21d27a69)
2023-07-11 20:59:01 +01:00
ibaker
996755c22b Expand @UnstableApi javadoc with how to request stable API additions
Issue: androidx/media#503

#minor-release

PiperOrigin-RevId: 547143885
(cherry picked from commit 2afcf99591)
2023-07-11 11:57:13 +01:00
ibaker
c1261aa266 Remove javadoc @link from non-javadoc comments
Also update type names to match the current names for these types.

PiperOrigin-RevId: 546884049
(cherry picked from commit eed0e42ff8)
2023-07-10 16:46:18 +01:00
ibaker
bae387651b Clarify that new ConditionVariable instances are closed
#minor-release

PiperOrigin-RevId: 546803592
(cherry picked from commit a8520bdee6)
2023-07-10 10:10:03 +01:00
andrewlewis
405e5a6e3e Fix incorrect class name for MediaPipe demo
Issue: androidx/media#500

#minor-release

PiperOrigin-RevId: 545942450
(cherry picked from commit bdbf3e29a1)
2023-07-06 12:07:21 +01:00
tonihei
9de5684d6e Change multidex dependency type to androidTestImplementation
This is only needed for instrumentation tests and should not
be included in regular builds.

Issue: androidx/media#499
PiperOrigin-RevId: 545913113
(cherry picked from commit 2250ffe6c8)
2023-07-06 09:45:11 +01:00
rohks
0c6cfea048 Replace BitArray.skipBytes() with BitArray.skipBits()
Based on the spec, ETSI TS 102 366 V1.4.1 Annex F, 6 bits should have skipped instead of 6 bytes.

This correction was pointed out in Issue: androidx/media#474.

PiperOrigin-RevId: 545658365
(cherry picked from commit 07d4e5986b)
2023-07-05 15:04:50 +01:00
ibaker
bcde7e03c2 Include timing info in some SCTE-35 toString implementations
This was helpful in investigating Issue: androidx/media#471

PiperOrigin-RevId: 545393217
(cherry picked from commit 3456382ae7)
2023-07-04 10:09:27 +00:00
michaelkatz
cb7b3862c4 Add nanoTime method to Clock to support overriding System.nanoTime()
PiperOrigin-RevId: 545237925
(cherry picked from commit de4575da28)
2023-07-03 16:29:13 +00:00
tonihei
26ee4c35f3 Replace exoplayer.dev@gmail.com with android-media-github@google.com
#minor-release

PiperOrigin-RevId: 545165879
(cherry picked from commit 5e19a33095)
2023-07-03 09:34:55 +00:00
ibaker
aa34db41f7 CEA-608: Only truncate to 32 visible characters
We introduced truncation to 32 chars in <unknown commit>
and included indent and offset in the calculation. I think this is
technically correct, but it causes problems with the content in
Issue: google/ExoPlayer#11019 and it doesn't seem a problem to only truncate actual
cue text (i.e. ignore offset and indent).

PiperOrigin-RevId: 544677965
(cherry picked from commit e8fdd83558)
2023-06-30 16:35:46 +00:00
tonihei
aefba8a565 Remove dead code in ProgressiveMediaSource.Builder
These fields cannot be set and the logic to handle them can be removed.

PiperOrigin-RevId: 544646460
(cherry picked from commit 2f113c8b82)
2023-06-30 14:05:39 +00:00
microkatz
3a66617b9e Merge pull request #487 from vishnuchilakala:allow_unsigned_int_for_adaptation_set_id
PiperOrigin-RevId: 544601945
(cherry picked from commit 9513f2c551)
2023-07-05 08:53:09 +00:00
tianyifeng
52706b2eb4 Ensure that ShuffleOrder has the same length as the current playlist
Add a fail-fast check in `ExoPlayerImpl` to ensure the equality of the lengths of `ShuffleOrder` and the current playlist. Also improve the documentation of `setShuffleOrder(ShuffleOrder)` with explicit instruction on this.

Issue: androidx/media#480

#minor-release

PiperOrigin-RevId: 544009359
(cherry picked from commit d895a46b28)
2023-06-28 10:41:49 +00:00
tonihei
f768fedaee Clarify MediaPeriod.readDiscontinuity Javadoc
It currently wrongly documents that it is only called before reading
streams (that has never been the case and all MediaPeriods already need
to handle calls after reading samples from the streams).

It was also a bit unclear what a discontinuity implies and the new
Javadoc calls out the main use case for discontinuties and the intended
meaning of returning a discontinuity.

#minor-release

PiperOrigin-RevId: 543989124
(cherry picked from commit b324b8aa72)
2023-06-28 08:55:56 +00:00
tianyifeng
7683ee254a Use different package names in DiagnosticInfo for media3 and exoplayer
Issue: androidx/media#476

#minor-release

PiperOrigin-RevId: 543460075
(cherry picked from commit 140c83ce7e)
2023-06-26 16:28:47 +00:00
tonihei
ec13c42800 Do not trim audio samples by changing their timestamp
MP4 edit lists sometimes ask to start playback between two samples.
If this happens, we currently change the timestamp of the first
sample to zero to trim it (e.g. to display the first frame for a
slightly shorter period of time). However, we can't do this to audio
samples are they have an inherent duration and trimming them this
way is not possible.

PiperOrigin-RevId: 543420218
(cherry picked from commit 2322462404)
2023-06-26 13:26:35 +00:00
Googler
bf4561c606 Removing @CallSuper from [add,remove]Listener of ForwardingListener.
PiperOrigin-RevId: 543373503
(cherry picked from commit 1fc49ce288)
2023-06-26 09:11:27 +00:00
jbibik
b220dfe73c Cleaner unified PlayerInfo update method in MediaControllerImplBase
`MediaControllerImplBase` has 2 methods for updating listeners about `PlayerInfo` changes - `updatePlayerInfo` (for masking the state) and `onPlayerInfoChanged` (when communicating with the session). There is a set number of listener callbacks related to `PlayerInfo` updates and both methods should go through the same control flow (whether we know that masking will ignore most of them or not).

A unified method `notifyPlayerInfoListenersWithReasons` encapsulates only the shared logic of 2 methods - listeners' callbacks. This ensures that both methods call them in the same order and none are missed out.

PiperOrigin-RevId: 542587879
(cherry picked from commit c2d8051662)
2023-06-22 16:49:36 +00:00
jbibik
e008e21b0f Fix missing equals sign in inline-comment parameter names
PiperOrigin-RevId: 542577676
(cherry picked from commit ea0f564c1e)
2023-06-22 16:09:57 +00:00
jbibik
b4c7e6cb86 Order MediaControllerImplBase listener callbacks as in ExoPlayerImpl
The callbacks for `PlayerInfo` changes are currently in both `MediaControllerImplBase.updatePlayerInfo` (masking) and `MediaControllerImplBase.onPlayerInfoChanged`. But the order was different between them both and `ExoPlayerImpl.updatePlaybackInfo` which they are trying to mimic.

#minor-release

PiperOrigin-RevId: 542519070
(cherry picked from commit b8ac5b4210)
2023-06-22 11:19:48 +00:00
ibaker
4f5d59b58f Switch to SVG assets hosted on developer.android.com for reference docs
#minor-release

PiperOrigin-RevId: 541970884
(cherry picked from commit 34f23451e6)
2023-06-20 17:23:37 +00:00
bachinger
f6a30f6645 Fix ArrayIndexOutOfBoundIndex when re-preparing after exception
When an app tried to re-prepare a live streeam with server side inserted
ad after a playback exception, the player tried to find the ad group by
its index in the ad playback state of the next timeline when creating
the first period.

If a source that supports server side ad, has removed the ad playback
state when the source has been removed, this causes a crash. For live
streams this is a reasonable thing to do given the exception could be
caused by an invalid ad playback state.

This change removes the ad metadata from the current period for live
streams and the timeline. In case the ad playback state is not reset
by the source, the first timeline refresh would ad the metadata again.

PiperOrigin-RevId: 541959628
(cherry picked from commit 4604f0cde6)
2023-06-20 16:55:22 +00:00
jbibik
4710b8f03a Fixed spelling across various PlayerInfo *ChangeReason fields
PiperOrigin-RevId: 541892788
(cherry picked from commit b9cc70d9e2)
2023-06-20 13:06:34 +00:00
tonihei
3561258949 Fix spurious sessions created for events after the playlist is cleared
Some events may arrive after the playlist is cleared (e.g. load
cancellation). In this case, the DefaultPlaybackSessionManager may
create a new session for the already removed item.

We already have checks in place that ignore events with old
windowSequenceNumbers, but these checks only work if the current
session is set (i.e. the playlist is non-empty). The fix is to add
the same check for empty playlists by keeping note of the last
removed window sequence number.

PiperOrigin-RevId: 541870812
(cherry picked from commit e0191ddded)
2023-06-20 12:27:23 +01:00
Marc Baechinger
7e0296fa7c Merge pull request #436 from jaeho-lee104:feature/improve_condition
PiperOrigin-RevId: 540875285
(cherry picked from commit af69d5822a)
2023-06-19 16:25:40 +01:00
rohks
f01ca9d9f1 Refactor method CmcdLog.createInstance to accept bufferedDurationUs
Instead of providing `playbackDurationUs` and `loadPositionUs` individually, which are used to calculate the buffer duration for CMCD logging, we can directly pass the pre-calculated `bufferedDurationUs` available in the `getNextChunk` method of the chunk source classes.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 540630112
(cherry picked from commit be9b057dda)
2023-06-15 18:55:30 +01:00
rohks
0aede89586 Add CMCD logging when requesting initialization chunk for DASH and HLS
Additionally, two existing methods to `buildDataSpec` in `DashUtil` have been deprecated, while a new method has been added that allows the inclusion of `httpRequestHeaders`.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 540594444
(cherry picked from commit 52878b2aca)
2023-06-15 16:48:55 +01:00
jbibik
2367e7a9e8 Default RepeatMode for conversion is NONE/OFF
Current behaviour causes an app to crash if it receives an unrecognized repeat mode send over the wire. In order to avoid the crash, a sensible default had to be chosen.

For `Player.RepeatMode`, it is `Player.REPEAT_MODE_OFF`, which is the same value we use as default when unbundling `PlayerInfo`.

For `PlaybackStateCompat.RepeatMode`, it is `PlaybackStateCompat.REPEAT_MODE_NONE`, which is what we use in the no-arg `LegacyPlayerInfo` constructor.

Issue: androidx/media#448

#minor-release

PiperOrigin-RevId: 540563792
(cherry picked from commit 501da109ce)
2023-06-15 14:31:59 +01:00
ibaker
3c9831fcb4 Remove = from parameter args in call to Constructor.newInstance
These comments reflect the parameter names of the constructor that
we're reflectively calling, but errorprone complains that they don't
match the parameter names of `Constructor.newInstance`.

PiperOrigin-RevId: 540348118
(cherry picked from commit 567890da9e)
2023-06-14 20:32:01 +01:00
siroberts
648e9943e5 Add missing checkNotNull to bitmapLoader.
#minor-release

PiperOrigin-RevId: 540309118
(cherry picked from commit cf21add916)
2023-06-14 18:22:13 +01:00
bachinger
3cfdd4fdc5 Implement equals/hashCode for CommandButton
#minor-release

PiperOrigin-RevId: 540274932
(cherry picked from commit 3d674fa2f3)
2023-06-14 16:13:48 +01:00
ibaker
983d9d57d7 Stop suppressing exceptions in MediaCodec.Callback during flush
Previously `AsynchronousMediaCodecCallback.mediaCodecException` was
cleared when flushing completed. This behaviour was changed in
aeff51c507
so now the exception is not cleared.

The result after that commit was that we would **only** suppress/ignore
the expression if a flush was currently pending, and we would throw it
both before and after the flush. This doesn't really make sense, so this
commit changes the behaviour to also throw the exception during the
flush.

This commit also corrects the assertion in
`flush_withPendingError_resetsError` and deflakes it so that it
consistently passes. The previous version of this test, although the
assertion was incorrect, would often pass because the
`dequeueInputBuffer` call would happen while the `flush` was still
pending, so the exception was suppressed.

#minor-release

PiperOrigin-RevId: 540237228
(cherry picked from commit 248d1d99ec)
2023-06-14 13:07:39 +01:00
tonihei
a9b78318ca Add missing @Override
PiperOrigin-RevId: 540220141
(cherry picked from commit c76680a65c)
2023-06-14 11:26:38 +01:00
jbibik
9dec0d308b Notify listeners of error changes when masking in MediaControllerImplBase
Currently, the implementation of `MediaControllerImplBase` differs from `ExoPlayerImpl`. The listeners of the former are notified of player error changes only in `onPlayerInfoChanged` and not `updatePlayerInfo` (masking method). Whereas `ExoPlayerImpl` has one unified method - `updatePlaybackInfo` - which sends the events to all the available listeners.

This change fixes the lack of 2 particular callbacks - `onPlayerErrorChanged` and `onPlayerError`, however, there might be more differences. Ideally, there should be a unified method for oldPlayerInfo/newPlayerInfo comparison-update-notify-listeners flow.

Issue: androidx/media#449

#minor-release

PiperOrigin-RevId: 539961618
(cherry picked from commit 4b5a457790)
2023-06-13 15:46:46 +01:00
ibaker
6615399861 Release ExoPlayer instances in ExoPlayerTest
This was recommended in https://github.com/robolectric/robolectric/issues/8187#issuecomment-1552060094

PiperOrigin-RevId: 539691757
(cherry picked from commit 959e974138)
2023-06-12 18:19:56 +01:00
bachinger
c3a96b2e08 Clean up HLS sample for cast demo
Issue: androidx/media#452
#minor-release
PiperOrigin-RevId: 539613535
(cherry picked from commit c2f78db87e)
2023-06-12 11:40:30 +00:00
claincly
0cf3ab31bf Factor out video decoding and fix two minor issues
1. Not treating 0 as valid buffer index
2. Not handling the case the last frame is a comparison frame

PiperOrigin-RevId: 539607482
(cherry picked from commit 4b1ac2f172)
2023-06-12 11:05:08 +00:00
ibaker
8ff61a1430 Stop setting -no-module-directories in ExoPlayer javadoc generation
This flag was introduced to fix links in javadoc search when generating
it with Java 11: <unknown commit>

The flag is no longer supported with Java 17 (which is required for
Gradle 8.0+), and seems to no longer be needed: I generated the javadoc
with it removed and the search links work OK.

PiperOrigin-RevId: 536738686
2023-08-11 15:52:04 +00:00
Tofunmi Adigun-Hameed
5328d6464a
Merge pull request #498 from androidx/release-1.1.0
Release 1.1.0
2023-07-05 08:56:12 +00:00
ibaker
00005cb09d Replace exoplayer.dev@gmail.com with android-media-github@google.com
#minor-release

PiperOrigin-RevId: 544596686
(cherry picked from commit f2c0eab468)
2023-06-30 10:57:51 +01:00
tofunmi
1d73c68465 Fix version bump for media3:1.1.0
#minor-release

PiperOrigin-RevId: 543376501
(cherry picked from commit 10cf06386d)
2023-06-26 10:04:55 +00:00
tofunmi
5fdeabbed8 Version bump for exoplayer 2.19.0 continued
#minor-release

PiperOrigin-RevId: 543369900
(cherry picked from commit 81dfe9d4b4)
2023-06-26 10:04:55 +00:00
tofunmi
ece76c4b61 Version bump to media3-1.1.0 and exoplayer 2.19.0
#minor-release

PiperOrigin-RevId: 542881427
(cherry picked from commit 114364897b)
2023-06-23 18:11:57 +00:00
tofunmi
69c6038e32 Merge release notes for media3 1.1.0 stable release
Merged during cherry-pick

PiperOrigin-RevId: 542539300
(cherry picked from commit 7e475146dd)
2023-06-23 12:20:40 +00:00
ibaker
b1522b4069 Add a section to CONTRIBUTING.md about push access to PR forks
#minor-release

PiperOrigin-RevId: 542294607
(cherry picked from commit 3f7599e9c3)
2023-06-23 12:13:32 +00:00
ibaker
bcdadbfdf5 Fix two more unresolved SVGs in Timeline.Window and Timeline.Period
These were missed in 10342507f7

#minor-release

PiperOrigin-RevId: 541860649
(cherry picked from commit 71f73229dd)
2023-06-23 12:13:31 +00:00
bachinger
1ae8ddd0fd Document how to use a custom receiver app with the cast demo
#minor-release
Issue: androidx/media#452
PiperOrigin-RevId: 539915277
(cherry picked from commit 5afe7552fe)
2023-06-23 12:13:31 +00:00
bachinger
e53796fc25 Fix bug where PlayerView distorts video when video size is unknown
PiperOrigin-RevId: 541640959
(cherry picked from commit 8d8c514d12)
2023-06-19 17:03:25 +01:00
tofunmi
3631e1c6f3 Version bump to media3:1.1.0-rc01
#minor-release

PiperOrigin-RevId: 539632164
(cherry picked from commit 4bceb64dee)
2023-06-12 13:23:56 +00:00
tofunmi
66b59ec3a7 Update RELEASENOTES.md for media3-1.1.0-rc01 release
Removed unreleased changes in this cherry-pick.

PiperOrigin-RevId: 539606230
(cherry picked from commit 49b893f6f3)
2023-06-12 16:15:31 +00:00
Googler
2ee0900659 Rollback of a66f08ba97
*** Original commit ***

Add a timer to end a video stream prematurely in ExtTexMgr

***

This has been submitting for more than 1.5hrs. "This presubmit is running slowly because you have been throttled by Build Queue due to using too much of your Product Area's quota."

adding NO_SQ as this is a pure rollback

PiperOrigin-RevId: 539135970
(cherry picked from commit 5c29abbbf4)
2023-06-12 09:15:55 +00:00
tianyifeng
23e92805a1 Throw exception when TimestampAdjuster initialization hits timeout
Add `HlsMediaSource.Factory.setTimestampAdjusterInitializationTimeoutMs(long)` to set the timeout for the loading thread to wait for the `TimestampAdjuster` to initialize. If the initialization doesn't complete before the timeout, a `PlaybackException` is thrown to avoid the playback endless stalling. The timeout is set to zero by default.

This can avoid HLS playback endlessly stalls when manifest has missing discontinuities. According to the HLS spec, all variants and renditions have discontinuities at the same points in time. If not, the one with discontinuities will have a new `TimestampAdjuster` not shared by the others. When the loading thread of that variant is waiting for the other threads to initialize the timestamp and hits the timeout, the playback will stall.

Issue: androidx/media#323

#minor-release

PiperOrigin-RevId: 539108886
(cherry picked from commit db3e662bdc)
2023-06-12 09:15:54 +00:00
bachinger
21fb8c9942 Fix splitting ad playback state for partial ad group when joining
This change addresses the case when the user joins the live stream
on an ad period but the metadata for the ad period is not emitted.
This results in inserting a partial ad group.

In this case the ad group duration is longer than the partial ad
group. If now the partial ad group ends at the period before the
last period of the window (unknown duration), the splitting algorithm
didn't recognize that the ad group already ended and made the last
period wrongly an ad period.

This change handles this edge case by counting the mapped ads in
the partial ad group to detect this situation and stops splitting.

#minor-release

PiperOrigin-RevId: 539102785
(cherry picked from commit cd604e7ead)
2023-06-12 09:15:54 +00:00
claincly
4dae1a1679 Add missing empty lines
PiperOrigin-RevId: 539100987
(cherry picked from commit edf30433b6)
2023-06-12 09:15:54 +00:00
bachinger
56c62d1ab1 Make current period a placeholder when a live stream is reset
In case the player is reset while a live stream is playing, the current
period needs to be a placeholder. This makes sure that the default start
position is used when the first live timeline arrives after re-preparing.

#minor-release

PiperOrigin-RevId: 539044360
(cherry picked from commit 71153a43a8)
2023-06-12 09:15:54 +00:00
claincly
50f4caacd6 Add a timer to end a video stream prematurely in ExtTexMgr
PiperOrigin-RevId: 539036285
(cherry picked from commit a66f08ba97)
2023-06-12 09:15:54 +00:00
bachinger
1c8c563263 Do not reset period uid when DashMediaSource is released
When the source is prepared again after stop, the period uid
is calculated by subtracting the `firstPeriodId` from the
period uid that is passed in to `createPeriod`. When this
happens after stop, the uid from the old period uid that
is still stored and has the value of the last played uid.

Hence the `firstPeriodId` must not be reset when released.

Issue: google/ExoPlayer#10838
PiperOrigin-RevId: 539028570
(cherry picked from commit 319854d624)
2023-06-12 09:15:54 +00:00
rohks
f1529d63a1 Implement logging support for Common Media Client Data (CMCD)
Add support for including Common Media Client Data (CMCD) in the outgoing requests of adaptive streaming formats DASH, HLS, and SmoothStreaming.

API structure and API methods:
   *   CMCD logging is disabled by default, use `MediaSource.Factory.setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)` to enable it.
   *   All keys are enabled by default, override `CmcdConfiguration.RequestConfig.isKeyAllowed(String key)` to filter out which keys are logged.
   *  Override `CmcdConfiguration.RequestConfig.getCustomData()` to enable custom key logging.

NOTE: Only the following fields have been implemented: `br`, `bl`, `cid`, `rtp`, and `sid`.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 539021056
(cherry picked from commit b55ddf12b4)
2023-06-12 09:15:54 +00:00
bachinger
ec3446fe8b Enable re-preparing the ImaSSAIMediaSource
#minor-release

PiperOrigin-RevId: 538927855
(cherry picked from commit a67ce066df)
2023-06-12 09:15:53 +00:00
jbibik
f18ec2e0c5 Make StreamKey Bundleable and remove deprecated trackIndex
#minor-release

PiperOrigin-RevId: 538809105
(cherry picked from commit 28b8fb706a)
2023-06-12 09:15:53 +00:00
tofunmi
39b98fe5ad Add 'Keep every nth frame' frame dropping strategy.
#minor-release

PiperOrigin-RevId: 538804347
(cherry picked from commit 276f2f1fe6)
2023-06-12 09:15:53 +00:00
tianyifeng
78f23c0c9b Add seekPrev and seekNext buttons on the default compact notification
This change is for Android 12 and below, where the buttons are derived from the actions added with the notification. From Android 13 (https://developer.android.com/about/versions/13/behavior-changes-13#playback-controls), the system derives media controls from `PlaybackState` actions.

When adding the actions onto the notification, the logic will iterate all the command buttons. The `COMMAND_KEY_CONPACT_VIEW_INDEX` extra will be checked for each button. If that extra is set for the three buttons on the compact view, then the customized buttons and their order will be used. Otherwise, the compact view will be "seekPrev" (if any), "play/pause" (if any), "seekNext" (if any) buttons (in such order).

Issue: androidx/media#410
PiperOrigin-RevId: 538797874
(cherry picked from commit 2e2f19351f)
2023-06-12 09:15:53 +00:00
claincly
f1b942150c Fix calling extra registerInputStream and not handling EOS
PiperOrigin-RevId: 538796466
(cherry picked from commit a7cff4e0e3)
2023-06-12 09:15:53 +00:00
sheenachhabra
ebfb9cf402 Add support for passing custom metadata via transformer
Changes included:
1. Enable MP4 extractor to read all types of metadata.
2. Allow passing String and Float metadata via Transformer.

Reference to QuickTime spec: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW21

PiperOrigin-RevId: 538783982
(cherry picked from commit 53c174f047)
2023-06-12 09:15:53 +00:00
sheenachhabra
f2c0d7e13c Enable nullness checker for Muxer module androidTest library
PiperOrigin-RevId: 538742957
(cherry picked from commit 2753fb0e3e)
2023-06-12 09:15:53 +00:00
huangdarwin
6dcfe44b89 Test: Add no-op effect test for GL tone mapping.
To ensure no regressions for the potentially confusing pipeline of:
* HDR electrical -> SDR linear EOTF+OOTF, and
* SDR linear -> SDR electrical OETF

PiperOrigin-RevId: 538741079
(cherry picked from commit 0c924fcb40)
2023-06-12 09:15:53 +00:00
tofunmi
5afc256eba DefaultVideoFrameProcessorMultipleTextureOutputPixelTest fixes & cleanup
PiperOrigin-RevId: 538495675
(cherry picked from commit ce203ccfed)
2023-06-12 09:15:52 +00:00
huangdarwin
797ee99baf Test: Move duplicated GL tone mapping logic into helper methods.
PiperOrigin-RevId: 538491957
(cherry picked from commit 9dad207603)
2023-06-12 09:15:52 +00:00
kimvde
71c2d7ba92 Remove unnecessary thread in AssetLoader tests
Also queue textures from a different thread in TextureAssetLoader, to
have a behaviour closer to reality.

PiperOrigin-RevId: 538473089
(cherry picked from commit 3ba8f6dd8f)
2023-06-12 09:15:52 +00:00
jbibik
ade2990503 Fix 1 ErrorProneStyle finding
PiperOrigin-RevId: 538469993
(cherry picked from commit e7f7e86f3e)
2023-06-12 09:15:52 +00:00
tofunmi
f7245a5ff2 Tests for disabled color transfers
#minor-release

PiperOrigin-RevId: 538466615
(cherry picked from commit c3b9328d74)
2023-06-12 09:15:52 +00:00
huangdarwin
295eb06145 Effect: Add multiple texture output test.
Confirms that multiple textures can be output, and that timestamps and pixels
are as expected.

PiperOrigin-RevId: 538459296
(cherry picked from commit adf53b4d50)
2023-06-12 09:15:52 +00:00
andrewlewis
752a49c8d0 Log additional information on test runner timeout
PiperOrigin-RevId: 538437142
(cherry picked from commit 828a05e0fa)
2023-06-12 09:15:52 +00:00
Tofunmi Adigun-Hameed
9b136d3368 Merge pull request #371 from tatsuyafujisaki:simplify-loadJSONFromAsset
PiperOrigin-RevId: 538423581
(cherry picked from commit 9aa519f1ee)
2023-06-12 09:15:52 +00:00
Tofunmi Adigun-Hameed
9db3769fac Merge pull request #439 from kaidokert:pick_workaround
PiperOrigin-RevId: 538209925
(cherry picked from commit 886717e3fe)
2023-06-12 09:15:51 +00:00
sheenachhabra
f1d285ed6f Add support for passing creation time via InAppMuxer
PiperOrigin-RevId: 538175466
(cherry picked from commit 7e14811e25)
2023-06-12 09:15:51 +00:00
Tofunmi Adigun-Hameed
d4e0a8d13d Merge pull request #425 from vishnuchilakala:set_min_live_position
PiperOrigin-RevId: 538173603
(cherry picked from commit 9ca6e5d90d)
2023-06-12 09:15:51 +00:00
tianyifeng
1c1ca3edaf Defer outputting the metadata sample when TimestampAdjuster isn't initialized
The sample timestamp carried by the emsg box can have a significant delta when comparing to the earliest presentation timestamp of the segment. Using this timestamp to intialize the timestamp offset in TimestampAdjuster will cause the media sample to have a wrong adjusted timestamp. So we should defer adjusting the metadata sample timestamp until the TimestampAdjuster is initialized with a real media sample.

PiperOrigin-RevId: 538172841
(cherry picked from commit f4bf376e89)
2023-06-12 09:15:51 +00:00
claincly
70a25b01bf Add utility to create ScheduledExecutorService
PiperOrigin-RevId: 538129792
(cherry picked from commit 08e7158be5)
2023-06-12 09:15:51 +00:00
jbibik
a5949d8806 Allow playback of MediaItems with LocalConfiguration
When initiated by MediaController, it should be possible for `MediaSession` to pass `MediaItems` to the `Player` if they have `LocalConfiguration`. In such case, it is not required to override `MediaSession.Callback.onAddMediaItems`, because the new current default implementation will handle it.

However, in other cases, MediaItem.toBundle() will continue to strip the LocalConfiguration information.

Issue: androidx/media#282

RELEASENOTES.md modified in cherrypick

PiperOrigin-RevId: 537993460
(cherry picked from commit d9764c18ad)
2023-06-12 09:15:01 +00:00
Googler
4a90efaf10 Override ParserException#getMessage
PiperOrigin-RevId: 537908595
(cherry picked from commit 83e9080b71)
2023-06-12 09:13:53 +00:00
ibaker
5792b9299e Add a 'more version details' box to the GitHub bug issue template
#minor-release

PiperOrigin-RevId: 537893360
(cherry picked from commit d328e62f69)
2023-06-12 09:13:53 +00:00
claincly
39ec69fe66 Fix recreation of DefaultShaderProgram in FinalWrapper
`outputSurfaceInfoChanged` is not reset when `defaultShaderProgram` is null.
That is, on the first time `ensureConfigured()` is called with output size
changed, `outputSurfaceInfoChanged` is not set to false after creating the
`defaultShaderProgram`, and `defaultShaderProgram` will be created again on the
second time `ensureConfigured()` is called.

PiperOrigin-RevId: 537870404
(cherry picked from commit 133943a635)
2023-06-12 09:13:53 +00:00
tofunmi
a8dbea74ce Revert AndroidTestUtil.canDecode to use EncoderUtil.findCodecForFormat
208eefc0fd introduced using `DefaultDecoderFactory.getDecoderInfo(format) != null` caused certain tests not to be skipped when they were expected to be, creating more mh failures.

PiperOrigin-RevId: 537820370
(cherry picked from commit 2af5752785)
2023-06-12 09:13:53 +00:00
sheenachhabra
83957eb67f Ignore ByteBuffer position when writing samples in Mp4Muxer
PiperOrigin-RevId: 537814319
(cherry picked from commit 997f2be5e5)
2023-06-12 09:13:53 +00:00
andrewlewis
3ef7bc291c Tidy color info checking tests
ExoPlayer extractors (backing `MetadataRetriever`) now parse the color format
from the bitstream so using `MetadataRetriever` should be an equivalent but
more lightweight way to verify the color info.

Also remove try/catch blocks in test code calling into these methods, and add
skipping based on decoder capabilities in the cases where it was missing.

PiperOrigin-RevId: 537789483
(cherry picked from commit 74478f2478)
2023-06-12 09:13:53 +00:00
huangdarwin
4bb00d5e2e Test: Add special effects for forcing transcode.
Previously, we would apply a general effect to signal wanting to transcode.

PiperOrigin-RevId: 537034455
(cherry picked from commit c52130a212)
2023-06-12 09:13:52 +00:00
Tofunmi Adigun-Hameed
568327ff2e Merge pull request #420 from changxiangzhong:fix/cp-missing
PiperOrigin-RevId: 537014587
(cherry picked from commit a739f6062e)
2023-06-12 09:13:52 +00:00
claincly
1238a5f328 Use the designated UNSET value for aspect ratio
PiperOrigin-RevId: 536770380
(cherry picked from commit f6dbe99c79)
2023-06-12 09:13:52 +00:00
kimvde
55a2e7ff9e Add TransformationRequest toString method
PiperOrigin-RevId: 536727079
(cherry picked from commit 108000834b)
2023-06-12 09:13:52 +00:00
ibaker
89c5e16d2f Soften MediaCodecRenderer's assumptions about using framework DRM
#minor-release

PiperOrigin-RevId: 536724725
(cherry picked from commit 0ddc024c69)
2023-06-12 09:13:52 +00:00
claincly
ba84de02f6 Fix codec's MIME type is not used
In some cases the codec selected for decoding has a different MIME type than
the media. In thoses cases Transformer continued to use the media's MIME type
and that caused codec configuration failures.

Removed `EncoderUtil.findCodecForFormat()` as we stopped using the method it
uses for finding a codec. Plus, the method is only used in the test.

See also `MediaCodecUtil.getALternativeCodecMimeType()`.

PiperOrigin-RevId: 536683663
(cherry picked from commit 208eefc0fd)
2023-06-12 09:13:52 +00:00
huangdarwin
db1b5f148d Exoplayer: Suppress check to allow video to run ahead of Audio.
Otherwise, texture output errors out if video decoding decodes faster than audio,
hitting the end of the file, while audio is still in the middle of the file.

PiperOrigin-RevId: 536679568
(cherry picked from commit e2821f10f5)
2023-06-12 09:13:52 +00:00
huangdarwin
2713f81fd0 Effect: Remove extra wait on taskExecutor release()
This future.get() duplicates the wait done in
singleThreadExecutorService.awaitTermination(). If awaitTermination times out, this future.get() would also result in unnecessary blocking.

PiperOrigin-RevId: 536442153
(cherry picked from commit 1c172e0bed)
2023-06-12 09:13:51 +00:00
sheenachhabra
6e74b1770c Add only supported MdtaMetadataEntry
PiperOrigin-RevId: 536351494
(cherry picked from commit 99d2cf6713)
2023-06-12 09:13:51 +00:00
jbibik
629ab59b5f Remove previously deprecated MediaItem.PlaybackProperties in favour of LocalConfiguration.
Deprecated field `MediaItem.playbackProperties` remains for backwards compatibility, but its type is changed from `MediaItem.PlaybackProperties` to `MediaItem.LocalConfiguration`. The private `MediaItem` constructor will now also take in a `LocalConfiguration` argument instead.

PiperOrigin-RevId: 535648420
(cherry picked from commit 25bf0c6738)
2023-06-12 09:13:51 +00:00
tofunmi
75ad65f14c Image transcoding: Add support for bmp image format.
With this change we will now support loading bitmaps from all the formats documented [here](https://developer.android.com/guide/topics/media/media-formats#image-formats) except for gifs (because they are animated). Java doc is added to express this.

PiperOrigin-RevId: 535610152
(cherry picked from commit 94d29f35fc)
2023-06-12 09:13:51 +00:00
kimvde
2ed784f156 Transmux video if rotation is only effect applied
PiperOrigin-RevId: 535554628
(cherry picked from commit f4d1a6c453)
2023-06-12 09:13:51 +00:00
Tofunmi Adigun-Hameed
b79ee36661 Removing unreleased Audio Offload changes from git 2023-06-07 09:05:51 +00:00
tofunmi
723424a852 Version bump to media3:1.1.0-beta01
#minor-release

PiperOrigin-RevId: 536464412
(cherry picked from commit 49ea280bb8)
2023-05-30 19:42:29 +00:00
Tofunmi Adigun-Hameed
6e0156766b Merge branch 'release' into release-1.1.0-beta01 2023-05-30 16:12:11 +00:00
huangdarwin
4d4f61b772 Rollback of 438ae0ed6a
*** Original commit ***

ExoPlayer: Add setVideoFrameProcessorFactory().

This allows apps to use a custom VideoFrameProcessor implementation for video
playback. This may be useful, for example, when outputting to a texture.
***

PiperOrigin-RevId: 536391597
(cherry picked from commit 06908e1a86)
2023-05-30 14:57:40 +00:00
tofunmi
a442919246 Update release notes for 1.1.0-beta01 release
PiperOrigin-RevId: 536383299
(cherry picked from commit ebbbcf9ac9)
Merged in cherry-pick
2023-05-30 14:57:05 +00:00
Tofunmi Adigun-Hameed
bd29a3553d Merge pull request #335 from cedricxperi:dts-direct-passthrough-support
Resolved Merge Conflict during cherrypicking

PiperOrigin-RevId: 535255453
(cherry picked from commit c3dd88d715)
2023-05-26 13:58:36 +00:00
ibaker
75a9de6c21 Add sections for each minor release to RELEASENOTES.md
#minor-release

PiperOrigin-RevId: 535240816
(cherry picked from commit 41b19df5fa)
2023-05-26 13:34:52 +00:00
Googler
d7e5c1bb0b Show the file path of the exported output video.
PiperOrigin-RevId: 535233266
(cherry picked from commit 86515f8683)
2023-05-26 13:34:52 +00:00
tofunmi
7047f44564 Move OnInputFrameProcessedListener into it's own file
PiperOrigin-RevId: 535183521
(cherry picked from commit a19e07c4d2)
2023-05-26 13:34:52 +00:00
tonihei
f2edc0bed1 Implement Player.replaceMediaItem(s)
This change moves the default logic into the actual Player
implementations, but does not introduce any behavior changes compared
to addMediaItems+removeMediaItems except to make the updates "atomic"
in ExoPlayerImpl, SimpleBasePlayer and MediaController. It also
provides backwards compatbility for cases where Players don't support
the operation.

Issue: google/ExoPlayer#8046

#minor-release

PiperOrigin-RevId: 534945089
(cherry picked from commit 2c07468908)
2023-05-26 13:25:10 +00:00
tonihei
638dee44a9 Merge pull request #386 from yschimke:icon
PiperOrigin-RevId: 534927167
(cherry picked from commit cf0334d793)
2023-05-26 13:25:10 +00:00
michaelkatz
df4803028f Use base Uri from the RTSP DESCRIBE response header for relative paths
Issue: google/ExoPlayer#11160

#minor-release

PiperOrigin-RevId: 534896789
(cherry picked from commit 85f83b1208)
2023-05-26 13:25:10 +00:00
huangdarwin
74a032d462 Effects: Have VFP texture output disable surface output.
Also, document that texture output disables manual frame release.

In the past, texture output would lead to surface output methods throwing. Now,
they're simply no-ops instead.

PiperOrigin-RevId: 534894168
(cherry picked from commit abf649cdfa)
2023-05-26 13:25:10 +00:00
andrewlewis
f59dac9d7d Clarify color transfers for internal textures
PiperOrigin-RevId: 534869452
(cherry picked from commit b988cce62c)
2023-05-26 13:25:10 +00:00
bachinger
5c498c3eca Keep aspect ratio of PlayerView when IDLE
When the video renderer is disabled, the video size is set to 0/0
and sent to listeners. The `PlayerView` potentially still has the last frame
displayed when the player is stopped or an error occurs. This may have the
effect that the frame is displayed distorted.

Not changing the aspect ratio when the video size arrives when the player is IDLE
avoids the problem. In the case when playback starts again and the renderes is
enabled, another video size is sent to the listener.

#minor-release

PiperOrigin-RevId: 534860889
(cherry picked from commit 6469fffd8f)
2023-05-26 13:25:10 +00:00
andrewlewis
a7501f4aaf Tidy TextureManager javadoc
Fix `@param`s and clarify wording.

PiperOrigin-RevId: 534857204
(cherry picked from commit 749c64c74f)
2023-05-26 13:25:10 +00:00
jbibik
171f48fccc Make MediaItem.AdsConfiguration bundleable
PiperOrigin-RevId: 534848363
(cherry picked from commit 3cc4e44fe3)
2023-05-26 13:25:09 +00:00
tonihei
8573a4ba85 Add clarifiying note to Player.replaceMediaItem
This helps to highlight that the replaced range doesn't need to have
the same size as before.

#minor-release

PiperOrigin-RevId: 534834917
(cherry picked from commit acb567d5a7)
2023-05-26 13:25:09 +00:00
sheenachhabra
c38f094b32 Add support for adding capture FPS via transformer
PiperOrigin-RevId: 534814892
(cherry picked from commit a944ffecb9)
2023-05-26 13:25:09 +00:00
sheenachhabra
fb952145fc Add support for adding XMP data via transformer
PiperOrigin-RevId: 534801202
(cherry picked from commit 71facd825e)
2023-05-26 13:25:09 +00:00
ibaker
6b19e5781c Clean up release notes (again)
I undid my last clean-up (b762ca993e) in 5a5c3ce3bd

#minor-release

PiperOrigin-RevId: 534763770
(cherry picked from commit 41492b6e29)
2023-05-26 13:25:09 +00:00
ibaker
c2d6c27d0b Remove deprecated onSeekProcessed
This change removes it from `Player.Listener` and `AnalyticsListener`,
use `onPositionDiscontinuity` with `DISCONTINUITY_REASON_SEEK` instead.

#minor-release

PiperOrigin-RevId: 534757426
(cherry picked from commit 5c713feb60)
2023-05-26 13:25:09 +00:00
huangdarwin
9e19c60907 Codec: Reduce limit for max decoder pending output frames.
Tentative/experimental value to reduce codec timeouts. We will reconsider using a larger limit after seeing whether this really does reduce error rate.

PiperOrigin-RevId: 534491615
(cherry picked from commit 66554b9b68)
2023-05-26 13:25:09 +00:00
claincly
38a341a458 Add logging for ExtTexMgr
- Number of frames from SurfaceTexture that is sent downstream
- Times ExtTexMgr signaled end of current input stream

PiperOrigin-RevId: 534487842
(cherry picked from commit d584a772e3)
2023-05-26 13:25:09 +00:00
sheenachhabra
d3f88a434b Add support for updating Metadata entries via InAppMuxer
Mp4Muxer already supports writing Mp4LocationData so added that
as supported Metadata entry.
Support for more Metadata entries will be added in upcoming CLs.

PiperOrigin-RevId: 534473866
(cherry picked from commit 7c477589e5)
2023-05-26 13:25:09 +00:00
ibaker
4d17a05b2b Ensure rootProject.name is only set from settings.gradle
I moved this assignment in 0888dfbd05
in order to provide a single source-of-truth for `publish.gradle`,
but as pointed out in Issue: androidx/media#416 this breaks apps that are depending
on our project locally using the instructions we publish. Instead we can
remove the `rootProject.name` check from `publish.gradle`, and check an
explicit boolean value instead to indicate if the root project is 'ours'
(with this boolean only set from `settings.gradle`, so it doesn't get
picked up by apps depending on us locally).

#minor-release

PiperOrigin-RevId: 534459085
(cherry picked from commit 9a79571284)
2023-05-26 13:25:09 +00:00
tonihei
88cdbe52d7 Improve MediaSource threading constraints documentation
And fix violation of this in AdsMediaSource.

#minor-release

PiperOrigin-RevId: 534441648
(cherry picked from commit c73955a4cd)
2023-05-26 13:25:09 +00:00
ibaker
6621287c86 Remove four deprecated AnalyticsListener decoder methods
Use the audio or video specific variants instead.

#minor-release

PiperOrigin-RevId: 534436644
(cherry picked from commit 5a5c3ce3bd)
2023-05-26 13:25:09 +00:00
ibaker
48c58cefc2 Remove deprecated OfflineLicenseHelper constructor
Use the non-deprecated constructor instead.

#minor-release

PiperOrigin-RevId: 534426655
(cherry picked from commit 48348df58a)
2023-05-26 13:25:09 +00:00
ibaker
c650a10256 Remove deprecated Cue constructors, use Cue.Builder instead
#minor-release

PiperOrigin-RevId: 534412494
(cherry picked from commit e6f5f58e47)
2023-05-26 13:25:09 +00:00
jbibik
16b09f6d63 Make MediaItem.SubtitleConfiguration bundleable
PiperOrigin-RevId: 534390168
(cherry picked from commit b7edc9e416)
2023-05-26 13:25:09 +00:00
ibaker
22ac971bbc Remove deprecated DownloadManager constructor
Use the constructor that takes an `Executor` instead.

#minor-release

PiperOrigin-RevId: 534370613
(cherry picked from commit ff0f1c4e9c)
2023-05-26 13:25:08 +00:00
bachinger
f8ef386065 Use artwork display mode in demo app
- Use artwork display mode `fill` to improve visual apperance
- Some minor cleanup

#minor-release

PiperOrigin-RevId: 534366246
(cherry picked from commit 230921e4ab)
2023-05-26 13:25:08 +00:00
ibaker
e8bcbd5249 Clean up release notes
This change merges some duplicate sections, moves some items to more
appropriate sections and removes unnecessary items (deprecations are
self-documenting, so don't need to be included here).

#minor-release

PiperOrigin-RevId: 534363065
(cherry picked from commit b762ca993e)
2023-05-26 13:25:08 +00:00
ibaker
ead2c0682a Remove deprecated DefaultLoadControl.Builder.createDefaultLoadControl()
Use `build()` instead.

#minor-release

PiperOrigin-RevId: 534348979
(cherry picked from commit 594e9ac50d)
2023-05-26 13:25:08 +00:00
ibaker
12ca8903ce Remove deprecated ExoPlayer.setHandleWakeLock(boolean)
Use `setWakeMode(int)` instead.

#minor-release

PiperOrigin-RevId: 534344010
(cherry picked from commit cad1ac2eb5)
2023-05-26 13:25:08 +00:00
bachinger
f372440882 Add artwork display mode to PlayerView
This change deprecates `PlayerView.setUseArtwork(boolean)` and
introduces `setArtworkDisplayMode(mode)` and
`artworkDisplayMode="off|fit|fill"` instead.

- off: no artwork is displayed (like deprecated useArtwork=false)
- fit: letterbox like media (like deprecated useArtwork=true)
- fill: scales the artwork to fill the entire width/weight of the player view

#minor-release

PiperOrigin-RevId: 534167226
(cherry picked from commit 46fb454b3f)
2023-05-26 13:25:08 +00:00
bachinger
5f3cb861fc Minor session demo app improvements
Basically this change removes a bug that makes video playback stuck when
a video is playing and the user taps the UMO notification to get to
the player activity.

- Use `launchMode="singleTop"` for `PlayerActivity`
- Change session activity to a back stacked activity on service `onDestroy`.

Using a back stacked activity `onDestroy()` will be useful once this demo
app implements playback resumption.

The rest of the changes are aesthetic:

- clean up and optimize screen space usage in UI of `PlayerActivity`
- changed some colors, paddings and spacings
- adds a default artwork for the `PlayerView`

PiperOrigin-RevId: 534152052
(cherry picked from commit 96a4ae7e40)
2023-05-26 13:25:08 +00:00
christosts
fbd0bae265 Fix seeking bug in opus
Fix a bug when seeking in an opus container. The calculations inside
DefaultOggSeeker may overflow a long primitive.

Issue: androidx/media#391

#minor-release

PiperOrigin-RevId: 534128513
(cherry picked from commit b9a4e614f7)
2023-05-26 13:25:08 +00:00
sheenachhabra
cebdb17134 Write metadata to Mp4Muxer in the release() method
Earlier metadata was written multiple times as it came.
With new changes, all the distinct metadata entries will
get collected and will be written at once in the end.

PiperOrigin-RevId: 534088401
(cherry picked from commit a9e3f5def4)
2023-05-26 13:25:08 +00:00
huangdarwin
9d04b11d49 Effect: Add GlTextureInfo release() and accessor methods.
This allows us to disallow access after release.

PiperOrigin-RevId: 534046475
(cherry picked from commit a6897aedaa)
2023-05-26 13:25:08 +00:00
huangdarwin
3d231cce05 ExoPlayer: Add setVideoFrameProcessorFactory().
This allows apps to use a custom VideoFrameProcessor implementation for video
playback. This may be useful, for example, when outputting to a texture.

PiperOrigin-RevId: 534044831
(cherry picked from commit 438ae0ed6a)
2023-05-26 13:25:08 +00:00
tonihei
5cdbd59756 Improve handling of adding items to empty playlist in MediaController
This is a follow-up to 99dac0be0f where we made the same change in
ExoPlayerImpl and SimpleBasePlayer, but for consistency it makes
sense to also update the masking code in MediaControllerImplBase to
assume the same logic.

Note: MediaControllerImplLegacy already handles this case via
setMediaItems and doesn't need to be updated further.

#minor-release

PiperOrigin-RevId: 534038759
(cherry picked from commit 33af245465)
2023-05-26 13:25:08 +00:00
tonihei
1b007deca0 Untangle PlayerInfo/PlaybackInfo updates
The methods in ExoPlayerImpl and MediaControllerImplBase that determine
the new PlayerInfo/PlaybackInfo currently have a hard-to-reason-about
setup where the method generating the new info accesses other methods
that rely on the existing class field instead of working with the
passed in PlayerInfo/PlaybackInfo. This prevents reuse of the util
methods (e.g. for replaceMediaItems) because they access potentially
stale state.

This change untangles these methods a bit by making the util methods
either static or at least ensure that they don't rely on existing
class fields of PlayerInfo/PlaybackInfo. Overall, the change is a
complete no-op.

#minor-release

PiperOrigin-RevId: 534036633
(cherry picked from commit 1fa790348e)
2023-05-26 13:25:08 +00:00
tonihei
44ffea2477 Keep pending initial position when setting empty playlist
MediaControllerImplBase currently drops the pending initial seek
position when a user sets an empty playlist.

When seeking in empty playlists and setting new empty playlists,
the class also drops the the period index (and wrongly assigns zero
instead of the windowIndex).

#minor-release

PiperOrigin-RevId: 534035046
(cherry picked from commit caf1c77af1)
2023-05-26 13:25:08 +00:00
tonihei
3704c7fc8d Extend main Player Javadoc
The main interface documentation hasn't been updated substantially
since 2017 and is missing notes for many of its current features and
requirements.

Also change the recommendation for implementors from BasePlayer to
SimpleBasePlayer to ensure new classes are more likely to cover all
of the interface requirements.

#minor-release

PiperOrigin-RevId: 534027117
(cherry picked from commit 6de6bd9c4f)
2023-05-26 13:25:08 +00:00
andrewlewis
8df047108c Remove unnecessary volatile
This field is always accessed with the mutex held.

PiperOrigin-RevId: 534027096
(cherry picked from commit ea0b94c0eb)
2023-05-26 13:25:07 +00:00
andrewlewis
8a9503c01a Use Ascii for conversion to lower case
PiperOrigin-RevId: 534016337
(cherry picked from commit b0418f1a2a)
2023-05-26 13:25:07 +00:00
andrewlewis
aa4f84d89a Run clang-format on GLSL
PiperOrigin-RevId: 534015933
(cherry picked from commit 2cbc2c6176)
2023-05-26 13:25:07 +00:00
ibaker
5c42c25ad3 Remove deprecated zero-arg DefaultTrackSelector constructor
Use `DefaultTrackSelector(Context)` instead.

#minor-release

PiperOrigin-RevId: 533985937
(cherry picked from commit 2b409da881)
2023-05-26 13:25:07 +00:00
jbibik
992c9aa470 Make DrmConfiguration Bundleable
PiperOrigin-RevId: 533721679
(cherry picked from commit 5008417c8c)
2023-05-26 13:25:07 +00:00
sheenachhabra
d40f37158a Move MdtaMetadataEntry class into container module
This class is to be shared between extractor, transformer
and muxer module.

PiperOrigin-RevId: 533490888
(cherry picked from commit b382a7c2da)
2023-05-26 13:25:07 +00:00
bachinger
b066a0912e Set video size to 0/0 when video render is disabled
In terms of MCVR with a `VideoRendererEventListener`, the video size is set to
0/0 right after `onVideoDisabled()` is called and is set to the actual size as
soon as the video size is known after 'onVideoEnabled()`.

For ExoPlayer and in terms of the `Player` interface, `Player.getVideoSize()`
returns a video size of 0/0 when `Player.getCurrentTracks()` does not support
`C.TRACK_TYPE_VIDEO`. This is ensured by the masking behavior of
`ExoPlayerImpl` that sets an empty track selection result when the playing
period changes due to a seek or timeline removal.

When transitioning playback from a video media item to the next, or when
seeking within the same video media item, the renderer is not disabled.

#minor-release

PiperOrigin-RevId: 533479600
(cherry picked from commit 2a6f893fba)
2023-05-26 13:25:07 +00:00
bachinger
ef6772b946 Return full media item when SystemUI calls service on device boot time
#minor-release

PiperOrigin-RevId: 533465595
(cherry picked from commit 3fa666c687)
2023-05-25 10:44:07 +00:00
ibaker
41de418c3d Remove deprecated ExoPlayer.retry(), use prepare() instead.
#minor-release

PiperOrigin-RevId: 533463348
(cherry picked from commit 50112c685b)
2023-05-25 10:44:07 +00:00
ibaker
7934eaf882 Add logging where we were swallowing failed futures in media3.session
This may not be completely exhaustive, but it's better than before!

#minor-release

PiperOrigin-RevId: 533457167
(cherry picked from commit fe19dc421d)
2023-05-25 10:44:07 +00:00
ibaker
c26659184c Add empty headings to the 'unreleased changes' section of release notes
PiperOrigin-RevId: 533403520
(cherry picked from commit 0e09c0041f)
2023-05-25 10:44:07 +00:00
claincly
1f8caa508f Add a getter method for texture manager
PiperOrigin-RevId: 533402277
(cherry picked from commit d7ad431cfc)
2023-05-25 10:44:07 +00:00
tonihei
5e98c938c0 Add FilteringMediaSource that only provides tracks of given types
This is useful for cases where only certain types (e.g. only video)
from a source are needed and other tracks should be filtered out
completely to avoid later track selection issues.

#minor-release

PiperOrigin-RevId: 533394658
(cherry picked from commit c44b3828ca)
2023-05-25 10:44:07 +00:00
huangdarwin
3ac01d43dd Effect: Use callback to release texture
This allows us to avoid needing a reference to the VideoFrameProcessor, which
can be especially difficult if an App only has a reference to the
VideoFrameProcessor.Factory it passes into Transformer/ExoPlayer.

PiperOrigin-RevId: 533205983
(cherry picked from commit 25fa2df2de)
2023-05-25 10:44:07 +00:00
ibaker
2b53139c5f Allow mock(Random.class) to work with Java 17
https://stackoverflow.com/questions/70993863/mockito-can-not-mock-random-in-java-17

#minor-release

PiperOrigin-RevId: 533161221
(cherry picked from commit 04106da932)
2023-05-25 10:44:07 +00:00
jbibik
9c1a80082f Use TestUtil.getPublicMethods instead of getDeclaredMethods
JaCoCo introduces private synthetic methods (even on interfaces) which
have to be skipped when checking that a 'forwarding' implementation does
forward everything. Instead we can use the existing `getPublicMethods()`
method which implicitly skips these (since they're private).

PiperOrigin-RevId: 533130932
(cherry picked from commit 620b9e1540)
2023-05-25 10:44:07 +00:00
sheenachhabra
400218c018 Add argument validation in Mp4LocationData
PiperOrigin-RevId: 533121451
(cherry picked from commit 209783bdf2)
2023-05-25 10:44:07 +00:00
claincly
dd425d53c9 Always use sRGB/BT.709 for bitmap inputs
PiperOrigin-RevId: 533117700
(cherry picked from commit 24a4396990)
2023-05-25 10:44:07 +00:00
Tofunmi Adigun-Hameed
cd9ff24086 Remove FfmpegVideoRenderer from 1.1.0 release 2023-05-18 18:04:45 +00:00
tofunmi
431b985a04 HDR texture asset loading
PiperOrigin-RevId: 532846248
(cherry picked from commit 5fe10d7652)
2023-05-18 16:07:52 +00:00
rohks
633c339dc1 Remove deprecated methods Format.copyWithXXX
Use `Format.buildUpon()` and `setXXX` instead.

#minor-release

PiperOrigin-RevId: 532840625
(cherry picked from commit 538524e579)
2023-05-18 16:07:52 +00:00
sheenachhabra
b97ec5edfc Add default constructor for InAppMuxer.Factory
PiperOrigin-RevId: 532838813
(cherry picked from commit 410840c9e1)
2023-05-18 16:07:52 +00:00
rohks
61a5dd76e3 Remove deprecated methods that create an instance of Format
Use `Format.Builder` instead.

#minor-release

PiperOrigin-RevId: 532808478
(cherry picked from commit 18aa664cb8)
2023-05-18 16:07:52 +00:00
huangdarwin
55c9d10022 HDR: Blocklist Galaxy Z Fold 4 for HLG tone mapping.
This device failed on HdrEditingTest's exportAndTranscode_hlg10File_whenHdrEditingUnsupported_toneMapsOrThrows
before this CL, and succeeds on that test after this CL.

PiperOrigin-RevId: 532796897
(cherry picked from commit 83190a0fe9)
2023-05-18 16:07:52 +00:00
sheenachhabra
7adca46e4b Move Mp4LocationData from extractor module to container module
This class will be shared between extractor and muxer module.

PiperOrigin-RevId: 532784415
(cherry picked from commit 7b62b33127)
2023-05-18 16:07:52 +00:00
ibaker
514f032afc Add main/dev-v2 branch options to bug.yml template
#minor-release

PiperOrigin-RevId: 532766676
(cherry picked from commit 84d0206c76)
2023-05-18 16:07:51 +00:00
ibaker
962499c9d8 Add Media3 1.0.2 and ExoPlayer 2.18.7 to bug.yml template
#minor-release

PiperOrigin-RevId: 532765549
(cherry picked from commit 4ede3d6007)
2023-05-18 16:07:51 +00:00
huangdarwin
ce5b57e03c Effect: Make TexturePool and use in FinalWrapper.
Have the FinalShaderProgramWrapper / VideoFrameProcessor texture
output access textures provided through a texture pool, that
recycles used textures.

Also, add the TexturePool interface to generally re-use textures.

PiperOrigin-RevId: 532754377
(cherry picked from commit 94efcd7917)
2023-05-18 16:07:51 +00:00
sheenachhabra
f5ec1bb6f9 Move NAL unit related methods from common to container module
PiperOrigin-RevId: 532750099
(cherry picked from commit e0d6f67dd9)
2023-05-18 16:07:51 +00:00
kimvde
6abc1a7155 Simplify FrameConsumptionManager onReadyToAcceptInputFrame logic
Propagate the "end of current stream" signal directly after queueing the
last frame, instead of waiting for the next onReadyToAcceptInputFrame()
call.

PiperOrigin-RevId: 532739462
(cherry picked from commit 028b3a7312)
2023-05-18 16:07:51 +00:00
tianyifeng
a5031a688b Avoid using @see in the summary fragment in C.java
PiperOrigin-RevId: 532536037
(cherry picked from commit 5d4c73eee5)
2023-05-18 16:07:51 +00:00
rohks
7773c88404 Remove deprecated WorkManagerScheduler constructor
Use a non deprecated constructor that includes the option to provide a `Context` parameter instead.

#minor-release

PiperOrigin-RevId: 532535770
(cherry picked from commit df52864420)
2023-05-18 16:07:51 +00:00
rohks
fa152ddc80 Remove deprecated String constants for Charsets
Use Kotlin Charsets from the `kotlin.text` package, the `java.nio.charset.StandardCharsets` or the `com.google.common.base.Charsets` instead.

#minor-release

PiperOrigin-RevId: 532469103
(cherry picked from commit 1061135cfd)
2023-05-18 16:07:51 +00:00
tofunmi
7fdae1ad0d Adjust image input ForPixelWidthHeightRatio
PiperOrigin-RevId: 532463400
(cherry picked from commit 63ee5ccb28)
2023-05-18 16:07:51 +00:00
rohks
5a72333554 Remove deprecated DownloadService constructor
Use a non deprecated constructor that includes the option to provide a `channelDescriptionResourceId` parameter.

#minor-release

PiperOrigin-RevId: 532450975
(cherry picked from commit 022a05c376)
2023-05-18 16:07:51 +00:00
ibaker
06c8433ce8 Remove deprecated DownloadHelper format-specific methods
Use `forMediaItem` instead.

PiperOrigin-RevId: 532414060
(cherry picked from commit 57479dd397)
2023-05-18 16:07:51 +00:00
bachinger
1510710c46 Enable live DASH stream for IMA DAI
This change enables the IMA extension to play live DASH streams
with DAI support. Samples streams can be found and played in the
main demo app.

Issue: google/ExoPlayer#10912
#minor-release
PiperOrigin-RevId: 532407708
(cherry picked from commit dab1353aad)
2023-05-17 16:59:56 +00:00
ibaker
3633ad15cc Update release notes for Media3 1.0.2
#minor-release

PiperOrigin-RevId: 532404001
(cherry picked from commit 1a38a0c41e)
2023-05-17 16:59:56 +00:00
tofunmi
43f8d080df Update mixed input test to include images of different aspect ratios
Makes this test a little more thorough.

PiperOrigin-RevId: 532386515
(cherry picked from commit 88642587ac)
2023-05-17 16:59:55 +00:00
huangdarwin
04a00c7ac4 Test: Suppress SSIM timeouts on galaxy fold/flip.
This is a failure only in SSIM, so it seems unlikely we'll prioritize this over
other work or bugs soon. Suppress test failures to reduce triage burden.

PiperOrigin-RevId: 532200729
(cherry picked from commit 62afbe87bb)
2023-05-17 16:59:55 +00:00
rohks
fc6429b2d4 Remove two deprecated InvalidResponseCodeException constructors
Use a non-deprecated constructor that accepts additional fields(`cause`, `responseBody`) to enhance error logging.

#minor-release

PiperOrigin-RevId: 532190896
(cherry picked from commit b120ef65ed)
2023-05-17 16:59:55 +00:00
tonihei
a8c56f2c60 Add Player.replaceMediaItem(s)
This methods allows to replace single items or a range of items directly
without using separate operations for add and remove. The advantage is
more readable code for apps and the potential for player
implementations to optimize this process (e.g. only replace values
without interrupting playback).

The current change just introduces the API with its default behavior.
The default logic will be removed again in the future in favor of
better logic in the Player implementations.

Issue: google/ExoPlayer#8046
PiperOrigin-RevId: 532151471
(cherry picked from commit b1cfeb04a0)
2023-05-17 16:59:55 +00:00
jbibik
27becc028d Allow ExoPlayer to opt into volume device control, forbidden by default
PiperOrigin-RevId: 532136692
(cherry picked from commit 1c6b894e88)
2023-05-17 16:59:55 +00:00
tonihei
7f1c1185e7 Remove unnecessary warning suppression
PiperOrigin-RevId: 532114601
(cherry picked from commit 79657692e4)
2023-05-17 16:59:55 +00:00
ibaker
7ac9cf0ec7 Remove deprecated DefaultDrmSessionManager constructors
Use `DefaultDrmSessionManager.Builder` instead.

#minor-release

PiperOrigin-RevId: 532102375
(cherry picked from commit 8a5cebb54d)
2023-05-17 16:59:55 +00:00
huangdarwin
a1fbb12ade Effect: Multiple Texture output
Allow the VideoFrameProcessor to output multiple textures at a time, so that
lifetime of textures is up to the consumer calling VFP.releaseOutputFrame.

The FinalShaderProgramWrapper also has a new maxCapacity limit added, to ensure
the a reasonable amount of textures is used and avoid using up memory.

PiperOrigin-RevId: 532094256
(cherry picked from commit 07ec1eaa48)
2023-05-17 16:59:55 +00:00
tonihei
c7004d43af Add consistency check to sending and receiving position updates
The periodic updates are only meant to happen while we are in the
same period or ad. This was already guaranteed except for two cases:
1. The Player in a session has updated its state without yet calling
   its listeners
2. The session scheduled a PlayerInfo update that hasn't been sent yet

... and in both cases, the following happened:
 - The change updated the mediaItemIndex to an index that didn't exist
   in a previous Timeline known to the Controller
 - One of the period position updates happened to be sent at exactly
   this time

This problem can be avoided by only scheduling the update if we are
still in the same period/ad and haven't scheduled a normal PlayerInfo
update already.

Since new MediaControllers may still connect to old sessons with this
bug, we need an equivalent change on the controller side to ignore such
buggy updates.

PiperOrigin-RevId: 532089328
(cherry picked from commit 96dd0ae583)
2023-05-17 16:59:55 +00:00
andrewlewis
5722e6472a Fix lost shader input capacity after end-of-stream
When exporting compositions with multiple images in a row, transformation could
get stuck if a shader was ready to accept input when end-of-stream was already
signaled and queued from upstream. Fix accounting for the downstream capacity.

Manually tested on concatenations with several images and several videos in a
row, by adding logging and verifying the capacity updates as expected across
edited media item transitions.

PiperOrigin-RevId: 532088793
(cherry picked from commit 6850391e45)
2023-05-17 16:59:55 +00:00
ibaker
1ebf5c2a6a Delete deprecated zero-arg DefaultBandwidthMeter constructor
Use `DefaultBandwidthMeter.Builder` instead.

#minor-release

PiperOrigin-RevId: 532069549
(cherry picked from commit 8f29a5eba9)
2023-05-17 16:59:55 +00:00
kimvde
5e926cdce5 Refactor SequenceAssetLoader release
In the past, the SequenceAssetLoader was released in TransformerInternal
when the export ended.

fc539da061 was made to release the SequenceAssetLoader earlier, when
loading ended. This was causing player release timeouts because the last
AssetLoader in the sequence was released before the SamplePipelines (see
0b40bc37ab for more information).

The code that was releasing the SequenceAssetLoader was first commented
out because we didn't have an understanding of what was happening.

This change removes the early SequenceAssetLoader release all together.
It doesn't have any effect as this code was already commented out.

PiperOrigin-RevId: 532065673
(cherry picked from commit 6dfb387117)
2023-05-17 16:59:55 +00:00
andrewlewis
b0f8a8f316 Signal end-of-stream after creating latch
The output end-of-stream notification from the last shader could theoretically
arrive before the latch for detecting it is created, which might cause waiting
on the latch indefinitely. Create the latch before signaling end of stream so
that it's guaranteed to be set before the end-of-stream signal arrives.

PiperOrigin-RevId: 532056472
(cherry picked from commit 857e6ebee8)
2023-05-17 16:59:55 +00:00
ibaker
7e30091196 Remove two deprecated SimpleCache constructors
Use a non-deprecated constructor that takes a `DatabaseProvider`
instead for better performance.

#minor-release

PiperOrigin-RevId: 532046598
(cherry picked from commit 0a86790be2)
2023-05-17 16:59:55 +00:00
ibaker
07ca741eb1 Rollback of 509830f38f
*** Original commit ***

Rollback of 221a56da38

*** Original commit ***

Rollback of 749d77b1d9

*** Original commit ***

PiperOrigin-RevId: 531530885
(cherry picked from commit 9366b4e50a)
2023-05-17 16:59:54 +00:00
huangdarwin
2ab9c0c556 Transformer: Add latest input format to DebugTraceUtil
This can provide more information to help debug muxer errors

PiperOrigin-RevId: 531521974
(cherry picked from commit 2736b11845)
2023-05-17 16:59:54 +00:00
bachinger
932bed1f79 Implement SystemUI contract for media resumption
When a `MediaButtonReceiver` is found in the manifest, the library
can implement the contract of SystemUI to signal that the app wants
a playback resumption notification to be displayed.

And, vice versa, if no `MediaButtonReceiver` is in the manifest, the
library will signal to not show the notification after the app has been
terminated.

#minor-release

PiperOrigin-RevId: 531516023
(cherry picked from commit 9bf6b7ea20)
2023-05-17 16:59:54 +00:00
sheenachhabra
f15e5733ce Add container module
This module will contain functionalities common to extractor and muxer.

PiperOrigin-RevId: 531501602
(cherry picked from commit eb8ec87a5c)
2023-05-17 16:59:54 +00:00
sheenachhabra
80aac22cf9 Add test file with metadata track
Mp4Muxer supports adding Metadata track.
Added test file to cover this scenario.

PiperOrigin-RevId: 531496409
(cherry picked from commit b3fd202e11)
2023-05-17 16:59:54 +00:00
sheenachhabra
2478b48997 Rollback of 925aa34e13
*** Original commit ***

Rollback of 65d5132f76

*** Original commit ***

Create InAppMuxer in transformer

To use the InAppMuxer, the client needs to pass InAppMuxer Factory.

***

***

PiperOrigin-RevId: 531470081
(cherry picked from commit 867355fdc5)
2023-05-17 16:59:54 +00:00
51 changed files with 8280 additions and 333 deletions

View file

@ -19,6 +19,7 @@ body:
options:
- Media3 main branch
- Media3 pre-release (alpha, beta or RC not in this list)
- Media3 1.5.1
- Media3 1.5.0
- Media3 1.4.1
- Media3 1.4.0

1
.gitignore vendored
View file

@ -52,6 +52,7 @@ tmp
# External native builds
.externalNativeBuild
.cxx
# VP9 decoder extension
libraries/decoder_vp9/src/main/jni/libvpx

View file

@ -2,6 +2,32 @@
## 1.5
### 1.5.1 (2024-12-19)
This release includes the following changes since the
[1.5.0 release](#150-2024-11-27):
* ExoPlayer:
* Disable use of asynchronous decryption in MediaCodec to avoid reported
codec timeout issues with this platform API
([#1641](https://github.com/androidx/media/issues/1641)).
* Extractors:
* MP3: Don't stop playback early when a `VBRI` frame's table of contents
doesn't cover all the MP3 data in a file
([#1904](https://github.com/androidx/media/issues/1904)).
* Video:
* Rollback of using `MediaCodecAdapter` supplied pixel aspect ratio values
when provided while processing `onOutputFormatChanged`
([#1371](https://github.com/androidx/media/pull/1371)).
* Text:
* Fix bug in `ReplacingCuesResolver.discardCuesBeforeTimeUs` where the cue
active at `timeUs` (started before but not yet ended) was incorrectly
discarded ([#1939](https://github.com/androidx/media/issues/1939)).
* Metadata:
* Extract disc/track numbering and genre from Vorbis comments into
`MediaMetadata`
([#1958](https://github.com/androidx/media/issues/1958)).
### 1.5.0 (2024-11-27)
This release includes the following changes since the

View file

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
project.ext {
releaseVersion = '1.5.0'
releaseVersionCode = 1_005_000_3_00
releaseVersion = '1.5.1'
releaseVersionCode = 1_005_001_3_00
minSdkVersion = 21
// See https://developer.android.com/training/cars/media/automotive-os#automotive-module
automotiveMinSdkVersion = 28

View file

@ -203,7 +203,7 @@ public final class ColorInfo {
/**
* Returns the {@link C.ColorSpace} corresponding to the given ISO color primary code, as per
* table A.7.21.1 in Rec. ITU-T T.832 (03/2009), or {@link Format#NO_VALUE} if no mapping can be
* table A.7.21.1 in Rec. ITU-T T.832 (06/2019), or {@link Format#NO_VALUE} if no mapping can be
* made.
*/
@Pure
@ -219,13 +219,52 @@ public final class ColorInfo {
case 9:
return C.COLOR_SPACE_BT2020;
default:
// Remaining color primaries are either reserved or unspecified.
return Format.NO_VALUE;
}
}
/**
* Returns the ISO color primary code corresponding to the given {@link C.ColorSpace}, as per
* table A.7.21.1 in Rec. ITU-T T.832 (06/2019). made.
*/
public static int colorSpaceToIsoColorPrimaries(@C.ColorSpace int colorSpace) {
switch (colorSpace) {
// Default to BT.709 SDR as per the <a
// href="https://www.webmproject.org/vp9/mp4/#optional-fields">recommendation</a>.
case Format.NO_VALUE:
case C.COLOR_SPACE_BT709:
return 1;
case C.COLOR_SPACE_BT601:
return 5;
case C.COLOR_SPACE_BT2020:
return 9;
}
return 1;
}
/**
* Returns the ISO matrix coefficients code corresponding to the given {@link C.ColorSpace}, as
* per table A.7.21.3 in Rec. ITU-T T.832 (06/2019).
*/
public static int colorSpaceToIsoMatrixCoefficients(@C.ColorSpace int colorSpace) {
switch (colorSpace) {
// Default to BT.709 SDR as per the <a
// href="https://www.webmproject.org/vp9/mp4/#optional-fields">recommendation</a>.
case Format.NO_VALUE:
case C.COLOR_SPACE_BT709:
return 1;
case C.COLOR_SPACE_BT601:
return 6;
case C.COLOR_SPACE_BT2020:
return 9;
}
return 1;
}
/**
* Returns the {@link C.ColorTransfer} corresponding to the given ISO transfer characteristics
* code, as per table A.7.21.2 in Rec. ITU-T T.832 (03/2009), or {@link Format#NO_VALUE} if no
* code, as per table A.7.21.2 in Rec. ITU-T T.832 (06/2019), or {@link Format#NO_VALUE} if no
* mapping can be made.
*/
@Pure
@ -249,6 +288,31 @@ public final class ColorInfo {
}
}
/**
* Returns the ISO transfer characteristics code corresponding to the given {@link
* C.ColorTransfer}, as per table A.7.21.2 in Rec. ITU-T T.832 (06/2019).
*/
public static int colorTransferToIsoTransferCharacteristics(@C.ColorTransfer int colorTransfer) {
switch (colorTransfer) {
// Default to BT.709 SDR as per the <a
// href="https://www.webmproject.org/vp9/mp4/#optional-fields">recommendation</a>.
case C.COLOR_TRANSFER_LINEAR:
return 8;
case C.COLOR_TRANSFER_SRGB:
return 13;
case Format.NO_VALUE:
case C.COLOR_TRANSFER_SDR:
return 1;
case C.COLOR_TRANSFER_ST2084:
return 16;
case C.COLOR_TRANSFER_HLG:
return 18;
case C.COLOR_TRANSFER_GAMMA_2_2:
return 4;
}
return 1;
}
/**
* Returns whether the {@code ColorInfo} uses an HDR {@link C.ColorTransfer}.
*

View file

@ -16,6 +16,7 @@
package androidx.media3.common;
import static androidx.media3.common.util.Assertions.checkState;
import static com.google.common.math.DoubleMath.fuzzyEquals;
import static java.lang.annotation.ElementType.TYPE_USE;
import android.os.Bundle;
@ -749,7 +750,7 @@ public final class Format {
/**
* Sets {@link Format#tileCountHorizontal}. The default value is {@link #NO_VALUE}.
*
* @param tileCountHorizontal The {@link Format#accessibilityChannel}.
* @param tileCountHorizontal The {@link Format#tileCountHorizontal}.
* @return The builder.
*/
@CanIgnoreReturnValue
@ -761,7 +762,7 @@ public final class Format {
/**
* Sets {@link Format#tileCountVertical}. The default value is {@link #NO_VALUE}.
*
* @param tileCountVertical The {@link Format#accessibilityChannel}.
* @param tileCountVertical The {@link Format#tileCountVertical}.
* @return The builder.
*/
@CanIgnoreReturnValue
@ -1442,6 +1443,9 @@ public final class Format {
if (format.width != NO_VALUE && format.height != NO_VALUE) {
builder.append(", res=").append(format.width).append("x").append(format.height);
}
if (!fuzzyEquals(format.pixelWidthHeightRatio, 1, 0.001)) {
builder.append(", par=").append(Util.formatInvariant("%.3f", format.pixelWidthHeightRatio));
}
if (format.colorInfo != null && format.colorInfo.isValid()) {
builder.append(", color=").append(format.colorInfo.toLogString());
}

View file

@ -30,6 +30,25 @@ import java.util.List;
/**
* A {@link Player} that forwards method calls to another {@link Player}. Applications can use this
* class to suppress or modify specific operations, by overriding the respective methods.
*
* <p>Subclasses must ensure they maintain consistency with the {@link Player} interface, including
* interactions with {@link Player.Listener}, which can be quite fiddly. For example, if removing an
* available {@link Player.Command} and disabling the corresponding method, subclasses need to:
*
* <ul>
* <li>Override {@link #isCommandAvailable(int)} and {@link #getAvailableCommands()}
* <li>Override and no-op the method itself
* <li>Override {@link #addListener(Listener)} and wrap the provided {@link Player.Listener} with
* an implementation that drops calls to {@link
* Player.Listener#onAvailableCommandsChanged(Commands)} and {@link
* Player.Listener#onEvents(Player, Events)} if they were only triggered by a change in
* command availability that is 'invisible' after the command removal.
* </ul>
*
* <p>Many customization use-cases are instead better served by {@link ForwardingSimpleBasePlayer},
* which allows subclasses to more concisely modify the behavior of an operation, or disallow a
* {@link Player.Command}. In many cases {@link ForwardingSimpleBasePlayer} should be used in
* preference to {@code ForwardingPlayer}.
*/
@UnstableApi
public class ForwardingPlayer implements Player {

View file

@ -29,11 +29,11 @@ public final class MediaLibraryInfo {
/** The version of the library expressed as a string, for example "1.2.3" or "1.2.0-beta01". */
// Intentionally hardcoded. Do not derive from other constants (e.g. VERSION_INT) or vice versa.
public static final String VERSION = "1.5.0";
public static final String VERSION = "1.5.1";
/** The version of the library expressed as {@code TAG + "/" + VERSION}. */
// Intentionally hardcoded. Do not derive from other constants (e.g. VERSION) or vice versa.
public static final String VERSION_SLASHY = "AndroidXMedia3/1.5.0";
public static final String VERSION_SLASHY = "AndroidXMedia3/1.5.1";
/**
* The version of the library expressed as an integer, for example 1002003300.
@ -47,7 +47,7 @@ public final class MediaLibraryInfo {
* (123-045-006-3-00).
*/
// Intentionally hardcoded. Do not derive from other constants (e.g. VERSION) or vice versa.
public static final int VERSION_INT = 1_005_000_3_00;
public static final int VERSION_INT = 1_005_001_3_00;
/** Whether the library was compiled with {@link Assertions} checks enabled. */
public static final boolean ASSERTIONS_ENABLED = true;

View file

@ -685,6 +685,9 @@ public final class MimeTypes {
}
mimeType = Ascii.toLowerCase(mimeType);
switch (mimeType) {
// Normalize uncommon versions of some video MIME types to their standard equivalent.
case BASE_TYPE_VIDEO + "/x-mvhevc":
return VIDEO_MV_HEVC;
// Normalize uncommon versions of some audio MIME types to their standard equivalent.
case BASE_TYPE_AUDIO + "/x-flac":
return AUDIO_FLAC;

View file

@ -96,8 +96,7 @@ public final class MediaFormatUtil {
/* defaultValue= */ Format.NO_VALUE))
.setRotationDegrees(
getInteger(mediaFormat, MediaFormat.KEY_ROTATION, /* defaultValue= */ 0))
// TODO(b/278101856): Disallow invalid values after confirming.
.setColorInfo(getColorInfo(mediaFormat, /* allowInvalidValues= */ true))
.setColorInfo(getColorInfo(mediaFormat))
.setSampleRate(
getInteger(
mediaFormat, MediaFormat.KEY_SAMPLE_RATE, /* defaultValue= */ Format.NO_VALUE))
@ -270,13 +269,6 @@ public final class MediaFormatUtil {
*/
@Nullable
public static ColorInfo getColorInfo(MediaFormat mediaFormat) {
return getColorInfo(mediaFormat, /* allowInvalidValues= */ false);
}
// Internal methods.
@Nullable
private static ColorInfo getColorInfo(MediaFormat mediaFormat, boolean allowInvalidValues) {
if (SDK_INT < 24) {
// MediaFormat KEY_COLOR_TRANSFER and other KEY_COLOR values available from API 24.
return null;
@ -294,21 +286,17 @@ public final class MediaFormatUtil {
@Nullable
byte[] hdrStaticInfo =
hdrStaticInfoByteBuffer != null ? getArray(hdrStaticInfoByteBuffer) : null;
if (!allowInvalidValues) {
// Some devices may produce invalid values from MediaFormat#getInteger.
// See b/239435670 for more information.
if (!isValidColorSpace(colorSpace)) {
colorSpace = Format.NO_VALUE;
}
if (!isValidColorRange(colorRange)) {
colorRange = Format.NO_VALUE;
}
if (!isValidColorTransfer(colorTransfer)) {
colorTransfer = Format.NO_VALUE;
}
// Some devices may produce invalid values from MediaFormat#getInteger.
// See b/239435670 for more information.
if (!isValidColorSpace(colorSpace)) {
colorSpace = Format.NO_VALUE;
}
if (!isValidColorRange(colorRange)) {
colorRange = Format.NO_VALUE;
}
if (!isValidColorTransfer(colorTransfer)) {
colorTransfer = Format.NO_VALUE;
}
if (colorSpace != Format.NO_VALUE
|| colorRange != Format.NO_VALUE
|| colorTransfer != Format.NO_VALUE

View file

@ -80,7 +80,7 @@ import java.nio.ByteBuffer;
Supplier<HandlerThread> queueingThreadSupplier) {
this.callbackThreadSupplier = callbackThreadSupplier;
this.queueingThreadSupplier = queueingThreadSupplier;
enableSynchronousBufferQueueingWithAsyncCryptoFlag = true;
enableSynchronousBufferQueueingWithAsyncCryptoFlag = false;
}
/**

View file

@ -67,7 +67,7 @@ public final class DefaultMediaCodecAdapterFactory implements MediaCodecAdapter.
@Deprecated
public DefaultMediaCodecAdapterFactory() {
asynchronousMode = MODE_DEFAULT;
asyncCryptoFlagEnabled = true;
asyncCryptoFlagEnabled = false;
context = null;
}
@ -79,7 +79,7 @@ public final class DefaultMediaCodecAdapterFactory implements MediaCodecAdapter.
public DefaultMediaCodecAdapterFactory(Context context) {
this.context = context;
asynchronousMode = MODE_DEFAULT;
asyncCryptoFlagEnabled = true;
asyncCryptoFlagEnabled = false;
}
/**

View file

@ -297,12 +297,19 @@ public final class MediaCodecInfo {
private boolean isCodecProfileAndLevelSupported(
Format format, boolean checkPerformanceCapabilities) {
Pair<Integer, Integer> codecProfileAndLevel = MediaCodecUtil.getCodecProfileAndLevel(format);
if (format.sampleMimeType != null
&& format.sampleMimeType.equals(MimeTypes.VIDEO_MV_HEVC)
&& codecMimeType.equals(MimeTypes.VIDEO_H265)) {
// Falling back to single-layer HEVC from MV-HEVC. Get base layer profile and level.
codecProfileAndLevel = MediaCodecUtil.getHevcBaseLayerCodecProfileAndLevel(format);
if (format.sampleMimeType != null && format.sampleMimeType.equals(MimeTypes.VIDEO_MV_HEVC)) {
String normalizedCodecMimeType = MimeTypes.normalizeMimeType(codecMimeType);
if (normalizedCodecMimeType.equals(MimeTypes.VIDEO_MV_HEVC)) {
// Currently as there is no formal support for MV-HEVC within Android framework, the profile
// is not correctly specified by the underlying codec; just assume the profile obtained from
// the MV-HEVC sample is supported.
return true;
} else if (normalizedCodecMimeType.equals(MimeTypes.VIDEO_H265)) {
// Falling back to single-layer HEVC from MV-HEVC. Get base layer profile and level.
codecProfileAndLevel = MediaCodecUtil.getHevcBaseLayerCodecProfileAndLevel(format);
}
}
if (codecProfileAndLevel == null) {
// If we don't know any better, we assume that the profile and level are supported.
return true;

View file

@ -80,9 +80,15 @@ import java.util.ArrayList;
@Override
public void discardCuesBeforeTimeUs(long timeUs) {
int indexToDiscardTo = getIndexOfCuesStartingAfter(timeUs);
if (indexToDiscardTo > 0) {
cuesWithTimingList.subList(0, indexToDiscardTo).clear();
if (indexToDiscardTo == 0) {
// Either the first cue starts after timeUs, or the cues list is empty.
return;
}
CuesWithTiming lastCueToDiscard = cuesWithTimingList.get(indexToDiscardTo - 1);
if (lastCueToDiscard.endTimeUs == C.TIME_UNSET || lastCueToDiscard.endTimeUs >= timeUs) {
indexToDiscardTo--;
}
cuesWithTimingList.subList(0, indexToDiscardTo).clear();
}
@Override
@ -142,7 +148,7 @@ import java.util.ArrayList;
/**
* Returns the index of the first {@link CuesWithTiming} in {@link #cuesWithTimingList} where
* {@link CuesWithTiming#startTimeUs} is strictly less than {@code timeUs}.
* {@link CuesWithTiming#startTimeUs} is strictly greater than {@code timeUs}.
*
* <p>Returns the size of {@link #cuesWithTimingList} if all cues are before timeUs
*/

View file

@ -1362,17 +1362,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
? mediaFormat.getInteger(KEY_CROP_BOTTOM) - mediaFormat.getInteger(KEY_CROP_TOP) + 1
: mediaFormat.getInteger(MediaFormat.KEY_HEIGHT);
}
pixelWidthHeightRatio = format.pixelWidthHeightRatio;
if (Util.SDK_INT >= 30
&& mediaFormat != null
&& mediaFormat.containsKey(MediaFormat.KEY_PIXEL_ASPECT_RATIO_WIDTH)
&& mediaFormat.containsKey(MediaFormat.KEY_PIXEL_ASPECT_RATIO_HEIGHT)) {
pixelWidthHeightRatio =
(float) mediaFormat.getInteger(MediaFormat.KEY_PIXEL_ASPECT_RATIO_WIDTH)
/ mediaFormat.getInteger(MediaFormat.KEY_PIXEL_ASPECT_RATIO_HEIGHT);
}
// The decoder applies the rotation when rendering to the surface. For 90 and 270 degree
// rotations, we need to flip the width, height and pixel aspect ratio to reflect the rotation
// that was applied.

View file

@ -44,6 +44,7 @@ public final class Mp3PlaybackTest {
"bear-id3.mp3",
"bear-id3-numeric-genre.mp3",
"bear-vbr-no-seek-table.mp3",
"bear-vbr-vbri-header-truncated-toc.mp3",
"bear-vbr-xing-header.mp3",
"play-trimmed.mp3",
"test-cbr-info-header.mp3");

View file

@ -217,6 +217,47 @@ public final class ReplacingCuesResolverTest {
assertThat(replacingCuesResolver.getNextCueChangeTimeUs(4_999_990)).isEqualTo(6_000_000);
}
@Test
public void discardCuesBeforeTimeUs_retainsActiveCueWithSetDuration() {
ReplacingCuesResolver replacingCuesResolver = new ReplacingCuesResolver();
CuesWithTiming activeCue =
new CuesWithTiming(FIRST_CUES, /* startTimeUs= */ 3_000_000, /* durationUs= */ 4_000_000);
CuesWithTiming laterCue =
new CuesWithTiming(SECOND_CUES, /* startTimeUs= */ 8_000_000, /* durationUs= */ 2_000_000);
replacingCuesResolver.addCues(activeCue, /* currentPositionUs= */ 5_000_000);
replacingCuesResolver.addCues(laterCue, /* currentPositionUs= */ 5_000_000);
// Discard cues before 5_000_000. activeCue should remain active because it ends at 7_000_000.
replacingCuesResolver.discardCuesBeforeTimeUs(5_000_000);
// Query at a time within activeCue's range to verify it's still there.
assertThat(replacingCuesResolver.getCuesAtTimeUs(6_000_000)).isEqualTo(FIRST_CUES);
// Ensure that laterCue is unaffected.
assertThat(replacingCuesResolver.getCuesAtTimeUs(9_000_000)).isEqualTo(SECOND_CUES);
}
@Test
public void discardCuesBeforeTimeUs_retainsActiveCueWithUnsetDuration() {
ReplacingCuesResolver replacingCuesResolver = new ReplacingCuesResolver();
CuesWithTiming activeCue =
new CuesWithTiming(
FIRST_CUES, /* startTimeUs= */ 3_000_000, /* durationUs= */ C.TIME_UNSET);
CuesWithTiming laterCue =
new CuesWithTiming(SECOND_CUES, /* startTimeUs= */ 8_000_000, /* durationUs= */ 2_000_000);
replacingCuesResolver.addCues(activeCue, /* currentPositionUs= */ 5_000_000);
replacingCuesResolver.addCues(laterCue, /* currentPositionUs= */ 5_000_000);
// Discard cues before 5_000_000. activeCue should remain active because its
// duration is unset, meaning it should remain visible until replaced by a subsequent cue
// starting at 8_000_000.
replacingCuesResolver.discardCuesBeforeTimeUs(5_000_000);
// Query at a time within activeCue's range to verify it's still there.
assertThat(replacingCuesResolver.getCuesAtTimeUs(6_000_000)).isEqualTo(FIRST_CUES);
// Ensure that laterCue is unaffected.
assertThat(replacingCuesResolver.getCuesAtTimeUs(9_000_000)).isEqualTo(SECOND_CUES);
}
@Test
public void clear_clearsAllCues() {
ReplacingCuesResolver replacingCuesResolver = new ReplacingCuesResolver();

View file

@ -50,7 +50,6 @@ import androidx.media3.common.MimeTypes;
import androidx.media3.common.TrackGroup;
import androidx.media3.common.VideoSize;
import androidx.media3.common.util.Clock;
import androidx.media3.common.util.Util;
import androidx.media3.decoder.CryptoInfo;
import androidx.media3.exoplayer.DecoderCounters;
import androidx.media3.exoplayer.ExoPlaybackException;
@ -101,7 +100,6 @@ import org.mockito.Mock;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
import org.robolectric.Shadows;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowDisplay;
import org.robolectric.shadows.ShadowLooper;
import org.robolectric.shadows.ShadowSystemClock;
@ -116,7 +114,6 @@ public class MediaCodecVideoRendererTest {
.setSampleMimeType(MimeTypes.VIDEO_H264)
.setWidth(1920)
.setHeight(1080)
.setPixelWidthHeightRatio(1.0f)
.build();
private static final TrackGroup TRACK_GROUP_H264 = new TrackGroup(VIDEO_H264);
@ -750,84 +747,6 @@ public class MediaCodecVideoRendererTest {
new VideoSize(VIDEO_H264.width, VIDEO_H264.height, VIDEO_H264.pixelWidthHeightRatio));
}
@Config(minSdk = 30)
@Test
public void
render_withMediaCodecModifyingPixelAspectRatioWidthHeight_sendsVideoSizeChangeWithMediaFormatValues()
throws Exception {
MediaCodecAdapter.Factory codecAdapterFactory =
configuration ->
new ForwardingSynchronousMediaCodecAdapter(
new SynchronousMediaCodecAdapter.Factory().createAdapter(configuration)) {
@Override
public MediaFormat getOutputFormat() {
MediaFormat mediaFormat = adapter.getOutputFormat();
if (Util.SDK_INT >= 30) {
// Change to 9:16 Ratio
mediaFormat.setInteger(MediaFormat.KEY_PIXEL_ASPECT_RATIO_WIDTH, 9);
mediaFormat.setInteger(MediaFormat.KEY_PIXEL_ASPECT_RATIO_HEIGHT, 16);
}
return mediaFormat;
}
};
MediaCodecVideoRenderer mediaCodecVideoRendererWithCustomAdapter =
new MediaCodecVideoRenderer(
ApplicationProvider.getApplicationContext(),
codecAdapterFactory,
mediaCodecSelector,
/* allowedJoiningTimeMs= */ 0,
/* enableDecoderFallback= */ false,
/* eventHandler= */ new Handler(testMainLooper),
/* eventListener= */ eventListener,
/* maxDroppedFramesToNotify= */ 1) {
@Override
protected @Capabilities int supportsFormat(
MediaCodecSelector mediaCodecSelector, Format format) {
return RendererCapabilities.create(C.FORMAT_HANDLED);
}
};
mediaCodecVideoRendererWithCustomAdapter.init(/* index= */ 0, PlayerId.UNSET, Clock.DEFAULT);
mediaCodecVideoRendererWithCustomAdapter.handleMessage(
Renderer.MSG_SET_VIDEO_OUTPUT, new Surface(new SurfaceTexture(/* texName= */ 0)));
FakeSampleStream fakeSampleStream =
new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ VIDEO_H264,
ImmutableList.of(
oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME), END_OF_STREAM_ITEM));
fakeSampleStream.writeData(/* startPositionUs= */ 0);
mediaCodecVideoRendererWithCustomAdapter.enable(
RendererConfiguration.DEFAULT,
new Format[] {VIDEO_H264},
fakeSampleStream,
/* positionUs= */ 0,
/* joining= */ false,
/* mayRenderStartOfStream= */ true,
/* startPositionUs= */ 0,
/* offsetUs= */ 0,
new MediaSource.MediaPeriodId(new Object()));
mediaCodecVideoRendererWithCustomAdapter.setCurrentStreamFinal();
mediaCodecVideoRendererWithCustomAdapter.start();
int positionUs = 0;
do {
mediaCodecVideoRendererWithCustomAdapter.render(
positionUs, SystemClock.elapsedRealtime() * 1000);
positionUs += 10;
} while (!mediaCodecVideoRendererWithCustomAdapter.isEnded());
shadowOf(testMainLooper).idle();
verify(eventListener)
.onVideoSizeChanged(
new VideoSize(
VIDEO_H264.width,
VIDEO_H264.height,
/* pixelWidthHeightRatio= */ VIDEO_H264.pixelWidthHeightRatio * (9.0f / 16.0f)));
}
@Test
public void
render_withMultipleQueued_sendsVideoSizeChangedWithCorrectPixelAspectRatioWhenMultipleQueued()
@ -1984,7 +1903,7 @@ public class MediaCodecVideoRendererTest {
private abstract static class ForwardingSynchronousMediaCodecAdapter
implements MediaCodecAdapter {
protected final MediaCodecAdapter adapter;
private final MediaCodecAdapter adapter;
ForwardingSynchronousMediaCodecAdapter(MediaCodecAdapter adapter) {
this.adapter = adapter;

View file

@ -28,7 +28,7 @@ android {
}
dependencies {
api 'com.google.ads.interactivemedia.v3:interactivemedia:3.33.0'
api 'com.google.ads.interactivemedia.v3:interactivemedia:3.35.1'
implementation project(modulePrefix + 'lib-exoplayer')
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
compileOnly 'com.google.errorprone:error_prone_annotations:' + errorProneVersion

View file

@ -410,13 +410,22 @@ public final class Ac4Util {
ac4Presentation.hasBackChannels,
ac4Presentation.topChannelPairs);
} else {
channelCount = ac4Presentation.numOfUmxObjects;
// The ETSI TS 103 190-2 V1.2.1 (2018-02) specification defines the parameter
// n_umx_objects_minus1 in Annex E (E.11.11) to specify the number of fullband objects. While
// the elementary stream specification (section 6.3.2.8.1 and 6.3.2.10.4) provides information
// about the presence of an LFE channel within the set of dynamic objects, this detail is not
// explicitly stated in the ISO Base Media File Format (Annex E). However, current
// implementation practices consistently include the LFE channel when creating an object-based
// substream. As a result, it has been decided that when interpreting the ISO Base Media File
// Format, the LFE channel should always be counted as part of the total channel count.
int lfeChannelCount = 1;
channelCount = ac4Presentation.numOfUmxObjects + lfeChannelCount;
// TODO: There is a bug in ETSI TS 103 190-2 V1.2.1 (2018-02), E.11.11
// For AC-4 level 4 stream, the intention is to set 19 to n_umx_objects_minus1 but it is
// equal to 15 based on current specification. Dolby has filed a bug report to ETSI.
// The following sentence should be deleted after ETSI specification error is fixed.
if (ac4Presentation.level == 4) {
channelCount = channelCount == 16 ? 21 : channelCount;
channelCount = channelCount == 17 ? 21 : channelCount;
}
}

View file

@ -24,6 +24,7 @@ import androidx.media3.common.MediaMetadata;
import androidx.media3.common.Metadata;
import androidx.media3.common.util.UnstableApi;
import com.google.common.base.Ascii;
import com.google.common.primitives.Ints;
/**
* @deprecated Use {@link androidx.media3.extractor.metadata.vorbis.VorbisComment} instead.
@ -58,6 +59,9 @@ public class VorbisComment implements Metadata.Entry {
@Override
public void populateMediaMetadata(MediaMetadata.Builder builder) {
// Vorbis comments can have duplicate keys, but all these fields are singular on MediaMetadata,
// so we naively overwrite whatever any previously set value (which results in 'keep last'
// semantics).
switch (key) {
case "TITLE":
builder.setTitle(value);
@ -71,6 +75,33 @@ public class VorbisComment implements Metadata.Entry {
case "ALBUMARTIST":
builder.setAlbumArtist(value);
break;
case "TRACKNUMBER":
@Nullable Integer trackNumber = Ints.tryParse(value);
if (trackNumber != null) {
builder.setTrackNumber(trackNumber);
}
break;
case "TOTALTRACKS":
@Nullable Integer totalTracks = Ints.tryParse(value);
if (totalTracks != null) {
builder.setTotalTrackCount(totalTracks);
}
break;
case "DISCNUMBER":
@Nullable Integer discNumber = Ints.tryParse(value);
if (discNumber != null) {
builder.setDiscNumber(discNumber);
}
break;
case "TOTALDISCS":
@Nullable Integer totalDiscs = Ints.tryParse(value);
if (totalDiscs != null) {
builder.setTotalDiscCount(totalDiscs);
}
break;
case "GENRE":
builder.setGenre(value);
break;
case "DESCRIPTION":
builder.setDescription(value);
break;

View file

@ -49,7 +49,9 @@ import androidx.media3.extractor.SeekPoint;
long position,
MpegAudioUtil.Header mpegAudioHeader,
ParsableByteArray frame) {
frame.skipBytes(10);
frame.skipBytes(6);
int bytes = frame.readInt();
long endOfMp3Data = position + mpegAudioHeader.frameSize + bytes;
int numFrames = frame.readInt();
if (numFrames <= 0) {
return null;
@ -63,15 +65,13 @@ import androidx.media3.extractor.SeekPoint;
int entrySize = frame.readUnsignedShort();
frame.skipBytes(2);
long minPosition = position + mpegAudioHeader.frameSize;
position += mpegAudioHeader.frameSize;
// Read table of contents entries.
long[] timesUs = new long[entryCount];
long[] positions = new long[entryCount];
for (int index = 0; index < entryCount; index++) {
timesUs[index] = (index * durationUs) / entryCount;
// Ensure positions do not fall within the frame containing the VBRI header. This constraint
// will normally only apply to the first entry in the table.
positions[index] = max(position, minPosition);
positions[index] = position;
int segmentSize;
switch (entrySize) {
case 1:
@ -91,11 +91,21 @@ import androidx.media3.extractor.SeekPoint;
}
position += segmentSize * ((long) scale);
}
if (inputLength != C.LENGTH_UNSET && inputLength != position) {
Log.w(TAG, "VBRI data size mismatch: " + inputLength + ", " + position);
if (inputLength != C.LENGTH_UNSET && inputLength != endOfMp3Data) {
Log.w(TAG, "VBRI data size mismatch: " + inputLength + ", " + endOfMp3Data);
}
return new VbriSeeker(
timesUs, positions, durationUs, /* dataEndPosition= */ position, mpegAudioHeader.bitrate);
if (endOfMp3Data != position) {
Log.w(
TAG,
"VBRI bytes and ToC mismatch (using max): "
+ endOfMp3Data
+ ", "
+ position
+ "\nSeeking will be inaccurate.");
endOfMp3Data = max(endOfMp3Data, position);
}
return new VbriSeeker(timesUs, positions, durationUs, endOfMp3Data, mpegAudioHeader.bitrate);
}
private final long[] timesUs;

View file

@ -50,6 +50,11 @@ public final class VorbisCommentTest {
String artist = "artist";
String albumTitle = "album title";
String albumArtist = "album Artist";
int trackNumber = 3;
int totalTracks = 12;
int discNumber = 1;
int totalDiscs = 3;
String genre = "Metal";
String description = "a description about the audio.";
List<Metadata.Entry> entries =
ImmutableList.of(
@ -57,6 +62,11 @@ public final class VorbisCommentTest {
new VorbisComment("ArTisT", artist),
new VorbisComment("ALBUM", albumTitle),
new VorbisComment("albumartist", albumArtist),
new VorbisComment("TRACKNUMBER", String.valueOf(trackNumber)),
new VorbisComment("TOTALTRACKS", String.valueOf(totalTracks)),
new VorbisComment("DISCNUMBER", String.valueOf(discNumber)),
new VorbisComment("TOTALDISCS", String.valueOf(totalDiscs)),
new VorbisComment("GENRE", genre),
new VorbisComment("DESCRIPTION", description));
MediaMetadata.Builder builder = MediaMetadata.EMPTY.buildUpon();
@ -69,6 +79,11 @@ public final class VorbisCommentTest {
assertThat(mediaMetadata.artist.toString()).isEqualTo(artist);
assertThat(mediaMetadata.albumTitle.toString()).isEqualTo(albumTitle);
assertThat(mediaMetadata.albumArtist.toString()).isEqualTo(albumArtist);
assertThat(mediaMetadata.trackNumber).isEqualTo(trackNumber);
assertThat(mediaMetadata.totalTrackCount).isEqualTo(totalTracks);
assertThat(mediaMetadata.discNumber).isEqualTo(discNumber);
assertThat(mediaMetadata.totalDiscCount).isEqualTo(totalDiscs);
assertThat(mediaMetadata.genre.toString()).isEqualTo(genre);
assertThat(mediaMetadata.description.toString()).isEqualTo(description);
}
}

View file

@ -71,6 +71,19 @@ public final class Mp3ExtractorTest {
simulationConfig);
}
@Test
public void mp3SampleWithVbriHeader() throws Exception {
ExtractorAsserts.assertBehavior(
Mp3Extractor::new, "media/mp3/bear-vbr-vbri-header.mp3", simulationConfig);
}
// https://github.com/androidx/media/issues/1904
@Test
public void mp3SampleWithVbriHeaderWithTruncatedToC() throws Exception {
ExtractorAsserts.assertBehavior(
Mp3Extractor::new, "media/mp3/bear-vbr-vbri-header-truncated-toc.mp3", simulationConfig);
}
@Test
public void mp3SampleWithCbrSeeker() throws Exception {
ExtractorAsserts.assertBehavior(

View file

@ -113,4 +113,63 @@ public class Mp4MuxerEndToEndNonParameterizedAndroidTest {
/*DumpFileAsserts.assertOutput(
context, fakeExtractorOutput, AndroidMuxerTestUtil.getExpectedDumpFilePath(vp9Mp4));*/
}
@Test
public void createMp4File_withSampleBatchingDisabled_matchesExpected() throws Exception {
@Nullable Mp4Muxer mp4Muxer = null;
try {
mp4Muxer =
new Mp4Muxer.Builder(checkNotNull(outputStream)).setSampleBatchingEnabled(false).build();
mp4Muxer.addMetadataEntry(
new Mp4TimestampData(
/* creationTimestampSeconds= */ 100_000_000L,
/* modificationTimestampSeconds= */ 500_000_000L));
feedInputDataToMuxer(context, mp4Muxer, checkNotNull(H265_HDR10_MP4));
} finally {
if (mp4Muxer != null) {
mp4Muxer.close();
}
}
FakeExtractorOutput fakeExtractorOutput =
TestUtil.extractAllSamplesFromFilePath(
new Mp4Extractor(new DefaultSubtitleParserFactory()), checkNotNull(outputPath));
DumpFileAsserts.assertOutput(
context,
fakeExtractorOutput,
AndroidMuxerTestUtil.getExpectedDumpFilePath("sample_batching_disabled_" + H265_HDR10_MP4));
}
@Test
public void createMp4File_withSampleBatchingAndAttemptStreamableOutputDisabled_matchesExpected()
throws Exception {
@Nullable Mp4Muxer mp4Muxer = null;
try {
mp4Muxer =
new Mp4Muxer.Builder(checkNotNull(outputStream))
.setSampleBatchingEnabled(false)
.setAttemptStreamableOutputEnabled(false)
.build();
mp4Muxer.addMetadataEntry(
new Mp4TimestampData(
/* creationTimestampSeconds= */ 100_000_000L,
/* modificationTimestampSeconds= */ 500_000_000L));
feedInputDataToMuxer(context, mp4Muxer, checkNotNull(H265_HDR10_MP4));
} finally {
if (mp4Muxer != null) {
mp4Muxer.close();
}
}
FakeExtractorOutput fakeExtractorOutput =
TestUtil.extractAllSamplesFromFilePath(
new Mp4Extractor(new DefaultSubtitleParserFactory()), checkNotNull(outputPath));
DumpFileAsserts.assertOutput(
context,
fakeExtractorOutput,
AndroidMuxerTestUtil.getExpectedDumpFilePath(
"sample_batching_and_attempt_streamable_output_disabled_" + H265_HDR10_MP4));
}
}

View file

@ -18,8 +18,6 @@ package androidx.media3.muxer;
import static androidx.media3.common.util.Assertions.checkArgument;
import static androidx.media3.common.util.Assertions.checkNotNull;
import static androidx.media3.common.util.Assertions.checkState;
import static androidx.media3.muxer.ColorUtils.MEDIAFORMAT_STANDARD_TO_PRIMARIES_AND_MATRIX;
import static androidx.media3.muxer.ColorUtils.MEDIAFORMAT_TRANSFER_TO_MP4_TRANSFER;
import static androidx.media3.muxer.MuxerUtil.UNSIGNED_INT_MAX_VALUE;
import static java.lang.Math.abs;
import static java.lang.Math.max;
@ -767,12 +765,7 @@ import org.checkerframework.checker.nullness.qual.PolyNull;
contents.put(paspBox());
// Put in a "colr" box if any of the three color format parameters has a non-default (0) value.
// TODO: b/278101856 - Only null check should be enough once we disallow invalid values.
if (format.colorInfo != null
&& (format.colorInfo.colorSpace != 0
|| format.colorInfo.colorTransfer != 0
|| format.colorInfo.colorRange != 0)) {
if (format.colorInfo != null) {
contents.put(colrBox(format.colorInfo));
}
@ -1360,13 +1353,14 @@ import org.checkerframework.checker.nullness.qual.PolyNull;
/** Returns the avcC box as per ISO/IEC 14496-15: 5.3.3.1.2. */
private static ByteBuffer avcCBox(Format format) {
checkArgument(
format.initializationData.size() >= 2, "csd-0 and/or csd-1 not found in the format.");
format.initializationData.size() >= 2,
"csd-0 and/or csd-1 not found in the format for avcC box.");
byte[] csd0 = format.initializationData.get(0);
checkArgument(csd0.length > 0, "csd-0 is empty.");
checkArgument(csd0.length > 0, "csd-0 is empty for avcC box.");
byte[] csd1 = format.initializationData.get(1);
checkArgument(csd1.length > 0, "csd-1 is empty.");
checkArgument(csd1.length > 0, "csd-1 is empty for avcC box.");
ByteBuffer csd0ByteBuffer = ByteBuffer.wrap(csd0);
ByteBuffer csd1ByteBuffer = ByteBuffer.wrap(csd1);
@ -1378,7 +1372,7 @@ import org.checkerframework.checker.nullness.qual.PolyNull;
contents.put((byte) 0x01); // configurationVersion
ImmutableList<ByteBuffer> csd0NalUnits = AnnexBUtils.findNalUnits(csd0ByteBuffer);
checkArgument(csd0NalUnits.size() == 1, "SPS data not found in csd0.");
checkArgument(csd0NalUnits.size() == 1, "SPS data not found in csd0 for avcC box.");
ByteBuffer sps = csd0NalUnits.get(0);
byte[] spsData = new byte[sps.remaining()];
@ -1414,10 +1408,11 @@ import org.checkerframework.checker.nullness.qual.PolyNull;
/** Returns the hvcC box as per ISO/IEC 14496-15: 8.3.3.1.2. */
private static ByteBuffer hvcCBox(Format format) {
// For H.265, all three codec-specific NALUs (VPS, SPS, PPS) are packed into csd-0.
checkArgument(!format.initializationData.isEmpty(), "csd-0 not found in the format.");
checkArgument(
!format.initializationData.isEmpty(), "csd-0 not found in the format for hvcC box.");
byte[] csd0 = format.initializationData.get(0);
checkArgument(csd0.length > 0, "csd-0 is empty.");
checkArgument(csd0.length > 0, "csd-0 is empty for hvcC box.");
ByteBuffer csd0ByteBuffer = ByteBuffer.wrap(csd0);
@ -1507,10 +1502,11 @@ import org.checkerframework.checker.nullness.qual.PolyNull;
/** Returns the av1C box. */
private static ByteBuffer av1CBox(Format format) {
// For AV1, the entire codec-specific box is packed into csd-0.
checkArgument(!format.initializationData.isEmpty(), "csd-0 is not found in the format");
checkArgument(
!format.initializationData.isEmpty(), "csd-0 is not found in the format for av1C box");
byte[] csd0 = format.initializationData.get(0);
checkArgument(csd0.length > 0, "csd-0 is empty.");
checkArgument(csd0.length > 0, "csd-0 is empty for av1C box.");
return BoxUtils.wrapIntoBox("av1C", ByteBuffer.wrap(csd0));
}
@ -1518,7 +1514,8 @@ import org.checkerframework.checker.nullness.qual.PolyNull;
/** Returns the vpcC box as per VP Codec ISO Media File Format Binding v1.0. */
private static ByteBuffer vpcCBox(Format format) {
// For VP9, the CodecPrivate or vpcCBox data is packed into csd-0.
checkArgument(!format.initializationData.isEmpty(), "csd-0 is not found in the format");
checkArgument(
!format.initializationData.isEmpty(), "csd-0 is not found in the format for vpcC box");
byte[] csd0 = format.initializationData.get(0);
checkArgument(csd0.length > 3, "csd-0 for vp9 is invalid.");
int versionAndFlags = 1 << 24; // version (value 1, 8 bits) + flag (value 0, 24 bits)
@ -1540,24 +1537,18 @@ import org.checkerframework.checker.nullness.qual.PolyNull;
// The default values for optional fields as per the : <a
// href="https://www.webmproject.org/vp9/mp4/#optional-fields">Vp9 webm spec</a>
int colourPrimaries = 1;
int colorPrimaries = 1;
int transferCharacteristics = 1;
int matrixCoefficients = 1;
if (format.colorInfo != null) {
ColorInfo colorInfo = format.colorInfo;
if (colorInfo.colorSpace != Format.NO_VALUE) {
colourPrimaries =
MEDIAFORMAT_STANDARD_TO_PRIMARIES_AND_MATRIX.get(colorInfo.colorSpace).get(0);
matrixCoefficients =
MEDIAFORMAT_STANDARD_TO_PRIMARIES_AND_MATRIX.get(colorInfo.colorSpace).get(1);
}
if (colorInfo.colorTransfer != Format.NO_VALUE) {
transferCharacteristics = MEDIAFORMAT_TRANSFER_TO_MP4_TRANSFER.get(colorInfo.colorTransfer);
}
colorPrimaries = ColorInfo.colorSpaceToIsoColorPrimaries(format.colorInfo.colorSpace);
transferCharacteristics =
ColorInfo.colorTransferToIsoTransferCharacteristics(format.colorInfo.colorTransfer);
matrixCoefficients = ColorInfo.colorSpaceToIsoMatrixCoefficients(format.colorInfo.colorSpace);
}
contents.put((byte) colourPrimaries);
contents.put((byte) colorPrimaries);
contents.put((byte) transferCharacteristics);
contents.put((byte) matrixCoefficients);
contents.putShort((short) 0); // codecInitializationDataSize must be 0 for VP9
@ -1648,40 +1639,11 @@ import org.checkerframework.checker.nullness.qual.PolyNull;
contents.put((byte) 'l');
contents.put((byte) 'x');
short primaries = 0;
short transfer = 0;
short matrix = 0;
byte range = 0;
if (colorInfo.colorSpace != Format.NO_VALUE) {
int standard = colorInfo.colorSpace;
if (standard < 0 || standard >= MEDIAFORMAT_STANDARD_TO_PRIMARIES_AND_MATRIX.size()) {
throw new IllegalArgumentException("Color standard not implemented: " + standard);
}
primaries = MEDIAFORMAT_STANDARD_TO_PRIMARIES_AND_MATRIX.get(standard).get(0);
matrix = MEDIAFORMAT_STANDARD_TO_PRIMARIES_AND_MATRIX.get(standard).get(1);
}
if (colorInfo.colorTransfer != Format.NO_VALUE) {
int transferInFormat = colorInfo.colorTransfer;
if (transferInFormat < 0 || transferInFormat >= MEDIAFORMAT_TRANSFER_TO_MP4_TRANSFER.size()) {
throw new IllegalArgumentException("Color transfer not implemented: " + transferInFormat);
}
transfer = MEDIAFORMAT_TRANSFER_TO_MP4_TRANSFER.get(transferInFormat);
}
if (colorInfo.colorRange != Format.NO_VALUE) {
int rangeInFormat = colorInfo.colorRange;
// Handled values are 0 (unknown), 1 (full) and 2 (limited).
if (rangeInFormat < 0 || rangeInFormat > 2) {
throw new IllegalArgumentException("Color range not implemented: " + rangeInFormat);
}
// Set this to 0x80 only for full range, 0 otherwise.
range = rangeInFormat == C.COLOR_RANGE_FULL ? (byte) 0x80 : 0;
}
short primaries = (short) ColorInfo.colorSpaceToIsoColorPrimaries(colorInfo.colorSpace);
short transfer =
(short) ColorInfo.colorTransferToIsoTransferCharacteristics(colorInfo.colorTransfer);
short matrix = (short) ColorInfo.colorSpaceToIsoMatrixCoefficients(colorInfo.colorSpace);
byte range = colorInfo.colorRange == C.COLOR_RANGE_FULL ? (byte) 0x80 : 0;
contents.putShort(primaries);
contents.putShort(transfer);
@ -1724,10 +1686,11 @@ import org.checkerframework.checker.nullness.qual.PolyNull;
/** Returns the esds box. */
private static ByteBuffer esdsBox(Format format) {
checkArgument(!format.initializationData.isEmpty(), "csd-0 not found in the format.");
checkArgument(
!format.initializationData.isEmpty(), "csd-0 not found in the format for esds box.");
byte[] csd0 = format.initializationData.get(0);
checkArgument(csd0.length > 0, "csd-0 is empty.");
checkArgument(csd0.length > 0, "csd-0 is empty for esds box.");
String mimeType = checkNotNull(format.sampleMimeType);
boolean isVorbis = mimeType.equals(MimeTypes.AUDIO_VORBIS);
@ -1847,7 +1810,8 @@ import org.checkerframework.checker.nullness.qual.PolyNull;
/** Returns the audio dOps box for Opus codec as per RFC-7845: 5.1. */
private static ByteBuffer dOpsBox(Format format) {
checkArgument(!format.initializationData.isEmpty());
checkArgument(
!format.initializationData.isEmpty(), "csd-0 not found in the format for dOps box.");
int opusHeaderLength = 8;
byte[] csd0 = format.initializationData.get(0);

View file

@ -1,97 +0,0 @@
/*
* Copyright 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package androidx.media3.muxer;
import android.media.MediaFormat;
import com.google.common.collect.ImmutableList;
/** Utilities for color information. */
/* package */ final class ColorUtils {
// The constants are defined as per ISO/IEC 29199-2 (mentioned in MP4 spec ISO/IEC 14496-12:
// 8.5.2.3).
private static final short TRANSFER_SMPTE170_M = 1; // Main; also 6, 14 and 15
private static final short TRANSFER_UNSPECIFIED = 2;
private static final short TRANSFER_GAMMA22 = 4;
private static final short TRANSFER_GAMMA28 = 5;
private static final short TRANSFER_SMPTE240_M = 7;
private static final short TRANSFER_LINEAR = 8;
private static final short TRANSFER_OTHER = 9; // Also 10
private static final short TRANSFER_XV_YCC = 11;
private static final short TRANSFER_BT1361 = 12;
private static final short TRANSFER_SRGB = 13;
private static final short TRANSFER_ST2084 = 16;
private static final short TRANSFER_ST428 = 17;
private static final short TRANSFER_HLG = 18;
// MediaFormat contains three color-related fields: "standard", "transfer" and "range". The color
// standard maps to "primaries" and "matrix" in the "colr" box, while "transfer" and "range" are
// mapped to a single value each (although for "transfer", it's still not the same enum values).
private static final short PRIMARIES_BT709_5 = 1;
private static final short PRIMARIES_UNSPECIFIED = 2;
private static final short PRIMARIES_BT601_6_625 = 5;
private static final short PRIMARIES_BT601_6_525 = 6; // It's also 7?
private static final short PRIMARIES_GENERIC_FILM = 8;
private static final short PRIMARIES_BT2020 = 9;
private static final short PRIMARIES_BT470_6_M = 4;
private static final short MATRIX_UNSPECIFIED = 2;
private static final short MATRIX_BT709_5 = 1;
private static final short MATRIX_BT601_6 = 6;
private static final short MATRIX_SMPTE240_M = 7;
private static final short MATRIX_BT2020 = 9;
private static final short MATRIX_BT2020_CONSTANT = 10;
private static final short MATRIX_BT470_6_M = 4;
/**
* Map from {@link MediaFormat} standards to MP4 primaries and matrix indices.
*
* <p>The i-th element corresponds to a {@link MediaFormat} value of i.
*/
public static final ImmutableList<ImmutableList<Short>>
MEDIAFORMAT_STANDARD_TO_PRIMARIES_AND_MATRIX =
ImmutableList.of(
ImmutableList.of(PRIMARIES_UNSPECIFIED, MATRIX_UNSPECIFIED), // Unspecified
ImmutableList.of(PRIMARIES_BT709_5, MATRIX_BT709_5), // BT709
ImmutableList.of(PRIMARIES_BT601_6_625, MATRIX_BT601_6), // BT601_625
ImmutableList.of(PRIMARIES_BT601_6_625, MATRIX_BT709_5), // BT601_625_Unadjusted
ImmutableList.of(PRIMARIES_BT601_6_525, MATRIX_BT601_6), // BT601_525
ImmutableList.of(PRIMARIES_BT601_6_525, MATRIX_SMPTE240_M), // BT601_525_Unadjusted
ImmutableList.of(PRIMARIES_BT2020, MATRIX_BT2020), // BT2020
ImmutableList.of(PRIMARIES_BT2020, MATRIX_BT2020_CONSTANT), // BT2020Constant
ImmutableList.of(PRIMARIES_BT470_6_M, MATRIX_BT470_6_M), // BT470M
ImmutableList.of(PRIMARIES_GENERIC_FILM, MATRIX_BT2020) // Film
);
/**
* Map from {@link MediaFormat} standards to MP4 transfer indices.
*
* <p>The i-th element corresponds to a {@link MediaFormat} value of i.
*/
public static final ImmutableList<Short> MEDIAFORMAT_TRANSFER_TO_MP4_TRANSFER =
ImmutableList.of(
TRANSFER_UNSPECIFIED, // Unspecified
TRANSFER_LINEAR, // Linear
TRANSFER_SRGB, // SRGB
TRANSFER_SMPTE170_M, // SMPTE_170M
TRANSFER_GAMMA22, // Gamma22
TRANSFER_GAMMA28, // Gamma28
TRANSFER_ST2084, // ST2084
TRANSFER_HLG // HLG
);
private ColorUtils() {}
}

View file

@ -200,6 +200,7 @@ public final class Mp4Muxer implements Muxer {
private @LastSampleDurationBehavior int lastSampleDurationBehavior;
@Nullable private AnnexBToAvccConverter annexBToAvccConverter;
private boolean sampleCopyEnabled;
private boolean sampleBatchingEnabled;
private boolean attemptStreamableOutputEnabled;
private @FileFormat int outputFileFormat;
@Nullable private EditableVideoParameters editableVideoParameters;
@ -214,6 +215,7 @@ public final class Mp4Muxer implements Muxer {
lastSampleDurationBehavior =
LAST_SAMPLE_DURATION_BEHAVIOR_SET_FROM_END_OF_STREAM_BUFFER_OR_DUPLICATE_PREVIOUS;
sampleCopyEnabled = true;
sampleBatchingEnabled = true;
attemptStreamableOutputEnabled = true;
outputFileFormat = FILE_FORMAT_DEFAULT;
}
@ -260,6 +262,21 @@ public final class Mp4Muxer implements Muxer {
return this;
}
/**
* Sets whether to enable sample batching.
*
* <p>If sample batching is enabled, samples are {@linkplain #writeSampleData(TrackToken,
* ByteBuffer, BufferInfo) written} in batches for each track, otherwise samples are written as
* they arrive.
*
* <p>The default value is {@code true}.
*/
@CanIgnoreReturnValue
public Mp4Muxer.Builder setSampleBatchingEnabled(boolean enabled) {
this.sampleBatchingEnabled = enabled;
return this;
}
/**
* Sets whether to attempt to write a file where the metadata is stored at the start, which can
* make the file more efficient to read sequentially.
@ -309,6 +326,7 @@ public final class Mp4Muxer implements Muxer {
lastSampleDurationBehavior,
annexBToAvccConverter == null ? AnnexBToAvccConverter.DEFAULT : annexBToAvccConverter,
sampleCopyEnabled,
sampleBatchingEnabled,
attemptStreamableOutputEnabled,
outputFileFormat,
editableVideoParameters);
@ -322,6 +340,7 @@ public final class Mp4Muxer implements Muxer {
private final @LastSampleDurationBehavior int lastSampleDurationBehavior;
private final AnnexBToAvccConverter annexBToAvccConverter;
private final boolean sampleCopyEnabled;
private final boolean sampleBatchingEnabled;
private final boolean attemptStreamableOutputEnabled;
private final @FileFormat int outputFileFormat;
@Nullable private final EditableVideoParameters editableVideoParameters;
@ -339,6 +358,7 @@ public final class Mp4Muxer implements Muxer {
@LastSampleDurationBehavior int lastFrameDurationBehavior,
AnnexBToAvccConverter annexBToAvccConverter,
boolean sampleCopyEnabled,
boolean sampleBatchingEnabled,
boolean attemptStreamableOutputEnabled,
@FileFormat int outputFileFormat,
@Nullable EditableVideoParameters editableVideoParameters) {
@ -347,6 +367,7 @@ public final class Mp4Muxer implements Muxer {
this.lastSampleDurationBehavior = lastFrameDurationBehavior;
this.annexBToAvccConverter = annexBToAvccConverter;
this.sampleCopyEnabled = sampleCopyEnabled;
this.sampleBatchingEnabled = sampleBatchingEnabled;
this.attemptStreamableOutputEnabled = attemptStreamableOutputEnabled;
this.outputFileFormat = outputFileFormat;
this.editableVideoParameters = editableVideoParameters;
@ -358,6 +379,7 @@ public final class Mp4Muxer implements Muxer {
annexBToAvccConverter,
lastFrameDurationBehavior,
sampleCopyEnabled,
sampleBatchingEnabled,
attemptStreamableOutputEnabled);
editableVideoTracks = new ArrayList<>();
}
@ -415,10 +437,13 @@ public final class Mp4Muxer implements Muxer {
/**
* {@inheritDoc}
*
* <p>Samples are written to the file in batches. If {@link Builder#setSampleCopyEnabled(boolean)
* sample copying} is disabled, the {@code byteBuffer} and the {@code bufferInfo} must not be
* modified after calling this method. Otherwise, they are copied and it is safe to modify them
* after this method returns.
* <p>When sample batching is {@linkplain Mp4Muxer.Builder#setSampleBatchingEnabled(boolean)
* enabled}, provide sample data ({@link ByteBuffer}, {@link BufferInfo}) that won't be modified
* after calling the {@link #writeSampleData(TrackToken, ByteBuffer, BufferInfo)} method, unless
* sample copying is also {@linkplain Mp4Muxer.Builder#setSampleCopyEnabled(boolean) enabled}.
* This ensures data integrity within the batch. If sample copying is {@linkplain
* Mp4Muxer.Builder#setSampleCopyEnabled(boolean) enabled}, it's safe to modify the data after the
* method returns, as the muxer internally creates a sample copy.
*
* @param trackToken The {@link TrackToken} for which this sample is being written.
* @param byteBuffer The encoded sample. The muxer takes ownership of the buffer if {@link
@ -522,6 +547,7 @@ public final class Mp4Muxer implements Muxer {
annexBToAvccConverter,
lastSampleDurationBehavior,
sampleCopyEnabled,
sampleBatchingEnabled,
attemptStreamableOutputEnabled);
}
}

View file

@ -43,6 +43,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
/** Writes all media samples into a single mdat box. */
/* package */ final class Mp4Writer {
private static final long INTERLEAVE_DURATION_US = 1_000_000L;
// Used for updating the moov box periodically when sample batching is disabled.
private static final long MOOV_BOX_UPDATE_INTERVAL_US = 1_000_000L;
private static final int DEFAULT_MOOV_BOX_SIZE_BYTES = 400_000;
private static final String FREE_BOX_TYPE = "free";
@ -51,6 +53,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
private final AnnexBToAvccConverter annexBToAvccConverter;
private final @Mp4Muxer.LastSampleDurationBehavior int lastSampleDurationBehavior;
private final boolean sampleCopyEnabled;
private final boolean sampleBatchingEnabled;
private final List<Track> tracks;
private final List<Track> editableVideoTracks;
private final AtomicBoolean hasWrittenSamples;
@ -63,9 +66,10 @@ import java.util.concurrent.atomic.AtomicBoolean;
private long mdatStart;
private long mdatEnd;
private long mdatDataEnd; // Always <= mdatEnd
// Typically written from the end of the mdat box to the end of the file.
private Range<Long> lastMoovWritten;
// Used for writing moov box periodically when sample batching is disabled.
private long lastMoovWrittenAtSampleTimestampUs;
/**
* Creates an instance.
@ -79,6 +83,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
* AVCC format (which uses length prefixes).
* @param lastSampleDurationBehavior The {@link Mp4Muxer.LastSampleDurationBehavior}.
* @param sampleCopyEnabled Whether sample copying is enabled.
* @param sampleBatchingEnabled Whether sample batching is enabled.
* @param attemptStreamableOutputEnabled Whether to attempt to write a streamable output.
*/
public Mp4Writer(
@ -87,17 +92,20 @@ import java.util.concurrent.atomic.AtomicBoolean;
AnnexBToAvccConverter annexBToAvccConverter,
@Mp4Muxer.LastSampleDurationBehavior int lastSampleDurationBehavior,
boolean sampleCopyEnabled,
boolean sampleBatchingEnabled,
boolean attemptStreamableOutputEnabled) {
this.outputFileChannel = fileChannel;
this.metadataCollector = metadataCollector;
this.annexBToAvccConverter = annexBToAvccConverter;
this.lastSampleDurationBehavior = lastSampleDurationBehavior;
this.sampleCopyEnabled = sampleCopyEnabled;
this.sampleBatchingEnabled = sampleBatchingEnabled;
tracks = new ArrayList<>();
editableVideoTracks = new ArrayList<>();
hasWrittenSamples = new AtomicBoolean(false);
canWriteMoovAtStart = attemptStreamableOutputEnabled;
lastMoovWritten = Range.closed(0L, 0L);
lastMoovWrittenAtSampleTimestampUs = 0L;
}
/**
@ -141,7 +149,20 @@ import java.util.concurrent.atomic.AtomicBoolean;
public void writeSampleData(Track track, ByteBuffer byteBuffer, BufferInfo bufferInfo)
throws IOException {
track.writeSampleData(byteBuffer, bufferInfo);
doInterleave();
if (sampleBatchingEnabled) {
doInterleave();
} else {
writePendingTrackSamples(track);
boolean primaryTrackSampleWritten = tracks.contains(track);
long currentSampleTimestampUs = bufferInfo.presentationTimeUs;
if (primaryTrackSampleWritten
&& canWriteMoovAtStart
&& (currentSampleTimestampUs - lastMoovWrittenAtSampleTimestampUs
>= MOOV_BOX_UPDATE_INTERVAL_US)) {
maybeWriteMoovAtStart();
lastMoovWrittenAtSampleTimestampUs = currentSampleTimestampUs;
}
}
}
/**

View file

@ -548,8 +548,11 @@ public final class CommandButton {
/**
* [will be deprecated] The icon should be defined with the constructor {@link Icon} parameter
* in {@link #Builder(int)} instead. Only in case the existing list of icons is not sufficient,
* use {@link #ICON_UNDEFINED} and set a separate resource id with {@link #setCustomIconResId}.
* in {@link #Builder(int)} instead.
*
* <p>If the existing list of icons is not sufficient, use {@link #ICON_UNDEFINED} for the
* constructor {@link Icon} parameter, and set a separate resource id with {@link
* #setCustomIconResId}.
*/
@CanIgnoreReturnValue
public Builder setIconResId(@DrawableRes int resId) {
@ -557,8 +560,10 @@ public final class CommandButton {
}
/**
* Sets the resource id of an icon that is used when the predefined {@link Icon} is not
* available or set to {@link #ICON_UNDEFINED}.
* Sets the fallback resource ID of an icon.
*
* <p>This is used when either the predefined {@link #icon} is not available, or it's set to
* {@link #ICON_UNDEFINED}.
*
* @param resId The resource id of a custom icon.
* @return This builder for chaining.
@ -571,12 +576,13 @@ public final class CommandButton {
}
/**
* Sets a {@linkplain ContentResolver#SCHEME_CONTENT content} or {@linkplain
* Sets a fallback {@linkplain ContentResolver#SCHEME_CONTENT content} or {@linkplain
* ContentResolver#SCHEME_ANDROID_RESOURCE resource} {@link Uri} for the icon of this button.
*
* <p>Note that this {@link Uri} may be used when the predefined {@link Icon} is not available
* or set to {@link #ICON_UNDEFINED}. It can be used in addition to {@link #setCustomIconResId}
* for consumers that are capable of loading the content or resource {@link Uri}.
* <p>Note that this {@link Uri} may be used when either the predefined {@link
* CommandButton#icon} is not available, or it's set to {@link #ICON_UNDEFINED}. It can be used
* in addition to {@link #setCustomIconResId} for consumers that are capable of loading the
* content or resource {@link Uri}.
*
* @param uri The uri to an icon.
* @return This builder for chaining.
@ -707,16 +713,23 @@ public final class CommandButton {
@UnstableApi public final @Icon int icon;
/**
* The icon resource id of the button that is used when the predefined {@link #icon} is not
* available or set to {@link #ICON_UNDEFINED}. Can be {@code 0} if not needed.
* The fallback icon resource ID of the button.
*
* <p>This is used when either the predefined {@link #icon} is not available, or it's set to
* {@link #ICON_UNDEFINED}.
*
* <p>Can be {@code 0} if not needed.
*/
@DrawableRes public final int iconResId;
/**
* The {@linkplain ContentResolver#SCHEME_CONTENT content} or {@linkplain
* ContentResolver#SCHEME_ANDROID_RESOURCE resource} {@link Uri} for the icon of the button that
* is used when the predefined {@link #icon} is not available or set to {@link #ICON_UNDEFINED}.
* Can be {@code null}.
* The fallback {@linkplain ContentResolver#SCHEME_CONTENT content} or {@linkplain
* ContentResolver#SCHEME_ANDROID_RESOURCE resource} {@link Uri} for the icon of the button.
*
* <p>This is used when either the predefined {@link #icon} is not available, or it's set to
* {@link #ICON_UNDEFINED}.
*
* <p>Can be {@code null}.
*
* <p>Note that this value can be used in addition to {@link #iconResId} for consumers that are
* capable of loading the content or resource {@link Uri}.

View file

@ -416,8 +416,9 @@ import org.checkerframework.checker.nullness.qual.NonNull;
if (Util.SDK_INT >= 31 && platformController != null) {
// Ensure the platform session gets allow-listed to start a foreground service after receiving
// the play command.
platformController.sendCommand(
MediaConstants.SESSION_COMMAND_MEDIA3_PLAY_REQUEST, /* args= */ null, /* cb= */ null);
platformController
.getTransportControls()
.sendCustomAction(MediaConstants.SESSION_COMMAND_MEDIA3_PLAY_REQUEST, /* args= */ null);
}
dispatchRemoteSessionTaskWithPlayerCommand(

View file

@ -281,7 +281,8 @@ import org.checkerframework.checker.initialization.qual.Initialized;
public void onCommand(String commandName, @Nullable Bundle args, @Nullable ResultReceiver cb) {
checkStateNotNull(commandName);
if (commandName.equals(MediaConstants.SESSION_COMMAND_MEDIA3_PLAY_REQUEST)) {
// Ignore, no need to handle this command here.
// Only applicable to controllers on Media3 1.5, where this command was sent via sendCommand
// instead of sendCustomAction. No need to handle this command here.
return;
}
if (commandName.equals(MediaConstants.SESSION_COMMAND_REQUEST_SESSION3_TOKEN) && cb != null) {
@ -305,6 +306,10 @@ import org.checkerframework.checker.initialization.qual.Initialized;
@Override
public void onCustomAction(String action, @Nullable Bundle args) {
if (action.equals(MediaConstants.SESSION_COMMAND_MEDIA3_PLAY_REQUEST)) {
// Ignore, no need to handle the custom action.
return;
}
SessionCommand command = new SessionCommand(action, /* extras= */ Bundle.EMPTY);
dispatchSessionTaskWithSessionCommand(
command,

View file

@ -0,0 +1,487 @@
seekMap:
isSeekable = true
duration = 2808000
getPosition(0) = [[timeUs=0, position=141]]
getPosition(1) = [[timeUs=0, position=141], [timeUs=1404000, position=10413]]
getPosition(1404000) = [[timeUs=1404000, position=10413]]
getPosition(2808000) = [[timeUs=1404000, position=10413]]
numberOfTracks = 1
track 0:
total output bytes = 38160
sample count = 117
format 0:
averageBitrate = 32000
sampleMimeType = audio/mpeg
maxInputSize = 4096
channelCount = 2
sampleRate = 48000
metadata = entries=[TSSE: description=null: values=[Lavf58.29.100]]
sample 0:
time = 0
flags = 1
data = length 96, hash 1F161542
sample 1:
time = 24000
flags = 1
data = length 768, hash CD1DC50F
sample 2:
time = 48000
flags = 1
data = length 336, hash 3F64124B
sample 3:
time = 72000
flags = 1
data = length 336, hash 8FFED94E
sample 4:
time = 96000
flags = 1
data = length 288, hash 9CD77D47
sample 5:
time = 120000
flags = 1
data = length 384, hash 24607BB5
sample 6:
time = 144000
flags = 1
data = length 480, hash 4937EBAB
sample 7:
time = 168000
flags = 1
data = length 336, hash 546342B1
sample 8:
time = 192000
flags = 1
data = length 336, hash 79E0923F
sample 9:
time = 216000
flags = 1
data = length 336, hash AB1F3948
sample 10:
time = 240000
flags = 1
data = length 336, hash C3A4D888
sample 11:
time = 264000
flags = 1
data = length 288, hash 7867DA45
sample 12:
time = 288000
flags = 1
data = length 336, hash B1240B73
sample 13:
time = 312000
flags = 1
data = length 336, hash 94CFCD35
sample 14:
time = 336000
flags = 1
data = length 288, hash 94F412C
sample 15:
time = 360000
flags = 1
data = length 336, hash A1D9FF41
sample 16:
time = 384000
flags = 1
data = length 288, hash 2A8DA21B
sample 17:
time = 408000
flags = 1
data = length 336, hash 6A429CE
sample 18:
time = 432000
flags = 1
data = length 336, hash 68853982
sample 19:
time = 456000
flags = 1
data = length 384, hash 1D6F779C
sample 20:
time = 480000
flags = 1
data = length 480, hash 6B31EBEE
sample 21:
time = 504000
flags = 1
data = length 336, hash 888335BE
sample 22:
time = 528000
flags = 1
data = length 336, hash 6072AC8B
sample 23:
time = 552000
flags = 1
data = length 336, hash C9D24234
sample 24:
time = 576000
flags = 1
data = length 288, hash 52BF4D1E
sample 25:
time = 600000
flags = 1
data = length 336, hash F93F4F0
sample 26:
time = 624000
flags = 1
data = length 336, hash 8617688A
sample 27:
time = 648000
flags = 1
data = length 480, hash FAB0D31B
sample 28:
time = 672000
flags = 1
data = length 384, hash FA4B53E2
sample 29:
time = 696000
flags = 1
data = length 336, hash 8C435F6A
sample 30:
time = 720000
flags = 1
data = length 336, hash 60D3F80C
sample 31:
time = 744000
flags = 1
data = length 336, hash DC15B68B
sample 32:
time = 768000
flags = 1
data = length 288, hash FF3DF141
sample 33:
time = 792000
flags = 1
data = length 336, hash A64B3042
sample 34:
time = 816000
flags = 1
data = length 336, hash ACA622A1
sample 35:
time = 840000
flags = 1
data = length 288, hash 3E34B8D4
sample 36:
time = 864000
flags = 1
data = length 288, hash 9B96F72A
sample 37:
time = 888000
flags = 1
data = length 336, hash E917C122
sample 38:
time = 912000
flags = 1
data = length 336, hash 10ED1470
sample 39:
time = 936000
flags = 1
data = length 288, hash 706B8A7C
sample 40:
time = 960000
flags = 1
data = length 336, hash 71FFE4A0
sample 41:
time = 984000
flags = 1
data = length 336, hash D4160463
sample 42:
time = 1008000
flags = 1
data = length 336, hash EC557B14
sample 43:
time = 1032000
flags = 1
data = length 288, hash 5598CF8B
sample 44:
time = 1056000
flags = 1
data = length 336, hash 7E0AB41
sample 45:
time = 1080000
flags = 1
data = length 336, hash 1C585FEF
sample 46:
time = 1104000
flags = 1
data = length 336, hash A4A4855E
sample 47:
time = 1128000
flags = 1
data = length 336, hash CECA51D3
sample 48:
time = 1152000
flags = 1
data = length 288, hash 2D362DC5
sample 49:
time = 1176000
flags = 1
data = length 336, hash 9EB2609D
sample 50:
time = 1200000
flags = 1
data = length 336, hash 28FFB3FE
sample 51:
time = 1224000
flags = 1
data = length 288, hash 2AA2D216
sample 52:
time = 1248000
flags = 1
data = length 336, hash CDBC7032
sample 53:
time = 1272000
flags = 1
data = length 336, hash 25B13FE7
sample 54:
time = 1296000
flags = 1
data = length 336, hash DB6BB1E
sample 55:
time = 1320000
flags = 1
data = length 336, hash EBE951F4
sample 56:
time = 1344000
flags = 1
data = length 288, hash 9E2EBFF7
sample 57:
time = 1368000
flags = 1
data = length 336, hash 36A7D455
sample 58:
time = 1392000
flags = 1
data = length 336, hash 84545F8C
sample 59:
time = 1416000
flags = 1
data = length 336, hash F66F3045
sample 60:
time = 1440000
flags = 1
data = length 576, hash 5AB089EA
sample 61:
time = 1464000
flags = 1
data = length 336, hash 8868086
sample 62:
time = 1488000
flags = 1
data = length 336, hash D5EB6D63
sample 63:
time = 1512000
flags = 1
data = length 288, hash 7A5374B7
sample 64:
time = 1536000
flags = 1
data = length 336, hash BEB27A75
sample 65:
time = 1560000
flags = 1
data = length 336, hash E251E0FD
sample 66:
time = 1584000
flags = 1
data = length 288, hash D54C970
sample 67:
time = 1608000
flags = 1
data = length 336, hash 52C473B9
sample 68:
time = 1632000
flags = 1
data = length 336, hash F5F13334
sample 69:
time = 1656000
flags = 1
data = length 480, hash A5F1E987
sample 70:
time = 1680000
flags = 1
data = length 288, hash 453A1267
sample 71:
time = 1704000
flags = 1
data = length 288, hash 7C6C2EA9
sample 72:
time = 1728000
flags = 1
data = length 336, hash F4BFECA4
sample 73:
time = 1752000
flags = 1
data = length 336, hash 751A395A
sample 74:
time = 1776000
flags = 1
data = length 336, hash EE38DB02
sample 75:
time = 1800000
flags = 1
data = length 336, hash F18837E2
sample 76:
time = 1824000
flags = 1
data = length 336, hash ED36B78E
sample 77:
time = 1848000
flags = 1
data = length 336, hash B3D28289
sample 78:
time = 1872000
flags = 1
data = length 288, hash 8BDE28E1
sample 79:
time = 1896000
flags = 1
data = length 336, hash CFD5E966
sample 80:
time = 1920000
flags = 1
data = length 288, hash DC08E267
sample 81:
time = 1944000
flags = 1
data = length 336, hash 6530CB78
sample 82:
time = 1968000
flags = 1
data = length 336, hash 6CC6636E
sample 83:
time = 1992000
flags = 1
data = length 336, hash 613047C1
sample 84:
time = 2016000
flags = 1
data = length 288, hash CDC747BF
sample 85:
time = 2040000
flags = 1
data = length 336, hash AF22AA74
sample 86:
time = 2064000
flags = 1
data = length 384, hash 82F326AA
sample 87:
time = 2088000
flags = 1
data = length 384, hash EDA26C4D
sample 88:
time = 2112000
flags = 1
data = length 336, hash 94C643DC
sample 89:
time = 2136000
flags = 1
data = length 288, hash CB5D9C40
sample 90:
time = 2160000
flags = 1
data = length 336, hash 1E69DE3F
sample 91:
time = 2184000
flags = 1
data = length 336, hash 7E472219
sample 92:
time = 2208000
flags = 1
data = length 336, hash DA47B9FA
sample 93:
time = 2232000
flags = 1
data = length 336, hash DD0ABB7C
sample 94:
time = 2256000
flags = 1
data = length 288, hash DBF93FAC
sample 95:
time = 2280000
flags = 1
data = length 336, hash 243F4B2
sample 96:
time = 2304000
flags = 1
data = length 336, hash 2E881490
sample 97:
time = 2328000
flags = 1
data = length 288, hash 1C28C8BE
sample 98:
time = 2352000
flags = 1
data = length 336, hash C73E5D30
sample 99:
time = 2376000
flags = 1
data = length 288, hash 98B5BFF6
sample 100:
time = 2400000
flags = 1
data = length 336, hash E0135533
sample 101:
time = 2424000
flags = 1
data = length 336, hash D13C9DBC
sample 102:
time = 2448000
flags = 1
data = length 336, hash 63D524CA
sample 103:
time = 2472000
flags = 1
data = length 288, hash A28514C3
sample 104:
time = 2496000
flags = 1
data = length 336, hash 72B647FF
sample 105:
time = 2520000
flags = 1
data = length 336, hash 8F740AB1
sample 106:
time = 2544000
flags = 1
data = length 336, hash 5E3C7E93
sample 107:
time = 2568000
flags = 1
data = length 336, hash 121B913B
sample 108:
time = 2592000
flags = 1
data = length 336, hash 578FCCF2
sample 109:
time = 2616000
flags = 1
data = length 336, hash 5B5823DE
sample 110:
time = 2640000
flags = 1
data = length 384, hash D8B83F78
sample 111:
time = 2664000
flags = 1
data = length 240, hash E649682F
sample 112:
time = 2688000
flags = 1
data = length 96, hash C559A6F4
sample 113:
time = 2712000
flags = 1
data = length 96, hash 792796BC
sample 114:
time = 2736000
flags = 1
data = length 120, hash 8172CD0E
sample 115:
time = 2760000
flags = 1
data = length 120, hash F562B52F
sample 116:
time = 2784000
flags = 1
data = length 96, hash FF8D5B98
tracksEnded = true

View file

@ -0,0 +1,487 @@
seekMap:
isSeekable = true
duration = 2808000
getPosition(0) = [[timeUs=0, position=141]]
getPosition(1) = [[timeUs=0, position=141], [timeUs=1404000, position=10413]]
getPosition(1404000) = [[timeUs=1404000, position=10413]]
getPosition(2808000) = [[timeUs=1404000, position=10413]]
numberOfTracks = 1
track 0:
total output bytes = 38160
sample count = 117
format 0:
averageBitrate = 32000
sampleMimeType = audio/mpeg
maxInputSize = 4096
channelCount = 2
sampleRate = 48000
metadata = entries=[TSSE: description=null: values=[Lavf58.29.100]]
sample 0:
time = 0
flags = 1
data = length 96, hash 1F161542
sample 1:
time = 24000
flags = 1
data = length 768, hash CD1DC50F
sample 2:
time = 48000
flags = 1
data = length 336, hash 3F64124B
sample 3:
time = 72000
flags = 1
data = length 336, hash 8FFED94E
sample 4:
time = 96000
flags = 1
data = length 288, hash 9CD77D47
sample 5:
time = 120000
flags = 1
data = length 384, hash 24607BB5
sample 6:
time = 144000
flags = 1
data = length 480, hash 4937EBAB
sample 7:
time = 168000
flags = 1
data = length 336, hash 546342B1
sample 8:
time = 192000
flags = 1
data = length 336, hash 79E0923F
sample 9:
time = 216000
flags = 1
data = length 336, hash AB1F3948
sample 10:
time = 240000
flags = 1
data = length 336, hash C3A4D888
sample 11:
time = 264000
flags = 1
data = length 288, hash 7867DA45
sample 12:
time = 288000
flags = 1
data = length 336, hash B1240B73
sample 13:
time = 312000
flags = 1
data = length 336, hash 94CFCD35
sample 14:
time = 336000
flags = 1
data = length 288, hash 94F412C
sample 15:
time = 360000
flags = 1
data = length 336, hash A1D9FF41
sample 16:
time = 384000
flags = 1
data = length 288, hash 2A8DA21B
sample 17:
time = 408000
flags = 1
data = length 336, hash 6A429CE
sample 18:
time = 432000
flags = 1
data = length 336, hash 68853982
sample 19:
time = 456000
flags = 1
data = length 384, hash 1D6F779C
sample 20:
time = 480000
flags = 1
data = length 480, hash 6B31EBEE
sample 21:
time = 504000
flags = 1
data = length 336, hash 888335BE
sample 22:
time = 528000
flags = 1
data = length 336, hash 6072AC8B
sample 23:
time = 552000
flags = 1
data = length 336, hash C9D24234
sample 24:
time = 576000
flags = 1
data = length 288, hash 52BF4D1E
sample 25:
time = 600000
flags = 1
data = length 336, hash F93F4F0
sample 26:
time = 624000
flags = 1
data = length 336, hash 8617688A
sample 27:
time = 648000
flags = 1
data = length 480, hash FAB0D31B
sample 28:
time = 672000
flags = 1
data = length 384, hash FA4B53E2
sample 29:
time = 696000
flags = 1
data = length 336, hash 8C435F6A
sample 30:
time = 720000
flags = 1
data = length 336, hash 60D3F80C
sample 31:
time = 744000
flags = 1
data = length 336, hash DC15B68B
sample 32:
time = 768000
flags = 1
data = length 288, hash FF3DF141
sample 33:
time = 792000
flags = 1
data = length 336, hash A64B3042
sample 34:
time = 816000
flags = 1
data = length 336, hash ACA622A1
sample 35:
time = 840000
flags = 1
data = length 288, hash 3E34B8D4
sample 36:
time = 864000
flags = 1
data = length 288, hash 9B96F72A
sample 37:
time = 888000
flags = 1
data = length 336, hash E917C122
sample 38:
time = 912000
flags = 1
data = length 336, hash 10ED1470
sample 39:
time = 936000
flags = 1
data = length 288, hash 706B8A7C
sample 40:
time = 960000
flags = 1
data = length 336, hash 71FFE4A0
sample 41:
time = 984000
flags = 1
data = length 336, hash D4160463
sample 42:
time = 1008000
flags = 1
data = length 336, hash EC557B14
sample 43:
time = 1032000
flags = 1
data = length 288, hash 5598CF8B
sample 44:
time = 1056000
flags = 1
data = length 336, hash 7E0AB41
sample 45:
time = 1080000
flags = 1
data = length 336, hash 1C585FEF
sample 46:
time = 1104000
flags = 1
data = length 336, hash A4A4855E
sample 47:
time = 1128000
flags = 1
data = length 336, hash CECA51D3
sample 48:
time = 1152000
flags = 1
data = length 288, hash 2D362DC5
sample 49:
time = 1176000
flags = 1
data = length 336, hash 9EB2609D
sample 50:
time = 1200000
flags = 1
data = length 336, hash 28FFB3FE
sample 51:
time = 1224000
flags = 1
data = length 288, hash 2AA2D216
sample 52:
time = 1248000
flags = 1
data = length 336, hash CDBC7032
sample 53:
time = 1272000
flags = 1
data = length 336, hash 25B13FE7
sample 54:
time = 1296000
flags = 1
data = length 336, hash DB6BB1E
sample 55:
time = 1320000
flags = 1
data = length 336, hash EBE951F4
sample 56:
time = 1344000
flags = 1
data = length 288, hash 9E2EBFF7
sample 57:
time = 1368000
flags = 1
data = length 336, hash 36A7D455
sample 58:
time = 1392000
flags = 1
data = length 336, hash 84545F8C
sample 59:
time = 1416000
flags = 1
data = length 336, hash F66F3045
sample 60:
time = 1440000
flags = 1
data = length 576, hash 5AB089EA
sample 61:
time = 1464000
flags = 1
data = length 336, hash 8868086
sample 62:
time = 1488000
flags = 1
data = length 336, hash D5EB6D63
sample 63:
time = 1512000
flags = 1
data = length 288, hash 7A5374B7
sample 64:
time = 1536000
flags = 1
data = length 336, hash BEB27A75
sample 65:
time = 1560000
flags = 1
data = length 336, hash E251E0FD
sample 66:
time = 1584000
flags = 1
data = length 288, hash D54C970
sample 67:
time = 1608000
flags = 1
data = length 336, hash 52C473B9
sample 68:
time = 1632000
flags = 1
data = length 336, hash F5F13334
sample 69:
time = 1656000
flags = 1
data = length 480, hash A5F1E987
sample 70:
time = 1680000
flags = 1
data = length 288, hash 453A1267
sample 71:
time = 1704000
flags = 1
data = length 288, hash 7C6C2EA9
sample 72:
time = 1728000
flags = 1
data = length 336, hash F4BFECA4
sample 73:
time = 1752000
flags = 1
data = length 336, hash 751A395A
sample 74:
time = 1776000
flags = 1
data = length 336, hash EE38DB02
sample 75:
time = 1800000
flags = 1
data = length 336, hash F18837E2
sample 76:
time = 1824000
flags = 1
data = length 336, hash ED36B78E
sample 77:
time = 1848000
flags = 1
data = length 336, hash B3D28289
sample 78:
time = 1872000
flags = 1
data = length 288, hash 8BDE28E1
sample 79:
time = 1896000
flags = 1
data = length 336, hash CFD5E966
sample 80:
time = 1920000
flags = 1
data = length 288, hash DC08E267
sample 81:
time = 1944000
flags = 1
data = length 336, hash 6530CB78
sample 82:
time = 1968000
flags = 1
data = length 336, hash 6CC6636E
sample 83:
time = 1992000
flags = 1
data = length 336, hash 613047C1
sample 84:
time = 2016000
flags = 1
data = length 288, hash CDC747BF
sample 85:
time = 2040000
flags = 1
data = length 336, hash AF22AA74
sample 86:
time = 2064000
flags = 1
data = length 384, hash 82F326AA
sample 87:
time = 2088000
flags = 1
data = length 384, hash EDA26C4D
sample 88:
time = 2112000
flags = 1
data = length 336, hash 94C643DC
sample 89:
time = 2136000
flags = 1
data = length 288, hash CB5D9C40
sample 90:
time = 2160000
flags = 1
data = length 336, hash 1E69DE3F
sample 91:
time = 2184000
flags = 1
data = length 336, hash 7E472219
sample 92:
time = 2208000
flags = 1
data = length 336, hash DA47B9FA
sample 93:
time = 2232000
flags = 1
data = length 336, hash DD0ABB7C
sample 94:
time = 2256000
flags = 1
data = length 288, hash DBF93FAC
sample 95:
time = 2280000
flags = 1
data = length 336, hash 243F4B2
sample 96:
time = 2304000
flags = 1
data = length 336, hash 2E881490
sample 97:
time = 2328000
flags = 1
data = length 288, hash 1C28C8BE
sample 98:
time = 2352000
flags = 1
data = length 336, hash C73E5D30
sample 99:
time = 2376000
flags = 1
data = length 288, hash 98B5BFF6
sample 100:
time = 2400000
flags = 1
data = length 336, hash E0135533
sample 101:
time = 2424000
flags = 1
data = length 336, hash D13C9DBC
sample 102:
time = 2448000
flags = 1
data = length 336, hash 63D524CA
sample 103:
time = 2472000
flags = 1
data = length 288, hash A28514C3
sample 104:
time = 2496000
flags = 1
data = length 336, hash 72B647FF
sample 105:
time = 2520000
flags = 1
data = length 336, hash 8F740AB1
sample 106:
time = 2544000
flags = 1
data = length 336, hash 5E3C7E93
sample 107:
time = 2568000
flags = 1
data = length 336, hash 121B913B
sample 108:
time = 2592000
flags = 1
data = length 336, hash 578FCCF2
sample 109:
time = 2616000
flags = 1
data = length 336, hash 5B5823DE
sample 110:
time = 2640000
flags = 1
data = length 384, hash D8B83F78
sample 111:
time = 2664000
flags = 1
data = length 240, hash E649682F
sample 112:
time = 2688000
flags = 1
data = length 96, hash C559A6F4
sample 113:
time = 2712000
flags = 1
data = length 96, hash 792796BC
sample 114:
time = 2736000
flags = 1
data = length 120, hash 8172CD0E
sample 115:
time = 2760000
flags = 1
data = length 120, hash F562B52F
sample 116:
time = 2784000
flags = 1
data = length 96, hash FF8D5B98
tracksEnded = true

View file

@ -0,0 +1,371 @@
seekMap:
isSeekable = true
duration = 2808000
getPosition(0) = [[timeUs=0, position=141]]
getPosition(1) = [[timeUs=0, position=141], [timeUs=1404000, position=10413]]
getPosition(1404000) = [[timeUs=1404000, position=10413]]
getPosition(2808000) = [[timeUs=1404000, position=10413]]
numberOfTracks = 1
track 0:
total output bytes = 27888
sample count = 88
format 0:
averageBitrate = 32000
sampleMimeType = audio/mpeg
maxInputSize = 4096
channelCount = 2
sampleRate = 48000
metadata = entries=[TSSE: description=null: values=[Lavf58.29.100]]
sample 0:
time = 1404000
flags = 1
data = length 336, hash 8C435F6A
sample 1:
time = 1428000
flags = 1
data = length 336, hash 60D3F80C
sample 2:
time = 1452000
flags = 1
data = length 336, hash DC15B68B
sample 3:
time = 1476000
flags = 1
data = length 288, hash FF3DF141
sample 4:
time = 1500000
flags = 1
data = length 336, hash A64B3042
sample 5:
time = 1524000
flags = 1
data = length 336, hash ACA622A1
sample 6:
time = 1548000
flags = 1
data = length 288, hash 3E34B8D4
sample 7:
time = 1572000
flags = 1
data = length 288, hash 9B96F72A
sample 8:
time = 1596000
flags = 1
data = length 336, hash E917C122
sample 9:
time = 1620000
flags = 1
data = length 336, hash 10ED1470
sample 10:
time = 1644000
flags = 1
data = length 288, hash 706B8A7C
sample 11:
time = 1668000
flags = 1
data = length 336, hash 71FFE4A0
sample 12:
time = 1692000
flags = 1
data = length 336, hash D4160463
sample 13:
time = 1716000
flags = 1
data = length 336, hash EC557B14
sample 14:
time = 1740000
flags = 1
data = length 288, hash 5598CF8B
sample 15:
time = 1764000
flags = 1
data = length 336, hash 7E0AB41
sample 16:
time = 1788000
flags = 1
data = length 336, hash 1C585FEF
sample 17:
time = 1812000
flags = 1
data = length 336, hash A4A4855E
sample 18:
time = 1836000
flags = 1
data = length 336, hash CECA51D3
sample 19:
time = 1860000
flags = 1
data = length 288, hash 2D362DC5
sample 20:
time = 1884000
flags = 1
data = length 336, hash 9EB2609D
sample 21:
time = 1908000
flags = 1
data = length 336, hash 28FFB3FE
sample 22:
time = 1932000
flags = 1
data = length 288, hash 2AA2D216
sample 23:
time = 1956000
flags = 1
data = length 336, hash CDBC7032
sample 24:
time = 1980000
flags = 1
data = length 336, hash 25B13FE7
sample 25:
time = 2004000
flags = 1
data = length 336, hash DB6BB1E
sample 26:
time = 2028000
flags = 1
data = length 336, hash EBE951F4
sample 27:
time = 2052000
flags = 1
data = length 288, hash 9E2EBFF7
sample 28:
time = 2076000
flags = 1
data = length 336, hash 36A7D455
sample 29:
time = 2100000
flags = 1
data = length 336, hash 84545F8C
sample 30:
time = 2124000
flags = 1
data = length 336, hash F66F3045
sample 31:
time = 2148000
flags = 1
data = length 576, hash 5AB089EA
sample 32:
time = 2172000
flags = 1
data = length 336, hash 8868086
sample 33:
time = 2196000
flags = 1
data = length 336, hash D5EB6D63
sample 34:
time = 2220000
flags = 1
data = length 288, hash 7A5374B7
sample 35:
time = 2244000
flags = 1
data = length 336, hash BEB27A75
sample 36:
time = 2268000
flags = 1
data = length 336, hash E251E0FD
sample 37:
time = 2292000
flags = 1
data = length 288, hash D54C970
sample 38:
time = 2316000
flags = 1
data = length 336, hash 52C473B9
sample 39:
time = 2340000
flags = 1
data = length 336, hash F5F13334
sample 40:
time = 2364000
flags = 1
data = length 480, hash A5F1E987
sample 41:
time = 2388000
flags = 1
data = length 288, hash 453A1267
sample 42:
time = 2412000
flags = 1
data = length 288, hash 7C6C2EA9
sample 43:
time = 2436000
flags = 1
data = length 336, hash F4BFECA4
sample 44:
time = 2460000
flags = 1
data = length 336, hash 751A395A
sample 45:
time = 2484000
flags = 1
data = length 336, hash EE38DB02
sample 46:
time = 2508000
flags = 1
data = length 336, hash F18837E2
sample 47:
time = 2532000
flags = 1
data = length 336, hash ED36B78E
sample 48:
time = 2556000
flags = 1
data = length 336, hash B3D28289
sample 49:
time = 2580000
flags = 1
data = length 288, hash 8BDE28E1
sample 50:
time = 2604000
flags = 1
data = length 336, hash CFD5E966
sample 51:
time = 2628000
flags = 1
data = length 288, hash DC08E267
sample 52:
time = 2652000
flags = 1
data = length 336, hash 6530CB78
sample 53:
time = 2676000
flags = 1
data = length 336, hash 6CC6636E
sample 54:
time = 2700000
flags = 1
data = length 336, hash 613047C1
sample 55:
time = 2724000
flags = 1
data = length 288, hash CDC747BF
sample 56:
time = 2748000
flags = 1
data = length 336, hash AF22AA74
sample 57:
time = 2772000
flags = 1
data = length 384, hash 82F326AA
sample 58:
time = 2796000
flags = 1
data = length 384, hash EDA26C4D
sample 59:
time = 2820000
flags = 1
data = length 336, hash 94C643DC
sample 60:
time = 2844000
flags = 1
data = length 288, hash CB5D9C40
sample 61:
time = 2868000
flags = 1
data = length 336, hash 1E69DE3F
sample 62:
time = 2892000
flags = 1
data = length 336, hash 7E472219
sample 63:
time = 2916000
flags = 1
data = length 336, hash DA47B9FA
sample 64:
time = 2940000
flags = 1
data = length 336, hash DD0ABB7C
sample 65:
time = 2964000
flags = 1
data = length 288, hash DBF93FAC
sample 66:
time = 2988000
flags = 1
data = length 336, hash 243F4B2
sample 67:
time = 3012000
flags = 1
data = length 336, hash 2E881490
sample 68:
time = 3036000
flags = 1
data = length 288, hash 1C28C8BE
sample 69:
time = 3060000
flags = 1
data = length 336, hash C73E5D30
sample 70:
time = 3084000
flags = 1
data = length 288, hash 98B5BFF6
sample 71:
time = 3108000
flags = 1
data = length 336, hash E0135533
sample 72:
time = 3132000
flags = 1
data = length 336, hash D13C9DBC
sample 73:
time = 3156000
flags = 1
data = length 336, hash 63D524CA
sample 74:
time = 3180000
flags = 1
data = length 288, hash A28514C3
sample 75:
time = 3204000
flags = 1
data = length 336, hash 72B647FF
sample 76:
time = 3228000
flags = 1
data = length 336, hash 8F740AB1
sample 77:
time = 3252000
flags = 1
data = length 336, hash 5E3C7E93
sample 78:
time = 3276000
flags = 1
data = length 336, hash 121B913B
sample 79:
time = 3300000
flags = 1
data = length 336, hash 578FCCF2
sample 80:
time = 3324000
flags = 1
data = length 336, hash 5B5823DE
sample 81:
time = 3348000
flags = 1
data = length 384, hash D8B83F78
sample 82:
time = 3372000
flags = 1
data = length 240, hash E649682F
sample 83:
time = 3396000
flags = 1
data = length 96, hash C559A6F4
sample 84:
time = 3420000
flags = 1
data = length 96, hash 792796BC
sample 85:
time = 3444000
flags = 1
data = length 120, hash 8172CD0E
sample 86:
time = 3468000
flags = 1
data = length 120, hash F562B52F
sample 87:
time = 3492000
flags = 1
data = length 96, hash FF8D5B98
tracksEnded = true

View file

@ -0,0 +1,371 @@
seekMap:
isSeekable = true
duration = 2808000
getPosition(0) = [[timeUs=0, position=141]]
getPosition(1) = [[timeUs=0, position=141], [timeUs=1404000, position=10413]]
getPosition(1404000) = [[timeUs=1404000, position=10413]]
getPosition(2808000) = [[timeUs=1404000, position=10413]]
numberOfTracks = 1
track 0:
total output bytes = 27888
sample count = 88
format 0:
averageBitrate = 32000
sampleMimeType = audio/mpeg
maxInputSize = 4096
channelCount = 2
sampleRate = 48000
metadata = entries=[TSSE: description=null: values=[Lavf58.29.100]]
sample 0:
time = 1404000
flags = 1
data = length 336, hash 8C435F6A
sample 1:
time = 1428000
flags = 1
data = length 336, hash 60D3F80C
sample 2:
time = 1452000
flags = 1
data = length 336, hash DC15B68B
sample 3:
time = 1476000
flags = 1
data = length 288, hash FF3DF141
sample 4:
time = 1500000
flags = 1
data = length 336, hash A64B3042
sample 5:
time = 1524000
flags = 1
data = length 336, hash ACA622A1
sample 6:
time = 1548000
flags = 1
data = length 288, hash 3E34B8D4
sample 7:
time = 1572000
flags = 1
data = length 288, hash 9B96F72A
sample 8:
time = 1596000
flags = 1
data = length 336, hash E917C122
sample 9:
time = 1620000
flags = 1
data = length 336, hash 10ED1470
sample 10:
time = 1644000
flags = 1
data = length 288, hash 706B8A7C
sample 11:
time = 1668000
flags = 1
data = length 336, hash 71FFE4A0
sample 12:
time = 1692000
flags = 1
data = length 336, hash D4160463
sample 13:
time = 1716000
flags = 1
data = length 336, hash EC557B14
sample 14:
time = 1740000
flags = 1
data = length 288, hash 5598CF8B
sample 15:
time = 1764000
flags = 1
data = length 336, hash 7E0AB41
sample 16:
time = 1788000
flags = 1
data = length 336, hash 1C585FEF
sample 17:
time = 1812000
flags = 1
data = length 336, hash A4A4855E
sample 18:
time = 1836000
flags = 1
data = length 336, hash CECA51D3
sample 19:
time = 1860000
flags = 1
data = length 288, hash 2D362DC5
sample 20:
time = 1884000
flags = 1
data = length 336, hash 9EB2609D
sample 21:
time = 1908000
flags = 1
data = length 336, hash 28FFB3FE
sample 22:
time = 1932000
flags = 1
data = length 288, hash 2AA2D216
sample 23:
time = 1956000
flags = 1
data = length 336, hash CDBC7032
sample 24:
time = 1980000
flags = 1
data = length 336, hash 25B13FE7
sample 25:
time = 2004000
flags = 1
data = length 336, hash DB6BB1E
sample 26:
time = 2028000
flags = 1
data = length 336, hash EBE951F4
sample 27:
time = 2052000
flags = 1
data = length 288, hash 9E2EBFF7
sample 28:
time = 2076000
flags = 1
data = length 336, hash 36A7D455
sample 29:
time = 2100000
flags = 1
data = length 336, hash 84545F8C
sample 30:
time = 2124000
flags = 1
data = length 336, hash F66F3045
sample 31:
time = 2148000
flags = 1
data = length 576, hash 5AB089EA
sample 32:
time = 2172000
flags = 1
data = length 336, hash 8868086
sample 33:
time = 2196000
flags = 1
data = length 336, hash D5EB6D63
sample 34:
time = 2220000
flags = 1
data = length 288, hash 7A5374B7
sample 35:
time = 2244000
flags = 1
data = length 336, hash BEB27A75
sample 36:
time = 2268000
flags = 1
data = length 336, hash E251E0FD
sample 37:
time = 2292000
flags = 1
data = length 288, hash D54C970
sample 38:
time = 2316000
flags = 1
data = length 336, hash 52C473B9
sample 39:
time = 2340000
flags = 1
data = length 336, hash F5F13334
sample 40:
time = 2364000
flags = 1
data = length 480, hash A5F1E987
sample 41:
time = 2388000
flags = 1
data = length 288, hash 453A1267
sample 42:
time = 2412000
flags = 1
data = length 288, hash 7C6C2EA9
sample 43:
time = 2436000
flags = 1
data = length 336, hash F4BFECA4
sample 44:
time = 2460000
flags = 1
data = length 336, hash 751A395A
sample 45:
time = 2484000
flags = 1
data = length 336, hash EE38DB02
sample 46:
time = 2508000
flags = 1
data = length 336, hash F18837E2
sample 47:
time = 2532000
flags = 1
data = length 336, hash ED36B78E
sample 48:
time = 2556000
flags = 1
data = length 336, hash B3D28289
sample 49:
time = 2580000
flags = 1
data = length 288, hash 8BDE28E1
sample 50:
time = 2604000
flags = 1
data = length 336, hash CFD5E966
sample 51:
time = 2628000
flags = 1
data = length 288, hash DC08E267
sample 52:
time = 2652000
flags = 1
data = length 336, hash 6530CB78
sample 53:
time = 2676000
flags = 1
data = length 336, hash 6CC6636E
sample 54:
time = 2700000
flags = 1
data = length 336, hash 613047C1
sample 55:
time = 2724000
flags = 1
data = length 288, hash CDC747BF
sample 56:
time = 2748000
flags = 1
data = length 336, hash AF22AA74
sample 57:
time = 2772000
flags = 1
data = length 384, hash 82F326AA
sample 58:
time = 2796000
flags = 1
data = length 384, hash EDA26C4D
sample 59:
time = 2820000
flags = 1
data = length 336, hash 94C643DC
sample 60:
time = 2844000
flags = 1
data = length 288, hash CB5D9C40
sample 61:
time = 2868000
flags = 1
data = length 336, hash 1E69DE3F
sample 62:
time = 2892000
flags = 1
data = length 336, hash 7E472219
sample 63:
time = 2916000
flags = 1
data = length 336, hash DA47B9FA
sample 64:
time = 2940000
flags = 1
data = length 336, hash DD0ABB7C
sample 65:
time = 2964000
flags = 1
data = length 288, hash DBF93FAC
sample 66:
time = 2988000
flags = 1
data = length 336, hash 243F4B2
sample 67:
time = 3012000
flags = 1
data = length 336, hash 2E881490
sample 68:
time = 3036000
flags = 1
data = length 288, hash 1C28C8BE
sample 69:
time = 3060000
flags = 1
data = length 336, hash C73E5D30
sample 70:
time = 3084000
flags = 1
data = length 288, hash 98B5BFF6
sample 71:
time = 3108000
flags = 1
data = length 336, hash E0135533
sample 72:
time = 3132000
flags = 1
data = length 336, hash D13C9DBC
sample 73:
time = 3156000
flags = 1
data = length 336, hash 63D524CA
sample 74:
time = 3180000
flags = 1
data = length 288, hash A28514C3
sample 75:
time = 3204000
flags = 1
data = length 336, hash 72B647FF
sample 76:
time = 3228000
flags = 1
data = length 336, hash 8F740AB1
sample 77:
time = 3252000
flags = 1
data = length 336, hash 5E3C7E93
sample 78:
time = 3276000
flags = 1
data = length 336, hash 121B913B
sample 79:
time = 3300000
flags = 1
data = length 336, hash 578FCCF2
sample 80:
time = 3324000
flags = 1
data = length 336, hash 5B5823DE
sample 81:
time = 3348000
flags = 1
data = length 384, hash D8B83F78
sample 82:
time = 3372000
flags = 1
data = length 240, hash E649682F
sample 83:
time = 3396000
flags = 1
data = length 96, hash C559A6F4
sample 84:
time = 3420000
flags = 1
data = length 96, hash 792796BC
sample 85:
time = 3444000
flags = 1
data = length 120, hash 8172CD0E
sample 86:
time = 3468000
flags = 1
data = length 120, hash F562B52F
sample 87:
time = 3492000
flags = 1
data = length 96, hash FF8D5B98
tracksEnded = true

View file

@ -0,0 +1,487 @@
seekMap:
isSeekable = true
duration = 2808000
getPosition(0) = [[timeUs=0, position=141]]
getPosition(1) = [[timeUs=0, position=141], [timeUs=1404000, position=10413]]
getPosition(1404000) = [[timeUs=1404000, position=10413]]
getPosition(2808000) = [[timeUs=1404000, position=10413]]
numberOfTracks = 1
track 0:
total output bytes = 38160
sample count = 117
format 0:
averageBitrate = 32000
sampleMimeType = audio/mpeg
maxInputSize = 4096
channelCount = 2
sampleRate = 48000
metadata = entries=[TSSE: description=null: values=[Lavf58.29.100]]
sample 0:
time = 0
flags = 1
data = length 96, hash 1F161542
sample 1:
time = 24000
flags = 1
data = length 768, hash CD1DC50F
sample 2:
time = 48000
flags = 1
data = length 336, hash 3F64124B
sample 3:
time = 72000
flags = 1
data = length 336, hash 8FFED94E
sample 4:
time = 96000
flags = 1
data = length 288, hash 9CD77D47
sample 5:
time = 120000
flags = 1
data = length 384, hash 24607BB5
sample 6:
time = 144000
flags = 1
data = length 480, hash 4937EBAB
sample 7:
time = 168000
flags = 1
data = length 336, hash 546342B1
sample 8:
time = 192000
flags = 1
data = length 336, hash 79E0923F
sample 9:
time = 216000
flags = 1
data = length 336, hash AB1F3948
sample 10:
time = 240000
flags = 1
data = length 336, hash C3A4D888
sample 11:
time = 264000
flags = 1
data = length 288, hash 7867DA45
sample 12:
time = 288000
flags = 1
data = length 336, hash B1240B73
sample 13:
time = 312000
flags = 1
data = length 336, hash 94CFCD35
sample 14:
time = 336000
flags = 1
data = length 288, hash 94F412C
sample 15:
time = 360000
flags = 1
data = length 336, hash A1D9FF41
sample 16:
time = 384000
flags = 1
data = length 288, hash 2A8DA21B
sample 17:
time = 408000
flags = 1
data = length 336, hash 6A429CE
sample 18:
time = 432000
flags = 1
data = length 336, hash 68853982
sample 19:
time = 456000
flags = 1
data = length 384, hash 1D6F779C
sample 20:
time = 480000
flags = 1
data = length 480, hash 6B31EBEE
sample 21:
time = 504000
flags = 1
data = length 336, hash 888335BE
sample 22:
time = 528000
flags = 1
data = length 336, hash 6072AC8B
sample 23:
time = 552000
flags = 1
data = length 336, hash C9D24234
sample 24:
time = 576000
flags = 1
data = length 288, hash 52BF4D1E
sample 25:
time = 600000
flags = 1
data = length 336, hash F93F4F0
sample 26:
time = 624000
flags = 1
data = length 336, hash 8617688A
sample 27:
time = 648000
flags = 1
data = length 480, hash FAB0D31B
sample 28:
time = 672000
flags = 1
data = length 384, hash FA4B53E2
sample 29:
time = 696000
flags = 1
data = length 336, hash 8C435F6A
sample 30:
time = 720000
flags = 1
data = length 336, hash 60D3F80C
sample 31:
time = 744000
flags = 1
data = length 336, hash DC15B68B
sample 32:
time = 768000
flags = 1
data = length 288, hash FF3DF141
sample 33:
time = 792000
flags = 1
data = length 336, hash A64B3042
sample 34:
time = 816000
flags = 1
data = length 336, hash ACA622A1
sample 35:
time = 840000
flags = 1
data = length 288, hash 3E34B8D4
sample 36:
time = 864000
flags = 1
data = length 288, hash 9B96F72A
sample 37:
time = 888000
flags = 1
data = length 336, hash E917C122
sample 38:
time = 912000
flags = 1
data = length 336, hash 10ED1470
sample 39:
time = 936000
flags = 1
data = length 288, hash 706B8A7C
sample 40:
time = 960000
flags = 1
data = length 336, hash 71FFE4A0
sample 41:
time = 984000
flags = 1
data = length 336, hash D4160463
sample 42:
time = 1008000
flags = 1
data = length 336, hash EC557B14
sample 43:
time = 1032000
flags = 1
data = length 288, hash 5598CF8B
sample 44:
time = 1056000
flags = 1
data = length 336, hash 7E0AB41
sample 45:
time = 1080000
flags = 1
data = length 336, hash 1C585FEF
sample 46:
time = 1104000
flags = 1
data = length 336, hash A4A4855E
sample 47:
time = 1128000
flags = 1
data = length 336, hash CECA51D3
sample 48:
time = 1152000
flags = 1
data = length 288, hash 2D362DC5
sample 49:
time = 1176000
flags = 1
data = length 336, hash 9EB2609D
sample 50:
time = 1200000
flags = 1
data = length 336, hash 28FFB3FE
sample 51:
time = 1224000
flags = 1
data = length 288, hash 2AA2D216
sample 52:
time = 1248000
flags = 1
data = length 336, hash CDBC7032
sample 53:
time = 1272000
flags = 1
data = length 336, hash 25B13FE7
sample 54:
time = 1296000
flags = 1
data = length 336, hash DB6BB1E
sample 55:
time = 1320000
flags = 1
data = length 336, hash EBE951F4
sample 56:
time = 1344000
flags = 1
data = length 288, hash 9E2EBFF7
sample 57:
time = 1368000
flags = 1
data = length 336, hash 36A7D455
sample 58:
time = 1392000
flags = 1
data = length 336, hash 84545F8C
sample 59:
time = 1416000
flags = 1
data = length 336, hash F66F3045
sample 60:
time = 1440000
flags = 1
data = length 576, hash 5AB089EA
sample 61:
time = 1464000
flags = 1
data = length 336, hash 8868086
sample 62:
time = 1488000
flags = 1
data = length 336, hash D5EB6D63
sample 63:
time = 1512000
flags = 1
data = length 288, hash 7A5374B7
sample 64:
time = 1536000
flags = 1
data = length 336, hash BEB27A75
sample 65:
time = 1560000
flags = 1
data = length 336, hash E251E0FD
sample 66:
time = 1584000
flags = 1
data = length 288, hash D54C970
sample 67:
time = 1608000
flags = 1
data = length 336, hash 52C473B9
sample 68:
time = 1632000
flags = 1
data = length 336, hash F5F13334
sample 69:
time = 1656000
flags = 1
data = length 480, hash A5F1E987
sample 70:
time = 1680000
flags = 1
data = length 288, hash 453A1267
sample 71:
time = 1704000
flags = 1
data = length 288, hash 7C6C2EA9
sample 72:
time = 1728000
flags = 1
data = length 336, hash F4BFECA4
sample 73:
time = 1752000
flags = 1
data = length 336, hash 751A395A
sample 74:
time = 1776000
flags = 1
data = length 336, hash EE38DB02
sample 75:
time = 1800000
flags = 1
data = length 336, hash F18837E2
sample 76:
time = 1824000
flags = 1
data = length 336, hash ED36B78E
sample 77:
time = 1848000
flags = 1
data = length 336, hash B3D28289
sample 78:
time = 1872000
flags = 1
data = length 288, hash 8BDE28E1
sample 79:
time = 1896000
flags = 1
data = length 336, hash CFD5E966
sample 80:
time = 1920000
flags = 1
data = length 288, hash DC08E267
sample 81:
time = 1944000
flags = 1
data = length 336, hash 6530CB78
sample 82:
time = 1968000
flags = 1
data = length 336, hash 6CC6636E
sample 83:
time = 1992000
flags = 1
data = length 336, hash 613047C1
sample 84:
time = 2016000
flags = 1
data = length 288, hash CDC747BF
sample 85:
time = 2040000
flags = 1
data = length 336, hash AF22AA74
sample 86:
time = 2064000
flags = 1
data = length 384, hash 82F326AA
sample 87:
time = 2088000
flags = 1
data = length 384, hash EDA26C4D
sample 88:
time = 2112000
flags = 1
data = length 336, hash 94C643DC
sample 89:
time = 2136000
flags = 1
data = length 288, hash CB5D9C40
sample 90:
time = 2160000
flags = 1
data = length 336, hash 1E69DE3F
sample 91:
time = 2184000
flags = 1
data = length 336, hash 7E472219
sample 92:
time = 2208000
flags = 1
data = length 336, hash DA47B9FA
sample 93:
time = 2232000
flags = 1
data = length 336, hash DD0ABB7C
sample 94:
time = 2256000
flags = 1
data = length 288, hash DBF93FAC
sample 95:
time = 2280000
flags = 1
data = length 336, hash 243F4B2
sample 96:
time = 2304000
flags = 1
data = length 336, hash 2E881490
sample 97:
time = 2328000
flags = 1
data = length 288, hash 1C28C8BE
sample 98:
time = 2352000
flags = 1
data = length 336, hash C73E5D30
sample 99:
time = 2376000
flags = 1
data = length 288, hash 98B5BFF6
sample 100:
time = 2400000
flags = 1
data = length 336, hash E0135533
sample 101:
time = 2424000
flags = 1
data = length 336, hash D13C9DBC
sample 102:
time = 2448000
flags = 1
data = length 336, hash 63D524CA
sample 103:
time = 2472000
flags = 1
data = length 288, hash A28514C3
sample 104:
time = 2496000
flags = 1
data = length 336, hash 72B647FF
sample 105:
time = 2520000
flags = 1
data = length 336, hash 8F740AB1
sample 106:
time = 2544000
flags = 1
data = length 336, hash 5E3C7E93
sample 107:
time = 2568000
flags = 1
data = length 336, hash 121B913B
sample 108:
time = 2592000
flags = 1
data = length 336, hash 578FCCF2
sample 109:
time = 2616000
flags = 1
data = length 336, hash 5B5823DE
sample 110:
time = 2640000
flags = 1
data = length 384, hash D8B83F78
sample 111:
time = 2664000
flags = 1
data = length 240, hash E649682F
sample 112:
time = 2688000
flags = 1
data = length 96, hash C559A6F4
sample 113:
time = 2712000
flags = 1
data = length 96, hash 792796BC
sample 114:
time = 2736000
flags = 1
data = length 120, hash 8172CD0E
sample 115:
time = 2760000
flags = 1
data = length 120, hash F562B52F
sample 116:
time = 2784000
flags = 1
data = length 96, hash FF8D5B98
tracksEnded = true

View file

@ -0,0 +1,487 @@
seekMap:
isSeekable = true
duration = 2808000
getPosition(0) = [[timeUs=0, position=141]]
getPosition(1) = [[timeUs=0, position=141], [timeUs=702000, position=10413]]
getPosition(1404000) = [[timeUs=1404000, position=19773]]
getPosition(2808000) = [[timeUs=2106000, position=29613]]
numberOfTracks = 1
track 0:
total output bytes = 38160
sample count = 117
format 0:
averageBitrate = 32000
sampleMimeType = audio/mpeg
maxInputSize = 4096
channelCount = 2
sampleRate = 48000
metadata = entries=[TSSE: description=null: values=[Lavf58.29.100]]
sample 0:
time = 0
flags = 1
data = length 96, hash 1F161542
sample 1:
time = 24000
flags = 1
data = length 768, hash CD1DC50F
sample 2:
time = 48000
flags = 1
data = length 336, hash 3F64124B
sample 3:
time = 72000
flags = 1
data = length 336, hash 8FFED94E
sample 4:
time = 96000
flags = 1
data = length 288, hash 9CD77D47
sample 5:
time = 120000
flags = 1
data = length 384, hash 24607BB5
sample 6:
time = 144000
flags = 1
data = length 480, hash 4937EBAB
sample 7:
time = 168000
flags = 1
data = length 336, hash 546342B1
sample 8:
time = 192000
flags = 1
data = length 336, hash 79E0923F
sample 9:
time = 216000
flags = 1
data = length 336, hash AB1F3948
sample 10:
time = 240000
flags = 1
data = length 336, hash C3A4D888
sample 11:
time = 264000
flags = 1
data = length 288, hash 7867DA45
sample 12:
time = 288000
flags = 1
data = length 336, hash B1240B73
sample 13:
time = 312000
flags = 1
data = length 336, hash 94CFCD35
sample 14:
time = 336000
flags = 1
data = length 288, hash 94F412C
sample 15:
time = 360000
flags = 1
data = length 336, hash A1D9FF41
sample 16:
time = 384000
flags = 1
data = length 288, hash 2A8DA21B
sample 17:
time = 408000
flags = 1
data = length 336, hash 6A429CE
sample 18:
time = 432000
flags = 1
data = length 336, hash 68853982
sample 19:
time = 456000
flags = 1
data = length 384, hash 1D6F779C
sample 20:
time = 480000
flags = 1
data = length 480, hash 6B31EBEE
sample 21:
time = 504000
flags = 1
data = length 336, hash 888335BE
sample 22:
time = 528000
flags = 1
data = length 336, hash 6072AC8B
sample 23:
time = 552000
flags = 1
data = length 336, hash C9D24234
sample 24:
time = 576000
flags = 1
data = length 288, hash 52BF4D1E
sample 25:
time = 600000
flags = 1
data = length 336, hash F93F4F0
sample 26:
time = 624000
flags = 1
data = length 336, hash 8617688A
sample 27:
time = 648000
flags = 1
data = length 480, hash FAB0D31B
sample 28:
time = 672000
flags = 1
data = length 384, hash FA4B53E2
sample 29:
time = 696000
flags = 1
data = length 336, hash 8C435F6A
sample 30:
time = 720000
flags = 1
data = length 336, hash 60D3F80C
sample 31:
time = 744000
flags = 1
data = length 336, hash DC15B68B
sample 32:
time = 768000
flags = 1
data = length 288, hash FF3DF141
sample 33:
time = 792000
flags = 1
data = length 336, hash A64B3042
sample 34:
time = 816000
flags = 1
data = length 336, hash ACA622A1
sample 35:
time = 840000
flags = 1
data = length 288, hash 3E34B8D4
sample 36:
time = 864000
flags = 1
data = length 288, hash 9B96F72A
sample 37:
time = 888000
flags = 1
data = length 336, hash E917C122
sample 38:
time = 912000
flags = 1
data = length 336, hash 10ED1470
sample 39:
time = 936000
flags = 1
data = length 288, hash 706B8A7C
sample 40:
time = 960000
flags = 1
data = length 336, hash 71FFE4A0
sample 41:
time = 984000
flags = 1
data = length 336, hash D4160463
sample 42:
time = 1008000
flags = 1
data = length 336, hash EC557B14
sample 43:
time = 1032000
flags = 1
data = length 288, hash 5598CF8B
sample 44:
time = 1056000
flags = 1
data = length 336, hash 7E0AB41
sample 45:
time = 1080000
flags = 1
data = length 336, hash 1C585FEF
sample 46:
time = 1104000
flags = 1
data = length 336, hash A4A4855E
sample 47:
time = 1128000
flags = 1
data = length 336, hash CECA51D3
sample 48:
time = 1152000
flags = 1
data = length 288, hash 2D362DC5
sample 49:
time = 1176000
flags = 1
data = length 336, hash 9EB2609D
sample 50:
time = 1200000
flags = 1
data = length 336, hash 28FFB3FE
sample 51:
time = 1224000
flags = 1
data = length 288, hash 2AA2D216
sample 52:
time = 1248000
flags = 1
data = length 336, hash CDBC7032
sample 53:
time = 1272000
flags = 1
data = length 336, hash 25B13FE7
sample 54:
time = 1296000
flags = 1
data = length 336, hash DB6BB1E
sample 55:
time = 1320000
flags = 1
data = length 336, hash EBE951F4
sample 56:
time = 1344000
flags = 1
data = length 288, hash 9E2EBFF7
sample 57:
time = 1368000
flags = 1
data = length 336, hash 36A7D455
sample 58:
time = 1392000
flags = 1
data = length 336, hash 84545F8C
sample 59:
time = 1416000
flags = 1
data = length 336, hash F66F3045
sample 60:
time = 1440000
flags = 1
data = length 576, hash 5AB089EA
sample 61:
time = 1464000
flags = 1
data = length 336, hash 8868086
sample 62:
time = 1488000
flags = 1
data = length 336, hash D5EB6D63
sample 63:
time = 1512000
flags = 1
data = length 288, hash 7A5374B7
sample 64:
time = 1536000
flags = 1
data = length 336, hash BEB27A75
sample 65:
time = 1560000
flags = 1
data = length 336, hash E251E0FD
sample 66:
time = 1584000
flags = 1
data = length 288, hash D54C970
sample 67:
time = 1608000
flags = 1
data = length 336, hash 52C473B9
sample 68:
time = 1632000
flags = 1
data = length 336, hash F5F13334
sample 69:
time = 1656000
flags = 1
data = length 480, hash A5F1E987
sample 70:
time = 1680000
flags = 1
data = length 288, hash 453A1267
sample 71:
time = 1704000
flags = 1
data = length 288, hash 7C6C2EA9
sample 72:
time = 1728000
flags = 1
data = length 336, hash F4BFECA4
sample 73:
time = 1752000
flags = 1
data = length 336, hash 751A395A
sample 74:
time = 1776000
flags = 1
data = length 336, hash EE38DB02
sample 75:
time = 1800000
flags = 1
data = length 336, hash F18837E2
sample 76:
time = 1824000
flags = 1
data = length 336, hash ED36B78E
sample 77:
time = 1848000
flags = 1
data = length 336, hash B3D28289
sample 78:
time = 1872000
flags = 1
data = length 288, hash 8BDE28E1
sample 79:
time = 1896000
flags = 1
data = length 336, hash CFD5E966
sample 80:
time = 1920000
flags = 1
data = length 288, hash DC08E267
sample 81:
time = 1944000
flags = 1
data = length 336, hash 6530CB78
sample 82:
time = 1968000
flags = 1
data = length 336, hash 6CC6636E
sample 83:
time = 1992000
flags = 1
data = length 336, hash 613047C1
sample 84:
time = 2016000
flags = 1
data = length 288, hash CDC747BF
sample 85:
time = 2040000
flags = 1
data = length 336, hash AF22AA74
sample 86:
time = 2064000
flags = 1
data = length 384, hash 82F326AA
sample 87:
time = 2088000
flags = 1
data = length 384, hash EDA26C4D
sample 88:
time = 2112000
flags = 1
data = length 336, hash 94C643DC
sample 89:
time = 2136000
flags = 1
data = length 288, hash CB5D9C40
sample 90:
time = 2160000
flags = 1
data = length 336, hash 1E69DE3F
sample 91:
time = 2184000
flags = 1
data = length 336, hash 7E472219
sample 92:
time = 2208000
flags = 1
data = length 336, hash DA47B9FA
sample 93:
time = 2232000
flags = 1
data = length 336, hash DD0ABB7C
sample 94:
time = 2256000
flags = 1
data = length 288, hash DBF93FAC
sample 95:
time = 2280000
flags = 1
data = length 336, hash 243F4B2
sample 96:
time = 2304000
flags = 1
data = length 336, hash 2E881490
sample 97:
time = 2328000
flags = 1
data = length 288, hash 1C28C8BE
sample 98:
time = 2352000
flags = 1
data = length 336, hash C73E5D30
sample 99:
time = 2376000
flags = 1
data = length 288, hash 98B5BFF6
sample 100:
time = 2400000
flags = 1
data = length 336, hash E0135533
sample 101:
time = 2424000
flags = 1
data = length 336, hash D13C9DBC
sample 102:
time = 2448000
flags = 1
data = length 336, hash 63D524CA
sample 103:
time = 2472000
flags = 1
data = length 288, hash A28514C3
sample 104:
time = 2496000
flags = 1
data = length 336, hash 72B647FF
sample 105:
time = 2520000
flags = 1
data = length 336, hash 8F740AB1
sample 106:
time = 2544000
flags = 1
data = length 336, hash 5E3C7E93
sample 107:
time = 2568000
flags = 1
data = length 336, hash 121B913B
sample 108:
time = 2592000
flags = 1
data = length 336, hash 578FCCF2
sample 109:
time = 2616000
flags = 1
data = length 336, hash 5B5823DE
sample 110:
time = 2640000
flags = 1
data = length 384, hash D8B83F78
sample 111:
time = 2664000
flags = 1
data = length 240, hash E649682F
sample 112:
time = 2688000
flags = 1
data = length 96, hash C559A6F4
sample 113:
time = 2712000
flags = 1
data = length 96, hash 792796BC
sample 114:
time = 2736000
flags = 1
data = length 120, hash 8172CD0E
sample 115:
time = 2760000
flags = 1
data = length 120, hash F562B52F
sample 116:
time = 2784000
flags = 1
data = length 96, hash FF8D5B98
tracksEnded = true

View file

@ -0,0 +1,371 @@
seekMap:
isSeekable = true
duration = 2808000
getPosition(0) = [[timeUs=0, position=141]]
getPosition(1) = [[timeUs=0, position=141], [timeUs=702000, position=10413]]
getPosition(1404000) = [[timeUs=1404000, position=19773]]
getPosition(2808000) = [[timeUs=2106000, position=29613]]
numberOfTracks = 1
track 0:
total output bytes = 27888
sample count = 88
format 0:
averageBitrate = 32000
sampleMimeType = audio/mpeg
maxInputSize = 4096
channelCount = 2
sampleRate = 48000
metadata = entries=[TSSE: description=null: values=[Lavf58.29.100]]
sample 0:
time = 702000
flags = 1
data = length 336, hash 8C435F6A
sample 1:
time = 726000
flags = 1
data = length 336, hash 60D3F80C
sample 2:
time = 750000
flags = 1
data = length 336, hash DC15B68B
sample 3:
time = 774000
flags = 1
data = length 288, hash FF3DF141
sample 4:
time = 798000
flags = 1
data = length 336, hash A64B3042
sample 5:
time = 822000
flags = 1
data = length 336, hash ACA622A1
sample 6:
time = 846000
flags = 1
data = length 288, hash 3E34B8D4
sample 7:
time = 870000
flags = 1
data = length 288, hash 9B96F72A
sample 8:
time = 894000
flags = 1
data = length 336, hash E917C122
sample 9:
time = 918000
flags = 1
data = length 336, hash 10ED1470
sample 10:
time = 942000
flags = 1
data = length 288, hash 706B8A7C
sample 11:
time = 966000
flags = 1
data = length 336, hash 71FFE4A0
sample 12:
time = 990000
flags = 1
data = length 336, hash D4160463
sample 13:
time = 1014000
flags = 1
data = length 336, hash EC557B14
sample 14:
time = 1038000
flags = 1
data = length 288, hash 5598CF8B
sample 15:
time = 1062000
flags = 1
data = length 336, hash 7E0AB41
sample 16:
time = 1086000
flags = 1
data = length 336, hash 1C585FEF
sample 17:
time = 1110000
flags = 1
data = length 336, hash A4A4855E
sample 18:
time = 1134000
flags = 1
data = length 336, hash CECA51D3
sample 19:
time = 1158000
flags = 1
data = length 288, hash 2D362DC5
sample 20:
time = 1182000
flags = 1
data = length 336, hash 9EB2609D
sample 21:
time = 1206000
flags = 1
data = length 336, hash 28FFB3FE
sample 22:
time = 1230000
flags = 1
data = length 288, hash 2AA2D216
sample 23:
time = 1254000
flags = 1
data = length 336, hash CDBC7032
sample 24:
time = 1278000
flags = 1
data = length 336, hash 25B13FE7
sample 25:
time = 1302000
flags = 1
data = length 336, hash DB6BB1E
sample 26:
time = 1326000
flags = 1
data = length 336, hash EBE951F4
sample 27:
time = 1350000
flags = 1
data = length 288, hash 9E2EBFF7
sample 28:
time = 1374000
flags = 1
data = length 336, hash 36A7D455
sample 29:
time = 1398000
flags = 1
data = length 336, hash 84545F8C
sample 30:
time = 1422000
flags = 1
data = length 336, hash F66F3045
sample 31:
time = 1446000
flags = 1
data = length 576, hash 5AB089EA
sample 32:
time = 1470000
flags = 1
data = length 336, hash 8868086
sample 33:
time = 1494000
flags = 1
data = length 336, hash D5EB6D63
sample 34:
time = 1518000
flags = 1
data = length 288, hash 7A5374B7
sample 35:
time = 1542000
flags = 1
data = length 336, hash BEB27A75
sample 36:
time = 1566000
flags = 1
data = length 336, hash E251E0FD
sample 37:
time = 1590000
flags = 1
data = length 288, hash D54C970
sample 38:
time = 1614000
flags = 1
data = length 336, hash 52C473B9
sample 39:
time = 1638000
flags = 1
data = length 336, hash F5F13334
sample 40:
time = 1662000
flags = 1
data = length 480, hash A5F1E987
sample 41:
time = 1686000
flags = 1
data = length 288, hash 453A1267
sample 42:
time = 1710000
flags = 1
data = length 288, hash 7C6C2EA9
sample 43:
time = 1734000
flags = 1
data = length 336, hash F4BFECA4
sample 44:
time = 1758000
flags = 1
data = length 336, hash 751A395A
sample 45:
time = 1782000
flags = 1
data = length 336, hash EE38DB02
sample 46:
time = 1806000
flags = 1
data = length 336, hash F18837E2
sample 47:
time = 1830000
flags = 1
data = length 336, hash ED36B78E
sample 48:
time = 1854000
flags = 1
data = length 336, hash B3D28289
sample 49:
time = 1878000
flags = 1
data = length 288, hash 8BDE28E1
sample 50:
time = 1902000
flags = 1
data = length 336, hash CFD5E966
sample 51:
time = 1926000
flags = 1
data = length 288, hash DC08E267
sample 52:
time = 1950000
flags = 1
data = length 336, hash 6530CB78
sample 53:
time = 1974000
flags = 1
data = length 336, hash 6CC6636E
sample 54:
time = 1998000
flags = 1
data = length 336, hash 613047C1
sample 55:
time = 2022000
flags = 1
data = length 288, hash CDC747BF
sample 56:
time = 2046000
flags = 1
data = length 336, hash AF22AA74
sample 57:
time = 2070000
flags = 1
data = length 384, hash 82F326AA
sample 58:
time = 2094000
flags = 1
data = length 384, hash EDA26C4D
sample 59:
time = 2118000
flags = 1
data = length 336, hash 94C643DC
sample 60:
time = 2142000
flags = 1
data = length 288, hash CB5D9C40
sample 61:
time = 2166000
flags = 1
data = length 336, hash 1E69DE3F
sample 62:
time = 2190000
flags = 1
data = length 336, hash 7E472219
sample 63:
time = 2214000
flags = 1
data = length 336, hash DA47B9FA
sample 64:
time = 2238000
flags = 1
data = length 336, hash DD0ABB7C
sample 65:
time = 2262000
flags = 1
data = length 288, hash DBF93FAC
sample 66:
time = 2286000
flags = 1
data = length 336, hash 243F4B2
sample 67:
time = 2310000
flags = 1
data = length 336, hash 2E881490
sample 68:
time = 2334000
flags = 1
data = length 288, hash 1C28C8BE
sample 69:
time = 2358000
flags = 1
data = length 336, hash C73E5D30
sample 70:
time = 2382000
flags = 1
data = length 288, hash 98B5BFF6
sample 71:
time = 2406000
flags = 1
data = length 336, hash E0135533
sample 72:
time = 2430000
flags = 1
data = length 336, hash D13C9DBC
sample 73:
time = 2454000
flags = 1
data = length 336, hash 63D524CA
sample 74:
time = 2478000
flags = 1
data = length 288, hash A28514C3
sample 75:
time = 2502000
flags = 1
data = length 336, hash 72B647FF
sample 76:
time = 2526000
flags = 1
data = length 336, hash 8F740AB1
sample 77:
time = 2550000
flags = 1
data = length 336, hash 5E3C7E93
sample 78:
time = 2574000
flags = 1
data = length 336, hash 121B913B
sample 79:
time = 2598000
flags = 1
data = length 336, hash 578FCCF2
sample 80:
time = 2622000
flags = 1
data = length 336, hash 5B5823DE
sample 81:
time = 2646000
flags = 1
data = length 384, hash D8B83F78
sample 82:
time = 2670000
flags = 1
data = length 240, hash E649682F
sample 83:
time = 2694000
flags = 1
data = length 96, hash C559A6F4
sample 84:
time = 2718000
flags = 1
data = length 96, hash 792796BC
sample 85:
time = 2742000
flags = 1
data = length 120, hash 8172CD0E
sample 86:
time = 2766000
flags = 1
data = length 120, hash F562B52F
sample 87:
time = 2790000
flags = 1
data = length 96, hash FF8D5B98
tracksEnded = true

View file

@ -0,0 +1,255 @@
seekMap:
isSeekable = true
duration = 2808000
getPosition(0) = [[timeUs=0, position=141]]
getPosition(1) = [[timeUs=0, position=141], [timeUs=702000, position=10413]]
getPosition(1404000) = [[timeUs=1404000, position=19773]]
getPosition(2808000) = [[timeUs=2106000, position=29613]]
numberOfTracks = 1
track 0:
total output bytes = 18528
sample count = 59
format 0:
averageBitrate = 32000
sampleMimeType = audio/mpeg
maxInputSize = 4096
channelCount = 2
sampleRate = 48000
metadata = entries=[TSSE: description=null: values=[Lavf58.29.100]]
sample 0:
time = 1404000
flags = 1
data = length 336, hash 84545F8C
sample 1:
time = 1428000
flags = 1
data = length 336, hash F66F3045
sample 2:
time = 1452000
flags = 1
data = length 576, hash 5AB089EA
sample 3:
time = 1476000
flags = 1
data = length 336, hash 8868086
sample 4:
time = 1500000
flags = 1
data = length 336, hash D5EB6D63
sample 5:
time = 1524000
flags = 1
data = length 288, hash 7A5374B7
sample 6:
time = 1548000
flags = 1
data = length 336, hash BEB27A75
sample 7:
time = 1572000
flags = 1
data = length 336, hash E251E0FD
sample 8:
time = 1596000
flags = 1
data = length 288, hash D54C970
sample 9:
time = 1620000
flags = 1
data = length 336, hash 52C473B9
sample 10:
time = 1644000
flags = 1
data = length 336, hash F5F13334
sample 11:
time = 1668000
flags = 1
data = length 480, hash A5F1E987
sample 12:
time = 1692000
flags = 1
data = length 288, hash 453A1267
sample 13:
time = 1716000
flags = 1
data = length 288, hash 7C6C2EA9
sample 14:
time = 1740000
flags = 1
data = length 336, hash F4BFECA4
sample 15:
time = 1764000
flags = 1
data = length 336, hash 751A395A
sample 16:
time = 1788000
flags = 1
data = length 336, hash EE38DB02
sample 17:
time = 1812000
flags = 1
data = length 336, hash F18837E2
sample 18:
time = 1836000
flags = 1
data = length 336, hash ED36B78E
sample 19:
time = 1860000
flags = 1
data = length 336, hash B3D28289
sample 20:
time = 1884000
flags = 1
data = length 288, hash 8BDE28E1
sample 21:
time = 1908000
flags = 1
data = length 336, hash CFD5E966
sample 22:
time = 1932000
flags = 1
data = length 288, hash DC08E267
sample 23:
time = 1956000
flags = 1
data = length 336, hash 6530CB78
sample 24:
time = 1980000
flags = 1
data = length 336, hash 6CC6636E
sample 25:
time = 2004000
flags = 1
data = length 336, hash 613047C1
sample 26:
time = 2028000
flags = 1
data = length 288, hash CDC747BF
sample 27:
time = 2052000
flags = 1
data = length 336, hash AF22AA74
sample 28:
time = 2076000
flags = 1
data = length 384, hash 82F326AA
sample 29:
time = 2100000
flags = 1
data = length 384, hash EDA26C4D
sample 30:
time = 2124000
flags = 1
data = length 336, hash 94C643DC
sample 31:
time = 2148000
flags = 1
data = length 288, hash CB5D9C40
sample 32:
time = 2172000
flags = 1
data = length 336, hash 1E69DE3F
sample 33:
time = 2196000
flags = 1
data = length 336, hash 7E472219
sample 34:
time = 2220000
flags = 1
data = length 336, hash DA47B9FA
sample 35:
time = 2244000
flags = 1
data = length 336, hash DD0ABB7C
sample 36:
time = 2268000
flags = 1
data = length 288, hash DBF93FAC
sample 37:
time = 2292000
flags = 1
data = length 336, hash 243F4B2
sample 38:
time = 2316000
flags = 1
data = length 336, hash 2E881490
sample 39:
time = 2340000
flags = 1
data = length 288, hash 1C28C8BE
sample 40:
time = 2364000
flags = 1
data = length 336, hash C73E5D30
sample 41:
time = 2388000
flags = 1
data = length 288, hash 98B5BFF6
sample 42:
time = 2412000
flags = 1
data = length 336, hash E0135533
sample 43:
time = 2436000
flags = 1
data = length 336, hash D13C9DBC
sample 44:
time = 2460000
flags = 1
data = length 336, hash 63D524CA
sample 45:
time = 2484000
flags = 1
data = length 288, hash A28514C3
sample 46:
time = 2508000
flags = 1
data = length 336, hash 72B647FF
sample 47:
time = 2532000
flags = 1
data = length 336, hash 8F740AB1
sample 48:
time = 2556000
flags = 1
data = length 336, hash 5E3C7E93
sample 49:
time = 2580000
flags = 1
data = length 336, hash 121B913B
sample 50:
time = 2604000
flags = 1
data = length 336, hash 578FCCF2
sample 51:
time = 2628000
flags = 1
data = length 336, hash 5B5823DE
sample 52:
time = 2652000
flags = 1
data = length 384, hash D8B83F78
sample 53:
time = 2676000
flags = 1
data = length 240, hash E649682F
sample 54:
time = 2700000
flags = 1
data = length 96, hash C559A6F4
sample 55:
time = 2724000
flags = 1
data = length 96, hash 792796BC
sample 56:
time = 2748000
flags = 1
data = length 120, hash 8172CD0E
sample 57:
time = 2772000
flags = 1
data = length 120, hash F562B52F
sample 58:
time = 2796000
flags = 1
data = length 96, hash FF8D5B98
tracksEnded = true

View file

@ -0,0 +1,139 @@
seekMap:
isSeekable = true
duration = 2808000
getPosition(0) = [[timeUs=0, position=141]]
getPosition(1) = [[timeUs=0, position=141], [timeUs=702000, position=10413]]
getPosition(1404000) = [[timeUs=1404000, position=19773]]
getPosition(2808000) = [[timeUs=2106000, position=29613]]
numberOfTracks = 1
track 0:
total output bytes = 8688
sample count = 30
format 0:
averageBitrate = 32000
sampleMimeType = audio/mpeg
maxInputSize = 4096
channelCount = 2
sampleRate = 48000
metadata = entries=[TSSE: description=null: values=[Lavf58.29.100]]
sample 0:
time = 2106000
flags = 1
data = length 384, hash EDA26C4D
sample 1:
time = 2130000
flags = 1
data = length 336, hash 94C643DC
sample 2:
time = 2154000
flags = 1
data = length 288, hash CB5D9C40
sample 3:
time = 2178000
flags = 1
data = length 336, hash 1E69DE3F
sample 4:
time = 2202000
flags = 1
data = length 336, hash 7E472219
sample 5:
time = 2226000
flags = 1
data = length 336, hash DA47B9FA
sample 6:
time = 2250000
flags = 1
data = length 336, hash DD0ABB7C
sample 7:
time = 2274000
flags = 1
data = length 288, hash DBF93FAC
sample 8:
time = 2298000
flags = 1
data = length 336, hash 243F4B2
sample 9:
time = 2322000
flags = 1
data = length 336, hash 2E881490
sample 10:
time = 2346000
flags = 1
data = length 288, hash 1C28C8BE
sample 11:
time = 2370000
flags = 1
data = length 336, hash C73E5D30
sample 12:
time = 2394000
flags = 1
data = length 288, hash 98B5BFF6
sample 13:
time = 2418000
flags = 1
data = length 336, hash E0135533
sample 14:
time = 2442000
flags = 1
data = length 336, hash D13C9DBC
sample 15:
time = 2466000
flags = 1
data = length 336, hash 63D524CA
sample 16:
time = 2490000
flags = 1
data = length 288, hash A28514C3
sample 17:
time = 2514000
flags = 1
data = length 336, hash 72B647FF
sample 18:
time = 2538000
flags = 1
data = length 336, hash 8F740AB1
sample 19:
time = 2562000
flags = 1
data = length 336, hash 5E3C7E93
sample 20:
time = 2586000
flags = 1
data = length 336, hash 121B913B
sample 21:
time = 2610000
flags = 1
data = length 336, hash 578FCCF2
sample 22:
time = 2634000
flags = 1
data = length 336, hash 5B5823DE
sample 23:
time = 2658000
flags = 1
data = length 384, hash D8B83F78
sample 24:
time = 2682000
flags = 1
data = length 240, hash E649682F
sample 25:
time = 2706000
flags = 1
data = length 96, hash C559A6F4
sample 26:
time = 2730000
flags = 1
data = length 96, hash 792796BC
sample 27:
time = 2754000
flags = 1
data = length 120, hash 8172CD0E
sample 28:
time = 2778000
flags = 1
data = length 120, hash F562B52F
sample 29:
time = 2802000
flags = 1
data = length 96, hash FF8D5B98
tracksEnded = true

View file

@ -0,0 +1,487 @@
seekMap:
isSeekable = true
duration = 2808000
getPosition(0) = [[timeUs=0, position=141]]
getPosition(1) = [[timeUs=0, position=141], [timeUs=702000, position=10413]]
getPosition(1404000) = [[timeUs=1404000, position=19773]]
getPosition(2808000) = [[timeUs=2106000, position=29613]]
numberOfTracks = 1
track 0:
total output bytes = 38160
sample count = 117
format 0:
averageBitrate = 32000
sampleMimeType = audio/mpeg
maxInputSize = 4096
channelCount = 2
sampleRate = 48000
metadata = entries=[TSSE: description=null: values=[Lavf58.29.100]]
sample 0:
time = 0
flags = 1
data = length 96, hash 1F161542
sample 1:
time = 24000
flags = 1
data = length 768, hash CD1DC50F
sample 2:
time = 48000
flags = 1
data = length 336, hash 3F64124B
sample 3:
time = 72000
flags = 1
data = length 336, hash 8FFED94E
sample 4:
time = 96000
flags = 1
data = length 288, hash 9CD77D47
sample 5:
time = 120000
flags = 1
data = length 384, hash 24607BB5
sample 6:
time = 144000
flags = 1
data = length 480, hash 4937EBAB
sample 7:
time = 168000
flags = 1
data = length 336, hash 546342B1
sample 8:
time = 192000
flags = 1
data = length 336, hash 79E0923F
sample 9:
time = 216000
flags = 1
data = length 336, hash AB1F3948
sample 10:
time = 240000
flags = 1
data = length 336, hash C3A4D888
sample 11:
time = 264000
flags = 1
data = length 288, hash 7867DA45
sample 12:
time = 288000
flags = 1
data = length 336, hash B1240B73
sample 13:
time = 312000
flags = 1
data = length 336, hash 94CFCD35
sample 14:
time = 336000
flags = 1
data = length 288, hash 94F412C
sample 15:
time = 360000
flags = 1
data = length 336, hash A1D9FF41
sample 16:
time = 384000
flags = 1
data = length 288, hash 2A8DA21B
sample 17:
time = 408000
flags = 1
data = length 336, hash 6A429CE
sample 18:
time = 432000
flags = 1
data = length 336, hash 68853982
sample 19:
time = 456000
flags = 1
data = length 384, hash 1D6F779C
sample 20:
time = 480000
flags = 1
data = length 480, hash 6B31EBEE
sample 21:
time = 504000
flags = 1
data = length 336, hash 888335BE
sample 22:
time = 528000
flags = 1
data = length 336, hash 6072AC8B
sample 23:
time = 552000
flags = 1
data = length 336, hash C9D24234
sample 24:
time = 576000
flags = 1
data = length 288, hash 52BF4D1E
sample 25:
time = 600000
flags = 1
data = length 336, hash F93F4F0
sample 26:
time = 624000
flags = 1
data = length 336, hash 8617688A
sample 27:
time = 648000
flags = 1
data = length 480, hash FAB0D31B
sample 28:
time = 672000
flags = 1
data = length 384, hash FA4B53E2
sample 29:
time = 696000
flags = 1
data = length 336, hash 8C435F6A
sample 30:
time = 720000
flags = 1
data = length 336, hash 60D3F80C
sample 31:
time = 744000
flags = 1
data = length 336, hash DC15B68B
sample 32:
time = 768000
flags = 1
data = length 288, hash FF3DF141
sample 33:
time = 792000
flags = 1
data = length 336, hash A64B3042
sample 34:
time = 816000
flags = 1
data = length 336, hash ACA622A1
sample 35:
time = 840000
flags = 1
data = length 288, hash 3E34B8D4
sample 36:
time = 864000
flags = 1
data = length 288, hash 9B96F72A
sample 37:
time = 888000
flags = 1
data = length 336, hash E917C122
sample 38:
time = 912000
flags = 1
data = length 336, hash 10ED1470
sample 39:
time = 936000
flags = 1
data = length 288, hash 706B8A7C
sample 40:
time = 960000
flags = 1
data = length 336, hash 71FFE4A0
sample 41:
time = 984000
flags = 1
data = length 336, hash D4160463
sample 42:
time = 1008000
flags = 1
data = length 336, hash EC557B14
sample 43:
time = 1032000
flags = 1
data = length 288, hash 5598CF8B
sample 44:
time = 1056000
flags = 1
data = length 336, hash 7E0AB41
sample 45:
time = 1080000
flags = 1
data = length 336, hash 1C585FEF
sample 46:
time = 1104000
flags = 1
data = length 336, hash A4A4855E
sample 47:
time = 1128000
flags = 1
data = length 336, hash CECA51D3
sample 48:
time = 1152000
flags = 1
data = length 288, hash 2D362DC5
sample 49:
time = 1176000
flags = 1
data = length 336, hash 9EB2609D
sample 50:
time = 1200000
flags = 1
data = length 336, hash 28FFB3FE
sample 51:
time = 1224000
flags = 1
data = length 288, hash 2AA2D216
sample 52:
time = 1248000
flags = 1
data = length 336, hash CDBC7032
sample 53:
time = 1272000
flags = 1
data = length 336, hash 25B13FE7
sample 54:
time = 1296000
flags = 1
data = length 336, hash DB6BB1E
sample 55:
time = 1320000
flags = 1
data = length 336, hash EBE951F4
sample 56:
time = 1344000
flags = 1
data = length 288, hash 9E2EBFF7
sample 57:
time = 1368000
flags = 1
data = length 336, hash 36A7D455
sample 58:
time = 1392000
flags = 1
data = length 336, hash 84545F8C
sample 59:
time = 1416000
flags = 1
data = length 336, hash F66F3045
sample 60:
time = 1440000
flags = 1
data = length 576, hash 5AB089EA
sample 61:
time = 1464000
flags = 1
data = length 336, hash 8868086
sample 62:
time = 1488000
flags = 1
data = length 336, hash D5EB6D63
sample 63:
time = 1512000
flags = 1
data = length 288, hash 7A5374B7
sample 64:
time = 1536000
flags = 1
data = length 336, hash BEB27A75
sample 65:
time = 1560000
flags = 1
data = length 336, hash E251E0FD
sample 66:
time = 1584000
flags = 1
data = length 288, hash D54C970
sample 67:
time = 1608000
flags = 1
data = length 336, hash 52C473B9
sample 68:
time = 1632000
flags = 1
data = length 336, hash F5F13334
sample 69:
time = 1656000
flags = 1
data = length 480, hash A5F1E987
sample 70:
time = 1680000
flags = 1
data = length 288, hash 453A1267
sample 71:
time = 1704000
flags = 1
data = length 288, hash 7C6C2EA9
sample 72:
time = 1728000
flags = 1
data = length 336, hash F4BFECA4
sample 73:
time = 1752000
flags = 1
data = length 336, hash 751A395A
sample 74:
time = 1776000
flags = 1
data = length 336, hash EE38DB02
sample 75:
time = 1800000
flags = 1
data = length 336, hash F18837E2
sample 76:
time = 1824000
flags = 1
data = length 336, hash ED36B78E
sample 77:
time = 1848000
flags = 1
data = length 336, hash B3D28289
sample 78:
time = 1872000
flags = 1
data = length 288, hash 8BDE28E1
sample 79:
time = 1896000
flags = 1
data = length 336, hash CFD5E966
sample 80:
time = 1920000
flags = 1
data = length 288, hash DC08E267
sample 81:
time = 1944000
flags = 1
data = length 336, hash 6530CB78
sample 82:
time = 1968000
flags = 1
data = length 336, hash 6CC6636E
sample 83:
time = 1992000
flags = 1
data = length 336, hash 613047C1
sample 84:
time = 2016000
flags = 1
data = length 288, hash CDC747BF
sample 85:
time = 2040000
flags = 1
data = length 336, hash AF22AA74
sample 86:
time = 2064000
flags = 1
data = length 384, hash 82F326AA
sample 87:
time = 2088000
flags = 1
data = length 384, hash EDA26C4D
sample 88:
time = 2112000
flags = 1
data = length 336, hash 94C643DC
sample 89:
time = 2136000
flags = 1
data = length 288, hash CB5D9C40
sample 90:
time = 2160000
flags = 1
data = length 336, hash 1E69DE3F
sample 91:
time = 2184000
flags = 1
data = length 336, hash 7E472219
sample 92:
time = 2208000
flags = 1
data = length 336, hash DA47B9FA
sample 93:
time = 2232000
flags = 1
data = length 336, hash DD0ABB7C
sample 94:
time = 2256000
flags = 1
data = length 288, hash DBF93FAC
sample 95:
time = 2280000
flags = 1
data = length 336, hash 243F4B2
sample 96:
time = 2304000
flags = 1
data = length 336, hash 2E881490
sample 97:
time = 2328000
flags = 1
data = length 288, hash 1C28C8BE
sample 98:
time = 2352000
flags = 1
data = length 336, hash C73E5D30
sample 99:
time = 2376000
flags = 1
data = length 288, hash 98B5BFF6
sample 100:
time = 2400000
flags = 1
data = length 336, hash E0135533
sample 101:
time = 2424000
flags = 1
data = length 336, hash D13C9DBC
sample 102:
time = 2448000
flags = 1
data = length 336, hash 63D524CA
sample 103:
time = 2472000
flags = 1
data = length 288, hash A28514C3
sample 104:
time = 2496000
flags = 1
data = length 336, hash 72B647FF
sample 105:
time = 2520000
flags = 1
data = length 336, hash 8F740AB1
sample 106:
time = 2544000
flags = 1
data = length 336, hash 5E3C7E93
sample 107:
time = 2568000
flags = 1
data = length 336, hash 121B913B
sample 108:
time = 2592000
flags = 1
data = length 336, hash 578FCCF2
sample 109:
time = 2616000
flags = 1
data = length 336, hash 5B5823DE
sample 110:
time = 2640000
flags = 1
data = length 384, hash D8B83F78
sample 111:
time = 2664000
flags = 1
data = length 240, hash E649682F
sample 112:
time = 2688000
flags = 1
data = length 96, hash C559A6F4
sample 113:
time = 2712000
flags = 1
data = length 96, hash 792796BC
sample 114:
time = 2736000
flags = 1
data = length 120, hash 8172CD0E
sample 115:
time = 2760000
flags = 1
data = length 120, hash F562B52F
sample 116:
time = 2784000
flags = 1
data = length 96, hash FF8D5B98
tracksEnded = true

View file

@ -17,7 +17,9 @@ track 0:
height = 144
frameRate = 15.00
colorInfo:
colorSpace = 1
colorRange = 2
colorTransfer = 3
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[Mp4Timestamp: creation time=3000000000, modification time=4000000000, timescale=10000]

View file

@ -19,7 +19,9 @@ track 0:
height = 144
frameRate = 15.00
colorInfo:
colorSpace = 1
colorRange = 2
colorTransfer = 3
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[Mp4Timestamp: creation time=3000000000, modification time=4000000000, timescale=10000]

View file

@ -17,7 +17,9 @@ track 0:
height = 720
frameRate = 29.97
colorInfo:
colorSpace = 1
colorRange = 2
colorTransfer = 3
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[Mp4Timestamp: creation time=3000000000, modification time=4000000000, timescale=10000]

View file

@ -19,7 +19,9 @@ track 0:
height = 480
frameRate = 30.00
colorInfo:
colorSpace = 1
colorRange = 2
colorTransfer = 3
lumaBitdepth = 8
chromaBitdepth = 8
metadata = entries=[Mp4Timestamp: creation time=3000000000, modification time=4000000000, timescale=10000]