8156 Commits

Author SHA1 Message Date
olly
2ee72076e5 Add datasource module
PiperOrigin-RevId: 404897119
2021-10-25 13:49:14 +01:00
olly
37b5847681 Get decoder buffers into the right place
PiperOrigin-RevId: 404876228
2021-10-21 23:16:02 +01:00
olly
ce17f61899 Add decoder module
PiperOrigin-RevId: 404810682
2021-10-21 18:41:33 +01:00
olly
bffe2f7bb3 Fix 2 ErrorProneStyle findings:
* @Reason is not a TYPE_USE annotation, so should appear before any modifiers and after Javadocs.
  (see go/java-style#s4.8.5-annotations)
* Curly braces should be used for inline Javadoc tags: {@code ...}
  (see http://go/bugpattern/InvalidInlineTag)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if the change looks generally problematic.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/media/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

PiperOrigin-RevId: 404769260
2021-10-21 18:25:26 +01:00
christosts
bbe2cef740 DefaultMediaSourceFactory: Lazily load media source factories
Th purpose of this change is to speed up the instantiation of the
DefaultMediaSourceFactory.

PiperOrigin-RevId: 404665352
2021-10-21 12:01:41 +01:00
samrobinson
140ef753f7 Move SimpleExoPlayer.Builder logic to ExoPlayer.Builder.
SimpleExoPlayer Builder now wraps an ExoPlayer.Builder, rather than the
other way round.

PiperOrigin-RevId: 404509106
2021-10-21 11:54:11 +01:00
olly
2ebbdbef8c Move upstream.cache to common ahead of module split
PiperOrigin-RevId: 404502640
2021-10-20 14:02:32 +01:00
bachinger
b74ee00c0f Minor JavaDoc improvement in ExoPlayerLibraryInfo
PiperOrigin-RevId: 404384670
2021-10-20 13:43:23 +01:00
bachinger
0555ae0a92 Move translated strings for download notification to lib-exoplayer
PiperOrigin-RevId: 404316538
2021-10-20 13:39:38 +01:00
olly
ea2013948a Finalize text package
PiperOrigin-RevId: 404277755
2021-10-19 17:32:24 +01:00
olly
b3a1dcfee9 Fix remaining releaseArtifactId renames
PiperOrigin-RevId: 404236349
2021-10-19 14:36:15 +01:00
olly
2ef2206041 Move text classes that don't need to live in common.
PiperOrigin-RevId: 404079772
2021-10-18 23:52:28 +01:00
olly
d601875452 Rename releaseArtifact to releaseArtifactId
PiperOrigin-RevId: 404059404
2021-10-18 22:45:47 +01:00
olly
4aeec53019 Copybara config cleanup
PiperOrigin-RevId: 404007749
2021-10-18 20:44:41 +01:00
olly
dd23cb13da Fix moving of DataReader
PiperOrigin-RevId: 403965543
2021-10-18 16:24:57 +01:00
olly
80286b42d6 Move metadata classes that don't need to live in common.
PiperOrigin-RevId: 403945085
2021-10-18 15:45:36 +01:00
ibaker
bcaadf434f Remove checkState calls from DefaultDrmSession#acquire() and release()
Issue: #9392 reports occasional IllegalStateExceptions from release()
in crashlytics,`with no way to reproduce locally. It seems likely there
is a bug somewhere in DRM handling, and ideally we would find that and
fix it.

However we haven't been able to find the problem, and in the meantime
these exceptions cause the entire app to crash. Although this is
arguably useful from a debugging perspective, it's obviously a poor
experience for developers and users, since all we're actually trying to
do is release the session, so maybe we shouldn't strictly care that it's
already released?

This change replaces the exception with an error log, which might be a
useful debugging hint if we see other DRM unexpected behaviour due to
references to released sessions being held for too long.

PiperOrigin-RevId: 403942546
2021-10-18 15:41:08 +01:00
olly
a242aa221e Move DataReader to common
PiperOrigin-RevId: 403928449
2021-10-18 15:34:37 +01:00
olly
a4c1005823 Move CachedRegionTracker to upstream root
PiperOrigin-RevId: 403914807
2021-10-18 15:29:52 +01:00
olly
18cf01cda6 Move DataSource utils into a DataSourceUtil class
PiperOrigin-RevId: 403910535
2021-10-18 15:25:43 +01:00
ibaker
8fd1381a84 Update two MediaItem.DrmConfiguration setters to reject null
Builder setters should only accept null when the underlying property can
be null. In this case null is directly converted to an empty map/list.

PiperOrigin-RevId: 403406626
2021-10-18 15:21:34 +01:00
ibaker
707968f7e6 Migrate usages of PositionInfo#windowIndex to mediaItemIndex
PiperOrigin-RevId: 403376452
2021-10-18 15:13:20 +01:00
aquilescanta
48518cf94d Add @RequiresApi to releaseDummySurface
dummySurface.release requires API 17.

PiperOrigin-RevId: 403368448
2021-10-18 15:00:58 +01:00
ibaker
18b1f3d624 Migrate usages of DrmConfiguration.sessionForClearTypes to new field
The new forcedSessionTrackTypes field was introduced in
<unknown commit>.

These usages are migrated in a follow-up change to add confidence that
the deprecated field continued to work correctly.

PiperOrigin-RevId: 403342893
2021-10-18 14:56:46 +01:00
ibaker
61c8f8c27e Rename DrmConfiguration.sessionForClearTypes to forcedSessionTrackTypes
The previous name is quite easy to misread because it sounds like it
splits up like "(session) for (clear types)" when it's meant to be
"(session for clear) (types)".

The old field is left deprecated for backwards compatibility. The
DrmConfiguration.Builder methods are directly renamed without
deprecation because they're not yet present in a released version of
the library.

PiperOrigin-RevId: 403338799
2021-10-15 12:53:50 +01:00
kimvde
5ef00f0e96 Remove deprecated ControlDispatcher
The possibilities to set a ControlDispatcher have been removed in
<unknown commit> so that the ControlDispatcher is always a
DefaultControlDispatcher.

PiperOrigin-RevId: 403327092
2021-10-15 12:45:39 +01:00
olly
6ef82e4423 Move upstream components to common
Common houses DataSource as an interface for reading data,
but most of the concrete implementations are in ExoPlayer.
This means that in practice, if an app wants to use a module
that reads using DataSource (e.g. extractor), they may be
forced to depend on ExoPlayer as well to get a concrete
implementation (e.g. FileDataSource). This change moves the
DataSource implementations into common to resolve this.

PiperOrigin-RevId: 403222081
2021-10-15 12:37:18 +01:00
olly
b2bf9f4d0f Fix missing import
PiperOrigin-RevId: 403113286
2021-10-14 23:23:57 +01:00
ibaker
21cfd62cfd Update ExoPlayer.Builder#build() to return ExoPlayer (instead of SEP)
Users who need a (deprecated) SimpleExoPlayer instance should use
(the also deprecated) SimpleExoPlayer.Builder.

PiperOrigin-RevId: 403108197
2021-10-14 23:20:01 +01:00
kimvde
746ad2e6aa Remove deprecated ControlDispatcher from API surface
PiperOrigin-RevId: 403101980
2021-10-14 17:03:23 +01:00
kim-vde
059dfaef7c Merge pull request #9496 from DolbyLaboratories:dev-v2-truehd
PiperOrigin-RevId: 403081883
2021-10-14 16:16:05 +01:00
olly
fb1cba3c92 Fix missing imports and package-info.java
PiperOrigin-RevId: 403071721
2021-10-14 16:12:48 +01:00
ibaker
1607043643 Rename Player.PositionInfo#windowIndex to mediaItemIndex
Also fix a typo where windowIndex was being passed to Objects.hashCode
twice.

The old field is left deprecated for backwards compatibility. Usages
will be migrated in an upcoming change.

PiperOrigin-RevId: 403049260
2021-10-14 12:24:01 +01:00
ibaker
a168c8c928 Use SimpleExoPlayer.Builder where necessary
An upcoming change will modify ExoPlayer.Builder#build() to return
ExoPlayer, so any places that explicitly need a SimpleExoPlayer
instance should be using SimpleExoPlayer.Builder.

PiperOrigin-RevId: 403028312
2021-10-14 12:15:46 +01:00
ibaker
5fe3ec59ca Deprecate SimpleExoPlayer in favour of ExoPlayer
PiperOrigin-RevId: 403028279
2021-10-14 12:11:35 +01:00
samrobinson
3c19850ed3 Migrate library usages of SimpleExoPlayer to ExoPlayer.
PiperOrigin-RevId: 402853522
2021-10-14 12:03:11 +01:00
krocard
3b8eba2dea Refactor initTrackSelectionAdapter
As suggested in parent change, return a list of
`TrackType` instead of appending to it.

This has the slight disadvantage of iterating twice
over the (short) list, but clarifies the code.

PiperOrigin-RevId: 402844458
2021-10-14 11:58:53 +01:00
krocard
98ee159df1 Use TracksInfo and selection override in users
Update the UI module, the demos and most other users
to make use of the new player TracksInfo and track
selection override APIs.

PiperOrigin-RevId: 402817857
2021-10-14 11:54:45 +01:00
olly
fe0a5662de Move DataSink and upstream.crypto to common
PiperOrigin-RevId: 402812895
2021-10-14 11:50:36 +01:00
olly
0dc2567179 Remove one method class in crypto package
PiperOrigin-RevId: 402787577
2021-10-13 20:14:49 +01:00
olly
02719fd5b9 Move test asset ContentProvider to testutil
PiperOrigin-RevId: 402772598
2021-10-13 20:11:02 +01:00
olly
91da6a3434 Fix nullness checks for UdpDataSource
PiperOrigin-RevId: 402765571
2021-10-13 20:07:24 +01:00
olly
b75d68782e Fix import
PiperOrigin-RevId: 402765438
2021-10-13 20:03:48 +01:00
jaewan
11becc050a Separate command code for prepare() and stop()
PiperOrigin-RevId: 402757305
2021-10-13 19:58:02 +01:00
christosts
a18e281275 SubtitleExtractor: optimize calls to ExtractorInput.read()
When ExtractorInput.getLength() returns a defined length, the
SubtitleExtractor will create a buffer of the same length, call
ExtractorInput.read() until it has read the input bytes, plus one more
time where ExtractorInput.read() returns RESULT_END_OF_INPUT. The last
call to ExtractorInput.read() however will make the SubtitleExtractor to
increase its buffer (including a copy) unnecessarily.

This change makes the SubtitleExtractor avoid calling
ExtractorInput.read() if the expected number of bytes have already
been read, so that the internal buffer does not grow.

PiperOrigin-RevId: 402583610
2021-10-12 20:04:46 +01:00
christosts
4b3cbfd64f End to end test for WebVTT sideloaded subtitles
Enable subtitle output in the PlaybackOutput and disable the text
renderer in the MkvPlaybackTest. Add WebvttPlaybackTest to test the
output of side-loaded WebVTT subtitles.

PiperOrigin-RevId: 402526588
2021-10-12 19:48:48 +01:00
christosts
a56af3d0e0 SubtitleExtractor: mark the limit of the input buffer
Before this change, the SubtitleExtractor did not mark the limit
of the input buffer, thus the SubtitleDecoder attempted to decode
more bytes. If the subtitle file had a new line at the end, this
bug would make the SubtitleDecoder append an line break after the
last subtitle.

PiperOrigin-RevId: 402523039
2021-10-12 19:44:46 +01:00
olly
8a9dcadef3 README updates for misc modules
PiperOrigin-RevId: 402292139
2021-10-12 19:40:44 +01:00
olly
67f9f18d8d README updates for remaining ExoPlayer modules
PiperOrigin-RevId: 402287125
2021-10-12 19:32:32 +01:00
olly
69f2692389 Register modules with common
PiperOrigin-RevId: 402267733
2021-10-11 14:18:37 +01:00