8128 Commits

Author SHA1 Message Date
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
olly
e160649d9c README updates for MediaSource, DataSource and UI modules
PiperOrigin-RevId: 401793145
2021-10-09 18:21:54 +01:00
olly
e4a5c07b5f Mechanical README cleanups 2
PiperOrigin-RevId: 401777730
2021-10-09 18:18:12 +01:00
olly
e7c6ed5e7f Mechanical README cleanups
PiperOrigin-RevId: 401767060
2021-10-09 18:14:36 +01:00
andrewlewis
1d29f12677 Update translations
PiperOrigin-RevId: 401767033
2021-10-09 18:10:12 +01:00
ibaker
ce66b01ee2 Remove ExoPlayer.Builder#buildExoPlayer
We no longer need separate methods to build Player and ExoPlayer.

PiperOrigin-RevId: 401751761
2021-10-09 17:58:54 +01:00
olly
d45cf6028d Remove reference to ExoPlayer from UI module
PiperOrigin-RevId: 401751490
2021-10-09 17:54:50 +01:00
bachinger
e66f9fafe1 Clean up ExoPlayerLibraryInfo
PiperOrigin-RevId: 401729859
2021-10-08 12:18:27 +01:00
samrobinson
96a2c03f59 Add public SimpleExoPlayer methods to ExoPlayer.
PiperOrigin-RevId: 401535981
2021-10-07 22:04:05 +01:00
ibaker
fc25798af6 Add public.xml to UI module with an empty <public /> node
This is the recommended way to mark all resources as private:
https://developer.android.com/studio/projects/android-library#PrivateResources

PiperOrigin-RevId: 401470108
2021-10-07 21:57:50 +01:00
ibaker
e4221c3844 Rollback of ed23b2905b
*** Original commit ***

Migrate callers of ExoPlayer.Builder#build() to buildExoPlayer()

An upcoming change will update build() to return Player.

PiperOrigin-RevId: 401468532
2021-10-07 21:53:57 +01:00
ibaker
f440aed4e9 Make ExoPlayer.Builder#build return SimpleExoPlayer
In a future change it will be updated to return ExoPlayer

We no longer need separate methods to build Player and ExoPlayer, so
buildExoPlayer will be removed shortly.

PiperOrigin-RevId: 401441016
2021-10-07 21:41:37 +01:00
ibaker
ee71c8387c Migrate usages of deprecated Player COMMAND_ constants
PiperOrigin-RevId: 401292817
2021-10-06 21:19:37 +01:00
tonihei
d5f71a5dbd Move misplaced parenthesis.
PiperOrigin-RevId: 401245843
2021-10-06 21:08:29 +01:00
ibaker
96cfd0b415 Rename Player methods to refer to MediaItem instead of Window
PiperOrigin-RevId: 401222863
2021-10-06 21:05:14 +01:00
olly
585b0bddcc DASH: Set MIME, width and height for image adaptation sets
Issue: #9500
PiperOrigin-RevId: 401091261
2021-10-06 20:55:10 +01:00
huangdarwin
03ff5b6618 Transformer: Add TranscodingTransformer.
Temporary file copy of Transformer, which uses
TransformerTranscodingVideoRenderer instead of
TransformerMuxingVideoRenderer to transform files. This allows devs to test
transcoding more easily using the Transformer demo, while external engineers
continue to see the completely working Muxing-based transformer.

In the future, this will replace the Transformer class.

PiperOrigin-RevId: 401020893
2021-10-05 23:33:55 +01:00
ibaker
ea210e35fe Remove IntRange annotations from index-based Player methods
It can be assumed that indexes are always >=0.

PiperOrigin-RevId: 400990569
2021-10-05 23:30:53 +01:00
ibaker
6d9b050a38 Add range annotations to Player volume and percentage methods
These are the most likely to cause developer confusion due to potential
ambiguity.

PiperOrigin-RevId: 400990454
2021-10-05 23:27:47 +01:00
claincly
3eda590c87 Rollback of 9788750ddb
*** Original commit ***

Simplify GL program handling.

***

PiperOrigin-RevId: 400970170
2021-10-05 23:24:48 +01:00
olly
80d365163d Rollback of 912c47ff6f
*** Original commit ***

Rollback of 8ed6c9fcf5

*** Original commit ***

Fix capitalization of language in track selector

Issue: #9452

***

***

PiperOrigin-RevId: 400942287
2021-10-05 23:18:25 +01:00
krocard
ac881be2fc Add TracksInfo to the Player API
TracksInfo is very similar to
`MappingTrackSelector.MappedTracksInfo` with some
fields removed to simplify the Player API,
notably it doesn't expose the renderer concept.

A significant difference is the addition of a `selected` boolean
field which avoids having a separate `getCurrentTrackSelection`
API.

This cl is a part of the bigger track selection change,
splitted for ease of review.

In particular, the MediaSession implementation and UI usage
have been slitted in child cls.

Find all cls with the tag:
#player-track-selection

PiperOrigin-RevId: 400937124
2021-10-05 23:15:16 +01:00
christosts
7a2c7c3297 Make asynchronous queueing non-experimental
This change makes asynchronous queueing non-experimental, it enables the
feature by default on devices with API level >= 31 (Android 12+) and
exposes APIs for apps to either fully opt-in or opt-out from the
feature.

The choice to use or not asynchronous queueing is moved out of
MediaCodecRenderer to a new MediaCodecAdapter factory, the
DefaultMediaCodecAdapterFactory. This is because, at the moment,
if an app passes a custom adapter factory to a MediaCodecRenderer and
then enables asynchronous queueing on it, the custom
adapter factory is not used but this is not visible to the user.

The default behavior of DefaultMediaCodecAdapterFactory is to create
asynchronous MediaCodec adapters for devices with API level >= 31
(Android 12+), and synchronous MediaCodec adapters on devices with older
API versions.

DefaultMediaCodecAdapterFactory exposes methods to force enable or force
disable the use of asynchronous adapters so that applications can enable
asynchronous queueing on devices with API versions before 31 (but not
before 23), or fully disable the feature. For applications that build
MediaCodecRenderers directly, they will need to create a
DefaultMediaCodecAdapterFactory and pass it to the renderer constructor.
For applications that rely on the DefaultRenderersFactory, additional
methods have been added on the DefaultRenderersFactory to control
enabling/disabling asynchronous queueing.

Issue: #6348
PiperOrigin-RevId: 400733506
2021-10-05 11:22:01 +01:00
kimvde
84881739ee Map TS stream type 0x80 to H262
Issue: #9472
PiperOrigin-RevId: 400715255
2021-10-04 15:43:47 +01:00
olly
912c47ff6f Rollback of 8ed6c9fcf5
*** Original commit ***

Fix capitalization of language in track selector

Issue: #9452

***

PiperOrigin-RevId: 400706984
2021-10-04 15:40:47 +01:00
olly
ac4a7e919a Remove ExoPlayer link from UI module
PiperOrigin-RevId: 400706800
2021-10-04 15:37:48 +01:00
claincly
9788750ddb Simplify GL program handling.
PiperOrigin-RevId: 400697945
2021-10-04 15:34:43 +01:00
bachinger
7383bf7696 Fix dev-v2 build
PiperOrigin-RevId: 400681582
2021-10-04 12:16:50 +01:00
olly
8ed6c9fcf5 Fix capitalization of language in track selector
Issue: #9452
PiperOrigin-RevId: 400680794
2021-10-04 12:13:49 +01:00