56 Commits

Author SHA1 Message Date
krocard
1fa9dbc31e Conserve ByteOrder when growingDecoderInputBuffer
#exo-offload

PiperOrigin-RevId: 302403507
2020-03-25 13:02:53 +00:00
olly
429bdfb974 Improve logging
- Make sure logging of UnknownHostException indicates the failure reason
- Indent stack traces inside event blocks in EventLogger
- Don't log media URLs

PiperOrigin-RevId: 302007601
2020-03-20 12:49:20 +00:00
olly
c294e0cb89 Clarify DataSpec.httpRequestHeaders documentation
Issue: #7069
PiperOrigin-RevId: 300738492
2020-03-19 00:47:49 +00:00
olly
920117b081 Drop prefix test- from test methods under v2/library
This CL removes the prefixes to the tests added after a6d0caaa3c.

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: 300547504
2020-03-19 00:46:48 +00:00
ibaker
2bd4d61b9b Use a Multiset for reference counting in MediaSourceEventDispatcher
This avoids duplicate events being dispatched to object foo if
addListener(foo) is called more than once.

Part of issue:#6765

PiperOrigin-RevId: 300529733
2020-03-19 00:46:15 +00:00
aquilescanta
1f202f0aee Make DataSource extend DataReader and upcast uses
This means DataSource.read now may throw InterruptedException.

PiperOrigin-RevId: 300523430
2020-03-19 00:45:59 +00:00
aquilescanta
47b62e8c02 DataReader: replace InterruptedException with InterruptedIOException
PiperOrigin-RevId: 299092243
2020-03-10 10:19:45 +00:00
ibaker
2f4e88d5af Remove ByteBufferBackingArray suppression from metadata decoders
PiperOrigin-RevId: 298312222
2020-03-10 10:16:25 +00:00
andrewlewis
0b946ac317 Move max encoded audio rates to format utils
PiperOrigin-RevId: 298290511
2020-03-10 10:16:00 +00:00
andrewlewis
2ca363316c Fix typo
PiperOrigin-RevId: 298288236
2020-03-10 10:15:52 +00:00
olly
a6d0caaa3c Drop prefix test- from test methods under v2/library
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/' {}

and then manually modified following tests where test method names conflict with test target.
- VorbisUtilTest
- VorbisReaderTest
- UtilTest
- DownloadManagerDashTest
- DefaultOggSeekerTest
- OggPageHeaderTest
- HlsMasterPlaylistParserTest

PiperOrigin-RevId: 298074653
2020-03-10 10:15:43 +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
andrewlewis
1ca9a061b1 Split AAC utils out of CodecSpecificDataUtil
PiperOrigin-RevId: 297823929
2020-02-28 18:42:30 +00:00
kimvde
56dbe83a4c Extractor tests: dump only non-default values for format
This removes noisy data from the dump files and allows updating less
dump files if a format field is added, removed or updated.

PiperOrigin-RevId: 297617138
2020-02-28 18:40:54 +00:00
aquilescanta
a114a0ed7f Rename SampleDataReader to DataReader and move to common
PiperOrigin-RevId: 297603312
2020-02-27 17:16:53 +00:00
samrobinson
88e356f214 Add WifiLock management to SimpleExoPlayer.
Issue:#6914
PiperOrigin-RevId: 297598910
2020-02-27 17:16:29 +00:00
andrewlewis
7c2889c620 Add ENCODING_ constants for AAC
PiperOrigin-RevId: 297579793
2020-02-27 17:16:02 +00:00
kim-vde
6946170d3e Merge pull request #6922 from phhusson:feature/ait
PiperOrigin-RevId: 297579733
2020-02-27 17:15:52 +00:00
andrewlewis
bd8ee155af Construct codecs string for AAC in MP4/TS/FLV
PiperOrigin-RevId: 297578984
2020-02-27 17:15:42 +00:00
olly
6fc5e6b905 Migrate HLS to Format.Builder
Issue: #2863
PiperOrigin-RevId: 296482726
2020-02-25 21:23:53 +00:00
olly
d6650e6514 Migrate SmoothStreaming to Format.Builder
Bitrates in SmoothStreaming manifests are average bitrates, as per
the ref'd issue.

Issue: #5978
PiperOrigin-RevId: 296467667
2020-02-25 21:23:37 +00:00
olly
42d4afe7b6 Make Format.Builder, peakBitrate and averageBitrate public
- Deprecate old Format.createXXX methods
- Deprecate most Format.copyXXX methods
- Stop using deprecated Format.copyXXX methods in the library

Note: Replacing library usages of Format.createXXX method
will be done in follow up CLs. These changes aren't purely
mechanical because we need to decide which out of peakBitrate
and averageBitrate to set in each case where currently a
single bitrate is provided.

Issue: #2863
PiperOrigin-RevId: 296450935
2020-02-25 21:23:21 +00:00
olly
75bb45e510 Format: Add Builder
Package private for now. It will be made visible in a child CL.

Issue: #2863
PiperOrigin-RevId: 296255558
2020-02-25 21:22:48 +00:00
olly
54283746be Fix lint errors
PiperOrigin-RevId: 295953956
2020-02-25 21:21:29 +00:00
christosts
3fb8ab2545 Async queueing: avoid extra memory allocations
When copying CryptoInfo for asynchronous input buffer queueing,
re-use the destination CryptoInfo's arrays to avoid re-allocating
memory.

