2986 Commits

Author SHA1 Message Date
christosts
4c0ba12c40 Synchronize calls to queueSecureInpuffer()
Parallel asynchronous calls to MediaCodec.queueSecureInputBuffer() may
produce garbled video on some platforms. This workaround synchronizes
calls to MediaCodec.queueSecureInputBuffer() so that only one call is
in flight.

PiperOrigin-RevId: 297601037
2020-02-27 17:16:37 +00:00
samrobinson
88e356f214 Add WifiLock management to SimpleExoPlayer.
Issue:#6914
PiperOrigin-RevId: 297598910
2020-02-27 17:16:29 +00:00
bachinger
d69572eb65 notify AudioListener about changes of skipSilenceEnabled
This change adds the callback onSkipSilenceEnabledChange to the AudioListener and calls it when changed by the user by calling setPlaybackParameters, or when changed internally by the DefaultAudioSink if the parameters are not applicable. It needs to be plumped through AudioSink, AudioRenderer to SEP which eventually calls the AudioListener.

No changes to the Player interface so far. The getter of skipSilenceEnabled is added to SimpleExoPlayer for completeness, but not yet to the Player interface. The setter is not yet exposed, but implemented as a private method for implementation reasons.

PiperOrigin-RevId: 297590291
2020-02-27 17:16:10 +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
tonihei
003b3c4e0e Move MediaCodecVideoRendererTest to right package.
PiperOrigin-RevId: 297354294
2020-02-27 17:15:19 +00:00
aquilescanta
6a0803dee0 Create the ProgresiveMediaExtractor interface
- Which abstracts ProgressiveMediaPeriod from the Extraction
  implementation.
- Will allow us to depend on MediaParser.

PiperOrigin-RevId: 297330623
2020-02-27 17:15:03 +00:00
christosts
f34930ab0d Simplify DefaultLoadControl
DefaultLoadControl applies the same min buffer duration to audio
and video. By default, min buffer is set equal to max buffer (50 seconds).

PiperOrigin-RevId: 297324489
2020-02-27 17:14:55 +00:00
olly
31f0302505 Extractor tests: Output average and peak bitrates separately
Note: The dump files will need updating again when the extractors
are modified to only set the appropriate bitrate. Enhancing the
test first is nice, because it means that in subsequent CLs the
dump file updates can be used to quickly see what's changed in
the output.
PiperOrigin-RevId: 297188367
2020-02-27 17:14:47 +00:00
Oliver Woodman
46ebaff965 Merge pull request #7010 from dbrain:fix_nullability
PiperOrigin-RevId: 297187116
2020-02-25 21:24:27 +00:00
tonihei
915f66730c Simplify using the Builder in SimpleExoPlayer subclasses.
PiperOrigin-RevId: 297111999
2020-02-25 21:24:17 +00:00
aquilescanta
a9eb086678 Decouple ProgressiveMediaPeriod and ExtractorHolder
- Avoid having ExtractorHolder expose the underlying extractor.
- Make ProgressiveMP inject a DataSource instead of a DefaultExtractor.

This CL should introduce no functional changes.

PiperOrigin-RevId: 296944788
2020-02-25 21:24:09 +00:00
ibaker
af8b8125e5 Remove BaseRenderer#getUpdatedSourceDrmSession
This seems to be no longer used

PiperOrigin-RevId: 296856117
2020-02-25 21:24:01 +00:00
bachinger
bc8fd2ca12 split and deprecate PlaybackParameters in AudioSink
This change deprecates PlaybackParameter in AudioSink and splits it into playbackSpeed and skipSilenceEnabled. These properties are set separately in a future CL. The playback speed will be set through the MediaClock, while skipSilenceEnabled will be set by sending a message to the audio renderer.

PiperOrigin-RevId: 296457043
2020-02-25 21:23:29 +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
aquilescanta
4c05201a37 Make ExtractorHolder a top-level class
PiperOrigin-RevId: 296405881
2020-02-25 21:23:12 +00:00
olly
995682eca0 Reflect ffwd/rew amount of time to UI
PiperOrigin-RevId: 296387837
2020-02-25 21:23:04 +00:00
aquilescanta
7a10f2bff3 Remove pre-renderer-migration workarounds in SampleQueue
They are no longer necessary.

PiperOrigin-RevId: 296193350
2020-02-25 21:22:18 +00:00
olly
47133f46cb Keep method signature together when overriding
Not important, but when overriding a method that can return null,
it seems preferable to put @Override first, followed by what it's
overriding (which includes the @Nullable).

Also remove explicit @NonNull use in the core library. @NonNull is
propagated by default, so this is redundant.

PiperOrigin-RevId: 296188379
2020-02-25 21:22:10 +00:00
olly
95ba4f85b0 Drop prefix test- from core test methods
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/' {}

PiperOrigin-RevId: 296169886
2020-02-25 21:22:02 +00:00
tonihei
72f4b964a5 Add parameter to Renderer.enable to allow rendering of first sample.
PiperOrigin-RevId: 295985916
2020-02-25 21:21:46 +00:00
olly
54283746be Fix lint errors
PiperOrigin-RevId: 295953956
2020-02-25 21:21:29 +00:00
ibaker
786a1ee82f Add ruby support to TtmlDecoder
I had to expand the info that gets passed around a bit, so I could join up the container, base & text ruby nodes.

