5565 Commits

Author SHA1 Message Date
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
e77ff2a3b0 Fix SmoothStreaming
Issue: #6981
PiperOrigin-RevId: 295579872
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
kimvde
b1b6c8dfea Add test for seek map duration correction in MP3 index seeker
PiperOrigin-RevId: 295543916
2020-02-17 17:14:07 +00:00
kimvde
74443f47f0 Fix DefaultExtractorsFactory Javadoc
PiperOrigin-RevId: 295540885
2020-02-17 17:13:57 +00:00
ibaker
0444e0b338 Add Util.toHexString
PiperOrigin-RevId: 295539969
2020-02-17 17:13:48 +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
krocard
5104548204 Make explicit that Passthrough ∩ PCM = ∅
Previously that was implicit, it was the passthrough dance:
 - MimeTypes.getEncoding(inputFormat) did not
   implement RAW MIME, so it was returning INVALID_ENCODING for PCM
 - and allowPassthrough was returning
         MimeTypes.getEncoding() != INVALID_ENCODING
 - which was setting codecInfo.passthrough, and passthroughEnabled.

Thus Util.isEncodingPcm(encoding) is the opposite of
(MimeTypes.getEncoding(inputFormat) != C.ENCODING_INVALID)

This was rather implicit and brittle as anyone
could add support for audio/RAW in
MimeTypes.getEncoding and break PCM playback.

As a result make it explicit that allowPassthrough
must always return false in PCM.

PiperOrigin-RevId: 295144013
2020-02-17 17:12:58 +00:00
krocard
ce3f981188 Cleanup: Fix comment and make member private
PiperOrigin-RevId: 295140561
2020-02-17 17:12:49 +00:00
andrewlewis
07f66ea469 Fix NewApi error for DummySurface usage
API level >= 17 is guaranteed by shouldUseDummySurface returning true,
but Android Studio shows a warning anyway.

PiperOrigin-RevId: 295118491
2020-02-17 17:12:39 +00:00
bachinger
68398b708e remove pitch field from PlaybackParameters
PiperOrigin-RevId: 294936851
2020-02-17 17:12:19 +00:00
Daniele Bonaldo
987939d306 Add suport for text background color classes 2020-02-13 17:37:21 +01:00
Daniele Bonaldo
fc5dbfeba4 Add default colors list in WebvttCueParser for text foreground class matching with tests
TIL: papayawhip is a color
2020-02-13 17:25:11 +01:00
aquilescanta
a1f666cb9d Make DrmInitData.SchemeData.uuid public
To ease implementation of MediaParser.

PiperOrigin-RevId: 294912244
2020-02-13 15:46:22 +00:00
olly
e606893ff8 Create a SampleDataReader interface for TrackOutput.sampleData().
Modify TrackOutput.sampleData() to accept SampleDataReader instead of ExtractorInput. SampleDataReader supports only read and skip calls, which all sampleData() implementations already restrict themselves to.

PiperOrigin-RevId: 294905155
2020-02-13 15:46:13 +00:00
kimvde
f5025bfce4 Share seek tests between FLAC extractors
PiperOrigin-RevId: 294893303
2020-02-13 15:46:05 +00:00
krocard
ebce903aaf Allow writing multiple frame in a buffer
Currently only one access unit can be written per
buffer write. This has been found to be power
inefficient in an offload situation.

#exo-offload

PiperOrigin-RevId: 294886188
2020-02-13 15:45:56 +00:00
tonihei
714fa477d0 Add isLastInTimelineWindow to MediaPeriodInfo.
This information isn't easily available to the player at the moment (or it
would need to revaluate this every time), so add it to MediaPeriodInfo similar
to the existing isLastInTimelinePeriod.

The player needs to know whether a MediaPeriod is the last in its Timeline
window if we want to add an option to pause at the end of a window.

PiperOrigin-RevId: 294877628
2020-02-13 15:45:39 +00:00
christosts
9c58e57127 Video frame processing offset in DecoderCounters
Add fields in DecoderCounters for computing the average video frame
processing offset.

The MediaCodecVideoRenderer reports the video frame processing offset
and the demo app presents it on the debug information.

PiperOrigin-RevId: 294677878
2020-02-13 15:45:22 +00:00
tonihei
9cf87290ec Always use period duration for end of stream messages.
The transition in EPII happens based on the duration of the periods, not
the windows. So use this duration in case they are not the same.

Also make sure to send the message at duration-1 because the playback position
at the duration is technically already the first position in the next item.

PiperOrigin-RevId: 294669335
2020-02-13 15:45:13 +00:00
olly
06f4983ffb Split bitrate into average and peak in VariantInfo
Issue: #2863
PiperOrigin-RevId: 294661214
2020-02-13 15:45:04 +00:00
tonihei
40101094ba Add option to send messages at end of stream.
This simplifies sending messages to the end of a stream. This was
already possible, but users needed to wait until the duration is known
before sending the message. This duration resolution can happen as part of the message position resolution.

