2662 Commits

Author SHA1 Message Date
olly
45013ece1e Add unit test for MatroskaExtractor full Block
The existing sample uses SimpleBlock

PiperOrigin-RevId: 284195590
2019-12-06 19:21:39 +00:00
olly
d73af0247b Suppress warnings emitted by Checker Framework version 3.0.1
More information:
https://docs.google.com/document/d/16tpK6aXqN68PvTyvt4siM-m7f0NXi_8xEeitLDzr8xY/edit?usp=sharing

Tested:
    TAP train for global presubmit queue
    http://test/OCL:284110051:BASE:284105515:1575631294184:2673a9f9
PiperOrigin-RevId: 284186732
2019-12-06 19:21:31 +00:00
bachinger
a705480b5d remove flakiness of testSeekTo_windowIndexIsReset
PiperOrigin-RevId: 284180332
2019-12-06 19:21:24 +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
4ad6d9d85c Don't overwrite MP4 container fps using capture fps
The capture frame rate is currently available both via Format.metadata
and decoded in Format.frameRate. As the container Format.frameRate may
be useful to apps, only store the capture frame rate in metadata (apps
will need to decode it but can now access the container frame rate too).

PiperOrigin-RevId: 284165711
2019-12-06 19:21:08 +00:00
olly
781e15ae3e 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 19:21:00 +00:00
olly
59c17163d6 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 19:20:52 +00:00
olly
dd60bac07d 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 19:20:44 +00:00
andrewlewis
bf495de529 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 19:20:36 +00:00
bachinger
f25bcedf72 Playlist API: submit ahead some files of the playlist API CL
PiperOrigin-RevId: 283988536
2019-12-06 19:20:13 +00:00
olly
aa2e9ffc10 Fix casting to not need warning suppression
Also remove getRendererCapabilities arg that's now always null.

PiperOrigin-RevId: 283966795
2019-12-06 19:20:06 +00:00
tonihei
64703e4aa6 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 19:19:58 +00:00
andrewlewis
cbdf45aa5f Verify metadata in extractor tests
PiperOrigin-RevId: 283960017
2019-12-06 19:19:50 +00:00
samrobinson
f3ba74324e Fix MCR comment line break.
PiperOrigin-RevId: 283958680
2019-12-06 19:19:42 +00:00
aquilescanta
96ea436759 Add a test for SampleQueue capacity increases
Also remove redundant line

PiperOrigin-RevId: 283956203
2019-12-06 19:19:34 +00:00
olly
9376479553 Add NonNull annotations to text packages
PiperOrigin-RevId: 283951181
2019-12-06 19:19:26 +00:00
olly
cb873dd1ee Use play and pause convenience methods
PiperOrigin-RevId: 283949259
2019-12-06 19:19:18 +00:00
olly
b35d5d894e Two minor nullability fixes
PiperOrigin-RevId: 283810554
2019-12-05 10:20:50 +00:00
aquilescanta
140ddc9f3e 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
2019-12-05 10:20:41 +00:00
aquilescanta
61c43c30ac Make DownloadHelper pass DrmSessionManager to MediaSources
PiperOrigin-RevId: 283795201
2019-12-05 10:20:32 +00:00
olly
5ce8560291 Fix incorrect DvbParser assignment
PiperOrigin-RevId: 283791815
2019-12-05 10:20:23 +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
olly
3930a539e0 Add NonNull annotations to metadata packages
Also remove MetadataRenderer and SpliceInfoDecoder from the
nullness blacklist

PiperOrigin-RevId: 283744417
2019-12-05 10:20:06 +00:00
olly
b7666df2b3 Add Player play and pause convenience methods
PiperOrigin-RevId: 283744017
2019-12-05 10:19:57 +00:00
ibaker
b045b62205 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-05 10:19:39 +00:00
Ian Baker
8494c3aeea Merge pull request #6595 from szaboa:dev-v2-ssa-position
PiperOrigin-RevId: 283722376
2019-12-05 10:19:27 +00:00
ibaker
9adb94e95c Clarify Cue.DIMEN_UNSET is also used for size
PiperOrigin-RevId: 283559073
2019-12-04 10:00:24 +00:00
andrewlewis
21dd59badb Don't try to track buffersInCodec with tunneling
PiperOrigin-RevId: 283551324
2019-12-04 10:00:10 +00:00
kimvde
23b54a95d2 Allow no output frame holder BinarySearchSeeker
PiperOrigin-RevId: 283544187
2019-12-04 09:59:57 +00:00
andrewlewis
f28a17f9eb Fix comment typo
PiperOrigin-RevId: 283543456
2019-12-04 09:59:50 +00:00
tonihei
65c4a58825 Use Util method to create Handler instead of using deprecated method.
Calls to new Handler() without arguments are deprecated as of the latest Android
version. Replace them by a Util.createHandler call similar to the ones we
already have.

