2799 Commits

Author SHA1 Message Date
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
tonihei
f937fe9e2a Replace all database.beginTransaction with beginTransactionNonExclusive
This ensures other database readers can continue reading while we do our
write transaction.

PiperOrigin-RevId: 281520758
2019-11-22 15:09:01 +00:00
olly
d8dcd2930c Remove stray word in logging
PiperOrigin-RevId: 281510703
2019-11-22 15:08:53 +00:00
tonihei
809234bc4f Mark all methods accessing SQLite databases as potentially blocking.
They are all marked with a JavaDoc comment and the @WorkerThread annotation
which is useful if apps are using threading annotations. All other public
methods in the same classes are marked with @AnyThread to avoid the impression
we forgot to annotate them.

PiperOrigin-RevId: 281490301
2019-11-22 15:08:46 +00:00
christosts
ca849a0679 Fix incorrent javadoc syntax
PiperOrigin-RevId: 281480582
2019-11-22 15:08:38 +00:00
christosts
f921d0d3e5 Ability to set timeout on release() and setSurface()
Add experimental APIs to set a timeout Player#release() and
PlayerMessage#blockUntilDeliver().

PiperOrigin-RevId: 281479146
2019-11-22 15:08:31 +00:00
aquilescanta
f6afbe6cb0 Make MediaLoadData a top level class
In order to reuse it in LoadErrorHandlingPolicy.

PiperOrigin-RevId: 281333287
2019-11-22 15:08:16 +00:00
ibaker
c8e5144494 Add testutils as test dep of library-core module
The current workaround seems to cause compilation errors inside the
testutils module in Android Studio. This seems to fix them.

This doesn't introduce a circular dependency because it's only
the tests in library-core depending on testutils.

PiperOrigin-RevId: 281318192
2019-11-22 15:08:08 +00:00
samrobinson
e26a61b903 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: 281276023
2019-11-22 15:08:00 +00:00
andrewlewis
dbd7e055e5 Reconfigure audio sink when PCM encoding changes
Note:
- Fixing this uncovers another bug in how audio processor draining
  works, so the test playlist still doesn't play correctly after this
  change.
- Once we reconfigure the audio sink based on the ExoPlayer Format
  rather than the codec MediaFormat in a later change, this change can
  be reverted.

Issue: #6601
PiperOrigin-RevId: 281264149
2019-11-22 15:07:52 +00:00
kimvde
774ccafa93 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
2019-11-22 15:07:44 +00:00
Pierre-Hugues Husson
ad8f6c183d Allow multiple metadata tracks, assuming multiple metadata renderers 2019-11-20 16:28:10 +01:00
aquilescanta
95d0921114 Make LoadEventInfo a top level class
In order to reuse it in LoadErrorHandlingPolicy.

PiperOrigin-RevId: 281087397
2019-11-18 17:55:51 +00:00
aquilescanta
699dd3d27c Deprecate public renderer constructors that take a DrmSessionManager
PiperOrigin-RevId: 281086336
2019-11-18 17:55:43 +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
olly
0db1fc67fa Cleanup key request parameters
- Make NonNull, which is already the case when using the manager builder.
- Better document PLAYREADY_CUSTOM_DATA_KEY, now that newPlayReadyInstance
  is no more.

PiperOrigin-RevId: 281079288
2019-11-18 17:55:20 +00:00