PiperOrigin-RevId: 294626984
2020-02-13 15:44:56 +00:00
kimvde
7a8ab7ce68 FakeTrackOutput: test all the formats sent
PiperOrigin-RevId: 294621946
2020-02-13 15:44:47 +00:00
tonihei
29c43b5e24 Move common bookkeeping to MediaCodecRenderer.
This is a no-op change and just moves some duplicated logic into the
base class.

PiperOrigin-RevId: 294615218
2020-02-13 15:44:38 +00:00
kimvde
bdfd24290f Share FLAC extractor tests between both extractors
PiperOrigin-RevId: 294614958
2020-02-13 15:44:29 +00:00
olly
1440cad5ed Fix build warnings under exoplayer/v2/library
- Removes empty <p> tag in javadoc
- Removes incorrect parameter name warnings for var args.

PiperOrigin-RevId: 294555651
2020-02-13 15:44:11 +00:00
olly
440468603a Add Format peak and average bitrate (hidden for now)
Issue: #2863
PiperOrigin-RevId: 294531127
2020-02-13 15:44:03 +00:00
olly
1cbe3f72e6 DataSpec: Deprecate most constructors
Keeping (Uri) and (Uri, position, length) to avoid needing
Builder for the trivial case.

PiperOrigin-RevId: 294530226
2020-02-13 15:43:54 +00:00
olly
c7b6a2e045 DataSpec: Add customData field.
PiperOrigin-RevId: 294520836
2020-02-13 15:43:45 +00:00
olly
14d3ed09d5 Add DataSpec.Builder
PiperOrigin-RevId: 294518763
2020-02-13 15:43:35 +00:00
Daniele Bonaldo
e99a7f6cd2 Merge branch 'dev-v2' into subtitle_color_in_cue_class
# Conflicts:
#	library/core/src/main/java/com/google/android/exoplayer2/text/webvtt/WebvttCueParser.java
2020-02-12 17:07:23 +01:00
olly
147f70bf5b Format: Move language into common fields section
Language is already applicable to image formats as well.
It can also apply to video formats. For example when the
video contains burnt in subtitles. Also, some animation
studios produce multiple variants of animations, in which
text within the scene itself (e.g., a signpost) is
replaced to be language specific.

PiperOrigin-RevId: 294500227
2020-02-11 22:10:35 +00:00
olly
39c65c658e DataSpec: Make DataSpecTest more useful
- Replace tests specific to HTTP request headers with tests that
  more generally test constructor correctness.
- Add test specifically around the constructor that infers the
  HTTP method from postBody, since that's a non-trivial bit of
  constructor logic.

Note: In general, I'm not sure this type of test (i.e., testing a
bit of trivial copying through a constructor) is worth the cost
of writing and maintaining them. That said, checking the new
uriPositionOffset is calculated correctly is non-trivial, as is
the HTTP method inference, so keeping them for now.
PiperOrigin-RevId: 294488684
2020-02-11 22:10:26 +00:00
olly
829282fa12 Replace DataSpec.absoluteStreamPosition with uriPositionOffset
This is a preliminary step toward adding a DataSpec.Builder,
which is needed for sanity when adding DataSpec.customData.

The existing absoluteStreamPosition field is very error prone,
because anyone using a Builder to adjust the request position
will need to remember to adjust two values:

dataSpec
    .buildUpon()
    .setAbsoluteStreamPosition(x)
    .setPosition(x)
    .build();

Furthermore, the difference between position and
absoluteStreamPosition is irrelevant in nearly all cases. In
the core library, the difference is only relevant when initializing
AES encryption/decryption to write/read cache files.

Replacing absoluteStreamPosition with uriPositionOffset will
simplify the code block above to:

dataSpec
    .buildUpon()
    .setPosition(x)
    .build();

PiperOrigin-RevId: 294485644
2020-02-11 22:10:17 +00:00
kim-vde
fed0acc253 Merge pull request #6949 from DolbyLaboratories:dev-v2-assets
PiperOrigin-RevId: 294441610
2020-02-11 17:12:55 +00:00
christosts
f59755f51c Fix JavaDoc
Replace Thread with thread on documentation.

PiperOrigin-RevId: 294401357
2020-02-11 17:12:45 +00:00
christosts
bc02643df0 Async queuing on MultiLockAsyncMediaCodecAdapter
Add support for asynchronous input buffer queueing in the
MultiLockAsyncMediaCodecAdapter.

PiperOrigin-RevId: 294397811
2020-02-11 17:12:37 +00:00
olly
12187c9048 Apply minimal layout change according to view size
- Add method to scale scrubber handle of DefaultTimeBar

PiperOrigin-RevId: 294366734
2020-02-11 17:12:29 +00:00
kimvde
363599dd54 Move assets from dash to testdata module
PiperOrigin-RevId: 294241169
2020-02-11 17:12:21 +00:00