501 Commits

Author SHA1 Message Date
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
kimvde
8f6b46f570 Transformer: flatten slow mo video at normal speed
Slow motion segments are not taken into account yet.

PiperOrigin-RevId: 339678840
2020-11-02 22:59:43 +00:00
christosts
d5170688b4 MediaItem: document params in method call
PiperOrigin-RevId: 339472160
2020-11-02 22:58:54 +00:00
samrobinson
2c746c6b6b Generalise the SlowMotion Metadata.Entry naming.
PiperOrigin-RevId: 339352447
2020-11-02 22:57:56 +00:00
tonihei
e57193676a Add min/max live offset to MediaItem.LiveConfiguration.
This allows the user and the media to define bounds in which the live offset
can vary.

Issue: #4904
PiperOrigin-RevId: 339214605
2020-11-02 22:57:19 +00:00
ibaker
50566fb8ac Suppress ProGuard warnings related to Guava's compile-only deps
Without these lines, ProGuard fails on the demo app (R8 works).

Also include some more `-dontwarn` lines from
https://github.com/google/guava/wiki/UsingProGuardWithGuava

#minor-release

Issue: #8103
PiperOrigin-RevId: 339050634
2020-11-02 22:56:21 +00:00
kimvde
80a37c7ed1 Rename MotionPhoto to MotionPhotoMetadata
This make it clear that this class does not contain any photo/video
data.

PiperOrigin-RevId: 339045203
2020-11-02 22:56:11 +00:00
samrobinson
1fcfef5cde Add readDelimiterTerminatedString to ParsableByteArray.
PiperOrigin-RevId: 338718776
2020-11-02 22:55:43 +00:00
samrobinson
7ccbf572c7 Add a Metadata Entry class for SEF Slow motion data.
PiperOrigin-RevId: 338695793
2020-11-02 22:55:34 +00:00
aquilescanta
a184924322 Avoid chunkless preparation if the codec mapping is ambiguous
Issue: #7877
PiperOrigin-RevId: 338659937
2020-11-02 22:55:03 +00:00
aquilescanta
4783c329cc Map HLS sample formats to the correct codec string
This change fixes format creation for traditional preparation of streams
where the master playlist contains more than one codec string per track
type.

Issue: #7877
PiperOrigin-RevId: 338538693
2020-10-23 13:54:50 +01:00
aquilescanta
ccf78f99c4 Allow multiple codecs with same type in DefaultHlsExtractorFactory
When disabling a TsExtractor track type because of a missing codec
in the master playlist, look through the entire codecs string
instead of checking the first codec with matching type.

Issue: #7877
PiperOrigin-RevId: 338530046
2020-10-23 13:54:40 +01:00
kimvde
175b8eb69e Read Google Photos motion photo metadata
PiperOrigin-RevId: 338436906
2020-10-22 12:37:41 +01:00
olly
563767d5e9 Bump version to 2.12.1
PiperOrigin-RevId: 338261975
2020-10-21 22:26:34 +01:00
kimvde
021d725c0a Add motion photo metadata entry
PiperOrigin-RevId: 337863184
2020-10-20 14:51:09 +01:00
ibaker
2371b024dd Switch to an 'api' dependency on Guava
The 'implementation' dependency causes problems when resolving
ListenableFuture in contexts that also include the
com.google.guava:listenablefuture:1.0 dependency.

Issue: #7905
Issue: #7997
Issue: #7993
PiperOrigin-RevId: 337093024
2020-10-17 01:34:15 +01:00
bachinger
bb7c934812 Add missing properties of MediaItem.Subtitle
Issue: #8044
PiperOrigin-RevId: 336955479
2020-10-17 01:32:59 +01:00
christosts
13f1f3b3eb Add live configuration to MediaItem
Issue: #4904
PiperOrigin-RevId: 336839370
2020-10-13 16:28:44 +01:00
christosts
ed873322d3 Parse ServiceDescription from DASH manifest
Issue: #4904
PiperOrigin-RevId: 336838559
2020-10-13 16:28:35 +01:00
andrewlewis
39277ebe95 Pass ad tags via AdsMediaSource
This is in preparation for supporting playlists of ads media sources using
ImaAdsLoader.

