2564 Commits

Author SHA1 Message Date
kimvde
54413c26d4 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
2020-01-17 13:37:58 +00:00
olly
a5ee17ec26 Fix casting to not need warning suppression
Also remove getRendererCapabilities arg that's now always null.

PiperOrigin-RevId: 283966795
2020-01-17 13:36:55 +00:00
andrewlewis
023e141be8 Verify metadata in extractor tests
PiperOrigin-RevId: 283960017
2020-01-17 13:36:40 +00:00
aquilescanta
0a0a478294 Add a test for SampleQueue capacity increases
Also remove redundant line

PiperOrigin-RevId: 283956203
2020-01-17 13:36:33 +00:00
aquilescanta
14897fb6df Invert the ownership scheme between SampleQueue and SampleMetadataQueue
Saves around 200 lines of code. High level overview:
- Rename SampleQueue to SampleDataQueue.
- Rename SampleMetadataQueue to SampleQueue.

This CL should not introduce behavior changes. The only significant
changes in synchronization should be:
+ Add synchronized keyword to isReady.
  - Seems to be necessary.
+ Add synchronized keyword to SampleQueue.sampleMetadata.
  - Before this change, SampleQueue.sampleMetadata could acquire the
    SampleMetadataQueue lock three times in a single method call.

Other miscellaneous improvements:
+ Put all private methods at the bottom.
+ Move release() to the right category.

PiperOrigin-RevId: 283795844
2020-01-17 13:36:09 +00:00
aquilescanta
9974670cc7 Make DownloadHelper pass DrmSessionManager to MediaSources
PiperOrigin-RevId: 283795201
2020-01-17 13:35:21 +00:00
andrewlewis
9c23888f1c Don't try to track buffersInCodec with tunneling
PiperOrigin-RevId: 283551324
2020-01-17 13:30:38 +00:00
kimvde
630992d05b Allow no output frame holder BinarySearchSeeker
PiperOrigin-RevId: 283544187
2020-01-17 13:29:44 +00:00
kimvde
f09f62da4f Expose metadata in FLAC extractor
PiperOrigin-RevId: 281538423
2020-01-17 13:20:54 +00:00
kimvde
a558501e38 Remove TODO around optimizing sample data outputs in FlacExtractor
Preliminary measurement showed that the results were similar to the non-optimized
version.

PiperOrigin-RevId: 281255476
2020-01-17 13:19:59 +00:00
kimvde
dcebf93ab4 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
2020-01-17 13:17:53 +00:00
Oliver Woodman
27e4855830 Fix tests for 2.11.1 2019-12-20 22:18:52 +00:00
olly
f6dad5cee0 Enable blacklisting for HTTP 416
Where media segments are specified using byte ranges, it makes
sense that a server might return 416 (which we don't consider
for blacklisting) if the segment is unavailable, rather than
the 404 (which we do consider for blacklisting) that we expect
when media segments are only specified using a URL.

Issue: #6775
PiperOrigin-RevId: 286620698
2019-12-20 20:51:58 +00:00
tonihei
c299748132
Fix build by saving periodIndex to separate variable 2019-12-20 16:47:42 +00:00
tonihei
5d728abc41
Fix potentially wrong window index in onMediaPeriodCreated.
Issue:#6776
2019-12-20 16:38:34 +00:00
olly
c6036d5271 Add test case for mdat atom extending beyond the file length
Issue: #6774
PiperOrigin-RevId: 286576383
2019-12-20 16:08:25 +00:00
olly
87865a5cc4 DefaultDownloadIndex: Clear failure reason when removing download
The Download constructor considers it invalid to have a failure
reason if the download isn't in the failed state. Unfortunately,
calling DefaultDownloadIndex.removeAllDownloads when there's a
failed download will change the state without clearing the reason.
If the downloads are then read back from the DefaultDownloadIndex
we end up violating the Download constructor assertion.

This change clears the failed reason for any existing rows in the
invalid state, and also fixes the root cause that allows invalid
rows to enter the table in the first place.

Issue: #6785
PiperOrigin-RevId: 286576242
2019-12-20 16:07:43 +00:00
olly
406acfc38f Relax MP4 sniffing to allow an atom to extend beyond the file length
Issue: #6774
PiperOrigin-RevId: 286575797
2019-12-20 16:07:35 +00:00
olly
e8cb7b2370 Fix typo
Merge of https://github.com/google/ExoPlayer/pull/6793

