40 Commits

Author SHA1 Message Date
rohks
c78abaac3f Simplify Flac extension build process
Removed `Android.mk` and `Application.mk`, allowing `CMake` to run directly from the build.gradle file. Users no longer need to check out `NDK` or depend on it, simplifying the usage of the Flac extension.

Also fixed a copy-pasted comment in `CMakeLists.txt` of Opus and IAMF.

PiperOrigin-RevId: 684769561
2024-10-11 03:09:32 -07:00
rohks
a2eda3348b Simplify Opus extension build process
Removed `Android.mk` and `Application.mk`, allowing `CMake` to run directly from the build.gradle file. Users no longer need to check out `NDK` or depend on it, simplifying the usage of the Opus extension.

PiperOrigin-RevId: 684489927
2024-10-10 10:23:26 -07:00
rohks
2640ebd58f Add 16 KB page support for decoder extensions on Android 15
We need to rebuild any native components of the app to prevent crashes on devices with 16 KB page support.

Tested on a device that supports 16 KB pages and runs Android 15, as well as on older Android devices.

Issue: androidx/media#1685
PiperOrigin-RevId: 684488244
2024-10-10 10:18:20 -07:00
Gaëtan Muller
71b8c32a6f Remove Multidex 2024-07-24 16:17:00 +01:00
ibaker
4fc66f42d6 Move OpusDecoderTest from /test/ (Robolectric) to /androidTest/
The dependency on the native `opusV2JNI` library doesn't work from
Robolectric, so the `assumeTrue` statements in this test always fail,
and the tests are always skipped. Moving it to an instrumentation test
allows the native library to be successfully loaded, and the test to be
run.

PiperOrigin-RevId: 655570129
2024-07-24 08:11:13 -07:00
bachinger
4777d62d31 Rollback of 8e2869278c
PiperOrigin-RevId: 607264513
2024-02-15 02:35:12 -08:00
asinclair
8e2869278c Internal Cleanup
PiperOrigin-RevId: 607117264
2024-02-14 15:06:10 -08:00
tonihei
ed5b7004b4 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
2024-01-26 10:06:18 -08:00
jbibik
e51c293f75 Plumb SubtitleParser.Factory into MatroskaExtractor
MatroskaExtractor will no longer be wrapped in SubtitleTranscodingExtractor, but instead use SubtitleTranscodingExtractorOutput under the hood.

FLAG_EMIT_RAW_SUBTITLE_DATA flag will be used to toggle between subtitle parsing during extraction (before the sample queue) or during decoding (after the sample queue).

The new extractor dump files generated by `MatroskaExtractorTest` now follow the new parsing logic and hence have mimeType as `x-media3-cues`.

PiperOrigin-RevId: 598616231
2024-01-15 08:32:22 -08:00
tonihei
b1541b096f 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

#minor-release

PiperOrigin-RevId: 588004832
2023-12-05 03:01:32 -08:00
tonihei
c8aac24ffd 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
2023-10-03 04:28:21 -07:00
tonihei
2322462404 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.

#minor-release

PiperOrigin-RevId: 543420218
2023-06-29 22:50:04 +00:00
ibaker
7e6dae7b31 Remove exoplayer2-only javadoc machinery from media3
This introduces whitespace-only changes in exoplayer2 due to the way
copybara stripping works.

PiperOrigin-RevId: 537296933
2023-06-05 09:47:58 +00:00
ibaker
b3db85133a Add android.namespace to all build.gradle files
This is a pre-requisite for the Android Studio upgrade assistant to
upgrade from AGP 7.2.2 to 8.0.1, otherwise it fails and complains
this is missing.

Issue: androidx/media#409
PiperOrigin-RevId: 533463246
2023-05-19 17:19:15 +01:00
tonihei
889f435a49 Update dependencies to latest versions
The only dependencies that are not updated are the ones that need
to be kept in sync with other system (like Android source tree) or
would require a Kotlin dependency in common or exoplayer modules.

As a side effect, some demo apps now need a Kotlin config and some
additional modules require desugaring/multidex logic. To simplify
the setup, the desugaring and multidex steps are added to the common
config.

PiperOrigin-RevId: 527243950
2023-04-26 15:49:57 +01:00
rohks
e4cb583af2 Remove Javadoc TODO from README of decoder extensions
As most classes are used via interface only and people depending on it locally can always find the Javadoc in Android Studio directly, we don't plan to add Javadocs for these extensions module in developer.android.com.

PiperOrigin-RevId: 521993756
2023-04-05 15:48:58 +01:00
rohks
766e7d7d35 Add media3 guide entries in README files
PiperOrigin-RevId: 520650881
2023-03-30 17:28:03 +00:00
rohks
6a928805d4 Fix javadoc links in media README files
Also fixed the javadoc link in devsite and removed javadoc links from decoder extensions as it is not published yet on developer.android.com.

#minor-release

PiperOrigin-RevId: 520636868
2023-03-30 17:26:40 +00:00
ibaker
636a4a8538 Add javadoc links to README files
Fix some other link titles and destinations spotted along the way.

#minor-release

