747 Commits

Author SHA1 Message Date
andrewlewis
9b6caf9eda Merge #5438: Dolby Vision
Imported from GitHub PR https://github.com/google/ExoPlayer/pull/5438

Plus the following changes:
- Only support profile 5 (handling other profiles requires
  backward-compatibility changes in the renderer which are left for a later
  change.)
- Only add KEY_PROFILE to the codec configuration MediaFormat for Dolby Vision.
- In MediaCodecUtil support all DV profiles that Android has constants for. This
  includes ones that are "not supported for new applications". Since we don't
  extract these profiles, this is currently only for the benefit of custom
  extractors.
- Misc code style fixes and reordering for consistency.

Merge 37878b975c2bc082b0568e21cbe62bfcef97c10d into 67be9e77834c0dc9d2b5d462c01c2f39718c8817

PiperOrigin-RevId: 233066799
2019-02-18 15:57:14 +00:00
aquilescanta
36da5fb511 Group audio renditions by name
Allows the player to adapt between audio renditions with different
names.

PiperOrigin-RevId: 233052105
2019-02-18 15:56:59 +00:00
andrewlewis
dec00997e3 Remove deprecated ImaAdsMediaSource and constructors
Given the change to require setPlayer on AdsLoaders, it seems like a good
opportunity to clean up deprecated ads-related symbols.

PiperOrigin-RevId: 233020171
2019-02-18 15:56:39 +00:00
olly
e3981ec484 Fix notifications to avoid flicker on KitKat
On KitKat you need to reuse the same notification builder when
generating a notification that's intended to replace a previous
one. See:

https://stackoverflow.com/questions/6406730/updating-an-ongoing-notification-quietly

PiperOrigin-RevId: 232503682
2019-02-06 15:45:24 +00:00
olly
784906b872 Update release notes
PiperOrigin-RevId: 232481580
2019-02-06 15:44:56 +00:00
tonihei
7a4cf96f4a Improve housekeeping of ConcatenatingMediaSource callbacks.
When calling releaseSource(), all pending messages will be removed. That means
that all action-on-completion callbacks which are somewhere in flight are
just dropped without being called. This change adds code to keep track of the
current state of each callback to allow all of them being called when the
source is released.

Issue:#5464
PiperOrigin-RevId: 232312528
2019-02-04 19:39:54 +00:00
olly
f1ded9c3c2 Wider fix for OMX.SEC.mp3.dec issue
Issue: #4519
PiperOrigin-RevId: 232299233
2019-02-04 19:39:13 +00:00
olly
ef6725bf48 Bump version for 2.9.5 release
PiperOrigin-RevId: 231744540
2019-01-31 14:06:02 +00:00
olly
45433869e5 Rename ExtractorMediaSource to ProgressiveMediaSource
It better describes what the class does. More importantly, we've had
inconsistent class names since we added offline support, for which we
added ProgressiveDownloader ("ExtractorDownloader" doesn't make any
sense). We could really do with aligning the names for clarity.

(Sorry)

PiperOrigin-RevId: 231387268
2019-01-29 16:45:42 +00:00
olly
19144c4c73 Allow to disable libyuv dependency on LIBVPX
Goal: reduce binary size.
PiperOrigin-RevId: 231198579
2019-01-29 16:43:32 +00:00
aquilescanta
6dde1e67d3 Parse CHANNELS attribute from EXT-X-MEDIA
PiperOrigin-RevId: 230743198
2019-01-29 16:42:18 +00:00
olly
355b3d6334 Increase minSdkVersion to 16
The combination of pre-16 API levels accounting for ~0.5% of the device
population, and that the most important components in ExoPlayer (e.g.
the MediaCodec renderers) have always required API level 16, mean it's
very unlikely this will negatively impact on anyone.

PiperOrigin-RevId: 230701808
2019-01-29 16:41:45 +00:00
olly
9fec49f326 Update 2.9.4 release notes
PiperOrigin-RevId: 230220448
2019-01-29 16:39:45 +00:00
tonihei
923aa420df Use loading period event time for fatal load errors.
ExoPlaybackExceptions of type SOURCE are always associated with the loading
period and thus we can use the event time for the loading period in
onPlayerError. Renderer and unexpected exceptions are still associated with the
currently playing period.

Issue:#5407
PiperOrigin-RevId: 230216253
2019-01-21 14:10:49 +00:00
tonihei
e4eaaedad3 Add max video size workaround for Amlogic decoder.
The Amlogic awesome decoder reduces the video size of interlaced videos by half
if the internal configuration isn't force reset with new maximum input size
values. The product of these new values must exceed 1920x1088 to force the
reset.