PiperOrigin-RevId: 286556008
2019-12-20 16:07:26 +00:00
tonihei
b7bc1fee9f Add missing @Nullable to MediaCodecAudioRenderer.getMediaClock
Without this @Nullable, potential subclasses can't  override the
method to return null if they don't want to use the renderer as a
media clock.

Issue:#6792
PiperOrigin-RevId: 286545736
2019-12-20 16:07:11 +00:00
olly
63f7b99836 Bump to 2.11.1
PiperOrigin-RevId: 286368964
2019-12-19 14:47:43 +00:00
ibaker
5d2ca02c5a Unwrap all nested IntDef values
This seems to work with R8 but interact badly with ProGuard.

issue:#6771
PiperOrigin-RevId: 286215262
2019-12-18 20:06:03 +00:00
andrewlewis
b4873e55e1 Fix keep rule for VideoDecoderOutputBuffer
PiperOrigin-RevId: 286156361
2019-12-18 19:30:22 +00:00
andrewlewis
c9109f437c Ensure raw resources are kept
R8 does constant folding, so we need to keep buildRawResourceUri
to ensure that resources passed to it are kept.

PiperOrigin-RevId: 286153875
2019-12-18 19:30:08 +00:00
ibaker
166e389c56 Suppress ProGuard warnings about javax.annotation
These annotations are compile-only - so we don't mind they're not
accessible at runtime.

PiperOrigin-RevId: 285993063
2019-12-18 19:29:35 +00:00
olly
0a701abafe Retain AV1 constructor for DefaultRenderersFactory
Issue: #6773
PiperOrigin-RevId: 285990377
2019-12-18 19:29:18 +00:00
olly
250a5deab5 Add more SeekMap assertions, and "fix" MatroskaExtractor
In MatroskaExtractor, if the last cue time exceeds the duration
specified in the header, then we end up generating a negative
duration chunk as the last item in the SeekMap. We should probably
not do this, so drop it instead.

Note: Matroska does have a CueDuration element, but it's not used
in the one problematic file I've found.
PiperOrigin-RevId: 285738418
2019-12-18 19:27:27 +00:00
ibaker
4653592d0e Propagate HTTP request headers through CacheDataSource
This has been broken since
c3d6be3afd
and broken for ICY (where I noticed the problem) since
5695bae9d8.
ICY symptom is that we see no repeated metadata, because the
Icy-MetaData:1 header doesn't make it to the server so we never get back
icy-metaint.

PiperOrigin-RevId: 285379234
2019-12-18 19:25:57 +00:00
samrobinson
03b02f98df Fix an issue where a keyframe was not skipped.
Keyframe was rendered rather than skipped when performing
an exact seek to a non-zero position close to the start of
the stream.

PiperOrigin-RevId: 284798460
2019-12-11 13:48:42 +00:00
olly
1de7ec2c70 Fix bug removing entries from CacheFileMetadataIndex
Issue: #6621
PiperOrigin-RevId: 284743414
2019-12-10 12:39:30 +00:00
olly
914a8df0ad MatroskaExtractor: Support lacing in full blocks
Caveats:

- Block additional data is ignored if the block is laced
  and contains multiple samples. Note that this is not
  a loss of functionality (SimpleBlock cannot have block
  additional data, and lacing was previously completely
  unsupported for Block)

- Subrip and ASS samples are dropped if they're in laced
  blocks with multiple samples (I don't think this is
  valid anyway)

Issue: #3026
PiperOrigin-RevId: 284545197
2019-12-09 17:58:23 +00:00
olly
0065f63f48 MatroskaExtractor: Constrain use of sample state member variables
This change constrains the use of sample state member variables to
writeSampleData, finishWriteSampleData and resetWriteSampleData.
Using them elsewhere gets increasingly confusing when considering
features like lacing in full blocks. For example sampleBytesWritten
cannot be used when calling commitSampleToOutput in this case
because we need to write the sample data for multiple samples
before we commit any of them.