PiperOrigin-RevId: 283532891
2019-12-04 09:59:44 +00:00
ibaker
fb6a8a2c5d 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-04 09:59:37 +00:00
tonihei
b84bde0252 Prevent stuck playback if shouldContinueLoading returns false
If LoadControl.shouldContinueLoading returns false and the renderers are not
ready for playback using the already buffered data, playback is stuck.

To prevent this situation, we always continue loading if the buffer is almost
empty. We already have a similar workaround for when
LoadControl.shouldStartPlayback returns false even if loading stopped.

Having both workarounds allows playback to continue even if the LoadControl
tries to prevent loading and playing all the time.

PiperOrigin-RevId: 283516750
2019-12-04 09:59:30 +00:00
olly
76a170c296 Remove some more core classes from nullness blacklist
PiperOrigin-RevId: 283366568
2019-12-04 09:59:17 +00:00
samrobinson
7c1b1c456b Rename onOutputFormatChanged.
Clarify `Format` vs `MediaFormat` in MediaCodecRenderer.

PiperOrigin-RevId: 283353651
2019-12-04 09:59:11 +00:00
bachinger
63d1086715 Merge pull request #6696 from phhusson:fix/nullable-selection-override
PiperOrigin-RevId: 283347700
2019-12-04 09:59:01 +00:00
olly
6c65c27e9b Remove nullness blacklist for UI module
PiperOrigin-RevId: 283324784
2019-12-04 09:58:53 +00:00
christosts
aceba835cc Enable MediaCodec asynchronous mode
Enable using MediaCodec in async mode. Expose experimental
API to enable/disable the feature.

PiperOrigin-RevId: 283309798
2019-12-04 09:58:27 +00:00
olly
1536a2ceea Rollback of e26a61b903
*** Original commit ***

Improve `Format` propagation within the `MediaCodecRenderer`.

For example, fix handling of pixel aspect ratio changes in
playlists where video resolution does not change.

Issue:#6646

***

PiperOrigin-RevId: 282903626
2019-12-04 09:58:00 +00:00
andrewlewis
a81149d962 Fix audio processor draining for reconfiguration
When transitioning to a new stream in a different format, the audio
processors are reconfigured. After this, they are drained and then
flushed so that they are ready to handle data in updated formats for the
new stream.

Before this change, some audio processors made the assumption that after
reconfiguration no more input would be queued in their old input format,
but this assumption is not correct: during draining more input may be
queued. Fix this behavior so that the new configuration is not referred
to while draining and only becomes active once flushed.

Issue: #6601
PiperOrigin-RevId: 282515359
2019-11-27 22:29:07 +00:00
andrewlewis
4799993d3b Remove redundant flush() calls from AudioProcessors
flush() is guaranteed to be called in all these cases anyway.

Also clarify documentation for AudioProcessor-specific methods that can
change the 'active' flag.

Issue: #6601
PiperOrigin-RevId: 282515255
2019-11-27 22:28:59 +00:00
andrewlewis
10f142b3ff Add AudioProcessor.AudioFormat
Issue: #6601
PiperOrigin-RevId: 282515179
2019-11-27 22:28:51 +00:00
andrewlewis
b7000e64e9 Always drain/flush AudioProcessors after configuration
This simplifies the contract of configure and is in preparation for
fixing a bug where more input can't be queued when draining audio
processors for a configuration change.

Issue: #6601
PiperOrigin-RevId: 282514367
2019-11-27 22:28:43 +00:00
Pierre-Hugues Husson
299487c175 Accept setting null override to setSelectionOverride
In-code documentation say this is allowed, and is the expected way to
disable renderer.
2019-11-26 17:21:33 +01:00
olly
f630ed1ab5 Fix incorrect Javadoc
PiperOrigin-RevId: 281976465
2019-11-22 16:58:42 +00:00
olly
66c206c71a Make placeholder sessions report their true state
Note that the renderer changes will all disappear when we remove
legacy injection of DrmSessionManager into renderers.

PiperOrigin-RevId: 281952601
2019-11-22 15:10:32 +00:00
olly
f3185d077f Improve WakeLock/AudioBecomingNoisy Javadoc
PiperOrigin-RevId: 281764207
2019-11-22 15:10:16 +00:00
olly
7c24ba0934 Simplify checking whether a sample can be read
PiperOrigin-RevId: 281763672
2019-11-22 15:10:09 +00:00
olly
ab8816214e Simplify playback of clear samples without keys
- Move property to DrmSession; it feels like a more natural place
  for it to go (and provides greater flexibility).
- Change flags to a boolean.

PiperOrigin-RevId: 281758729
2019-11-22 15:10:02 +00:00
kimvde
b18650fdcf Expose metadata in FLAC extractor
PiperOrigin-RevId: 281538423
2019-11-22 15:09:17 +00:00