Existing ways of passing ad tags should still function but are deprecated (and
won't be supported with playlists).

Issue: #3750
PiperOrigin-RevId: 335618364
2020-10-06 14:31:50 +01:00
andrewlewis
3e8dacc284 Move DataSource reading methods into Util
This will be used to read ads responses out of data: URLs in a subsequent
change.

PiperOrigin-RevId: 334778780
2020-10-06 14:30:56 +01:00
christosts
cf30ee504e Util.getStringForTime() prefixes negative times
Fix bug to place the negative sign in the beginning
of the returned String.

PiperOrigin-RevId: 333504868
2020-09-25 16:32:37 +01:00
ibaker
f56db87c99 Add SDK_INT mapping from S -> 31
PiperOrigin-RevId: 332211266
2020-09-17 17:50:59 +01:00
ibaker
70ebe12ef9 Suppress Guava-related ProGuard/R8 warnings
I didn't copy-paste the whole of
https://github.com/google/guava/wiki/UsingProGuardWithGuava because
this line seems relevant based on our current usage.

Lots of that file seems to relate to classes that are strongly
discouraged on Android:
https://github.com/google/guava/wiki/Android#specifics

I've only added this to the `common` module, since everyone that uses
ExoPlayer must depend on that. This avoids duplicating this line into
every module that has a Guava dependency.

Also remove some other warning suppressions that are defined in both
`core` and `common`.

Issue: #7904
PiperOrigin-RevId: 332203086
2020-09-17 17:41:34 +01:00
olly
cdcb30ed21 Exclude Guava transitive annotation dependencies
PiperOrigin-RevId: 331148067
2020-09-11 16:01:15 +01:00
olly
b2b08ade99 Make User-Agent optional
PiperOrigin-RevId: 330593247
2020-09-09 09:41:51 +01:00
gyumin
d155416c54 Add Util.postOrRun
To avoid repetition, it adds Util.postOrRun and replaces existing
instances with the util method.

PiperOrigin-RevId: 329472769
2020-09-07 20:40:04 +01:00
olly
e163fe6949 Optimize AAC seeking except for xHE-AAC
In 2.11.2 to 2.11.5, we considered all AAC streams as consisting
only of sync samples. In 2.11.6+, we considered no AAC streams as
consisting of sync samples, because the property is not guaranteed
specifically for xHE-AAC. This will have caused a small regression
is seek speed for some types of media.

This change brings back the optimization for AAC, specifically
excluding only xHE-AAC (and cases where we don't know what type of
AAC we're dealing with).

PiperOrigin-RevId: 328950697
2020-09-07 20:39:27 +01:00
tonihei
e16cd239ea Only report 5G for SDK 29+.
PiperOrigin-RevId: 328524230
2020-08-26 16:40:12 +01:00
kimvde
6960dde8a8 Add nullness annotations to FragmentedMp4Extractor
PiperOrigin-RevId: 327797428
2020-08-26 16:39:07 +01:00
aquilescanta
a673eec845 Make Format's constructor take the Builder as argument
Which saves the large parameter list.

PiperOrigin-RevId: 327619725
2020-08-21 12:51:33 +01:00
ibaker
54c92080bf Fix nullness warnings in testutil package
PiperOrigin-RevId: 327190676
2020-08-21 12:48:29 +01:00
olly
f2d2e6475a Bump release to 2.12.0
PiperOrigin-RevId: 327005645
2020-08-17 16:14:48 +01:00
olly
511a6c729e Increase flexibility of ISM URL handling
PiperOrigin-RevId: 326025335
2020-08-17 16:09:01 +01:00
olly
82b26357c9 Infer ISM content type from URL specified extension
PiperOrigin-RevId: 326012248
2020-08-17 16:08:43 +01:00
ibaker
443468d103 Clarify MediaItem.Builder javadoc
Make it clear that setUri sets PlaybackProperties.uri

Also capitalise all references to DRM, ID, URI and UUID

PiperOrigin-RevId: 326002853
2020-08-17 16:08:34 +01:00
olly
5de56cd618 Opus: Add utility for handling header and initialization data
PiperOrigin-RevId: 325202386
2020-08-07 19:02:14 +01:00