5754 Commits

Author SHA1 Message Date
krocard
58f42e9f8b Annotate render's read source result
So that swich case has a warning if all case are not
covered.

PiperOrigin-RevId: 298574013
2020-03-10 10:17:48 +00:00
ibaker
7bfd2b27eb Start generating HTML from Span-styling in SubtitleWebView
PiperOrigin-RevId: 298565231
2020-03-10 10:17:39 +00:00
bachinger
eb3ea92806 remove unnecessary null-check
PiperOrigin-RevId: 298559123
2020-03-10 10:17:31 +00:00
olly
f248a10627 [AVOD] Added if empty checks for streamKeys.
DashMediaSource is created with Manifest data and streamKeys can be empty given that streamKeys are only created out of MediaItem inside DashMediaSource, and this particular implementation don't extract them out of MediaItem properties.

Tested=Verified playback works.
PiperOrigin-RevId: 298550021
2020-03-10 10:17:23 +00:00
bachinger
d1bbd3507a add media item to create media sources
This change adds the createMediaSource(MediaItem mediaItem) method to the MediaSourceFactory interface. It doesn't deprecate createMediaSource(Uri uri) to keep the cl smaller. Deprecation and removing calls to the deprecated method from within the library and extension follow in a separate CL.

PiperOrigin-RevId: 298352442
2020-03-10 10:17:03 +00:00
tonihei
b095fd57e6 Extend test case to cover existing and potential bug conditions.
PiperOrigin-RevId: 298334500
2020-03-10 10:16:45 +00:00
Oliver Woodman
06e1651612 Merge pull request #7026 from DolbyLaboratories:dev-v2-test-assets
PiperOrigin-RevId: 298317097
2020-03-10 10:16:35 +00:00
ibaker
2f4e88d5af Remove ByteBufferBackingArray suppression from metadata decoders
PiperOrigin-RevId: 298312222
2020-03-10 10:16:25 +00:00
tonihei
a12d72c72c Fix flakiness in SimpleDecoderVideoRendererTest
The test had two problems:
 1. It posts messages using a Handler and we need to idle the main looper
    to actually deliver this message.
 2. SimpleDecoder uses a background thread that is not within our control
    from the test. Ensure the decoding happens after we queue input buffers
    by using a lock.

PiperOrigin-RevId: 298300175
2020-03-10 10:16:08 +00:00
andrewlewis
0b946ac317 Move max encoded audio rates to format utils
PiperOrigin-RevId: 298290511
2020-03-10 10:16:00 +00:00
andrewlewis
2ca363316c Fix typo
PiperOrigin-RevId: 298288236
2020-03-10 10:15:52 +00:00
olly
a6d0caaa3c Drop prefix test- from test methods under v2/library
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/' {}

and then manually modified following tests where test method names conflict with test target.
- VorbisUtilTest
- VorbisReaderTest
- UtilTest
- DownloadManagerDashTest
- DefaultOggSeekerTest
- OggPageHeaderTest
- HlsMasterPlaylistParserTest

PiperOrigin-RevId: 298074653
2020-03-10 10:15:43 +00:00
bachinger
c1258e7e9f add getter/setter of skipSilenceEnable to AudioComponent
PiperOrigin-RevId: 298070828
2020-03-10 10:15:33 +00:00
Davide Bertola
8908cc85ed DASHMediaSource: avoid potentially locking twice
It many happen when changing manifest uri because of http 302 and MPD.Location present.
2020-03-09 16:43:55 +01:00
Davide Bertola
ca70b10c03 DASHMediaSource: ensure MPD.Location is applied in also case of http redirect 2020-03-09 16:33:57 +01:00
Davide Bertola
087c6e0e05 stick to new dash manifest uri after http 302 redirection 2020-03-09 16:02:22 +01:00
Nicola Verbeeck
170fc852ca DASH: Include AssetIdentifier in period
DASH: Parse AssetIdentifier in period
Breaking: DashManifestParser.buildPeriod signature has changed
2020-03-06 12:24:04 +01:00
Cizor
ebc765c3e1 Rendererd buffer count when tunneling enabled
Increasing buffer count when tunneling enabled, for video tracks.
Audio buffer count works fine for both modes.
2020-03-05 18:21:47 +05:30
olly
67b29bbe39 Format.Builder: Finish migration
Issue: #5978
PiperOrigin-RevId: 297876336
2020-02-28 18:43:04 +00:00
christosts
0649c7b958 MediaCodecRenderer: apply rendering limit on feed
PiperOrigin-RevId: 297873726
2020-02-28 18:42:56 +00:00
olly
4c1f0c40ce Format.Builder: Simplify some test classes
PiperOrigin-RevId: 297865356
2020-02-28 18:42:48 +00:00
olly
3730639c95 Don't set decoded bitrate on audio/flac format
PiperOrigin-RevId: 297864386
2020-02-28 18:42:39 +00:00
andrewlewis
1ca9a061b1 Split AAC utils out of CodecSpecificDataUtil
PiperOrigin-RevId: 297823929
2020-02-28 18:42:30 +00:00
tonihei
6c7a2c3cfd Ensure seeks are not ignored in ended state.
We should only ignore seek to the current position if we are
currently READY or BUFFERING. Also, pending initial seek positions
should only be saved while we have an empty timeline, independent of
the player state.

