9083 Commits

Author SHA1 Message Date
ibaker
2f19b63ca0 Add package-info files to packages that only exist in tests
This doesn't affect the nullness checker or Kotlin, but it does make
weird warnings appear in Android Studio. It seems mildly preferable to
have the same spurious warnings in these files that we have in other
tests, rather than different spurious warnings.

PiperOrigin-RevId: 321173760
2020-07-24 10:34:12 +01:00
ibaker
8ae04bcfee Migrate usages of deprecated Window#tag
PiperOrigin-RevId: 321169585
2020-07-24 10:34:03 +01:00
ibaker
5a2e04ec39 Migrate usages of deprecated SinglePeriodTimeline constructor
PiperOrigin-RevId: 321168965
2020-07-24 10:33:54 +01:00
ibaker
8eb2354e5e Replace deprecated JUnit Assertions with Truth
PiperOrigin-RevId: 321168125
2020-07-24 10:33:45 +01:00
ibaker
437d1b6e9a Migrate usages of deprecated Player#set/getPlaybackParameters()
PiperOrigin-RevId: 321166822
2020-07-24 10:33:36 +01:00
kimvde
820970e767 Remove occurrence of sanity in AdaptiveTrackSelectionTest
PiperOrigin-RevId: 321163229
2020-07-24 10:33:27 +01:00
bachinger
d62688cfc0 Mask periodId and loadingPeriodId
This change masks playbackInfo.periodId and playbackInfo.loadingPeriodId for operations which change these periods (set/add/remove sources and seeks).

Because this masking is reflected in the playbackInfo object, player attributes can be retrieved without the maskingXyz variables in EPI. This has the advantage that the playbackInfo object always reflects the public state of the player even when operations are still pending. The maskingXyz variables in EPI are only required for the deprecated use case of an initial seek in an empty timeline.

PiperOrigin-RevId: 321160092
2020-07-24 10:33:18 +01:00
ibaker
683d630ec6 Migrate usage of deprecated OfflineLicenseHelper constructor
PiperOrigin-RevId: 321158149
2020-07-24 10:33:09 +01:00
ibaker
93c9e93a09 Migrate usages of renderer constants in C.java to the Renderer ones
PiperOrigin-RevId: 321157794
2020-07-24 10:33:00 +01:00
ibaker
49db15ef73 Migrate usages of DownloadHelper TrackSelector constants
PiperOrigin-RevId: 321157115
2020-07-24 10:32:51 +01:00
ibaker
7b69b47a5e Migrate usages of deprecated MediaSource#getTag() method
PiperOrigin-RevId: 321156463
2020-07-24 10:32:42 +01:00
kimvde
1d1762d30d Add Builder to Transformer
PiperOrigin-RevId: 321155415
2020-07-24 10:32:33 +01:00
gyumin
18d8db4e77 Move DeviceInfo from core to common
In order to use DeviceInfo class in media2, this CL moves the class to
common module. It didn't move the other file in the same package,
DeviceListener, as it's for DeviceComponent but media2 SessionPlayer
doesn't have components as it is already flattened. PlayerCallback will
have equivalent methods of DeviceListener.

PiperOrigin-RevId: 321154997
2020-07-24 10:32:24 +01:00
ibaker
e9482c7f0c Migrate uses of deprecated DefaultDownloadFactory constructor
PiperOrigin-RevId: 321153963
2020-07-24 10:32:15 +01:00
ibaker
f024045638 Migrate uses of Uri-based ProgressiveDownloader() to MediaItem-based
The constructor that takes a Uri is deprecated

PiperOrigin-RevId: 321148326
2020-07-24 10:32:06 +01:00
ibaker
f83d478cc3 Migrate uses of prepare(MediaSource) to setMediaSource() & prepare()
PiperOrigin-RevId: 321147910
2020-07-24 10:31:57 +01:00
ibaker
425d48b67a Migrate usages of Cue constructors to Cue.Builder
All the public Cue constructors are deprecated

PiperOrigin-RevId: 321122512
2020-07-24 10:31:49 +01:00
ibaker
ff4516086c Migrate usages of deprecated InvalidResponseCodeException constructor
PiperOrigin-RevId: 321121988
2020-07-24 10:31:40 +01:00
ibaker
b48a762f20 Migrate overrides of deprecated AdsViewProvider.getAdOverlayViews
PiperOrigin-RevId: 321121735
2020-07-24 10:31:31 +01:00
ibaker
e9a8335381 Migrate callers to pass MediaItem to createMediaSource()
createMediaSource(Uri) is deprecated.