Issue:#5003
PiperOrigin-RevId: 230206675
2019-01-21 12:58:06 +00:00
olly
14eb561e38 Use MediaCrypto.setMediaDrmSession to avoid black flicker
Issue: #3561
PiperOrigin-RevId: 229934093
2019-01-21 12:57:04 +00:00
andrewlewis
310925ca12 Upgrade to GVR SDK 1.190.0
Change the dependency to the new monolithic GVR SDK target.

PiperOrigin-RevId: 229931549
2019-01-21 12:56:43 +00:00
olly
ef24125d20 Fix release notes for 2.9.4
PiperOrigin-RevId: 229841782
2019-01-21 12:56:22 +00:00
tonihei
22413b8037 Add start position to MediaSource.createPeriod.
That's the same position set in MediaPeriod.prepare (where it may be removed
in the future).

Having the position at an earlier point is necessary to fix an
issue with lazy preparation in ConcatenatingMediaSource where the prepare
position was assumed to be known but MediaPeriod.prepare hasn't been called
yet.

Issue:#5350
PiperOrigin-RevId: 229756637
2019-01-17 17:26:24 +00:00
bachinger
16a185de1d make PlayerNotificationListener better suited for foreground services
Issue: #5301
Issue: #4988
Issue: #4813
Issue: #5344
Issue: #5117
PiperOrigin-RevId: 229603354
2019-01-17 14:37:23 +00:00
bachinger
8adc16a623 allow developers to set the subText of the notifcation
Issue: #5344
PiperOrigin-RevId: 229527963
2019-01-17 14:37:00 +00:00
olly
36883e6277 Bump version for 2.9.4 release
PiperOrigin-RevId: 229364563
2019-01-15 15:03:35 +00:00
Oliver Woodman
3b5e8ada31 Merge pull request #5355 from zsmatyas:dev-v2
PiperOrigin-RevId: 229364147
2019-01-15 15:03:24 +00:00
tonihei
b97b35e2e0 Add buffer flag for last sample to improve buffered position calculation.
The buffered position is currently based on the mimimum queued timestamp of
all AV tracks. If the tracks have unequal lengths, one track continues loading
without bounds as the "buffered position" will always stay at the shorter
track's duration.

This change adds an optional buffer flag to mark the last sample of the
stream. This is set in the Mp4Extractor only so far. ExtractorMediaSource
uses this flag to ignore AV streams in the buffered duration calculation if
they already finished loading.

Issue:#3670
PiperOrigin-RevId: 229359899
2019-01-15 14:29:07 +00:00
olly
9ab08bbe5d Fix DRM protected SmoothStreaming with subtitles
Issue: #5378
PiperOrigin-RevId: 229261658
2019-01-14 23:58:45 +00:00
olly
1b62277a0b Disable cache fragmentation except for progressive
DataSpec.FLAG_ALLOW_CACHE_FRAGMENTATION is added to indicate to the
cache when fragmentation is allowed. This flag is set for progressive
requests only.

To avoid breaking changes, CacheDataSink defaults to ignoring the flag
(and enabling fragmentation) for now. Respecting the flag can be
enabled manually. DownloaderConstructorHelper enables respecting of
the flag.

Issue: #4253
PiperOrigin-RevId: 229176835
2019-01-14 23:58:25 +00:00
tonihei
86637facdd Don't forget isSeekable in ExtractorMediaSource.
We currently forget whether a source is seekable at re-preparation. This was
implemented intentionally this way under the assumption that we really can't seek
until we have loaded the seek map again. However, seek operations are only
allowed after a media period is prepared. So there is no harm in remembering
whether a source is seekable.

This problem currently prevents reusing ClippingMediaSources with
ExtractorMediaSource and a non-zero start clip position.

Issue: #5351
PiperOrigin-RevId: 229169441
2019-01-14 23:58:15 +00:00
tonihei
e8a7cb2546 Remove player and isTopLevelSource parameters from MediaSource.prepare.
They are not longer needed anywhere, are error-prone (because of threading
requirements), and complicate testing and using MediaSources without a player.

PiperOrigin-RevId: 227871157
2019-01-08 07:38:00 +00:00
tonihei
6828797555 Pass Handler together with Runnable callbacks for playlist commands.
We currently either use the app thread returned by the player or the thread
the commands are called on depending on whether the media source is already
prepared or not.

This change lets the application decide which callback thread to use. As a
side effect, we also don't longer need access the player instance passed to
MediaSource.prepare.

PiperOrigin-RevId: 227871111
2019-01-08 07:37:50 +00:00
andrewlewis
14027bc98e Treat AVERROR_INVALIDDATA as non-fatal
Also configure the FFmpeg context to ignore errors as far as possible (this
appears to have an effect only for certain decoders).

