501 Commits

Author SHA1 Message Date
olly
be88143fcd Remove deprecated parts of demo app IntentUtil
PiperOrigin-RevId: 324604419
2020-08-07 18:59:11 +01:00
gyumin
437275caed Implement device info/volume methods
PiperOrigin-RevId: 323544314
2020-08-01 12:54:23 +01:00
ibaker
fda3b3d8ec Use static imports for methods that make sense without their class name
PiperOrigin-RevId: 323349585
2020-07-27 23:59:52 +01:00
ibaker
7083dbf7b4 Remove zero-args ParsableByteArray#reset() method
It's potentially confusing that this resets both position & limit, so
require callers to pass `limit` explicitly, or call setPosition(0)
if that's actually what they intended.

This makes enforcing the limit in an upcoming change slightly safer.

PiperOrigin-RevId: 323340485
2020-07-27 23:59:43 +01:00
ibaker
ce2e6e2fd6 Hide ParsableByteArray#data behind a getter
This allows us to enforce the limit because the array can only be
reassigned through reset(byte[]) or reset(byte[], int) (which update
the limit)

PiperOrigin-RevId: 323339960
2020-07-27 23:59:34 +01:00
ibaker
478f59fd08 Replace ExoPlayer's functional types with Guava alternatives
This removes Supplier, Function and Predicate. Consumer is kept because
Guava doesn't have an equivalent (Java 8 does, but we can't use that
yet).

#exofixit

PiperOrigin-RevId: 323324392
2020-07-27 23:59:25 +01:00
olly
0ce2632ad1 Clean up some Format documentation
- Fix spurious line break
- Try and cut down on references to other components

PiperOrigin-RevId: 322971988
2020-07-27 23:58:40 +01:00
christosts
9a51681332 Update internal reference
#exofixit

PiperOrigin-RevId: 322791471
2020-07-24 10:48:07 +01:00
olly
6d92eebe51 Revert Format back to only containing audio encoding for PCM
PiperOrigin-RevId: 322683545
2020-07-24 10:46:37 +01:00
olly
92029ed0ad Un-deprecate Format.pcmEncoding and switch tests back to it.
This change precedes one that will remove Format.encoding.

PiperOrigin-RevId: 322619495
2020-07-24 10:46:28 +01:00
christosts
6c837643b9 Fix dependency on common module
PiperOrigin-RevId: 322533712
2020-07-24 10:44:30 +01:00
christosts
3191afe82e Common tests do not depend on testutils
This commit duplicates some code from the testutils module
in common test in order to break the dependency from testutils.

PiperOrigin-RevId: 322366013
2020-07-24 10:44:02 +01:00
ibaker
e0b7263ce4 Remove SpannedSubject dependency from UtilTest
PiperOrigin-RevId: 322341513
2020-07-24 10:43:25 +01:00
christosts
34a887e2d3 Common module tests depend on core
PiperOrigin-RevId: 322325657
2020-07-24 10:43:16 +01:00
christosts
b249480060 Offline: store MIME type and keySetId
Replace `type` with (optional) `mimeType` and add `keySetId` in
DownloadRequest. The DownloadHelper infers the downloading method (DASH,
HLS, SmoothStreaming or Progressive) from the content's MIME type and
URI.

PiperOrigin-RevId: 322117384
2020-07-24 10:39:30 +01:00
christosts
63b965d3f0 Non-null MIME types infer to other content type
PiperOrigin-RevId: 322114754
2020-07-24 10:39:12 +01:00
olly
9185b5177a Temporarily remove OPUS from sync samples optimization.
This is currently causing frames to be dropped when we seek.

PiperOrigin-RevId: 322009748
2020-07-24 10:38:44 +01:00
ibaker
161dea661f Assorted deprecation fixes/migrations/suppressions
These were missed on the first pass

PiperOrigin-RevId: 321553847
2020-07-24 10:37:41 +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
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
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
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
a0703cb716 Add encoding constant for AAC ER BSAC
PiperOrigin-RevId: 320601157
2020-07-13 14:03:45 +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
ibaker
fa594489d9 Completely separate MediaSource & DrmSession EventDispatchers
PiperOrigin-RevId: 319989989
2020-07-08 13:55:38 +01:00
kimvde
c06fa144e1 Remove some sanity occurrences in Java files
Remove occurrences in comments and private fields.

ISSUE: #7565
PiperOrigin-RevId: 319828820
2020-07-08 13:54:51 +01:00
aquilescanta
afbeb4267a Add UnsupportedMediaCrypto
ExoMediaCrypto with the sole purpose of being unsupported. So all
renderers checking whether the type is supported will report
encrypted content as unsupported, unless the source producing
the format replaces it with a valid value.

PiperOrigin-RevId: 319824703
2020-07-08 13:54:43 +01:00
olly
93b5b947db Support decode-only metadata buffers
PiperOrigin-RevId: 319798613
2020-07-08 13:54:24 +01:00
tonihei
113a2df775 Add some missing nullness assertions.
They are all for Context.getSystemService that is allowed to return
null. In most cases where we need to service, we make an assertion that
it is available.