PiperOrigin-RevId: 321121383
2020-07-24 10:31:22 +01:00
kimvde
d615a3a740 Fix sample time of partially fragmented MP4s with tfdt box
PiperOrigin-RevId: 321109232
2020-07-24 10:31:12 +01:00
kimvde
68cd283830 Remove occurrences of grandfathering
ISSUE: #7565
PiperOrigin-RevId: 321108417
2020-07-24 10:31:03 +01:00
ibaker
23d680a4b4 Suppress deprecation warnings in deprecated places
PiperOrigin-RevId: 320970814
2020-07-24 10:30:53 +01:00
olly
f205539616 Use lambdas where possible
PiperOrigin-RevId: 320960833
2020-07-13 17:00:44 +01:00
tonihei
29b12e2f8d Split SampleQueue.advanceTo into two operations.
The method currently advances the read position and returns the number
of skipped samples. This prevents checking how many samples are skipped
before the operation is executed.

Instead, we have a new method that returns the number of to be skipped
samples and a skip method that executes the skipping.

PiperOrigin-RevId: 320953439
2020-07-13 17:00:33 +01:00
kimvde
92437f3a0f Remove some occurrences of dummy
Remove occurrences in comments and private fields.

ISSUE: #7565
PiperOrigin-RevId: 320948364
2020-07-13 17:00:21 +01:00
olly
5c9c0e2073 Improve handling of floating point audio
- DefaultAudioSink always supports floating point input. Make it
  advertise this fact.
- Remove the ability to enable/disable floating point output in
  FfmpegAudioRenderer, since this ability is now also provided on
  DefaultAudioSink.
- Let FfmpegAudioRenderer query the sink to determine whether it
  will output floating point PCM directly or resample it to 16-bit
  PCM.

PiperOrigin-RevId: 320945360
2020-07-13 17:00:10 +01:00
olly
21e56f571d Misc analysis fixes
PiperOrigin-RevId: 320921457
2020-07-13 14:04:29 +01:00
ibaker
cdfee89181 Use CSS inheritance for background-color in WebViewSubtitleOutput
CSS background-color isn't inherited to inner HTML elements by default:
https://developer.mozilla.org/en-US/docs/Web/CSS/background-color

But Android Span styling assumes an outer BackgroundColorSpan will
affect inner spans. This usually doesn't make a difference, because
HTML elements are transparent by default, so there's an implicit
inheritance by just being able to see through to the 'outer' element
underneath. However this doesn't work if the inner element sits outside
the bounding box of the outer element, e.g. <rt> (ruby text, sits above/below)
or a <span> with font-size > 100%.
END_PUBLIC

Demo of <rt> and font-size problems: http://go/cpl/ruby-backgrounds/1
Demo of CSS inheritance: http://go/cpl/css-inheritance/1

PiperOrigin-RevId: 320915999
2020-07-13 14:04:20 +01:00
andrewlewis
245459a34a Fix raw type
PiperOrigin-RevId: 320909448
2020-07-13 14:04:11 +01:00
insun
5e50e110a4 Mark currently selected subtitle track in track list
Previously, the automatically selected subtitle track
has not been marked (with check mark) in subtitle track list,
just like audio track.

But, in subtitle track option UI, there is no 'auto' option,
which is different from audio track selection menu.

This CL marks the auto selected subtitle track name in the cc list.

PiperOrigin-RevId: 320802575
2020-07-13 14:04:02 +01:00
kimvde
702568c3b6 Remove some occurrences of dummy in core library
Remove occurrences in comments and private fields.

ISSUE: #7565
PiperOrigin-RevId: 320606558
2020-07-13 14:03:54 +01:00
olly
a0703cb716 Add encoding constant for AAC ER BSAC
PiperOrigin-RevId: 320601157
2020-07-13 14:03:45 +01:00
krocard
33cf96cfdf Fix more DecoderCounter increase in batching mode
The counter was increased by one for each batch
instead of each frame.

Additionally fix a null check.

PiperOrigin-RevId: 320592873
2020-07-13 14:03:36 +01:00
ibaker
9290b468d0 Stop sharing a Handler between EPI and EPII
Sharing the Handler has led to it being accidentally used for purposes
beyond the original intention.

Instead for EPII -> EPI communication: Call methods directly on
ExoPlayerImpl that then post from the playback thread to the
application thread.

And for the MediaSourceList and Queue initialization, create a dedicated
Handler based on the same applicationLooper.