PiperOrigin-RevId: 493276172
2022-12-12 11:19:23 +00:00
ibaker
45b8fb0ae1 Add set -eu to all shell scripts
These flags ensure that any errors cause the script to exit (instead of
just carrying on) (`-e`) and that any unrecognised substitution variables
cause an error instead of silently resolving to an empty string (`-u`).

Issues like Issue: google/ExoPlayer#10791 should be more quickly resolved with
`set -e` because the script will clearly fail with an error like
`make: command not found` which would give the user a clear pointer
towards the cause of the problem.

#minor-release

PiperOrigin-RevId: 490001419
2022-11-22 10:11:32 +00:00
ibaker
0388631ee2 Remove @hide javadoc annotation from ExoPlayer GitHub
This tag is only understood by Dackka, which is used to generate the media3 javadoc.

PiperOrigin-RevId: 489233200
2022-11-22 09:58:02 +00:00
ibaker
e9ddfa5336 Fix Dackka/Metalava errors in av1, flac, ffmpeg, midi, and opus modules
This uses `@hide` on `protected final` methods to hide them from Dackka
javadoc generation, since these methods are inaccessible to developers
anyway. These symbols will still (currently) be included in artefacts
distributed on Maven (because we don't run Metalava as part of
generating these artefacts).

In some cases I had to change the visibility/finality of methods to make
them `protected final` before adding the `@hide` annotation (but
the impact should be very low, since most of these methods were either
already unusable by app developers, or they shouldn't have been used).

#minor-release

PiperOrigin-RevId: 487472907
2022-11-10 14:44:16 +00:00
samrobinson
fc34542864 Move AudioProcessor to common.
PiperOrigin-RevId: 483699606
2022-10-31 11:34:30 +00:00
bachinger
2625061ec0 Add manifest to make gradle build work
PiperOrigin-RevId: 481606248
2022-10-17 16:05:52 +00:00
rohks
c96e010d35 Fix instrumentation tests not working via Gradle
PiperOrigin-RevId: 475560401
2022-09-30 18:03:11 +00:00
rohks
5b3f320230 Switch incorrectly configured native multidex to legacy
Native multidex can only be used for binaries with minSdkVersion of 21 or higher, but minSdkVersion was specified to 16.

PiperOrigin-RevId: 470003836
2022-09-30 17:04:29 +00:00
rohks
280705734d Replace usage of android_binary with build_test for libraries
`android_binary` is only required when building an application.

PiperOrigin-RevId: 469413752
2022-09-30 16:57:17 +00:00
bachinger
55a194c575 Ignore decoding test cases when library not available
#minor-release

PiperOrigin-RevId: 452043577
2022-05-31 15:00:28 +00:00
bachinger
5cdac6575e Add explicit cast to ByteBuffer for Java 8 compatibility
PiperOrigin-RevId: 451994696
2022-05-31 10:43:00 +00:00
olly
f1e59f8001 Libopus Support For WebM DiscardPadding
PiperOrigin-RevId: 429364728
2022-02-18 14:56:25 +00:00
olly
09772908b3 Make sure native library loads use correct class loader
Merge of https://github.com/google/ExoPlayer/pull/9934

#minor-release

PiperOrigin-RevId: 429259055
2022-02-17 15:00:31 +00:00
olly
8d09da4abf Trim CodecDelay/PreSkip In New OpusDecoder Instances By Default
PiperOrigin-RevId: 427819209
2022-02-17 10:18:14 +00:00
olly
64b56cf184 Include opusV2JNI Target In Non-Android Builds
Allow opusV2JNI to be built-for & included-in non-Android build targets by ifdef'ing out the liblog dependency. Also removed libz and libandroid dependencies.

PiperOrigin-RevId: 427269838
2022-02-17 10:03:47 +00:00
tonihei
287182952d Fix the position of IntDefs to match TYPE_USE
#minor-release

PiperOrigin-RevId: 427131569
2022-02-08 11:07:50 +00:00
olly
1270eb012d Fix For Sample-To-Bytes Calculation In OpusDecoder
Aligning the byte size calculation with the sizes defined in opus_jni.cc
for the `outputFloat=true` case

#minor-release

PiperOrigin-RevId: 427028982
2022-02-08 11:07:50 +00:00
olly
1f7174e731 Revert of 87420e5f9bd1671cd3068185f7358f5faba53e71
PiperOrigin-RevId: 426996878
2022-02-08 11:07:43 +00:00
ibaker
87420e5f9b Fix the position of IntDefs to match TYPE_USE
#minor-release

PiperOrigin-RevId: 426855255
2022-02-07 10:49:31 +00:00
olly
6ad19d65c0 Fix 1 ErrorProneStyle finding:
* @CryptoType is a TYPE_USE annotation, so should appear after modifiers and directly before the type.

PiperOrigin-RevId: 418814902
2022-01-05 12:15:12 +00:00
bachinger
222db48298 Make package in test manifest consistent
PiperOrigin-RevId: 406255369
2021-11-08 15:18:26 +00:00
Andrew Lewis
933e207b3e Update to androidx.media3
PiperOrigin-RevId: 405656499
2021-10-27 09:12:46 +01:00