11898 Commits

Author SHA1 Message Date
kimvde
01613a2e55 Remove usages of deprecated SimpleExoPlayer.Builder
PiperOrigin-RevId: 390130681
2021-08-11 17:34:19 +01:00
olly
7dffb2dc4d Migrate to Player.Listener
PiperOrigin-RevId: 390124675
2021-08-11 17:32:55 +01:00
Christos Tsilopoulos
4aa5898029 Merge branch 'release-v2' into dev-v2 2021-08-11 15:32:38 +01:00
christosts
02f7aafe67
Merge pull request #9279 from google/dev-v2-r2.15.0
r2.15.0
2021-08-11 15:04:22 +01:00
christosts
d56b6a5244 Move DASH multiple base URL release note
The release note was put under 2.14.2 but the feature is
released in 2.15.0.

#minor-release

PiperOrigin-RevId: 390093836
2021-08-11 12:36:56 +01:00
christosts
c57bfcee93 Move DASH multiple base URL release note
The release note was put under 2.14.2 but the feature is
released in 2.15.0.

#minor-release

PiperOrigin-RevId: 390093836
2021-08-11 12:08:47 +01:00
kimvde
10b4e10f43 Move SimpleExoPlayer.Builder to ExoPlayer
- Remove ExoPlayer.Builder
- Copy SimpleExoPlayer.Builder to ExoPlayer
- Deprecate SimpleExoPlayer.Builder

PiperOrigin-RevId: 389890299
2021-08-11 12:07:16 +01:00
olly
f5d8c211f5 Remove some deprecated source/sink classes
PiperOrigin-RevId: 389879570
2021-08-11 12:06:02 +01:00
christosts
f34446123d Bump version to 2.15.0 and tidy release notes
PiperOrigin-RevId: 389871495
2021-08-10 15:41:20 +01:00
christosts
067fcdb89d Update javadoc for 2.15.0
#minor-release

PiperOrigin-RevId: 389862401
2021-08-10 15:24:31 +01:00
olly
31a839c848 Move non-player specific classes to common
These will all be needed in common to break dependencies
between decoder extension modules and the core module.

PiperOrigin-RevId: 389871983
2021-08-10 15:01:42 +01:00
christosts
b4e99304c4 Bump version to 2.15.0 and tidy release notes
#minor-release

PiperOrigin-RevId: 389871495
2021-08-10 15:00:24 +01:00
christosts
5a4f2348c8 Update javadoc for 2.15.0
#minor-release

PiperOrigin-RevId: 389862401
2021-08-10 14:58:59 +01:00
olly
b627d70054 Migrate uses of deprecated DataSource factories
PiperOrigin-RevId: 389844289
2021-08-10 14:56:20 +01:00
olly
937bc008c1 Use correct IntDef in FFmpegAudioDecoder
PiperOrigin-RevId: 389840014
2021-08-10 14:54:42 +01:00
ibaker
ff078cb4b5 Add explicit protected constructor to Timeline.
Timeline is already abstract, so it can only be constructed from a
subclass anyway.

PiperOrigin-RevId: 389827960
2021-08-10 14:53:23 +01:00
olly
700ec93994 Move DeviceInfo into root package
PiperOrigin-RevId: 389681733
2021-08-09 20:11:23 +01:00
olly
7e8ba03147 Deprecate final non-nested Factory classes in upstream
PiperOrigin-RevId: 389661768
2021-08-09 20:07:24 +01:00
olly
e2ffb5e11b Remove DeviceListener
PiperOrigin-RevId: 389640670
2021-08-09 20:06:05 +01:00
olly
5dc8eeb4bf Remove IntArrayQueue from public API
PiperOrigin-RevId: 389622428
2021-08-09 20:03:22 +01:00
ibaker
db1fe8041b Remove @DoNotInstrument from test classes
This isn't needed now we've updated to Robolectric 4.6

Follow-up to 0df0df9aee

PiperOrigin-RevId: 389616471
2021-08-09 20:02:05 +01:00
ibaker
849c307402 Move requiresSecureDecoder logic into ExoMediaDrm
The result is plumbed back to `MediaCodecRenderer` via a new
`DrmSession#requiresSecureDecoder` method.

This allows us to use the `MediaDrm#requiresSecureDecoder` method added
in Android 12:
https://developer.android.com/reference/android/media/MediaDrm#requiresSecureDecoder(java.lang.String)

This change also removes
`FrameworkMediaCrypto#forceAllowInsecureDecoderComponents`, replacing it
with equivalent logic in `FrameworkMediaDrm#requiresSecureDecoder`.

