226 Commits

Author SHA1 Message Date
olly
dc33c0bdfb Improve logging II
- Show renderers with no tracks in EventLogger track logging
- Log renderer names in EventLogger track logging
- Add useful message to ExoPlaybackException instances (including
  renderer name for renderer errors)

PiperOrigin-RevId: 302421616
2020-03-25 13:03:12 +00:00
olly
ee6afe5eb9 Merge AudioDecoderException and VideoDecoderException
This is a necessary step for Decoder implementations to support
audio and video. MediaCodecRenderer.DecoderException is renamed
MediaCodecDecoderException and extends the new DecoderException

Issue: #2159
PiperOrigin-RevId: 301698238
2020-03-19 00:50:39 +00:00
olly
cbe99ec475 Make SimpleDecoderXRenderers work with any Decoder implementation
The restriction that these classes only work with SimpleDecoders
is unnecessary. An FfmpegVideoRenderer will not be able to use a
SimpleDecoder, because the SimpleDecoder assumption that each input
buffer can be decoded immediately into a corresponding output is
not true for all video codecs that Ffmpeg supports (e.g., H264 does
not have this property). Generalizing SimpleDecoderVideoRenderer to
DecoderVideoRenderer will allow FfmpegVideoRenderer to still use
the base class, without having to use a SimpleDecoder.

This is a preliminary change toward being able to merge a version
of https://github.com/google/ExoPlayer/pull/7079.

Issue: #2159
PiperOrigin-RevId: 301412344
2020-03-19 00:49:58 +00:00
olly
2f91c12f56 Drop prefix test- from test methods under v2/extensions
This is one step toward following the google3's test naming convention.
See go/java-testing/getting_started#basic-test-template for details
why prefix test isn't necessary.

This CL is generated by following command
$ find -name '*Test.java' | xargs -I{} sed -i 's/^\ \ public\ void\ test\([A-Z]\)\(.*\)$/  public void \L\1\E\2/' {}

PiperOrigin-RevId: 300530329
2020-03-19 00:46:24 +00:00
aquilescanta
47b62e8c02 DataReader: replace InterruptedException with InterruptedIOException
PiperOrigin-RevId: 299092243
2020-03-10 10:19:45 +00:00
tonihei
b5976a55ff Upgrade Kotlin annotations and fix gradle warnings
The new version fixes some warnings in Gradle builds. Also
add missing indirect compileOnly dependencies to fix some more warnings

Issue:issue:#7007
PiperOrigin-RevId: 298855510
2020-03-10 10:19:19 +00:00
olly
67b29bbe39 Format.Builder: Finish migration
Issue: #5978
PiperOrigin-RevId: 297876336
2020-02-28 18:43:04 +00:00
olly
3730639c95 Don't set decoded bitrate on audio/flac format
PiperOrigin-RevId: 297864386
2020-02-28 18:42:39 +00:00
olly
c6a6e0d6f3 Migrate various call sites to Format.Builder
PiperOrigin-RevId: 297562889
2020-02-27 17:15:34 +00:00
kimvde
52825a272d Rename FLAC dump files based on output instead of language
PiperOrigin-RevId: 297336461
2020-02-27 17:15:11 +00:00
aquilescanta
5c3c803460 Remove DRM management from Renderers
PiperOrigin-RevId: 295569075
2020-02-17 17:40:30 +00:00
kimvde
f5025bfce4 Share seek tests between FLAC extractors
PiperOrigin-RevId: 294893303
2020-02-13 15:46:05 +00:00
kimvde
bdfd24290f Share FLAC extractor tests between both extractors
PiperOrigin-RevId: 294614958
2020-02-13 15:44:29 +00:00
olly
1cbe3f72e6 DataSpec: Deprecate most constructors
Keeping (Uri) and (Uri, position, length) to avoid needing
Builder for the trivial case.

PiperOrigin-RevId: 294530226
2020-02-13 15:43:54 +00:00
kimvde
79a3bad4c3 Move assets from FLAC extension to testdata
PiperOrigin-RevId: 293553412
2020-02-11 17:09:08 +00:00
kimvde
a9507a0064 Make FakeExtractorOutput dump additional seek points
PiperOrigin-RevId: 293337032
2020-02-11 17:08:00 +00:00
kimvde
792d9b39e0 Flac extension: disable BinarySearchSeeker if totalSamples is unknown
The ceilingTimePosition is based on the total number of samples. Binary
search seeking is not possible if this value is unknown.