Issue: #5293
PiperOrigin-RevId: 227851397
2019-01-08 07:37:30 +00:00
tonihei
e4ad90efd0 Set Player separately in AdsLoader interface.
Passing the player through MediaSource.prepare is only needed for the AdsLoader
and complicates other usages of MediaSource. Providing the player directly to
the AdsLoader is also in line with the usage pattern of PlayerView and other
components.

Also rename methods to start/stop to better reflect their usage.

PiperOrigin-RevId: 227682112
2019-01-08 07:33:52 +00:00
eguven
7ae768376c Prepare DownloadState for upcoming changes
Made DownloadState top level class.
Replaced action field DownloadAction fields.
Added removing, removed and restarting states.
Renamed started state to downloading.

PiperOrigin-RevId: 227664735
2019-01-08 07:33:23 +00:00
tonihei
803b878a8a Use Handler instead of ExoPlayer messages in ConcatenatingMediaSource
ExoPlayer methods must not be called from any thread besides the specified
app thread. Therefore we shouldn't use them here. Using a regular Handler
instead is fully equivalent.

Issue:#5240
PiperOrigin-RevId: 227650489
2019-01-08 07:33:13 +00:00
andrewlewis
1e99224019 Remove AdsLoader listeners on releasing ImaAdsLoader
Issue: #4114
PiperOrigin-RevId: 227516509
2019-01-08 07:32:31 +00:00
olly
173f36897b Update release notes
PiperOrigin-RevId: 226459209
2019-01-08 07:31:28 +00:00
olly
f4d741a565 Bump for 2.9.3
PiperOrigin-RevId: 226356810
2018-12-20 21:14:04 +00:00
andrewlewis
bad8ec5952 Relax audio decoder capability checks
Issue: #5145
PiperOrigin-RevId: 226297129
2018-12-20 12:44:18 +00:00
Oliver Woodman
be2636c365 Merge pull request #4993 from saschpe:icy
PiperOrigin-RevId: 226031838
2018-12-18 19:46:54 +00:00
andrewlewis
0e8e9621c0 Use the true bitrate for CBR MP3 seeking
PiperOrigin-RevId: 225989898
2018-12-18 19:46:43 +00:00
Oliver Woodman
4d282b2278 Merge pull request #5216 from mseroczynski:dev-v2
PiperOrigin-RevId: 225966289
2018-12-18 19:46:23 +00:00
aquilescanta
8202cb2d2a Mitigate the need for FLAG_ALLOW_NON_IDR_KEYFRAMES
Use random access indicator in transport streams

Issue:#1967
Issue:#2020
Issue:#2182
Issue:#2469
Issue:#2581
Issue:#2748
Issue:#2939
Issue:#2979
Issue:#3316
Issue:#3574
Issue:#3709
Issue:#3747
Issue:#4103
Issue:#4184
Issue:#4355
Issue:#4538
Issue:#4719
Issue:#4861
Issue:#4925
Issue:#4951
Issue:#5108
Issue:#5186
PiperOrigin-RevId: 225798044
2018-12-18 19:45:18 +00:00
Michał Seroczyński
49a99beaef
Merge branch 'dev-v2' into dev-v2 2018-12-17 11:19:50 +01:00
Oliver Woodman
254589cbe8 Merge pull request #5066 from szaboa:feature/1583_support_png_ttml
PiperOrigin-RevId: 225531695
2018-12-14 15:42:57 +00:00
tonihei
173ddd6ee7 Add simplified adaptive media source stream key filter to factory classes.
This change only simplifies the API by using the ManifestParser internally.

PiperOrigin-RevId: 225516193
2018-12-14 15:42:36 +00:00
olly
7d21154b62 Fix release notes
PiperOrigin-RevId: 225170404
2018-12-14 15:40:46 +00:00
eguven
4bf42bd2ad Rename TaskState to DownloadState
PiperOrigin-RevId: 225145311
2018-12-14 15:40:16 +00:00
eguven
230a798f23 Create only one task for all DownloadActions for the same content
PiperOrigin-RevId: 225060323
2018-12-14 15:40:06 +00:00
olly
05bfeca50b Enable setOutputSurfaceWorkaround for dangal
Issue: #5169
PiperOrigin-RevId: 225025357
2018-12-14 15:39:53 +00:00
olly
2f365e5a4b Don't write CachedContentIndex to disk on key removal
Issue: #5136
PiperOrigin-RevId: 224857629
2018-12-14 15:39:13 +00:00
tonihei
5776bed190 TrackSelection.Factory clean-up.
We currently have two factory methods where it is completely unclear which one needs
to be overridden.

This change deprecates the old one, adds a Util method to easily map back from the new
to the old behaviour, and updates all implementations of the now deprecated method in
our code.

PiperOrigin-RevId: 224303560
2018-12-10 18:08:50 +00:00