PiperOrigin-RevId: 320590527
2020-07-13 14:03:27 +01:00
olly
09e97cf279 Fix some Javadoc issues
PiperOrigin-RevId: 320581002
2020-07-13 14:03:19 +01:00
kimvde
efce10c873 Simplify FragmentedMp4Extractor sample time logic
PiperOrigin-RevId: 320574671
2020-07-13 14:03:10 +01:00
ibaker
6624c7cb9a Check referenceCount > 0 in DefaultDrmSession#release()
Also flip DefaultDrmSessionManager#prepare()/release() into guard
clauses.

Suggestions from review comments on:
316f8a88cd

PiperOrigin-RevId: 320572462
2020-07-13 14:03:01 +01:00
andrewlewis
3214851fbb Migrate off deprecated IMA SDK APIs
AdDisplayContainer now takes the video ad player at construction time,
and obstructions are registered/unregistered via a new method. Also
'content complete' is now notified via ad callbacks rather than the
AdsLoader.

PiperOrigin-RevId: 320567666
2020-07-13 14:02:52 +01:00
andrewlewis
bcbe310681 Use MediaPeriodId for ad preparation errors
PiperOrigin-RevId: 320565543
2020-07-13 14:02:43 +01:00
andrewlewis
1e2ed51f25 Add support for H.263 and MPEG-4 Part 2 in TS
The new reader is named H263Reader as it handles H.263 streams, but
MPEG-4 Part 2 streams are also intended to be handled. The reader's
output format MIME type is video/mp4v as the H.263 streams can be
decoded by decoders supporting this MIME type.

The implementation is based on the framework implementation for
extracting MPEG-4 video in MPEG-TS
(https://cs.android.com/android/platform/superproject/+/master:frameworks/av/media/libstagefright/mpeg2ts/ESQueue.cpp;l=1825;drc=86e363c1fac27302ca4ae33e73296f7797672995)
and is similar to the existing H262Reader.

Issue: #1603
Issue: #5107
PiperOrigin-RevId: 320565337
2020-07-13 14:02:34 +01:00
andrewlewis
a8f1cdcfd7 Upgrade IMA SDK to 3.19.4
This brings in a fix for the IMA SDK ignoring the media load timeout.

Issue: #7170
PiperOrigin-RevId: 320557386
2020-07-10 09:09:48 +01:00
kimvde
c29fc94540 Fix saiz and senc sample count checks for FMP4
Issue: #7592
PiperOrigin-RevId: 320556981
2020-07-10 09:09:39 +01:00
olly
fd3e10ed76 Fix VPFO counter reporting
DecoderCounters are reset in onEnabled, but the way the local
counters in MediaCodecVideoRenderers were reset assumed the
DecoderCounters were reset in onStarted.

PiperOrigin-RevId: 320440991
2020-07-10 09:09:30 +01:00
olly
351b54e97f Pass correct Format to AudioSink.configure
Building on the Format that was provided on the input side of the
decoder creates a format that's a mixture of the formats on the
input and output sides of the decoder. This change instead builds
a PCM format from scratch.

PiperOrigin-RevId: 320405656
2020-07-10 09:09:21 +01:00
krocard
945471452f Update skippedOutputBufferCount correctly in batching mode
The counter was increased by one for each batch
instead of each frame.

PiperOrigin-RevId: 320396903
2020-07-10 09:09:12 +01:00
olly
e8596428c0 Pass correct formats to AudioSink
The renderers are currently constructing formats that consist of their
input format with added PCM encoding. Such formats are not self-consistent,
and this only works because DefaultAudioSink ignores the rest of the
format if the format has a PCM encoding. It would not work if the sink
implementation checked the MIME type, for example, which wouldn't be a
strange or incorrect thing for it to do.

The more correct approach is to construct a new format that properly
represents the PCM that will be provided to the sink.

This change also renames supportsOutput to supportsFormat, because
AudioSink itself has both an input and an output side, and this method
is actually evaluating support on the input side of the sink.

PiperOrigin-RevId: 320396089
2020-07-10 09:09:02 +01:00
jaewan
02f8cdf1d9 Release media2 extension
PiperOrigin-RevId: 320351394
2020-07-09 08:28:14 +00:00
insun
9a42141e66 Toggles subtitle button's image and content description accordingly
PiperOrigin-RevId: 320323388
2020-07-09 08:04:16 +00:00
ibaker
b1e9257de1 Fix the type of message passed with MSG_PLAYBACK_INFO_CHANGED
The receiving code was updated in:
7b82a3c889
but this sending site was missed.

PiperOrigin-RevId: 320173033
2020-07-09 08:04:04 +00:00