PiperOrigin-RevId: 292921177
2020-02-11 17:07:26 +00:00
bachinger
4bb6036cf6 add playback state changed listener
This change deprecates Player.onPlayerStateChanged(boolean pwr, int state). It removes deprecation for trivial cases. I'll remove other deprecated usages (mostly in ui module) in follow-up CLs to not bloat this CL.

PiperOrigin-RevId: 292917872
2020-02-11 17:07:03 +00:00
kimvde
1a0afacfe1 FLAC extension: remove sample rate check
This check is not needed because the FLAC specification does not
restrict the sample rate value and because the extension reads files
with other sample rates properly.

PiperOrigin-RevId: 292909391
2020-02-11 17:06:32 +00:00
andrewlewis
7b63afb212 Move FlacSteamMetadata to extractor package
It could either live in .util or .extractor, but since it's not needed
outside the extractor package in core (and the FLAC extension), and
FlacStreamMetadataTest uses a FLAC asset, it seems preferable to move it
into the extractor package.

PiperOrigin-RevId: 291372032
2020-01-24 18:15:11 +00:00
olly
a225e887fa Move @MonotonicNonNull annotations to their correct positions
PiperOrigin-RevId: 289823804
2020-01-16 13:51:09 +00:00
olly
ccce9948a9 Align media2 extension tests with other tests
PiperOrigin-RevId: 289494365
2020-01-16 13:50:36 +00:00
olly
d24188f663 Add tests to validate FLAC decoder output
PiperOrigin-RevId: 289091494
2020-01-10 15:57:23 +00:00
olly
1a9b301f52 Fix extension FLAC decoder to correctly handle non-16-bit depths
PiperOrigin-RevId: 288860159
2020-01-10 15:55:49 +00:00
kimvde
ee091e6a45 Use FlacLibrary.isAvailable in FlacExtractor selection
PiperOrigin-RevId: 288667790
2020-01-08 15:58:12 +00:00
kimvde
35fbb7f7ca Add comment explaining FlacBinarySearchSeeker output
PiperOrigin-RevId: 288464154
2020-01-08 15:57:14 +00:00
andrewlewis
a0044257b4 Add troubleshooting instructions for decoding extensions
PiperOrigin-RevId: 286585978
2019-12-20 16:59:07 +00:00
olly
8bafd6ff7d Fix FLAC seeking when the last seek point is a placeholder
PiperOrigin-RevId: 285449865
2019-12-18 18:49:48 +00:00
kimvde
a95c28a929 Implement binary search seeking for FLAC extractor
PiperOrigin-RevId: 284814594
2019-12-11 13:45:43 +00:00
ibaker
9ec524a7e2 Rollback of 355ed11a3c
*** Original commit ***

Suppress warnings emitted by Checker Framework version 2.11.1

More information:
https://docs.google.com/document/d/16tpK6aXqN68PvTyvt4siM-m7f0NXi_8xEeitLDzr8xY/edit?usp=sharing

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:278915274:BASE:278884711:1573074344615:a6701677

***

PiperOrigin-RevId: 284741721
2019-12-10 12:37:42 +00:00
kimvde
d0508b2bde Make metadata field nullable in FlacStreamMetadata
This makes the format metadata null (instead of an empty Metadata
object) when it is not provided, and is therefore consistent with the
other extractors behavior.

PiperOrigin-RevId: 284171148
2019-12-06 19:21:16 +00:00
andrewlewis
cbdf45aa5f Verify metadata in extractor tests
PiperOrigin-RevId: 283960017
2019-12-06 19:19:50 +00:00
olly
cb873dd1ee Use play and pause convenience methods
PiperOrigin-RevId: 283949259
2019-12-06 19:19:18 +00:00
tonihei
72d5b425d3 Add IntDefs for renderer capabilities.
This simplifies documentation and adds compiler checks that the correct values
are used.

