21347 Commits

Author SHA1 Message Date
Copybara-Service
1bb48b1c47 Merge pull request #1616 from colinkho:chmain
PiperOrigin-RevId: 665779059
2024-08-21 02:32:16 -07:00
kimvde
51622b6d80 Add BufferingVideoSink
PiperOrigin-RevId: 665733825
2024-08-21 00:15:25 -07:00
Copybara-Service
5304f227a7 Merge pull request #1624 from colinkho:comain
PiperOrigin-RevId: 665430514
2024-08-20 10:47:43 -07:00
Ian Baker
bed1dadcbf Add release note 2024-08-20 17:50:58 +01:00
Ian Baker
9c25845cd7 Restore a couple of blank lines 2024-08-20 17:47:48 +01:00
Ian Baker
a6f5d3daf5 Format with google-java-format 2024-08-20 17:47:48 +01:00
Colin Kho
0a0444b9a5 Use Suppliers.memoize for lazy instantiation of AudioManager 2024-08-20 17:47:47 +01:00
Colin Kho
6af92b0af3 Differ AudioManager retrieval to whenever AudioFocusManagement is required 2024-08-20 17:47:47 +01:00
sheenachhabra
4b7c5100f1 Move moov box generation to Boxes.java
This is a no-op change.
Like all other boxes, moov box creation can also be in
Boxes.java class.

PiperOrigin-RevId: 665359529
2024-08-20 07:47:58 -07:00
rohks
f52ca07446 Add option to enable index-based seeking in AmrExtractor
This allows seek operations in files that were previously unseekable, particularly those with variable bitrate (VBR) or constant bitrate (CBR) with silence frames.

New samples for tests were created by adding silence frames to existing narrowband and wideband versions.

PiperOrigin-RevId: 665349241
2024-08-20 07:17:26 -07:00
Copybara-Service
24f3856ea4 Merge pull request #1580 from colinkho:main
PiperOrigin-RevId: 665330328
2024-08-20 06:17:20 -07:00
Ian Baker
41430aaa0c Fix annotation position and clarify javadoc 2024-08-20 13:42:00 +01:00
sheenachhabra
bb3948aa98 Implement interleaving of editable video tracks
The CL adds another way of writing editable video
tracks where the samples will be interleaved with the
primary track samples in the "mdat" box.

PiperOrigin-RevId: 665313751
2024-08-20 05:28:29 -07:00
Copybara-Service
643ec73e58 Merge pull request #1607 from colinkho:atom
PiperOrigin-RevId: 665285219
2024-08-20 04:03:45 -07:00
ibaker
b04b270c2b Use SubtitleExtractor from MediaParserChunkExtractor
This uses a 'bundled' extractor (`SubtitleExtractor`) because
`MediaParser` doesn't support transcoding subtitles to
`application/x-media3-cues`. This transcoding is required to support
non-legacy subtitle handling where they are parsed during extraction,
instead of during rendering.

PiperOrigin-RevId: 665282298
2024-08-20 03:54:17 -07:00
Ian Baker
af5df6e700 Add retryCount parameter to make it clear onLoadStarted is called for retries too 2024-08-20 11:28:18 +01:00
Colin Kho
33d9b78e21 Fix javadoc of onLoadStarted & remove error information as fields 2024-08-20 11:13:41 +01:00
Colin Kho
1cc1bf02ef Added onLoadStarted callback to Loader's callback 2024-08-20 11:13:41 +01:00
Ian Baker
2e49e91c84 Rename to singular BoxParser for consistency with other types like ColorParser 2024-08-20 11:11:14 +01:00
Ian Baker
77f3ef9b25 Add @UnstableApi annotation 2024-08-20 11:09:50 +01:00
Ian Baker
2dd6794ba0 More atom -> box updates in public API surface 2024-08-20 11:09:50 +01:00
Colin Kho
3a95b24afc Rename BoxParsers tag from AtomParsers to BoxParsers 2024-08-20 11:09:50 +01:00
Colin Kho
6ba9c9ff9e Rename AtomParsers to BoxParsers 2024-08-20 11:09:50 +01:00
Colin Kho
0b5443c450 Make Extractor/Mp4 Atom Parsing code reusable by external custom mp4 extractors 2024-08-20 11:09:50 +01:00
kimvde
266f16823f Remove VideoSink.isFrameDropAllowedOnInput
This is an unnecessary layer

