154 Commits

Author SHA1 Message Date
krocard
97206b9c72 Add a builder to DefaultAudioSink
`DefaultAudioSink` already has 3 telescoping
constructors and an other one would be have been
needed to add a buffer size tuning option.

PiperOrigin-RevId: 414703366
2021-12-08 10:01:38 +00:00
bachinger
7975182856 Make package in test manifest consistent
PiperOrigin-RevId: 406255369
2021-10-29 11:35:26 +01:00
andrewlewis
0ad1cdbfa1 Tidy READMEs
PiperOrigin-RevId: 405598530
2021-10-26 14:08:21 +01:00
olly
37b5847681 Get decoder buffers into the right place
PiperOrigin-RevId: 404876228
2021-10-21 23:16:02 +01:00
olly
ce17f61899 Add decoder module
PiperOrigin-RevId: 404810682
2021-10-21 18:41:33 +01:00
olly
db84773c01 Further README tweaks
PiperOrigin-RevId: 402811825
2021-10-13 20:18:36 +01:00
olly
eeec2b2e77 Final README updates
PiperOrigin-RevId: 402547071
2021-10-12 19:52:39 +01:00
olly
e4a5c07b5f Mechanical README cleanups 2
PiperOrigin-RevId: 401777730
2021-10-09 18:18:12 +01:00
olly
e7c6ed5e7f Mechanical README cleanups
PiperOrigin-RevId: 401767060
2021-10-09 18:14:36 +01:00
ibaker
ad99a44083 Add empty sdk-version node to all AndroidManifest.xml files
PiperOrigin-RevId: 397772916
2021-09-21 14:17:33 +01:00
andrewlewis
be1fe08ba5 Add license headers
PiperOrigin-RevId: 394176546
2021-09-02 09:42:10 +01:00
olly
85142be9a4 DRM refactor / cleanup
PiperOrigin-RevId: 391403236
2021-08-19 10:42:56 +01:00
kimvde
01613a2e55 Remove usages of deprecated SimpleExoPlayer.Builder
PiperOrigin-RevId: 390130681
2021-08-11 17:34:19 +01:00
olly
937bc008c1 Use correct IntDef in FFmpegAudioDecoder
PiperOrigin-RevId: 389840014
2021-08-10 14:54:42 +01:00
ibaker
0df0df9aee Remove @DoNotInstrument from test classes
This isn't needed now we've updated to Robolectric 4.6

PiperOrigin-RevId: 383109343
2021-07-09 08:58:38 +01:00
olly
a3dbd61239 Remove obsolete Checker Framework suppression strings
More information: go/checker-3130-lsc

Tested:
    Some test failures are present, but the CL author has decided to mail the change anyway
PiperOrigin-RevId: 379622938
2021-06-21 21:56:37 +01:00
olly
4b30cca914 Update @SuppressWarnings annotations for go/nullness diagnostics
in preparation for upgrading the version of the Checker Framework in google3.

More information: go/checker-3110-lsc