Spec: https://www.w3.org/TR/2018/REC-ttml2-20181108/#style-attribute-ruby
PiperOrigin-RevId: 295931653
2020-02-25 21:21:04 +00:00
ibaker
4107375c9d Catch-and-log all subtitle decode errors
issue:#6885
PiperOrigin-RevId: 295931197
2020-02-25 21:20:55 +00:00
andrewlewis
0b7f5260ca Update stale comment in TrimmingAudioProcessor
The part about leaving the pending trim start byte count unmodified
if the processor was just configured is not correct.

PiperOrigin-RevId: 295745371
2020-02-25 21:20:47 +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
Daniel Brain
39f097c79c DownloadHelper.createMediaSource() nullable DrmSessionManager 2020-02-25 15:53:03 +11:00
Daniel Brain
aa9b85c66e DownloadService.onStartCommand() nullable Intent 2020-02-25 15:51:58 +11:00
Pierre-Hugues Husson
cfb2e9dd11 Include an AitDecoderTest
Those test data are defined using tsduck xml format.
feedInputBuffer is identical to SpliceInfoDecoderTest's, could be worth
mutualizing
2020-02-18 16:10:07 +01:00
Pierre-Hugues Husson
46e342bf3e Rename variables to match standard, Add more comments refering to standard 2020-02-18 15:23:48 +01:00
Pierre-Hugues Husson
90601267e6 Use ParsableBitArray's readString 2020-02-18 15:04:10 +01:00
Pierre-Hugues Husson
98de7c460b [AitDecoder] Move to ParsableBitArray 2020-02-18 15:00:26 +01:00
Pierre-Hugues Husson
7bf63e732d Remove dead-code readDvbString 2020-02-18 13:44:09 +01:00
olly
3d20fd59c2 Add ACCESS_NETWORK_STATE permission to core module
When common was split from core, this permission was moved
to common. However both modules need it.

PiperOrigin-RevId: 295690886
2020-02-18 11:00:43 +00:00
olly
28575a1f31 Fix some TargetApi/RequiresApi annotations
PiperOrigin-RevId: 295607866
2020-02-18 11:00:19 +00:00
krocard
f0c0f6eb8f Merge handleBuffer and handleEncodedBuffer
This was unnecessary complexity to avoid very few users
to be broken.

PiperOrigin-RevId: 295603082
2020-02-18 11:00:10 +00:00
olly
1dbf2997c4 Remove DefaultSsChunkSource from nullness blacklist
Issue: #6981
PiperOrigin-RevId: 295584705
2020-02-17 17:40:31 +00:00
aquilescanta
3591562364 Remove FormatHolder.includesDrmSession
With the Renderer migration, this is officially unnecessary, and
should always be true for supported encrypted content.

PiperOrigin-RevId: 295584542
2020-02-17 17:40:30 +00:00
ibaker
bd02812430 Add package-info.java to text.span package
PiperOrigin-RevId: 295582502
2020-02-17 17:40:30 +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
krocard
27bd1294ec AudioSink: Correct access unit count logic
Previously, the input buffer accessUnit count
was passed as the output of the audio processors
which did not make sense as the processors can
split buffers.

This patch passes the access unit count through a
member variable.

PiperOrigin-RevId: 295572577
2020-02-17 17:40:30 +00:00
ibaker
e6ebd8d70a Move SpanUtil into text.span package
Seems like it belongs here.

PiperOrigin-RevId: 295571820
2020-02-17 17:40:30 +00:00
aquilescanta
5c3c803460 Remove DRM management from Renderers
PiperOrigin-RevId: 295569075
2020-02-17 17:40:30 +00:00
tonihei
d3f806fdf4 Let FakeRenderer subclasses decide whether to render a sample.
This is closer to how our actual renderers look like and allows tests
to use a similar logic to show/suppress the first frame in follow-up changes.

PiperOrigin-RevId: 295557548
2020-02-17 17:40:30 +00:00
tonihei
56ec705275 Copy getting-stuck-prevention into DefaultLoadControl.
We will eventually remove the workaround from ExoPlayerImplInternal
added in
b84bde0252
and replace it by an error that gets thrown if the LoadControl behaves
badly.

PiperOrigin-RevId: 295556131
2020-02-17 17:39:37 +00:00
Ian Baker
4e4a87f352 Merge pull request #4178 from danybony:subtitle_color_in_cue_class
PiperOrigin-RevId: 295548715
2020-02-17 17:14:28 +00:00
olly
ed210bca4e Source package: Add some missing nullness annotations
Plus a bit of misc warning cleanup whilst I was there

PiperOrigin-RevId: 295415657
2020-02-17 17:13:38 +00:00
olly
0257e895d0 DefaultTrackSelectorTest: Add @Test to enable test, and fix it
PiperOrigin-RevId: 295414974
2020-02-17 17:13:29 +00:00
christosts
0a612ce34a Video processing offset in AnalyticsListener
PiperOrigin-RevId: 295146481
2020-02-17 17:13:09 +00:00