124 Commits

Author SHA1 Message Date
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
Fillmore, Christopher
d94a40ac77 Add responseBody field to InvalidResponseCodeException
Issue #6853

Previously the body of an HTTP response was not included in an
InvalidResponseCodeException. This change adds a field to store
the response body, and updates DefaultHttpDataSource to populate
this value.
2020-02-12 16:40:47 -05: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
aquilescanta
6377e277c7 Move DrmSession into the core module
PiperOrigin-RevId: 292112214
2020-01-30 19:30:12 +00:00
olly
9161fe2328 Make LongArray tests a bit more concise
This also makes them look more like the equivalent tests for
the list / array cases.

PiperOrigin-RevId: 291890150
2020-01-28 16:55:59 +00:00
aquilescanta
bb9b3fd45e Fix some typos
PiperOrigin-RevId: 291750515
2020-01-28 16:55:41 +00:00
Pierre-Hugues Husson
1d65afdd16 Add minimal support of DVB AIT
This is used by broadcast channels to provide interactive contents.
2020-01-28 16:07:02 +01:00
kimvde
accbc5bba5 Add binarySearchFloor() for LongArrays
PiperOrigin-RevId: 291397882
2020-01-27 11:05:03 +00:00
andrewlewis
91517dc957 Split out extractor and common modules
PiperOrigin-RevId: 291378636
2020-01-24 18:15:19 +00:00