Issue:#6886
PiperOrigin-RevId: 297813854
2020-02-28 18:42:13 +00:00
tonihei
68c401b53e Mark initial progressive source Timeline as placeholder
This is more accurate since it's just a placeholder and none of the
values is provided by the media.

It also allows to fix a problem in ClippingMediaSource where we
couldn't detect a clipping error because we didn't know if the
timeline is a placeholder or not.

Issue:#5924
PiperOrigin-RevId: 297813606
2020-02-28 18:42:05 +00:00
tonihei
697165ce56 Enable window-period offset in tests by default.
This ensures all player interactions in tests automatically verify that
timestamps calculations are done correctly.

PiperOrigin-RevId: 297813324
2020-02-28 18:41:56 +00:00
tonihei
28cefe12c5 Don't ignore first period when updating information to new Timeline.
This while loop started with the second period in the queue and the
first one was always ignored.

PiperOrigin-RevId: 297812937
2020-02-28 18:41:48 +00:00
tonihei
91a87b3fa0 Prevent deletion of unprepared periods.
When a new Timeline arrives in the Player, we check whether we can keep
existing MediaPeriods. This check currently involves a condition that
checks if the MediaPeriod is already prepared. The only reason we do
that is to avoid calling MediaPeriod.seekToUs, which is not allowed
on an unprepared MediaPeriod.

It's better to keep the MediaPeriod to prevent restarting the
preparation process. The prepration check can move further down to the
place right before we would call seekToUs.

PiperOrigin-RevId: 297812584
2020-02-28 18:41:39 +00:00
tonihei
3ef0015817 Ensure to update all existing MediaPeriodInfo to new Timeline
AnalyticsCollector keeps a list of existing MediaPeriodInfo that need
to be updated to new Timelines when they arrive. This already
happens in all cases except that the playingMediaPeriod wasn't updated
when it didn't change during the timeline update.

PiperOrigin-RevId: 297812038
2020-02-28 18:41:30 +00:00
tonihei
3b1b2951e4 Clarify/fix position reference points for AdPlaybackState.
The positions were interchangeably used with window and period
positions. This change more clearly ensures that all positions in the
AdPlaybackState are based on periods and that we use the right adjustments
for all usages.

PiperOrigin-RevId: 297811633
2020-02-28 18:41:22 +00:00
olly
db97d0c37c Format.Builder: Migrate MatroskaExtractor
Selection flags and language tags appear to apply to all tracks
in MKV, so I think the change in output is correct.

PiperOrigin-RevId: 297646190
2020-02-28 18:41:04 +00:00
kimvde
56dbe83a4c Extractor tests: dump only non-default values for format
This removes noisy data from the dump files and allows updating less
dump files if a format field is added, removed or updated.

PiperOrigin-RevId: 297617138
2020-02-28 18:40:54 +00:00
ybai001
40df646a07 Add AC3 and EAC3-JOC Test Assets 2020-02-28 19:32:01 +08:00
aquilescanta
a114a0ed7f Rename SampleDataReader to DataReader and move to common
PiperOrigin-RevId: 297603312
2020-02-27 17:16:53 +00:00
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
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