501 Commits

Author SHA1 Message Date
olly
3fcc14b3c2 OkHttp/Rtmp extensions: Remove dependency on core
They only require common. This allows their use for non-playback networking
without requiring the user to depend on the whole of core. I will also make
the same change for Cronet, although this needs a little more work.

PiperOrigin-RevId: 353649388
2021-01-25 17:38:36 +00:00
krocard
b0258e7192 Move Player in common
This is the last CL to move Player in common.

#player-to-common

PiperOrigin-RevId: 353642347
2021-01-25 15:37:48 +00:00
olly
dc7fde1ff7 Some more language fixes
Issue: #7565
PiperOrigin-RevId: 353613493
2021-01-25 15:36:59 +00:00
olly
9825e5f9d7 Move some utility classes to common
These are used by the cast extension, so will need moving eventually!

PiperOrigin-RevId: 353219703
2021-01-22 16:22:18 +00:00
olly
4791900848 Move Player.getTrackSelector to ExoPlayer
PiperOrigin-RevId: 353212567
2021-01-22 16:22:09 +00:00
krocard
a10e9de484 Check that cache dir exist
Not checking it would force ExoPlayer to use the
global tmp dir which would expose it to
external file replacement attacks.

This is a theoretical vulnerability as this code is
only use in tests and cache dir always exist in the
AOSP android implementation.

PiperOrigin-RevId: 353013929
2021-01-22 16:21:35 +00:00
krocard
efcaee563a Move TrackGroup and TrackGroupArray in common
This is a dependency of TrackSelection and Player.

#player-to-common

PiperOrigin-RevId: 353004379
2021-01-22 16:21:10 +00:00
ibaker
3069251bd0 Add gzip support to WebServerDispatcher
Add a test to DataSourceContractTest that asserts the gzip flag is
either ignored or handled correctly.

Add a test resource to DefaultHttpDataSourceContracTest that enables
gzip compression on the 'server' and checks it's handled correctly by
the client.

PiperOrigin-RevId: 352574359
2021-01-19 19:23:57 +00:00
andrewlewis
60f000c8b1 Remove incorrect TODOs
PiperOrigin-RevId: 352552961
2021-01-19 19:23:23 +00:00
ibaker
fc952bfba2 Annotate log methods with @Pure
PiperOrigin-RevId: 352519583
2021-01-19 19:22:47 +00:00
samrobinson
1be4960464 Implement a segment based speed provider and interface.
PiperOrigin-RevId: 352401836
2021-01-18 22:00:19 +00:00
samrobinson
dedf60713d Enforce stricter SlowMotionData and Segment initialisation checks.
PiperOrigin-RevId: 352389366
2021-01-18 22:00:11 +00:00
olly
464f53373a Remove deprecated debug listener methods from SimpleExoPlayer
- Once the ability to add debug listeners is removed, analyticsCollector
  is the only component that needs to receive the events. Hence it is
  called directly.
- It seemed less confusing to do the same thing for (non-debug) video and
  audio events, and to have AnalyticsCollector no longer implement
  VideoListener and AudioListener directly. This clears up confusion that
  arises as a result of the debug and non-debug interfaces defining the
  same methods in some cases, and having to be careful not to end up
  calling the corresponding AnalyticsCollector method twice.

PiperOrigin-RevId: 351835491
2021-01-15 10:57:47 +00:00
kimvde
4c3f580b0c Rollback of 7d847a9552
*** Original commit ***

Handle sample size mismatch in MP4 extractors

#minor-release

***

PiperOrigin-RevId: 351774860
2021-01-15 10:56:47 +00:00
olly
8045c62d09 Fully document ExoMediaDrm
PiperOrigin-RevId: 351771497
2021-01-15 10:56:37 +00:00
kimvde
7d847a9552 Handle sample size mismatch in MP4 extractors
#minor-release

PiperOrigin-RevId: 351756333
2021-01-15 10:56:17 +00:00
andrewlewis
9b062053fa Add support for JPEG motion photo extraction
PiperOrigin-RevId: 351752989
2021-01-15 10:56:07 +00:00
olly
9198dd6f5a Update AudioListener to reflect new audio session ID logic
PiperOrigin-RevId: 351597144
2021-01-15 10:55:16 +00:00
christosts
73114e3987 Remove deprecated method DrmInitData.get(UUID)
PiperOrigin-RevId: 351589689
2021-01-15 10:55:06 +00:00
andrewlewis
d5124e8cdc Add presentation time to motion photo metadata
PiperOrigin-RevId: 351581997
2021-01-15 10:54:56 +00:00
tonihei
a0460c3bd7 Remove ExoPlaybackException.TYPE_TIMEOUT.
The ExoPlaybackException types are locations from where the exception
is coming from and not the type of exception itself, which should be
denoted by different exception classes.