PiperOrigin-RevId: 665267029
2024-08-20 03:09:13 -07:00
kimvde
9b69690856 Move some tests from CompositionPlaybackTest out of performance
directory

PiperOrigin-RevId: 665202382
2024-08-20 00:13:21 -07:00
Colin Kho
f9f3e67ee2 Include initialization chunk wording in getChunkIndex method 2024-08-19 10:31:34 -07:00
Colin Kho
4a6c5c7598 Cache ChunkIndex once load is done 2024-08-19 10:28:14 -07:00
ktrajkovski
ab366e2626 Fix licensing link from http to https in IAMF related files.
PiperOrigin-RevId: 664845636
2024-08-19 09:38:49 -07:00
claincly
677f8ad9f4 Fix edge case: no frame between trim position and the next sync sample
PiperOrigin-RevId: 664841893
2024-08-19 09:32:32 -07:00
ktrajkovski
63b45b7503 Build IAMF libraries with gradle and ndk-build.
In order to support building with `gradle` a new `build.gradle` file was added together with `Android.mk`, `Application.mk`, and `libiamf.mk` necessary for local builds with NDK.

After this change, IAMF files may also be played in the ExoPlayer demo built locally (without blaze).

PiperOrigin-RevId: 664841684
2024-08-19 09:29:47 -07:00
tonihei
ba00798451 Make NalUnitTargetBuffer public
This class is a useful utility for custom TS parsers that operate
on NAL units.

PiperOrigin-RevId: 664795988
2024-08-19 07:23:05 -07:00
kimvde
cd0a7e1143 Document why playback tests are in the performance package
PiperOrigin-RevId: 664792272
2024-08-19 07:14:32 -07:00
kimvde
b95b534f68 Fix inverted colors in call to Color.rgb
PiperOrigin-RevId: 664716252
2024-08-19 03:00:45 -07:00
sheenachhabra
ed905a6498 Refactor pending sample writing logic in Mp4Writer
The refactored method can be reused when implementing depth/editing format
interleave mode.

PiperOrigin-RevId: 663774290
2024-08-16 10:29:32 -07:00
ibaker
3600d04719 Deprecate SingleSampleMediaChunk
This is only used as part of legacy subtitle decoding. If any apps are
using it directly (rather than via `DashMediaSource` or `SsMediaSource`)
they probably need to enable legacy decoding in `TextRenderer` to avoid
playback failures.

PiperOrigin-RevId: 663740343
2024-08-16 08:36:38 -07:00
ibaker
91a95e23c9 Remove CueDecoder.decode overload without length & offset params
This method is only used in tests, so let's remove it and just test the
one that takes `length` and `offset`.

PiperOrigin-RevId: 663731139
2024-08-16 07:59:12 -07:00
tianyifeng
1ffc962fde Update translations
#cherrypick

PiperOrigin-RevId: 663705597
2024-08-16 06:06:40 -07:00
Googler
afac17bef0 Mp4Muxer: Add support for Vp9 codec
Implement vpcCBox to provide support for muxing video encoded using the VP9 codec.

PiperOrigin-RevId: 663603654
2024-08-15 22:34:56 -07:00
jbibik
c3313c0049 Add jvmTarget and kotlin-android plugin to common_ktx module
According to https://kotlinlang.org/docs/gradle-configure-project.html#check-for-jvm-target-compatibility-of-related-compile-tasks and https://kotlinlang.org/docs/gradle-configure-project.html#what-can-go-wrong-if-targets-are-incompatible, we require explicit jvmTarget setting in order not to run into:

`'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.`

Missing the plugin and the jvmTarget resulted in a failed `compileDebugKotlin` task for any application code, which was trying to import common_ktx functions (e.g. `Player.listen` with `Unresolved reference: listen` error)

PiperOrigin-RevId: 663358677
2024-08-15 10:36:10 -07:00
Colin Kho
1c1fd4d8b8 Add getter for ChunkIndex on InitializationChunk 2024-08-15 10:00:56 -07:00
rohks
50708f8c37 Add AmrExtractor tests with FLAG_ENABLE_CONSTANT_BITRATE_SEEKING_ALWAYS
PiperOrigin-RevId: 663320349
2024-08-15 08:53:28 -07:00
tonihei
b58a1d16f7 Split DefaultAudioSink.writeBuffer in two seperate steps
The method currently has two ways of operating with a complicated
contract:
 1. outputBuffer == null -> sets a new outputBuffer and starts
    draining it as far as possible.
 2. outputBuffer != null -> continues draining a previous buffer,
    requires that the input parameter is the same as outputBuffer.

This contract can be made cleaner by splitting the logic into
(1) setting a new output buffer and (2) draining the output buffer.

Only one parameter is needed for each method and there is no
requirement to pass in the same argument as before because we already
know what we are draining. This also means the caller of the method
doesn't have to keep track of the actual outputBuffer, allowing
further processing steps in the future that change the drained
instance.

PiperOrigin-RevId: 663316251
2024-08-15 08:33:31 -07:00
sheenachhabra
7a1f3629ff Extract method to find minimum presentation timestamp across tracks
This is a ground work of implementing depth/editing format interleave mode.

PiperOrigin-RevId: 663301670
2024-08-15 07:40:27 -07:00
ibaker
873ec1544e Remove nested import of Player.Events from PlayerExtensions.listen
This makes it clearer that the part inside and outside the parentheses
are clearly different, and not "just" a reference to `Player.Events`.
Specifically this syntax is showing that the function has a `Player`
"receiver", **and** is a function from `Player.Events` to `Unit`.

https://kotlinlang.org/docs/lambdas.html#function-types

PiperOrigin-RevId: 663293405
2024-08-15 07:07:48 -07:00
ibaker
ee27334f06 Rename Atom to Mp4Box, and move it to container module
This makes the class available to custom MP4-parsing implementations,
while also allowing it to be used by `muxer` in future.

'Box' is the term used throughout the ISO 14496-12 spec, while the
'Atom' nomenclature was used in an earlier form of the spec
(Quicktime).

This change moves it from `extractor.mp4.Atom` to `container.Mp4Box`,
to be consistent with existing MP4-specific types in the `container`
module like `Mp4TimestampData`.

PiperOrigin-RevId: 663274752
2024-08-15 05:44:32 -07:00
sheenachhabra
4df5ecb045 Rename flushPending() to writePendingTrackSamples()
The new name is more readable

PiperOrigin-RevId: 663264188
2024-08-15 04:54:19 -07:00
ktrajkovski
fc18ad3135 Add LibiamfAudioRenderer's constructor to proguard rules.
Making a change to the `proguard-rules.txt` also requires a test added as `IamfModuleProguard`.

PiperOrigin-RevId: 663239150
2024-08-15 02:55:38 -07:00
sheenachhabra
68eaa061e0 Add support for depth/editing file format in Mp4Extractor
PiperOrigin-RevId: 662956209
2024-08-14 09:55:01 -07:00
claincly
92635342fb Move the test of removeAudio to robolectric
The audio mixing is not deterministic on real device testing because of
threading, but runs deterministically on robolectric tests

PiperOrigin-RevId: 662925912
2024-08-14 08:23:22 -07:00