12205 Commits

Author SHA1 Message Date
ibaker
f94148c478 Add microseconds suffix to Timeline#getPeriodPosition
The old methods are deprecated and left in place for backwards
compatibility.

PiperOrigin-RevId: 400188084
2021-10-04 11:40:20 +01:00
Andrew Shu
e883c04006 Fix setting initial 0 position in PlayerControlView 2021-10-03 15:58:05 -07:00
ibaker
b192465bba Migrate usages of MediaItem.Subtitle to SubtitleConfiguration
Usages of the (already deprecated) Subtitle constructors were not
migrated, as it would require migrating to the Builder which is a more
involved change.

PiperOrigin-RevId: 400153139
2021-10-01 11:27:30 +01:00
claincly
d4343ed858 Allow configuring encoder.
PiperOrigin-RevId: 400151886
2021-10-01 11:23:17 +01:00
ibaker
7a3dedce07 Rename MediaItem.Subtitle to SubtitleConfiguration
This is more consistent with the other MediaItem inner classes which are
all Configurations.

The old class and fields are left deprecated for backwards
compatibility.

The deprecated Subtitle constructors are not moved to
SubtitleConfiguration.

PiperOrigin-RevId: 400144640
2021-10-01 11:19:53 +01:00
ibaker
4e9e38f3a7 Update ExoPlayer.Builder#build() to return Player
If callers need an ExoPlayer instance they should use buildExoPlayer().

Also remove the @InlineMe annotation now these methods are no longer
equivalent.

PiperOrigin-RevId: 400143239
2021-10-01 11:16:20 +01:00
Oliver Woodman
9926a8f6e3 Merge pull request #9498 from DolbyLaboratories:dev-v2-direct-automotive
PiperOrigin-RevId: 400134426
2021-10-01 11:12:56 +01:00
ibaker
ce0cf23a7f Migrate callers of ExoPlayer.Builder#build() to buildExoPlayer()
An upcoming change will update build() to return Player.

PiperOrigin-RevId: 399981901
2021-09-30 21:36:14 +01:00
krocard
d5ef11aaf3 Add track selection override to the player API
This moves `SelectionOverride` from `DefaultTrackSelector`
to `TrackSelectionParameters`.

It is then use to allow track selection override per
track selection array.

Note that contrary to
`DefaultTrackSelector.Parameters.selectionOverride`, the renderer
concept is not exposed.

This cl is a part of the bigger track selection change,
splitted for ease of review.
Find all cls with the tag:
#player-track-selection

PiperOrigin-RevId: 399933612
2021-09-30 21:29:53 +01:00
bachinger
ece0cfc9f2 Move some tests to facilitate package renaming
PiperOrigin-RevId: 399923140
2021-09-30 21:27:03 +01:00
samrobinson
e335022e0b Fix mediaMetadata being reset when media is repeated.
Issue: #9458
PiperOrigin-RevId: 399901865
2021-09-30 21:24:10 +01:00
olly
410ddf458c Add link to annual media developer survey.
This will be removed after the survey has closed in ~1 month.

PiperOrigin-RevId: 399890121
2021-09-30 11:31:44 +01:00
gyumin
b105412a41 Rename BundleableUtils to BundleableUtil for consistency
All utility classes in the common module has the same naming convention.

PiperOrigin-RevId: 399831748
2021-09-30 11:28:59 +01:00
tonihei
00412967c7 Simplify tests for correct order of release events.
There are two very similar tests checking for release events,
one running with Robolectric and one instrumentation test.

The instrumentation test only adds the interaction with the player
to release it while the renderers are active. This same interaction
can be added to the Robolectric test as well.
This arguably improves the realism of the Robolectric test too
as we listen for real player events instead of simulating the same
events.

PiperOrigin-RevId: 399694869
2021-09-30 11:26:19 +01:00
bachinger
82172c7d3b Strip DaiStreamRequest and test from public release for now.
PiperOrigin-RevId: 399669963
2021-09-30 11:23:27 +01:00
bachinger
6d014cbfd2 Move SubtitleExtractor to text package
PiperOrigin-RevId: 399661676
2021-09-30 11:20:44 +01:00
ibaker
71f07e7a2b Update ExoPlayer.Builder javadoc to mention buildExoPlayer()
PiperOrigin-RevId: 399651641
2021-09-30 11:17:59 +01:00
bachinger
ee14d51d90 Merge pull request #9413 from jaeho-lee104:feature/dev-2-abr-option
PiperOrigin-RevId: 399510059
2021-09-29 10:14:21 +01:00
ibaker
f39dba0c5b Migrate usages of MediaItem.ClippingProperties to ClippingConfiguration
PiperOrigin-RevId: 399471555
2021-09-29 10:10:13 +01:00
ibaker
8db6ea4649 Rename MediaItem.ClippingProperties to ClippingConfiguration
This is more consistent with the other MediaItem inner classes which are
all Configurations.

The old class and fields are left deprecated for backwards
compatibility.