To avoid a mixture of error types and class checks, the timeout
exceptions should use their own class and be of type RENDERER as this
is where the timeout actually happens.

PiperOrigin-RevId: 351337699
2021-01-13 00:02:58 +00:00
tonihei
c63f3d92ba Remove ExoPlaybackException.TYPE_OUT_OF_MEMORY
Catching OOM errors is bad practise unless there is a specific known
cause that tried to allocate a large amount of memory. Without this
known cause with a large allocation, the source of the error is
likely somewhere else in the app and every random small further
allocation may lead to additional OOM errors (for example b/145134199).

We have three known causes in ExoPlayer:
 1. Source allocations based on unexpected values in streams. This is
    caught on the loader thread and reported as an
    UnexpectedLoaderException.
 2. Output buffer allocations by non-MediaCodec decoders. These are
    caught in SimpleDecoder on the decoder thread and reported as
    UnexpectedDecodeException.
 3. Input buffer allocations by non-MediaCodc decoders in their
    constructors. These are currently caught on a higher-level and
    reported as ExoPlaybackException.TYPE_OUT_OF_MEMORY.

For consistency and to prevent catching OOM errors without known cause
we can remove the generic TYPE_OUT_OF_MEMORY and catch the specific
exception where it occurs to report it as an
ExoPlaybackException.TYPE_RENDERER. This also has the added advantage
that the format metadata is added to the exception.

PiperOrigin-RevId: 351326688
2021-01-13 00:02:39 +00:00
olly
de0e1e5168 Throw specific exception if input buffer is too small
This potentially allows a caller to resize their buffers to take into account
the required size.

It's kept as an IllegalStateException, since most use cases where it's thrown
still reflect invalid states, and since making it a checked exception requires
marking a lot of methods with throws clauses.

PiperOrigin-RevId: 351216968
2021-01-12 08:46:15 +00:00
ibaker
facef65c8c Bump version to 2.12.3
#minor-release

PiperOrigin-RevId: 351169686
2021-01-11 18:06:04 +00:00
andrewlewis
a7b20fd133 Rollback of 59aec416af
*** Original commit ***

Rollback of ff8c8645ab

*** Original commit ***

Merge #8401: Initialize Format.codecs from HEVC SPS NAL unit (#8393)

Imported from GitHub PR https://github.com/google/ExoPlayer/pull/8401

This will allow ExoPlayer to check if video track's profile and level are supported by decoder when playing progressive media so...

***

PiperOrigin-RevId: 351139861
2021-01-11 18:05:34 +00:00
olly
2a5f6d8f62 Improve user-agent configuration
- Support setting the user-agent in CronetDataSource
- Support setting the default user-agent in CronetEngineWrapper
- Use the underlying network stack's default user-agent by
  default. Many applications will configure the underlying
  CronetEngine or OkHttpClient with a user-agent that they
  expect to be used throughout their app, so always overriding
  this with our own default, on reflection, is not the best
  thing to do!

Issue: #8395
PiperOrigin-RevId: 350921963
2021-01-11 18:04:43 +00:00
olly
59aec416af Rollback of ff8c8645ab
*** Original commit ***

Merge #8401: Initialize Format.codecs from HEVC SPS NAL unit (#8393)

Imported from GitHub PR https://github.com/google/ExoPlayer/pull/8401

This will allow ExoPlayer to check if video track's profile and level are supported by decoder when playing progressive media sources.
Merge e582fb91b73c7c95e754167140211d5473c36d14 into 1347d572ef9ce79aacd667cfffa7d7468c8408a4

Issue: #8393

***

PiperOrigin-RevId: 350871621
2021-01-11 18:04:22 +00:00
Alexey Rochev
ff8c8645ab Merge #8401: Initialize Format.codecs from HEVC SPS NAL unit (#8393)
Imported from GitHub PR https://github.com/google/ExoPlayer/pull/8401

This will allow ExoPlayer to check if video track's profile and level are supported by decoder when playing progressive media sources.
Merge e582fb91b73c7c95e754167140211d5473c36d14 into 1347d572ef9ce79aacd667cfffa7d7468c8408a4

Issue: #8393
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/ExoPlayer/pull/8401 from equeim:hevc-codecs e582fb91b73c7c95e754167140211d5473c36d14
PiperOrigin-RevId: 350738065
2021-01-08 15:33:09 +00:00
tonihei
25ed6b127d Clarify parameter Javadoc for playback speed values.
In many cases we just used "playback speed" as a detailed Javadoc
parameter or return type definition. This doesn't define which scale
the speed is using.