Issue: #3026
PiperOrigin-RevId: 284541942
2019-12-09 17:57:10 +00:00
olly
567f2a6575 Fix Javadoc issues
PiperOrigin-RevId: 284509437
2019-12-09 16:47:18 +00:00
olly
7e93c5c0b6 Enable physical display size hacks for API level 29
For AOSP TV devices that might not pass manual verification.

PiperOrigin-RevId: 284154763
2019-12-06 23:28:05 +00:00
olly
22f25c57bb MatroskaExtractor naming cleanup II
- Remove "lacing" from member variables. They're used even if
  there is no lacing (and the fact that lacing is the way of
  getting multiple samples into a block isn't important).

Issue: #3026
PiperOrigin-RevId: 284152447
2019-12-06 23:27:58 +00:00
olly
5973b76481 MatroskaExtractor naming cleanup
- Change sampleHasReferenceBlock to a block reading variable, which is
  what it is (the distinction didn't matter previously, but will do so
  when we add lacing support in full blocks because there wont be a 1:1
  relationship any more.
- Move sampleRead to be a reading state variable.
- Stop abbreviating "additional"

Issue: #3026
PiperOrigin-RevId: 284000937
2019-12-06 23:27:52 +00:00
andrewlewis
4f363b1492 Fix mdta handling on I/O error
An I/O error could occur while handling the start of an mdta box, in
which case retrying would cause another ContainerAtom to be added. Fix
this by skipping the mdta header before updating container atoms.

PiperOrigin-RevId: 284000715
2019-12-06 23:27:43 +00:00
tonihei
1e609e245b Add format and renderer support to renderer exceptions.
This makes the exception easier to interpret and helps with debugging of
externally reported issues.

PiperOrigin-RevId: 283965317
2019-12-06 23:27:11 +00:00
samrobinson
eb5016a6ff Fix MCR comment line break.
PiperOrigin-RevId: 283958680
2019-12-06 23:24:57 +00:00
olly
e10a78e6b7 Add NonNull annotations to text packages
PiperOrigin-RevId: 283951181
2019-12-06 23:24:42 +00:00
olly
cab05cb71d Two minor nullability fixes
PiperOrigin-RevId: 283810554
2019-12-06 23:24:11 +00:00
olly
9f44e902b1 Fix incorrect DvbParser assignment
PiperOrigin-RevId: 283791815
2019-12-06 23:23:48 +00:00
tonihei
e97b8347eb Add IntDefs for renderer capabilities.
This simplifies documentation and adds compiler checks that the correct values
are used.

PiperOrigin-RevId: 283754163
2019-12-06 23:23:42 +00:00
olly
7d7c37b324 Add NonNull annotations to metadata packages
Also remove MetadataRenderer and SpliceInfoDecoder from the
nullness blacklist

PiperOrigin-RevId: 283744417
2019-12-06 23:23:14 +00:00
ibaker
86a86f6466 Refactor ExtractorInput javadoc about allowEndOfInput
This parameter is a little confusing, especially as the behaviour
can be surprising if the intended use-case isn't clear. This change
moves the description of the parameter into the class javadoc,
adds context/justification and slims down each method's
javadoc to refer to the class-level.

Related to investigating/fixing issue:#6700

PiperOrigin-RevId: 283724826
2019-12-06 23:22:30 +00:00
Ian Baker
6a354bb29f Merge pull request #6595 from szaboa:dev-v2-ssa-position
PiperOrigin-RevId: 283722376
2019-12-06 23:22:12 +00:00
ibaker
e595791245 Clarify Cue.DIMEN_UNSET is also used for size
PiperOrigin-RevId: 283559073
2019-12-06 22:47:45 +00:00
andrewlewis
ab016ebd81 Fix comment typo
PiperOrigin-RevId: 283543456
2019-12-06 22:45:26 +00:00
ibaker
a6098bb9fa Allow AdtsExtractor to encounter EOF
Fixes issue:#6700

sample_cbs_truncated.adts test file produced using
`$ split -b 31795 sample_truncated.adts` to remove the last 10 bytes

PiperOrigin-RevId: 283530136
2019-12-06 22:44:46 +00:00
olly
92566323da Remove some more core classes from nullness blacklist
PiperOrigin-RevId: 283366568
2019-12-06 22:43:01 +00:00