MediaItem.Builder#setClippingProperties is directly renamed (without
deprecation) because it only exists on the dev-v2 branch and hasn't
been included in a numbered ExoPlayer release.

PiperOrigin-RevId: 399471414
2021-09-29 10:07:18 +01:00
ibaker
b6b39cf7cf Use JUnit's Assume to skip Widevine GTS tests on non-GMS devices
DashTestRunner.setWidevineInfo instantiates a Widevine MediaDrm to check
for L1 support, which fails on GMS devices that don't support Widevine.

The Widevine tests should be skipped on these devices, but the
setWidevineInfo call happens in @Before before the skipping logic
inside the test.

This change moves the skipping logic to the beginning of @Before, and
uses Assume to ensure the test isn't run.

This will also report the test as 'skipped due to unmet assumption'
which is more precise than 'passed'.

PiperOrigin-RevId: 399452734
2021-09-29 10:04:29 +01:00
tonihei
d9cfebd895 Update initial network bandwidth estimates.
PiperOrigin-RevId: 399444511
2021-09-29 10:01:50 +01:00
christosts
5ae2982122 Change how AnalyticsCollector forwards onPlayerReleased
Before releasing r2.15.0, we had a regression that crashed
PlaybackStatsListener. A change in the AnalyticsCollector made
it to send an additional AnalyticsListener.onEvents() callback after
calling Player.release() and AnalyticsListener.onEvents() appeared
to arrive with event times that were not monotonically increasing.
The AnalyticsListener.onEvents() callback that contained
AnalyticsListener.EVENT_PLAYER_RELEASED was called with a timestamp that
was smaller than event times of previously AnalyticsListener.onEvents()
calls.

A first fix changed the order of events being forwarded to
AnalyticsListener. Upon calling Player.release(), the AnalyticsCollector
would call AnalyticsListener.onPlayerReleased() and its associated
AnalyticsListener.onEvents() on the same stack call. This fix maintained
that event times are monotonically increasing, but made
AnalyticsListener.onPlayerReleased() be called earlier.

This change:
- Further changes AnalyticsCollector to ensure that
  AnalyticsListener.onPlayerReleased() and its related
  AnalyticsListener.onEvents() are the last callbacks to be called,
  and the associated timestamp is bigger than  previously reported
  event times.
- Adds an instrumentation test to guard against the regression.

PiperOrigin-RevId: 399437724
2021-09-28 16:48:57 +01:00
ibaker
679e3751d5 Fix bug in MCVR where dummySurface is released but surface isn't nulled
The fix for Issue: #8776 was to release and null-out dummySurface if
it doesn't match the security level of the decoder. But it's possible
that this.surface is already set to this.dummySurface, in which case we
must also null out this.surface otherwise we will later try and re-use
the old, released DummySurface instance.

This logic already exists in MCVR#onReset, so I pulled it into a
releaseDummySurface() helper function.

Issue: #9476
#minor-release
PiperOrigin-RevId: 399420476
2021-09-28 16:43:39 +01:00
bachinger
3e7b2d06c1 Move SubtitleExtractor to text package
PiperOrigin-RevId: 399400909
2021-09-28 16:41:08 +01:00
ibaker
ed23b2905b Migrate callers of ExoPlayer.Builder#build() to buildExoPlayer()
An upcoming change will update build() to return Player.

PiperOrigin-RevId: 399382297
2021-09-28 16:38:20 +01:00
ibaker
a04f1d1726 Migrate usages of MediaItem.PlaybackProperties to LocalConfiguration
PiperOrigin-RevId: 399206106
2021-09-28 16:35:31 +01:00
bachinger
e373e0cbaf Inline SimpleSubtitleOutputBuffer
PiperOrigin-RevId: 399179751
2021-09-28 16:32:53 +01:00
kimvde
a82690a533 Use SurfaceTexture.getTimestamp
PiperOrigin-RevId: 399139842
2021-09-28 16:30:12 +01:00
gyumin
1e6a3aa6fb Update androidx.media version to 1.4.2
PiperOrigin-RevId: 399108998
2021-09-28 16:27:37 +01:00
Dean Wheatley
732fc3ef3a Check direct playback capabilities for automotive devices
For Automotive devices, surround encodings can be supported via
the passthrough path. Therefore, include automotive in the allowed
device types in the isDirectPlaybackSupported checks. The automotive
system feature is checked, rather then UI_MODE_TYPE_CAR, because
the UI_MODE_TYPE_CAR can be force enabled via
android.app.UiModeManager.enableCarMode(), whereas FEATURE_AUTOMOTIVE
cannot be forced.
2021-09-28 16:47:57 +10:00
Oliver Woodman
9108dc5b0e Merge pull request #9421 from MarcusWichelmann:hevc-sps-parsing
PiperOrigin-RevId: 398749045
2021-09-24 18:13:01 +01:00
olly
a9867880f0 IMA sdk request input serialization/deserialization
temporary pulled out from the main cl to keep code small for review

