12228 Commits

Author SHA1 Message Date
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
Christos Tsilopoulos
387e14acef Merge branch 'release-v2' into dev-v2 2021-09-22 18:15:01 +01:00
christosts
2a88f0fb29
Merge pull request #9462 from google/dev-v2-r2.15.1
r2.15.1
2021-09-22 17:58:21 +01:00
christosts
5588dcae21 Update javadoc for 2.15.1
#minor-release

PiperOrigin-RevId: 397976212
2021-09-21 14:35:18 +01:00
christosts
a0b235c537 Update javadoc for 2.15.1
#minor-release

PiperOrigin-RevId: 397976212
2021-09-21 14:25:22 +01:00
ibaker
e804df8c1f Rename MediaItem.DrmConfiguration.uuid to scheme
The type is already UUID so there's no need to duplicate that info in
the field name, and 'scheme' is a widely used term throughout both
ExoPlayer and android.os.MediaDrm documentation.

The old field remains deprecated for backwards compatibility.

The MediaItem.DrmConfiguration.Builder#setUuid method is renamed
directly (without deprecation) because it's not yet part of a released
ExoPlayer version.

PiperOrigin-RevId: 397961553
2021-09-21 14:23:21 +01:00
ibaker
ab484a4b11 Simplify MediaItem.Builder interactions in DefaultMediaSourceFactory
This takes advantage of the new MediaItem.LiveConfiguration.Builder

This change will always allocate a new LiveConfiguration.Builder and
LiveConfiguration, but preserves the behaviour of keeping the same
MediaItem instance if no values have changed.

PiperOrigin-RevId: 397961427
2021-09-21 14:21:32 +01:00
ibaker
ea45f9ffb8 Remove @RequiresApi(16) from SynchronousMediaCodecAdapter
This isn't needed since the whole library's min API is already 16

PiperOrigin-RevId: 397939444
2021-09-21 14:19:28 +01:00
ibaker
ad99a44083 Add empty sdk-version node to all AndroidManifest.xml files
PiperOrigin-RevId: 397772916
2021-09-21 14:17:33 +01:00
christosts
dee0c2cc71 Bump version to 2.15.1 and tidy release notes
PiperOrigin-RevId: 397758146
2021-09-21 09:54:16 +01:00
christosts
276d2e9d0d Bump version to 2.15.1 and tidy release notes
#minor-release

PiperOrigin-RevId: 397758146
2021-09-20 17:39:23 +01:00
andrewlewis
7d524d6d6f Fix incorrect @IntRange
PiperOrigin-RevId: 397753634
2021-09-20 17:37:43 +01:00
ibaker
9666fbdda6 Add MediaItem.LiveConfiguration.Builder
PiperOrigin-RevId: 397748657
2021-09-20 17:35:59 +01:00
ibaker
47b82cdc45 Add MediaItem.AdsConfiguration.Builder
PiperOrigin-RevId: 397718885
2021-09-20 13:04:31 +01:00
kimvde
46d97bdd39 Fix DTS_X audio mime type
Issue: #9429

#minor-release

PiperOrigin-RevId: 397717740
2021-09-20 13:02:53 +01:00
andrewlewis
8a910fd0aa Make @HlsMediaSource.MetadataType TYPE_USE
PiperOrigin-RevId: 397717018
2021-09-20 13:00:46 +01:00
tonihei
0f3a86b89d Remove accidental log line.
PiperOrigin-RevId: 397707790
2021-09-20 12:58:48 +01:00
ibaker
8d3cad570e Document MediaItem.DrmConfiguration#buildUpon()
PiperOrigin-RevId: 397697019
2021-09-20 12:57:08 +01:00
ibaker
701be41534 Demo app: Fail fast if parsing invalid DRM config from JSON
These fields can't be used if `drm_uuid` isn't set. Make that case throw
an exception, so it's obvious to a developer what's wrong.

Most of the fields 'obviously' need `drm_uuid` to be set, but it's not
obvious for `drm_session_for_clear_content` (because it might be
reasonable to assume it's possible to play clear content without
specifying a UUID). This tripped me up in
https://github.com/google/ExoPlayer/issues/8842#issuecomment-833659808.