PiperOrigin-RevId: 319503557
2020-07-03 15:31:30 +01:00
tonihei
e4e743a35f Fix remaining common module nullness issues.
PiperOrigin-RevId: 319183621
2020-07-03 09:01:20 +01:00
bachinger
20820800f3 Prevent parallel timeline access in MaskingMediaSource
The list of MediaSourceHolder in ExoPlayerImpl is only maintained to be able to create a PlaylistTimeline for masking. By keeping only the id and a snapshot of the timeline of the MediaSourceHolder in ExoPlayerImpl, parallel access is prevented and we still have sufficient information to create the masking timeline.

PiperOrigin-RevId: 319003837
2020-07-03 09:00:19 +01:00
olly
159c77919a Bump release to 2.11.7
PiperOrigin-RevId: 318790917
2020-06-29 13:33:18 +01:00
krocard
78825a41dc Store encodings in Format instead of just pcm encodings
Previously only pcm encoding were stored in Format,
this was an issue as for audio passthrough and offload
lots of code needs to pass complex format informations
(encoding, sample rate, channel count, gapless metadata)
but could not use Format and each function was taking
each as different parameter.

By allowing Format to contain any encoding, and not only
pcmEncoding, it allows to pass a Format everywhere in ExoPlayer
code that needs a Format.

This patch does not have any functional change. It is only an internal refactor.

PiperOrigin-RevId: 318789444
2020-06-29 13:33:09 +01:00
tonihei
4138e28d62 Move common gradle setup to a setting file.
This removes a lot of duplication from the module configuration,
avoids divergence, and makes sure that only the important differences
to the default are visible in each module file.

PiperOrigin-RevId: 318024823
2020-06-26 11:13:25 +01:00
olly
73546231d2 Bump ExoPlayerLibraryInfo versions to 2.11.6
PiperOrigin-RevId: 317921368
2020-06-26 11:13:10 +01:00
gyumin
3eac5b4328 Move AudioAttributes to common module
PiperOrigin-RevId: 317864048
2020-06-26 11:12:53 +01:00
samrobinson
836babd5d6 Replace usages of Charset.forName with Guava Charsets.
PiperOrigin-RevId: 317672619
2020-06-23 11:07:43 +01:00
tonihei
1836f1df36 Update Checkerframework.
The compat dependency is no longer maintained and we need to keep
it at its old version.

PiperOrigin-RevId: 317658349
2020-06-23 11:07:34 +01:00
tonihei
c5c4c87728 Restrict some Handler to current Looper only.
They currently fall back to the main Looper if the current thread
doesn't have a Looper. All the changed Handlers are guaranteed to
be created on a thread with a Looper (mostly the ExoPlayer playback
Looper) and thus can make this stricter assumption. This makes it
easier to reason about the code as there are no ambiguities as to which
thread the Handler is running on.

PiperOrigin-RevId: 317334503
2020-06-23 11:06:31 +01:00
tonihei
7d66865d20 Rollback of 63ae4cc54b
*** Original commit ***

Rollback of 6ae472243f

*** Original commit ***

PiperOrigin-RevId: 317331407
2020-06-23 11:06:22 +01:00
olly
63ae4cc54b Rollback of 6ae472243f
*** Original commit ***

Rename Util methods to clarify which Looper is used.

The method name didn't clarify that either the main or current
Looper is used.

***

PiperOrigin-RevId: 317283606
2020-06-23 11:05:56 +01:00
tonihei
6ae472243f Rename Util methods to clarify which Looper is used.
The method name didn't clarify that either the main or current
Looper is used.

PiperOrigin-RevId: 317276561
2020-06-23 11:05:46 +01:00
olly
816a364a51 Clean up MimeTypes Javadoc
PiperOrigin-RevId: 317148010
2020-06-23 11:05:29 +01:00
olly
88883ffd67 Generalize MimeTypes.isWebm to MimeTypes.isMatroska
It seems more natural given we always end up instantiating a Matroska extractor,
not one that's specific to the WebM subset of Matroska. There's also no reason
not to support Matroska MIME types in DASH.

PiperOrigin-RevId: 316975451
2020-06-23 11:04:56 +01:00
olly
f85098a88f Update deprecation JavaDoc for ExoPlayer DataSpec
constructor to note that the builder does NOT
infer the http method from the existence of the
post body.

PiperOrigin-RevId: 316765677
2020-06-17 14:31:59 +01:00
olly
c808db9935 Add MIME types for which every sample is known to be a sync sample.
- Leaving the TODO, since there are still MIME types we're unsure about.
- Removing AAC because xHE-AAC does not have this property. We may re-add
  it with an additional profile check to exclude xHE-AAC in the future.

PiperOrigin-RevId: 316715147
2020-06-17 14:31:43 +01:00
aquilescanta
e7da26368a Add MediaParser-based implementation of ChunkExtractor
PiperOrigin-RevId: 315720712
2020-06-11 10:11:20 +01:00
krocard
0caada8b8c Fix formating in javadoc
PiperOrigin-RevId: 315516836
2020-06-11 10:10:27 +01:00