PiperOrigin-RevId: 398746806
2021-09-24 18:10:56 +01:00
ibaker
0cd1031dcd Rename MediaItem.PlaybackProperties to LocalConfiguration
This aligns with other MediaItem.FooConfiguration class names and also
more clearly represents that this class encapsulates information used
for local playback that is lost when serializing MediaItem between
processes.

The old class and fields are kept (deprecated) for backwards
compatibility.

PiperOrigin-RevId: 398742708
2021-09-24 18:08:51 +01:00
olly
a720380e77 Update DownloadService for Android 12
- If DownloadService is configured to run as a foreground service,
  it will remain started and in the foreground when downloads are
  waiting for requirements to be met, with a suitable "waiting for
  XYZ" message in the notification. This is necessary because new
  foreground service restrictions in Android 12 prevent to service
  from being restarted from the background.
- Cases where requirements are not supported by the Scheduler will
  be handled in the same way, even on earlier versions of Android.
  So will cases where a Scheduler is not provided.
- The Scheduler will still be used on earlier versions of Android
  where possible.

Note: We could technically continue to use the old behavior on
Android 12 in cases where the containing application still has a
targetSdkVersion corresponding to Android 11 or earlier. However,
in practice, there seems to be little value in doing this.
PiperOrigin-RevId: 398720114
2021-09-24 18:04:42 +01:00
andrewlewis
fecb8b7ec8 Make parameter name match inherited doc @param
This is currently required to make javadoc generation via Dackka succeed.

PiperOrigin-RevId: 398518538
2021-09-24 18:00:27 +01:00
gyumin
7f99d30199 Fix gradle sync error
PiperOrigin-RevId: 398489644
2021-09-24 17:58:26 +01:00
andrewlewis
aefe02434f Upgrade dackka
This brings in a fix that prevented documentation generation due to `<caption>` tags not being supported.

PiperOrigin-RevId: 398475800
2021-09-24 17:56:25 +01:00
ibaker
c5abf34646 Add ExoPlayer.Builder#buildExoPlayer method
Annotate build() with @InlineMe. I will update build() to return Player
in a future change.

PiperOrigin-RevId: 398446323
2021-09-23 15:15:20 +01:00
bachinger
4fec4b8f6a Move format specific metadata packages to lib-extractor
PiperOrigin-RevId: 398262695
2021-09-23 15:13:10 +01:00
bachinger
f2a027e068 Move text classes from lib-exoplayer to lib-extractor and lib-common
PiperOrigin-RevId: 398247348
2021-09-23 15:09:07 +01:00
ibaker
59cd783dd4 Add MediaItem.ClippingProperties.Builder
PiperOrigin-RevId: 398232186
2021-09-23 15:05:10 +01:00
bachinger
1372300073 Fix lint warning that breaks gradle build
Calling AudioManager.isOffloadedPlaybackSupported is available since API 29 only.

PiperOrigin-RevId: 398229498
2021-09-23 15:03:01 +01:00
ibaker
a63155975a Use the new MediaItem.Builder#setLiveConfiguration method
PiperOrigin-RevId: 398215071
2021-09-23 14:57:19 +01:00
ibaker
fefa6cb817 Add MediaItem.Subtitle.Builder
PiperOrigin-RevId: 398200055
2021-09-23 14:55:16 +01:00
ibaker
a194d73c75 Use the new MediaItem.Builder#setAdsConfiguration method
PiperOrigin-RevId: 398185843
2021-09-23 14:53:21 +01:00
ibaker
c927bc8358 Add clearkey-based DRM playback emulator tests
These give some documentation-as-code for a clearkey integration with
ExoPlayer.

#exofixit

PiperOrigin-RevId: 398017708
2021-09-23 14:51:10 +01:00
ibaker
e0a9540cd3 Mark MediaItem.Subtitle.mimeType as @Nullable
The MIME type is currently required to select a SubtitleDecoder
implementation in the TextRenderer. Future changes might remove this
requirement, so we pre-emptively mark the field as @Nullable.

The change in SingleSampleMediaSource ensures the track still maps to
the TextRenderer, otherwise it shows up as unmapped. Passing null MIME
type to MediaItem.Subtitle constructor now results in this from
EventLogger:

TextRenderer [
  Group:0, adaptive_supported=N/A [
    [ ] Track:0, id=null, mimeType=text/x-unknown, language=en, supported=NO_UNSUPPORTED_TYPE
  ]
]

PiperOrigin-RevId: 398010809
2021-09-23 14:49:15 +01:00
ibaker
dd39513a2e Rename MediaItem.DrmConfiguration.requestHeaders to add license
Both license and provisioning requests could be considered 'DRM
requests', and these headers are only sent on license requests, so
rename them to reflect that.

The old field remains deprecated for backwards compatibility.

PiperOrigin-RevId: 397980021
2021-09-23 14:47:13 +01:00
ibaker
9932c12d77 Simplify usage of MediaItem.Builder in DashMediaSource
This change only calls setters if we need to override the existing value
(or more specifically, set a value that's absent).

PiperOrigin-RevId: 397979904
2021-09-23 14:45:16 +01:00