PiperOrigin-RevId: 397328556
2021-09-20 12:54:55 +01:00
kimvde
0f0e11aaeb Make README structure match the desired androidx structure
PiperOrigin-RevId: 397319051
2021-09-17 16:06:00 +01:00
claincly
fd6a6ec8df Support RFC4566 SDP attribute.
Issue: #9430

The current supported SDP (RFC2327) spec only allows for alpha-numeric
characters in the attribute-field. RFC4566 (section 9, token type) allowed
extra characters, and this CL adds the support.

PiperOrigin-RevId: 397301173
2021-09-17 16:02:10 +01:00
ibaker
5f3953d336 Improve AdtsExtractor#sniff when trying different sync word offsets
The previous implementation did the following (after skipping any ID3
headers at the start of the stream):
1. Skip forward byte-by-byte looking for a sync word (0xFFF)
2. Assume this indicates the start of an ADTS frame and read the size
  a) If frameSize <= 6 immediately return false
3. Skip forward by frameSize and expect to find another ADTS sync word
   (with no further scanning).
   b) If we find one, great! Loop from step 2.
   a) If we don't find one then assume the **last** sync word we found
      wasn't actually one, so loop from step 1 starting one extra byte
      into the stream. This means we're looking for a sync word we would
      have skipped over in step 3.

The asymmetry here comes from the different handling of frameSize <= 6
(immediately return false) and frameSize being 'wrong because it doesn't
lead to another sync word' (scan the file again from the beginning for
alternative sync words).

With this change both these cases are handled symmetrically (always scan
for alternative sync words). Step 2a) becomes the same as 3b): Loop back
to the beginning of the stream with an incremented offset and scan for
another sync word.

#minor-release

PiperOrigin-RevId: 397285756
2021-09-17 13:22:13 +01:00
olly
8d01d66ac9 Fix documention for specifying a custom exolist.json
Issue: #9437
#minor-release
PiperOrigin-RevId: 397273931
2021-09-17 13:21:26 +01:00
ibaker
04943db71c Don't call MediaItem.Builder#setKeySetId without setting the DRM UUID
This is known to silently drop the value. This setter is now deprecated
in favour of `MediaItem.Builder#setDrmConfiguration(MediaItem.DrmConfiguration)`,
which requires a UUID in order to construct the `DrmConfiguration`
instance.

Issue: #9378 tracks correctly propagating the DRM info out of
`DownloadRequest#toMediaItem`.
PiperOrigin-RevId: 397291013
2021-09-17 13:14:57 +01:00
ibaker
13827186aa Use the new MediaItem.Builder#setDrmConfiguration method
PiperOrigin-RevId: 397290953
2021-09-17 13:12:53 +01:00
ibaker
73aece6356 Improve AdtsExtractor#sniff when trying different sync word offsets
The previous implementation did the following (after skipping any ID3
headers at the start of the stream):
1. Skip forward byte-by-byte looking for a sync word (0xFFF)
2. Assume this indicates the start of an ADTS frame and read the size
  a) If frameSize <= 6 immediately return false
3. Skip forward by frameSize and expect to find another ADTS sync word
   (with no further scanning).
   b) If we find one, great! Loop from step 2.
   a) If we don't find one then assume the **last** sync word we found
      wasn't actually one, so loop from step 1 starting one extra byte
      into the stream. This means we're looking for a sync word we would
      have skipped over in step 3.

The asymmetry here comes from the different handling of frameSize <= 6
(immediately return false) and frameSize being 'wrong because it doesn't
lead to another sync word' (scan the file again from the beginning for
alternative sync words).

With this change both these cases are handled symmetrically (always scan
for alternative sync words). Step 2a) becomes the same as 3b): Loop back
to the beginning of the stream with an incremented offset and scan for
another sync word.

#minor-release

PiperOrigin-RevId: 397285756
2021-09-17 13:10:58 +01:00
bachinger
6f728a43ad Remove obsolete imports
PiperOrigin-RevId: 397280475
2021-09-17 12:03:50 +01:00
olly
985e73dec8 Fix documention for specifying a custom exolist.json
Issue: #9437
#minor-release
PiperOrigin-RevId: 397273931
2021-09-17 12:00:41 +01:00