PiperOrigin-RevId: 295706771
2020-02-25 21:20:30 +00:00
Pierre-Hugues Husson
274743cddc [ParsableBitArray] Add readString 2020-02-18 15:03:57 +01:00
olly
ab21f885d4 Bump version to 2.11.3
PiperOrigin-RevId: 295695297
2020-02-18 11:00:59 +00:00
olly
80ae40f6f4 Add missing IntDef to switch
PiperOrigin-RevId: 295692163
2020-02-18 11:00:51 +00:00
olly
5b3ed8286c Add non-null by default to source package (last one!)
Note on UnknownNull: Where there exists a generically typed
base class and both null and non-null types are permitted,
we need to clear the default non-null that's otherwise
propagated everywhere. This then lets the nullness of the
type work properly.

PiperOrigin-RevId: 295582444
2020-02-17 17:40:30 +00:00
olly
d1e4a63ae0 Zero out trailing bytes in CryptoInfo.iv
CryptoInfo.iv length is always 16. When the actual initialization vector
is shorter, zero out the trailing bytes.

Issue: #6982
PiperOrigin-RevId: 295575845
2020-02-17 17:40:30 +00:00
ibaker
0444e0b338 Add Util.toHexString
PiperOrigin-RevId: 295539969
2020-02-17 17:13:48 +00:00
aquilescanta
a1f666cb9d Make DrmInitData.SchemeData.uuid public
To ease implementation of MediaParser.

PiperOrigin-RevId: 294912244
2020-02-13 15:46:22 +00:00
olly
440468603a Add Format peak and average bitrate (hidden for now)
Issue: #2863
PiperOrigin-RevId: 294531127
2020-02-13 15:44:03 +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
olly
c7b6a2e045 DataSpec: Add customData field.
PiperOrigin-RevId: 294520836
2020-02-13 15:43:45 +00:00
olly
14d3ed09d5 Add DataSpec.Builder
PiperOrigin-RevId: 294518763
2020-02-13 15:43:35 +00:00
olly
147f70bf5b Format: Move language into common fields section
Language is already applicable to image formats as well.
It can also apply to video formats. For example when the
video contains burnt in subtitles. Also, some animation
studios produce multiple variants of animations, in which
text within the scene itself (e.g., a signpost) is
replaced to be language specific.

PiperOrigin-RevId: 294500227
2020-02-11 22:10:35 +00:00
olly
39c65c658e DataSpec: Make DataSpecTest more useful
- Replace tests specific to HTTP request headers with tests that
  more generally test constructor correctness.
- Add test specifically around the constructor that infers the
  HTTP method from postBody, since that's a non-trivial bit of
  constructor logic.

Note: In general, I'm not sure this type of test (i.e., testing a
bit of trivial copying through a constructor) is worth the cost
of writing and maintaining them. That said, checking the new
uriPositionOffset is calculated correctly is non-trivial, as is
the HTTP method inference, so keeping them for now.
PiperOrigin-RevId: 294488684
2020-02-11 22:10:26 +00:00
olly
829282fa12 Replace DataSpec.absoluteStreamPosition with uriPositionOffset
This is a preliminary step toward adding a DataSpec.Builder,
which is needed for sanity when adding DataSpec.customData.

The existing absoluteStreamPosition field is very error prone,
because anyone using a Builder to adjust the request position
will need to remember to adjust two values:

dataSpec
    .buildUpon()
    .setAbsoluteStreamPosition(x)
    .setPosition(x)
    .build();

Furthermore, the difference between position and
absoluteStreamPosition is irrelevant in nearly all cases. In
the core library, the difference is only relevant when initializing
AES encryption/decryption to write/read cache files.

Replacing absoluteStreamPosition with uriPositionOffset will
simplify the code block above to:

dataSpec
    .buildUpon()
    .setPosition(x)
    .build();

PiperOrigin-RevId: 294485644
2020-02-11 22:10:17 +00:00
christosts
5725acb789 Defer MediaCodec queueing to background thread
The DedicatedThreadAsyncMediaCodecAdapter supports enqueueing
input buffers in a background Thread.

PiperOrigin-RevId: 294202744
2020-02-11 17:11:50 +00:00
olly
7d19a85c59 DataSpec: Cleanup
PiperOrigin-RevId: 294183213
2020-02-11 17:11:19 +00:00
krocard
9875c5d2b4 AudioCapabilities: Missing int class annotation
PiperOrigin-RevId: 293565660
2020-02-11 17:09:23 +00:00
olly
8ac5698aac Remove deprecated Format.createSampleFormat
PiperOrigin-RevId: 292888026
2020-02-03 14:44:56 +00:00
ibaker
b6bd57ab12 Replace most usages of @TargetApi with @RequiresApi
We keep @TargetApi where the method is a safe no-op on
older versions due to an in-line version check.

PiperOrigin-RevId: 292878727
2020-02-03 11:21:21 +00:00
olly
3a702cf53a Change Format.createTextSampleFormat for common uses cases
PiperOrigin-RevId: 292863614
2020-02-03 11:20:56 +00:00
olly
0be3451c39 Change Format.createImageSampleFormat for common use case
PiperOrigin-RevId: 292570360
2020-02-03 11:20:40 +00:00
olly
a7c6cb4abb Add some missing local @Nullable annotations
PiperOrigin-RevId: 292564056
2020-02-03 11:20:31 +00:00
olly
d287e13d9e Add Format.createSampleFormat for common use case
PiperOrigin-RevId: 292562678
2020-01-31 17:52:51 +00:00
olly
04218bdeb8 Remove deprecated Format constructors
PiperOrigin-RevId: 292554283
2020-01-31 17:52:42 +00:00