8507 Commits

Author SHA1 Message Date
kim-vde
292942feb3 Merge pull request #6971 from DolbyLaboratories:dev-v2-ts-assets
PiperOrigin-RevId: 297591404
2020-02-27 17:16:20 +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
andrewlewis
bd8ee155af Construct codecs string for AAC in MP4/TS/FLV
PiperOrigin-RevId: 297578984
2020-02-27 17:15:42 +00:00
olly
c6a6e0d6f3 Migrate various call sites to Format.Builder
PiperOrigin-RevId: 297562889
2020-02-27 17:15:34 +00:00
aquilescanta
bfd8474e83 Remove SampleDataReader.skip
In order to make DataSource extend SampleDataReader.

PiperOrigin-RevId: 297368181
2020-02-27 17:15:27 +00:00
tonihei
003b3c4e0e Move MediaCodecVideoRendererTest to right package.
PiperOrigin-RevId: 297354294
2020-02-27 17:15:19 +00:00
kimvde
52825a272d Rename FLAC dump files based on output instead of language
PiperOrigin-RevId: 297336461
2020-02-27 17:15:11 +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
olly
6fc5e6b905 Migrate HLS to Format.Builder
Issue: #2863
PiperOrigin-RevId: 296482726
2020-02-25 21:23:53 +00:00
olly
f342df2047 Migrate DASH to Format.Builder
Bitrates in the DASH manifest are peak bitrates, as per the ref'd issue.

Issue: #5978
PiperOrigin-RevId: 296478812
2020-02-25 21:23:45 +00:00
olly
d6650e6514 Migrate SmoothStreaming to Format.Builder
Bitrates in SmoothStreaming manifests are average bitrates, as per
the ref'd issue.

Issue: #5978
PiperOrigin-RevId: 296467667
2020-02-25 21:23:37 +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
vigneshv
ba58a5217d Add ReleaseInputBuffer callback
The release_input_buffer callback will be called when the library
is done consuming an "input buffer". The buffer passed into
EnqueueFrame must be kept valid until this callback is called. If
frame parallel is false, then this callback can be nullptr (in
this case the buffer has to be kept valid until the next call to
DequeueFrame). If frame parallel is true, this callback cannot be
nullptr.

PiperOrigin-RevId: 296276083
2020-02-25 21:22:56 +00:00
olly
75bb45e510 Format: Add Builder
Package private for now. It will be made visible in a child CL.

Issue: #2863
PiperOrigin-RevId: 296255558
2020-02-25 21:22:48 +00:00
ibaker
94315ab757 Remove duplicate SCTE-35 format and add sample to TsExtractorTest
It's not clear why we're currently outputting the format in both init()
and consume() - it seems likely that this was accidentally introduced
in <unknown commit>
when we started outputting the format in consume() but didn't remove it
from init().

The SCTE-35 TsExtractorTest doesn't pass with the current code because
when it seeks back to the beginning of the file init() is not called
again so the second pass through only sees one sample (and
ExtractorAsserts checks that seeking back to 0 produces the same output
as reading the file from the beginning).

I generated the SCTE-35 sample using TSDuck's tsp command:
$ tsp --add-input-stuffing 1/10 \
   -I file testdata/src/test/assets/ts/sample.ts \
   -P pmt --service 1  --add-programinfo-id 0x43554549 --add-pid 600/0x86 \
   -P spliceinject --service 1 --files scte_35.xml --wait-first-batch \
   -P filter --negate --pid 0x1FFF \
   -O file testdata/src/test/assets/ts/sample_scte35.ts

This was adapted from the instructions in section 5.2.24.1 of the TSDuck
user manual: https://tsduck.io/download/docs/tsduck.pdf

PiperOrigin-RevId: 296217084
2020-02-25 21:22:40 +00:00
ibaker
113c418884 Explain how to overwrite golden data in extractor test failure message
This info is already in the javadoc of FakeExtractorOutput#assertOutput
but it's not super discoverable if you just see the test failure. I was
manually copying the dump results around before realising there was
a mechanism to auto-update.

PiperOrigin-RevId: 296204463
2020-02-25 21:22:27 +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
olly
7e6a1418e3 Demo apps: Annotate @NonNull where necessary
Because we now annotate not-null by default in ExoPlayer
library modules, we're seeing warnings in the demo apps where
we override a method and don't explicitly specify an equivalent
@NotNull annotation.

It's probably confusing to use not-null by default for the
demo apps, so this change uses @NonNull where necessary to fix
the warnings.

PiperOrigin-RevId: 296000044
2020-02-25 21:21:54 +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
c95ed7d18c Change libgav1's frame buffer callback API.
1. Have frame buffer callbacks return Libgav1StatusCode instead of int.
The 0 (success), -1 (failure) return value convention is less obvious.
Note: The callers of frame buffer callbacks,
BufferPool::OnFrameBufferSizeChanged() and YuvBuffer::Realloc(),
currently return bool, so more work is needed to propagate the frame
buffer callbacks' Libgav1StatusCode return value to the Decoder API.

2. Allow the FrameBufferSizeChangedCallback to be omitted if the frame
buffer size information is not useful to the application.

3. Remove the old (version 1) frame buffer callback API. Remove the
frame buffer callback adaptor.

frame_buffer2.h is renamed frame_buffer.h.
Libgav1FrameBuffer2 is renamed Libgav1FrameBuffer.
GetFrameBufferCallback2 and ReleaseFrameBufferCallback2 are renamed
GetFrameBufferCallback and ReleaseFrameBufferCallback.

PiperOrigin-RevId: 295971183
2020-02-25 21:21:37 +00:00
olly
54283746be Fix lint errors
PiperOrigin-RevId: 295953956
2020-02-25 21:21:29 +00:00
christosts
1f905434d2 Add 60fps test assets in demo app
PiperOrigin-RevId: 295946028
2020-02-25 21:21:21 +00:00
tonihei
a6fb22c67f Add missing package-info.java
All packages that are not in a test directory (or a demo app) should have
the non-null-by-default annotation. Add the remaining ones.

PiperOrigin-RevId: 295938504
2020-02-25 21:21:13 +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
olly
47ee1f2841 FLAC extractor documentation tweak
PiperOrigin-RevId: 295724578
2020-02-25 21:20:39 +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
xufulong
6d14c168e2 use swresample instead of avresample, since avresample module has been deprecated. 2020-02-19 22:09:01 +08: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
8e84fe55a1 Include a new TS sample, with ait, dsm-cc, eit 2020-02-18 16:09:41 +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
274743cddc [ParsableBitArray] Add readString 2020-02-18 15:03:57 +01:00
Pierre-Hugues Husson
98de7c460b [AitDecoder] Move to ParsableBitArray 2020-02-18 15:00:26 +01:00