237 Commits

Author SHA1 Message Date
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
krocard
93506f6395 Copy REPEAT_MODE to C temporary for timeline
This copy will be removed once Player is migrated to
common.

#exo-offload

PiperOrigin-RevId: 344515979
2020-11-30 09:32:01 +00:00
ibaker
46598a46fd Audit usages of ParsableByteArray#reset(int)
This method should be assumed to clear the data of the underlying array
(it will do this if the new limit > data.length).

This means it should only be called (directly) before writing into the
backing array.

It shouldn't be used as a shorthand for position=0, limit=x - those
should be two explicit method calls.

Most of these changes are no-ops, but they make the code more correct.

The TS SectionReader can't be easily changed to be 'safe', because it
relies on sectionData maintaining state between iterations of the while
loop. Instead I've added comments justifying the existing code.

PiperOrigin-RevId: 344515340
2020-11-30 09:31:49 +00:00
sungsoo
43713abe79 Add MediaUtilsTest
PiperOrigin-RevId: 344384426
2020-11-27 11:07:39 +00:00
olly
2fbad2105e Make special exception for cleartext-not-permitted
#exofixit

PiperOrigin-RevId: 344246408
2020-11-27 11:07:07 +00:00
bachinger
c17d1091f3 Remove "live" from fields in MediaItem.LiveConfiguraton
#exofixit

PiperOrigin-RevId: 344065519
2020-11-27 11:05:54 +00:00
tonihei
d4e1904604 Rollback of 483a350e84
*** Original commit ***

Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.

LSC: go/checker-lsc

Tested:
    TAP train for global presubmit queue
    http://test/OCL:342788973:BASE:342817196:1605636478036:6c558c0c

***

PiperOrigin-RevId: 343895651
2020-11-24 16:02:45 +00:00
ibaker
b562adf26c Tweak ParsableByteArray#readLine javadoc
Don't refer to the "system's default charset", just specify UTF-8
explicitly.

PiperOrigin-RevId: 343839878
2020-11-24 16:01:41 +00:00
tonihei
f13ffb4390 Rollback of 5d9c2d7b6a
*** Original commit ***

Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.

***

PiperOrigin-RevId: 343086403
2020-11-18 18:40:30 +00:00
olly
3c91ba14b3 Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.
PiperOrigin-RevId: 343003559
2020-11-18 18:40:17 +00:00
olly
483a350e84 Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.
PiperOrigin-RevId: 342999390
2020-11-18 18:40:06 +00:00
samrobinson
e832a4e0fc Adjust SEF reader times to long.
PiperOrigin-RevId: 342642410
2020-11-16 16:51:09 +00:00
olly
3b8b2f707b Remove C.StreamType constant that's not a real stream type
#minor-release

PiperOrigin-RevId: 341833274
2020-11-13 14:54:12 +00:00
andrewlewis
5fd1601f91 Signal an ads identifier to the AdsLoader
In a later change, the AdPlaybackState will include the playing adsId (set by
the AdsLoader) and the ads loader will use this to determine what ad
information is associated with the playing/next periods, to allow loading ads
in playlists.

Apps can continue to pass just a URI for an ad tag with their MediaItem, in
which case the associated playlist will request that ad tag just and the same
state will be used for all occurrences of the ad tag.

This change has breaking changes to the AdsLoader interface and removes
deprecated ways of passing the ad tag, as it's very likely to go into a major
release anyway and not needing to handle the deprecated cases simplifies
ImaAdsLoader.

Issue: #3750
PiperOrigin-RevId: 340438580
2020-11-06 16:32:31 +00:00
olly
c1dc802050 Make defaultLicenseUrl optional
Some content types always provide the license URL in the media.
The PlayReady example in the demo app doesn't provide a default
license URL for this reason, as an example.

#minor-release

PiperOrigin-RevId: 340125784
2020-11-02 23:00:57 +00:00