PiperOrigin-RevId: 377925828
2021-06-08 13:02:47 +01:00
olly
0de6bc861a Format *_jni.cc files
PiperOrigin-RevId: 374830877
2021-05-20 15:40:34 +01:00
bachinger
4c1a294b2e Format Java source files
PiperOrigin-RevId: 372127633
2021-05-06 13:32:25 +01:00
bachinger
39ac09e7c6 Add @DoNotInstrument for unit test classes of extensions
PiperOrigin-RevId: 372101509
2021-05-06 13:32:05 +01:00
bachinger
cdff456621 Make copybara remove the LINT.IfChange tag
PiperOrigin-RevId: 371135534
2021-04-29 17:35:05 +01:00
olly
87d8907b4b Fix 4 ErrorProneStyle findings:
* @Encoding is not a TYPE_USE annotation, so should appear before any modifiers and after Javadocs.
  (see go/java-style#s4.8.5-annotations) (2 times)
* @Nullable is not a TYPE_USE annotation, so should appear before any modifiers and after Javadocs.
  (see go/java-style#s4.8.5-annotations) (2 times)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Suggest a fix on the CL (go/how-to-suggest-fix).
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if the change looks generally problematic.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/exoplayer/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

PiperOrigin-RevId: 370048160
2021-04-26 17:48:23 +01:00
ibaker
dafea4e40f Re-format some javadoc
PiperOrigin-RevId: 369642047
2021-04-21 18:46:00 +01:00
olly
1315e11bfd Ffmpeg extension: Wait for channel count and sample rate
When playing TrueHD streams, it's possible that the first decoded
buffer is empty, and that the channel count and sample rate are
still unknown. To correct for this, defer determining the format
until a buffer that will actually be output from the decoder has
been obtained, and only then query the channel count and sample
rate.

Issue: #8616
#minor-release
PiperOrigin-RevId: 366246245
2021-04-01 16:06:59 +01:00
andrewlewis
86a0a405b6 Update instructions for GMaven releasing
Issue: #5246

#minor-release

PiperOrigin-RevId: 366041182
2021-04-01 16:05:53 +01:00
kimvde
718c1e773e Update extensions NDK version to latest LTS version
Latest LTS version is better than latest stable version because it will
be supported for longer.

#minor-release
Issue:#8581
PiperOrigin-RevId: 359467482
2021-02-25 09:18:58 +00:00
kimvde
926884d2f2 Upgrade extensions NDK version
#minor-release
Issue:#8581
PiperOrigin-RevId: 357563419
2021-02-19 10:56:02 +00:00
aquilescanta
054bff80fd Fix ffmpeg build script's strip tool for armeabi-v7a
Broken in bf21e3c690.

PiperOrigin-RevId: 344777455
2020-11-30 16:11:19 +00:00
krocard
538445572d Move FormatSupport in common
#player-to-common

PiperOrigin-RevId: 344558028
2020-11-30 09:33:11 +00:00
aquilescanta
1cdf5e79e3 Rename the FFMPEG extension binary to ffmpegJNI
Instead of ffmpeg_jni for consistency with other extensions.

PiperOrigin-RevId: 344411014
2020-11-27 11:07:55 +00:00
aquilescanta
bf21e3c690 Make libffmpeg_jni link statically against ffmpeg
Also make compilation automatically determine the number of
threads to use during compilation.

PiperOrigin-RevId: 344264761
2020-11-27 11:07:15 +00:00
tonihei
f13ffb4390 Rollback of 5d9c2d7b6a
*** Original commit ***

Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.

***

PiperOrigin-RevId: 343086403
2020-11-18 18:40:30 +00:00
olly
3c91ba14b3 Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.
PiperOrigin-RevId: 343003559
2020-11-18 18:40:17 +00:00
olly
c47e62209d Report reasons for not being able to reuse decoders
PiperOrigin-RevId: 342344090
2020-11-16 16:49:48 +00:00
olly
744c57c87d More verbose instructions for consistency
PiperOrigin-RevId: 332015471
2020-09-16 17:00:52 +01:00
aquilescanta
a3cd36beb1 Update the FFmpeg extension readme to use symlinking
PiperOrigin-RevId: 332012857
2020-09-16 16:37:08 +01:00
aquilescanta
b866c5e424 Fix the FFmpeg extension build
Since gradle 4.0, CMake imported libraries are bundled in the APK, so
manually bundling them causes a duplication which breaks the build.

Issue: #7906
PiperOrigin-RevId: 332012375
2020-09-16 16:36:59 +01:00
olly
3110587fbe Fix extension renderer test names + add FfmpegVideo case
PiperOrigin-RevId: 330409635
2020-09-09 09:41:32 +01:00
tonihei
ad346fbdbe Fix FfmpegVideoRenderer tag
PiperOrigin-RevId: 325857202
2020-08-17 16:08:06 +01:00
olly
4d03d30890 Audio extension decoders: Pass decoder to getOutputFormat
It seems generally useful to have access to the decoder in
getOutputFormat. We're currently working around lack of access
by using member variables in the concrete audio extension
renderers. In the case of the Ffmpeg extension, holding a
reference to the decoder is preventing it from being garbage
collected when the decoder is released by the base class.

PiperOrigin-RevId: 324799670
2020-08-07 19:00:18 +01:00
aquilescanta
684994fe61 Remove Renderer references to Format.drmInitData
PiperOrigin-RevId: 323392470
2020-07-28 00:00:27 +01:00
aquilescanta
19602ca4ca Use CMake to build the ffmpeg audio extension
PiperOrigin-RevId: 322793308
2020-07-24 10:48:16 +01:00
olly
6d92eebe51 Revert Format back to only containing audio encoding for PCM
PiperOrigin-RevId: 322683545
2020-07-24 10:46:37 +01:00
olly
5c9c0e2073 Improve handling of floating point audio
- DefaultAudioSink always supports floating point input. Make it
  advertise this fact.
- Remove the ability to enable/disable floating point output in
  FfmpegAudioRenderer, since this ability is now also provided on
  DefaultAudioSink.
- Let FfmpegAudioRenderer query the sink to determine whether it
  will output floating point PCM directly or resample it to 16-bit
  PCM.

PiperOrigin-RevId: 320945360
2020-07-13 17:00:10 +01:00
olly
e8596428c0 Pass correct formats to AudioSink
The renderers are currently constructing formats that consist of their
input format with added PCM encoding. Such formats are not self-consistent,
and this only works because DefaultAudioSink ignores the rest of the
format if the format has a PCM encoding. It would not work if the sink
implementation checked the MIME type, for example, which wouldn't be a
strange or incorrect thing for it to do.

The more correct approach is to construct a new format that properly
represents the PCM that will be provided to the sink.

This change also renames supportsOutput to supportsFormat, because
AudioSink itself has both an input and an output side, and this method
is actually evaluating support on the input side of the sink.

PiperOrigin-RevId: 320396089
2020-07-10 09:09:02 +01:00
krocard
78825a41dc Store encodings in Format instead of just pcm encodings
Previously only pcm encoding were stored in Format,
this was an issue as for audio passthrough and offload
lots of code needs to pass complex format informations
(encoding, sample rate, channel count, gapless metadata)
but could not use Format and each function was taking
each as different parameter.

By allowing Format to contain any encoding, and not only
pcmEncoding, it allows to pass a Format everywhere in ExoPlayer
code that needs a Format.

This patch does not have any functional change. It is only an internal refactor.

PiperOrigin-RevId: 318789444
2020-06-29 13:33:09 +01:00
krocard
1c018e71d4 Propagate format in supportsOutput
*** Reason for rollforward ***

Fixed dependent cl was rolled forward

*** Original change description ***

Rollback of 2aac0717d7

*** Original commit ***

Propagate format in supportsOutput

It is needed to know if gapless is needed,
as gapless offload might not be supported.

***

***

PiperOrigin-RevId: 318429321
2020-06-26 11:23:19 +01:00
tonihei
4138e28d62 Move common gradle setup to a setting file.
This removes a lot of duplication from the module configuration,
avoids divergence, and makes sure that only the important differences
to the default are visible in each module file.

PiperOrigin-RevId: 318024823
2020-06-26 11:13:25 +01:00
andrewlewis
fc0e0d4cb8 Rollback of 2aac0717d7
*** Original commit ***

Propagate format in supportsOutput

It is needed to know if gapless is needed,
as gapless offload might not be supported.

***

PiperOrigin-RevId: 315947888
2020-06-12 00:26:26 +01:00
krocard
2aac0717d7 Propagate format in supportsOutput
It is needed to know if gapless is needed,
as gapless offload might not be supported.

PiperOrigin-RevId: 315877127
2020-06-12 00:25:33 +01:00