PiperOrigin-RevId: 389616038
2021-08-09 20:00:42 +01:00
olly
0097a79c2d Add ability to disable Surface.setFrameRate calls
Adding a CHANGE_FRAME_RATE_STRATEGY_ALWAYS strategy is
omitted from this commit, since adding it is more complicated
than just plumbing it through and leaving everything else
unchanged. Specifically, VideoFrameReleaseTimeHelper would
need updating to behave differently when such a strategy is
enabled. It currently calls setFrameRate in cases such as
pausing, seeking and re-buffering, on the assumption that
changes to the underlying display refresh rate will only be
made if they can be done seamlessly. For a mode in which
this will not be the case, it makes more sense to stick to
the content frame-rate when these events occur. It may also
make sense to only use explicit content frame-rate values,
and not those inferred from individual frame timestamps.
Finally, for adaptive content containing a mix of frame-rates,
it makes sense to use the maximal frame-rate across all
variants, and to avoid calling setFrameRate on switches from
one variant to another.

Applications that know the frame-rate of their content can
set ExoPlayer's strategy to CHANGE_FRAME_RATE_STRATEGY_OFF and
then use setFrameRate directly on the output surface. Note that
this is likely to be a better option for apps than anything we
could implement in ExoPlayer, because the application layer
most likely knows the frame-rate of the content earlier than
ExoPlayer does (e.g., to perform the disruptive mode switch
at the same time as an activity transition).

Adding CHANGE_FRAME_RATE_STRATEGY_ALWAYS will be deferred
until there's clear demand for it. In the meantime, we'll
recommend the alternative approach above.

PiperOrigin-RevId: 389610965
2021-08-09 19:59:16 +01:00
olly
eb74856c57 Fix constants.gradle bug ref
PiperOrigin-RevId: 389579365
2021-08-09 19:57:43 +01:00
claincly
be19624a20 Add a factory option to enable logging RTSP messages.
Many GH users find it hard to print out RTSP messages if they use ExoPlayer
as an external dependency.

PiperOrigin-RevId: 389197812
2021-08-09 19:56:22 +01:00
christosts
bf462aca69 Fix bug in Timeline.getRemovedAdGroupCount()
#minor-release

PiperOrigin-RevId: 389174519
2021-08-06 16:10:43 +01:00
christosts
d698e96a57 Fix bug in Timeline.getRemovedAdGroupCount()
#minor-release

PiperOrigin-RevId: 389174519
2021-08-06 16:02:43 +01:00
olly
225081721d Statically import TRACK_TYPE constants in SimpleExoPlayer
PiperOrigin-RevId: 389170562
2021-08-06 16:01:22 +01:00
apodob
a5e772f91f Move SubtitleDecoder to common
This CL moves SubtitleDecoder and all its dependencies
to common in order to enable using it in extractor
module while implementing SubtitleExtractor.

PiperOrigin-RevId: 388979021
2021-08-06 16:00:03 +01:00
apodob
281fc84d15 Add CueDecoder and CueEncoder.
This CL introduces two classes:
* CueEncoder - encodes list of Cue object into byte array.
* CueDecoder - decodes byte array into list of Cue objects.

This two classes are necessary in order to push Cues through SampleQueue. This classes are meant to be used by subtitle Extractor.

PiperOrigin-RevId: 388932088
2021-08-06 15:58:45 +01:00
olly
bdff0d9374 Upgrade to gradle 7.0.2
PiperOrigin-RevId: 388929850
2021-08-06 15:57:25 +01:00
kimvde
9e798a647e Miscalleneous small fixes in Transformer
PiperOrigin-RevId: 388911857
2021-08-06 15:56:01 +01:00
andrewlewis
fc1db189f2 Remove deprecated ExoPlayer GVR extension
PiperOrigin-RevId: 388907645
2021-08-06 15:54:34 +01:00
olly
8525ef70ba Remove SDK_INT codename checks for R and S
These API levels have both been finalized. We're also calling methods
from these API levels directly, which may not exist if a device is
running a non-finalized R or S release.

PiperOrigin-RevId: 388903410
2021-08-06 15:53:08 +01:00
andrewlewis
8fb1e5ce51 Set StreamIndex Name as format.label in SS
Issue: #9252

#minor-release

PiperOrigin-RevId: 388889406
2021-08-05 12:44:20 +01:00
claincly
6ca0b30755 Handle RTSP session id properly.
Issue: #9254

#minor-release

We used to allow only alphanumerical characters in session id. The spec also
allows "$", "-", "_", ".", "+" (RFC2326 Sections 3.4 and 15.1).

PiperOrigin-RevId: 388873742
2021-08-05 12:43:57 +01:00
olly
9dcfd90ef7 Cleanup some deprecated constants
PiperOrigin-RevId: 388893920
2021-08-05 12:33:28 +01:00
andrewlewis
d0e426080b Set StreamIndex Name as format.label in SS
Issue: #9252

#minor-release