PlaybackParameters as the main point to set the speed already uses a
more precise wording to describe the value as a factor by which playback
will be sped up.

This change replaces other usages of "playback speed" with this wording
whereever we would usually add a unit, keeping "playback speed" for
summary statements etc to reference the general concept that doesn't
usually require a unit.

PiperOrigin-RevId: 350379139
2021-01-07 10:44:34 +00:00
Ian Baker
a9a150a1d3 Merge pull request #8397 from equeim:avc-codecs
PiperOrigin-RevId: 350105847
2021-01-05 12:00:21 +00:00
andrewlewis
97d3e52340 Move XML parsing utils to common module
This is in preparation for using them from the extractor module.

PiperOrigin-RevId: 349571390
2021-01-05 11:59:58 +00:00
Alexey Rochev
78a975c268 Initialize Format.codecs from AVC SPS NAL unit (#8393)
This will allow ExoPlayer to check if video track's profile
and level are supported by decoder when playing progressive media sources.

Also fix typo in AvcConfig.
2020-12-24 20:30:35 +03:00
kimvde
e6d8741467 Add method to compute a SparseLongArray min value.
PiperOrigin-RevId: 348008973
2020-12-23 22:48:47 +00:00
andrewlewis
12f1615205 Use MediaItem as ads identifier by default
Issue: #3750
PiperOrigin-RevId: 347572122
2020-12-17 11:25:53 +00:00
krocard
d857eec1f7 Move classes Player depends on to common
This will allow player to be moved to common.

#player-to-common

PiperOrigin-RevId: 347375344
2020-12-17 11:25:52 +00:00
bachinger
a335c96450 Deprecate HttpDataSource.Factory.getDefaultRequestProperties
#exofixit

PiperOrigin-RevId: 347375323
2020-12-17 11:25:52 +00:00
bachinger
05c928f96d Add live configuration to Timeline.Window
Issue: #5011
PiperOrigin-RevId: 346828103
2020-12-14 10:17:23 +00:00
bachinger
9a00ba1d38 Improve javadoc of Window.windowStartTimeMs
PiperOrigin-RevId: 346346359
2020-12-14 10:16:14 +00:00
krocard
b5f0379ba0 Move ExoPlaybackException in common
This is needed to move Player in common.

#player-to-common

PiperOrigin-RevId: 346157905
2020-12-14 10:15:25 +00:00
krocard
7d3e5f2af8 Move MediaPeriodId in common minimalistically
This is needed to move ExoPlayerException in common.
The follow up cl moves MediaPeriodId completely.

#player-to-common

PiperOrigin-RevId: 346133091
2020-12-14 10:15:15 +00:00
kimvde
dd782ef9b4 Throw ParserException if AAC config is invalid
Issue:#8295
PiperOrigin-RevId: 346064966
2020-12-14 10:14:45 +00:00
kimvde
3a17dd5fec Slomo flattening: get metadata from smta box
Retrieve the capture frame rate and the SVC temporal layer count from
the smta box instead of the meta box because this is what Samsung do. It
is not guaranteed that the meta box will be present and will contain all
the necessary info in all slomo files.

PiperOrigin-RevId: 345639680
2020-12-14 10:14:14 +00:00
krocard
09509c2390 Simple migration to common
Migrate all classes that are simple to move to
common.

#player-to-common

PiperOrigin-RevId: 345412080
2020-12-03 17:11:56 +00:00
krocard
830982496d Move Timeline to common
PiperOrigin-RevId: 345398603
2020-12-03 17:11:38 +00:00
krocard
553d5351c2 Move Renderer.VideoScalingMode back to C
As Player depends on VideoScalingMode, and
Renderer should not move to common,
to move Player to common, VideoScalingMode
needs to move first.

#player-to-common

PiperOrigin-RevId: 345314448
2020-12-03 17:11:30 +00:00
andrewlewis
c7e1d3f222 Mark assertion methods as @Pure
See https://checkerframework.org/manual/#type-refinement-purity.

PiperOrigin-RevId: 344994705
2020-12-03 17:10:01 +00:00
ibaker
84a7ffc12a Add ParsableByteArray#ensureCapacity() method that keeps data
#exofixit

PiperOrigin-RevId: 344845328
2020-12-03 17:09:35 +00:00
ibaker
e508fb64f3 Bump version to 2.12.2
PiperOrigin-RevId: 344801462
2020-11-30 16:11:44 +00:00
krocard
538445572d Move FormatSupport in common
#player-to-common

PiperOrigin-RevId: 344558028
2020-11-30 09:33:11 +00:00
andrewlewis
4446e2637d Fix unexpected multiline comments
#exofixit

PiperOrigin-RevId: 344517105
2020-11-30 09:32:25 +00:00