PiperOrigin-RevId: 283754163
2019-12-05 10:20:15 +00:00
kimvde
23b54a95d2 Allow no output frame holder BinarySearchSeeker
PiperOrigin-RevId: 283544187
2019-12-04 09:59:57 +00:00
olly
3065d51310 Provide instructions for building extensions using Windows PowerShell
PiperOrigin-RevId: 283296427
2019-12-04 09:58:13 +00:00
kimvde
b18650fdcf Expose metadata in FLAC extractor
PiperOrigin-RevId: 281538423
2019-11-22 15:09:17 +00:00
kimvde
9b2917a9ae Add Java FLAC extractor
Seeking, live streams support and exposure of vorbis and ID3 data
are not part of this commit.

Issue: #6406
PiperOrigin-RevId: 281083332
2019-11-18 17:55:28 +00:00
kimvde
d1da3d925b Fix FLAC bit rate computation
PiperOrigin-RevId: 279088193
2019-11-15 05:12:34 +00:00
kimvde
a226bd0d69 Fix extractor sniffing in FLAC extension
Assuming that a flac stream starts with bytes
['f', 'L', 'a', 'C', 0, 0, 0, 0x22] is not always correct as it could
also start with ['f', 'L', 'a', 'C', 0x80, 0, 0, 0x22]
(see https://xiph.org/flac/format.html#metadata_block_streaminfo).

PiperOrigin-RevId: 279080562
2019-11-15 05:12:25 +00:00
olly
355ed11a3c Suppress warnings emitted by Checker Framework version 2.11.1
More information:
https://docs.google.com/document/d/16tpK6aXqN68PvTyvt4siM-m7f0NXi_8xEeitLDzr8xY/edit?usp=sharing

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:278915274:BASE:278884711:1573074344615:a6701677
PiperOrigin-RevId: 279080514
2019-11-15 05:12:17 +00:00
kimvde
29d110b7eb Fix FLAC extension tests
- Add @Test annotations.
- Fix seeking to ignore potential placeholders
  (see https://xiph.org/flac/format.html#metadata_block_seektable).

PiperOrigin-RevId: 279074092
2019-11-15 05:12:09 +00:00
kimvde
c8170e18d0 Update AndroidX Test versions to latest
Split the version of the sublibraries because their latest version
number is different. See
https://developer.android.com/jetpack/androidx/releases/test#1.2.0.

PiperOrigin-RevId: 278585090
2019-11-05 16:18:38 +00:00
andrewlewis
a4e7274cca Update audio extension build configurations
- Fix FLAC extension build (currently broken due to use of std::array,
  but fixed by migrating to NDK r20).
- Move opus and ffmpeg extensions to NDK r20. For ffmpeg, upgrade to
  release 4.2 which requires using libswresample and updates to the
  build script.

Issue: #6601
PiperOrigin-RevId: 277924119
2019-11-05 16:16:38 +00:00
olly
47423b3100 Fix code triggering [-Werror, -Wreorder].
Otherwise, it will be a build error once we turn on the error.
Sponge: https://sponge.corp.google.com/target?id=8e88bd90-a716-40f7-9599-b70e9193b297&target=//third_party/java_src/android_libs/exoplayer/v2/extensions/flac/src/main:binary.
PiperOrigin-RevId: 276461029
2019-10-30 08:49:17 +00:00
Oliver Woodman
6e65a71806 Merge pull request #6379 from wingyippp:flac-seek-map-two-points
PiperOrigin-RevId: 272856747
2019-10-04 13:32:59 +01:00
olly
8453d07f54 Remove unnecessary DeleteLocalRef usage
Keeping the ones inside loops, because theoretically they
can be useful there (in practice, for this use case, it's
highly unlikely to make any difference).

PiperOrigin-RevId: 272834073
2019-10-04 13:32:42 +01:00
wingyippp
8ce8e351e1 new int64_t[4] after check mSeekTable supported 2019-10-03 14:40:39 +08:00
wingyippp
03ba1c9a2f return null if Seek Table is not supported. proguard in flac-extension 2019-10-03 13:50:17 +08:00
wingyippp
070aab7225 return SeekPoints directly for flacGetSeekPoints JNI method. update the proguard-rules.txt 2019-09-10 20:19:51 +08:00