PiperOrigin-RevId: 388889406
2021-08-05 12:32:15 +01:00
claincly
a5cbd9f6c2 Handle RTSP session id properly.
Issue: #9254

#minor-release

We used to allow only alphanumerical characters in session id. The spec also
allows "$", "-", "_", ".", "+" (RFC2326 Sections 3.4 and 15.1).

PiperOrigin-RevId: 388873742
2021-08-05 12:31:06 +01:00
gyumin
2946cbe190 Update androidx.media version to 1.4.1
PiperOrigin-RevId: 388860854
2021-08-05 12:29:46 +01:00
sungsoo
a533d8190a Add a method to distinguish whether a player can be set by MediaSession
PiperOrigin-RevId: 388835913
2021-08-05 12:28:34 +01:00
aquilescanta
17723c0836 Simplify network-related error codes
This change removes ERROR_CODE_IO_NETWORK_UNAVAILABLE,
ERROR_CODE_IO_NETWORK_CONNECTION_CLOSED, and ERROR_CODE_IO_DNS_FAILED
in favor of keeping only ERROR_CODE_IO_NETWORK_CONNECTION_FAILED.

PiperOrigin-RevId: 388715972
2021-08-04 19:05:41 +01:00
Christos Tsilopoulos
f23ab8e2c1 Merge pull request #9247 from colinbarr:dev-v2-rtsp-fmtp-trailing-semicolon
PiperOrigin-RevId: 388713101
2021-08-04 19:04:04 +01:00
olly
ba3f86821f Tweak use of TimestampAdjuster for seeking
- Fix use of getTimestampOffsetUs in TsExtractor where
  getFirstSampleTimestampUs should have been used.
- Don't reset TimestampAdjuster if it's in no-offset mode.
- Improve comment clarity

#minor-release

PiperOrigin-RevId: 388682711
2021-08-04 19:03:06 +01:00
christosts
5689e093da Set HlsSampleStreamWrapper.trackType for audio-only playlists
For audio-only playlists, when formats are communicated to the app with
AnalyticsListener.onDownstreamFormatChanged(), the passed MediaLoadData
do not indicate this is an audio track and therefore the
PlaybackStatsListener cannot derive audio format-related information.

This change sets the main SampleStreamWrappers track type to AUDIO, if
the master playlist contains only audio variants.

Issue: #9175

#minor-release

PiperOrigin-RevId: 388676060
2021-08-04 19:02:50 +01:00
christosts
5b2b882e81 Change how AnalyticsCollector releases listeners
The AnalyticsCollector releases listeners lazily so that listener
callbacks triggered on the application looper after
SimpleExoPlayer.release() are still handled. The change in ListenerSet
to post the onEvents callback on the front of the application looper
changed (correctly) how onEvents are propagated, however this made
the AnalyticsCollector deliver onEvents with out-of-order EventTimes.

This change fixes AnalyticsCollector to trigger onPlayerReleased() and
the matching onEvents() event in the correct order.

#minor-release

PiperOrigin-RevId: 388668739
2021-08-04 19:02:29 +01:00
andrewlewis
5932406926 Use AudioTrack.isDirectPlaybackSupported on TVs only
Issue: #9239

PiperOrigin-RevId: 388437614
2021-08-04 19:01:19 +01:00
apodob
95dcd89651 Add font-size support to WebVTT CssParser.
This CL addresses the github issue [#8946](https://github.com/google/ExoPlayer/issues/8964). That issue requests support for `font-size` CSS property in WebVTT subtitle format. This CL:
* Adds support for `font-size` property by extending capabilities of WebVTT `CssParser`. Implementation of `font-size` property value parsing is based on the one in `TtmlDecoder`.
* Adds unit test along with test file containing WebVTT subtitles with all currently supported `font-size` units.

#minor-release

PiperOrigin-RevId: 388423859
2021-08-04 18:57:58 +01:00
olly
8732f2f030 HLS: Avoid stuck-buffering issues
Issue: #8850
Issue: #9153
#minor-release
PiperOrigin-RevId: 388257563
2021-08-04 18:57:08 +01:00
olly
e95c42ef98 Simplify TimestampAdjuster logic
- Use timestampOffsetUs == C.TIME_UNSET directly as the way of
  determining whether the adjuster has determined the offset,
  rather than relying on lastSampleTimestampUs checks for this.
- Remove comment referring to lastSampleTimestampUs as holding
  the "adjusted PTS". Its value may not have originated from a PTS
  timestamp. It's also confusing to refer to it as "adjusted"
  given timestampOffsetUs has not been applied to it.
- Fix PassthroughSectionPayloadReader to make sure it'll never
  output a sample with an unset timestamp.

#minor-release

PiperOrigin-RevId: 388226180
2021-08-04 18:56:39 +01:00