7170 Commits

Author SHA1 Message Date
kimvde
aa25037600 JpegExtractor: support JFIF segment preceding Exif segment
#minor-release

PiperOrigin-RevId: 364561115
2021-04-09 17:07:44 +01:00
Ian Baker
65ab00859f Merge pull request #8653 from dlafayet:textemphasis
PiperOrigin-RevId: 364363882
2021-04-09 17:07:08 +01:00
andrewlewis
871c24b966 Fix typo in styled player control view javadoc
#minor-release

PiperOrigin-RevId: 363915106
2021-04-09 17:05:40 +01:00
aquilescanta
ca9af38420 Add 'once' to list of devices that need SetOutputSurfaceWorkaround
Issue: #8718
PiperOrigin-RevId: 363869093
2021-04-09 17:05:13 +01:00
kimvde
5c722acca0 JpegExtractor: read GContainer and GContainerItem XMP prefixes
#minor-release

PiperOrigin-RevId: 363859522
2021-04-09 17:04:39 +01:00
aquilescanta
3732eca8b7 Avoid invalid extractors in DefaultHlsExtractorFactory
This change fixes playback of playlists where segments have the
extension and Content-Type of JPEG pictures (although in reality)
they are transport streams. File inferrence before this change will
cause an exception when assuming the inferred file type is one of
the allowed HLS containers.

#minor-release
Issue: #8733
PiperOrigin-RevId: 363641277
2021-04-09 17:04:08 +01:00
olly
0d052e0399 HLS: Allow audio variants to initialize the timestamp adjuster
This makes HLS playback less liable to become stuck if discontinuity
tags are inserted at different times across media playlists.

Issue: #8700
Issue: #8372
PiperOrigin-RevId: 362903428
2021-04-09 16:59:46 +01:00
ibaker
06e6391866 Fix CEA-708 priority
According to the spec (section 8.4.2), high numeric values represent low
priorities, so we need to flip this sort.

Issue: #8704
#minor-release
PiperOrigin-RevId: 362558370
2021-04-09 16:57:26 +01:00
andrewlewis
3bdfb76c0c Don't update the ad group count when releasing ImaAdsLoader
`ImaAdsLoader` clears its `AdPlaybackState` when it's released but this could
cause `AdsMediaSource` to look up information in the ad playback state that is
no longer in bounds.

Issue: #8693

PiperOrigin-RevId: 362556286
2021-04-09 16:56:54 +01:00
aquilescanta
21326e67e3 Fallback to inferred file types when sniffing fails
If none of the extractors successfully sniff the content then we will fall back
to inferred file types in the following order:
- Webvtt if the media comes from a SUBTITLE EXT-X-MEDIA.
- The type of media declared in the HTTP "Content-Type" header.
- The type of the media according to the file extension.
- Transport stream.

Issue: #8700
PiperOrigin-RevId: 362519769
2021-04-09 16:49:31 +01:00
ibaker
3dae045487 Deflake ClippedPlaybackTest
PiperOrigin-RevId: 362298115
2021-04-09 16:49:00 +01:00
ibaker
39e6f665a7 Pass the end position of a stream to TextRenderer when marking it final
In a period transition we pass the start time of the next period, for
the final period we pass the duration of the period or timeline, if
known.

This means sideloaded subtitles now respect the end point of
ClippingMediaSource and ensures that content subtitles aren't
incorrectly displayed over mid-roll ads.

When transitioning back into the subtitled content the subtitles still
appear slightly before the video transitions, meaning the first subtitle
of the content is shown with the last few frames of the ad. Resolving
this in a way that doesn't break anything else requires a deeper
investigation.

Issue: #5317
Issue: #8456
#minor-release
PiperOrigin-RevId: 361797118
2021-04-09 16:13:10 +01:00
Ian Baker
fbdc1bbfd7 Merge pull request #8654 from abeljim:dev-v2-8435-bolditalic
PiperOrigin-RevId: 361767801
2021-04-09 16:11:47 +01:00
tonihei
37d5947b9e Use correct period-window offset for initial prepare position.
MaskingMediaSource needs to resolve the prepare position set for a MaskingPeriod
while the source was still unprepared to the first actual prepare position.

It currently assumes that the period-window offset and the default position is
zero. This assumption is correct when a PlaceholderTimeline is used, but it
may not be true if the real timeline is already known (e.g. when re-preparing
a live stream after a playback error).

Fix this by using the known timeline at the time of the preparation.
Also:
 - Update a test that should have caught this to use lazy re-preparation.
 - Change the demo app code to use the recommended way to restart playback
   after a BehindLiveWindowException.

Issue: #8675
PiperOrigin-RevId: 361604191
2021-04-09 16:10:26 +01:00
Ian Baker
db60db70fc Merge pull request #8662 from joakimzhang:dev-v2
PiperOrigin-RevId: 361029604
2021-04-09 16:07:55 +01:00
bachinger
01d4adad6d Reset playback speed when live speed control becomes unused
Issue: #8664
#minor-release
PiperOrigin-RevId: 360877086
2021-04-09 16:06:56 +01:00
Oliver Woodman
d6eb61d6f8 Merge pull request #8546 from TadejZupancic:dev-v2
PiperOrigin-RevId: 360433358
2021-04-09 16:06:22 +01:00
kimvde
1a190ff90e Link to callback in Player getters' Javadoc
PiperOrigin-RevId: 360398175
2021-04-09 16:04:54 +01:00
andrewlewis
bcd0a91ed6 Fall back from DTS HD to DTS
#minor-release

PiperOrigin-RevId: 360384540
2021-04-09 14:10:21 +01:00
olly
8570248079 Fix scrubber not reappearing correctly in some cases
Issue: #8646
PiperOrigin-RevId: 360184586
2021-04-09 14:08:49 +01:00
ibaker
e4d5e07fd3 Make SsaDecoder robust against absent Format items
Suggested in a comment on PR Issue: #8615

PiperOrigin-RevId: 359522217
2021-04-09 14:01:23 +01:00
Ian Baker
4364b9150f Disable flaky test in ExoPlayerTest
targetLiveOffsetInMedia_unknownWindowStartTime_doesNotAdjustLiveOffset
is flaky on the release branch. It's not flaky on the dev-v2 branch
due to recent changes to FakeClock's behaviour which aren't yet present
on release-v2.
2021-02-25 16:29:37 +00:00
bachinger
c96f695af7 Bump version to 2.13.2
PiperOrigin-RevId: 359486817
2021-02-25 11:51:24 +00:00
marcbaechinger
e21b99a671 Merge pull request #8615 from szaboa:dev-v2-8435-ssa-font-size
PiperOrigin-RevId: 359244236
2021-02-24 18:35:59 +00:00
kimvde
3f8f7ba97f Fix conditions to enable UI actions
- Ensure consistency between (Styled)PlayerControlView,
  PlayerNotificationManager, TimelineQueueNavigator and
  DefaultControlDispatcher.
- Handle the case where a live stream has ended when enabling previous
  and next actions (window.isLive() is true and window.isDynamic is
  false in that case)

PiperOrigin-RevId: 359063793
2021-02-24 18:32:11 +00:00
kimvde
90c18e4410 Enable next button if window is live
This behavior is consistent with DefaultControlDispatcher#dispatchNext().

#minor-release

PiperOrigin-RevId: 357145076
2021-02-24 18:14:03 +00:00
marcbaechinger
e890204757 Merge pull request #8539 from larryng:patch-1
PiperOrigin-RevId: 359000734
2021-02-24 18:07:55 +00:00
olly
46995b3c24 Remove unused mocking in CacheWriterTest
#minor-release

PiperOrigin-RevId: 358998449
2021-02-23 13:55:35 +00:00
olly
18a94aa717 SilenceSampleStream.readData: Handle flags-only buffers
The SampleStream.readData contract is that when reading a sample
with a flags-only buffer, the buffer timestamp and flags should
be set and the read position should not be advanced.

#minor-release

PiperOrigin-RevId: 357842130
2021-02-22 15:04:08 +00:00
olly
5be7d4da9e Don't clear audioSessionId when audio disabled
Issue: #8585
PiperOrigin-RevId: 357553237
2021-02-22 14:52:37 +00:00
tonihei
0ab9a219f7 Clarify/correct restrictions of AdsMediaSource.
The source can be used in compositions (in fact, every source is
automatically used in an internal composition when constructing the
playlist), and there is not really a concept of top-level media source
any more since the Player supports playlists.

The actual restriction is that the content media source needs to have
exactly one period to be able to create a SinglePeriodAdTimeline.

#minor-release

PiperOrigin-RevId: 357544191
2021-02-22 14:46:35 +00:00
kimvde
84d7433936 Revert logic to decide whether meta atom is full
The previous logic was changed under the assumption that the first box
inside a meta box was not always an hdlr box, but this is not true.

#minor-release

PiperOrigin-RevId: 357200713
2021-02-22 14:35:54 +00:00
kimvde
75cc5990b0 Add support for MP4/QuickTime non-full meta atoms
PiperOrigin-RevId: 357160215
2021-02-22 14:32:08 +00:00
olly
5807d2e0be Fix RequiresApi annotation
#minor-release

PiperOrigin-RevId: 357273184
2021-02-12 22:55:02 +00:00
olly
26371ae40f Bump version to 2.13.1
PiperOrigin-RevId: 357219132
2021-02-12 20:01:59 +00:00
tonihei
01f57c3c0b Fix available end time calculation for multi-period DASH live streams
The available end time was accidentally substracted by the start time
of the last period.

To avoid similar time reference confusion in the future, also renaming
many variables and methods to clearly reflect the time reference point.
And to avoid constant conversion, the processManifest method also
attempts to converge to time relative to the start of the window as
quickly as possible.

Issue: #8537
PiperOrigin-RevId: 357001624
2021-02-12 17:19:37 +00:00
ibaker
295e8bacb3 Check if keepalive is enabled before releasing sessions in DDSM.release
If keepalive is disabled the existing code over-eagerly releases
DrmSession instances. This is arguably OK since a (Default)DrmSession
should be released before its (Default)Manager is released
(since the underlying MediaDrm instance might be released when the
manager is released). And if all sessions are released before the
manager is released then `sessions` is empty, so the loop is a no-op.

Issue: #8576
PiperOrigin-RevId: 356955308
2021-02-12 17:19:19 +00:00
ibaker
d48d59bda1 Propagate DRM config when creating ad media sources
The `DrmConfiguration.sessionForClearTypes` property is often used
to ensure a secure decoder is used for clear ads played in encrypted
content. This is because some devices show black frames when switching
decoders.

Before this change the DRM config isn't propagated down when
constructing the ad media source, meaning
`DrmSessionManager.DRM_UNSUPPORTED` is always used, which will
cause playback to switch from secure to clear decoder when transitioning
to an ad break (ignoring the MediaItem `sessionForClearTypes` option.

Issue: #8568

PiperOrigin-RevId: 356951124
2021-02-12 17:19:03 +00:00
andrewlewis
ed3d1c6283 Don't set playback parameters when using tunneling
Issue: #4803

PiperOrigin-RevId: 356923345
2021-02-12 17:18:34 +00:00
ibaker
19ab087c61 Cache the last DrmSessionManager instance inside the default provider
Without this a new manager is instantiated for every item in a playlist,
meaning the impact of caching improvements to DefaultDrmSessionManager
are reduced (since the cache doesn't persist across playlist items).

With this change, playlists of items with identical DRM config will use
the same manager instance (and thus share existing sessions).

Issue: #8523
PiperOrigin-RevId: 356690852
2021-02-12 17:17:58 +00:00
andrewlewis
56feb96fc9 Handle loading the same ad more than once
Also allow the player's prepared ad media period durations array to exceed the
length of the loaded ad URIs array, as it's possible for the player to buffer
an ad media period fully at the point where it's known that an ad is coming up
but its URI is still unknown.

PiperOrigin-RevId: 356249284
2021-02-12 17:17:40 +00:00
tonihei
5211f06dc2 Don't apply speed adjustment if windowStartTime is unknown.
This may happen for HLS live streams without program date time
information.

Issue: #8560

PiperOrigin-RevId: 356227729
2021-02-12 17:17:11 +00:00
kimvde
a08514315f Transformer: remove SpeedProvider interface from Javadoc
#minor-release

PiperOrigin-RevId: 356221487
2021-02-12 17:15:58 +00:00
kimvde
77798e4fef Avoid skipping the first decoder output buffers after speed change
#minor-release

PiperOrigin-RevId: 355652144
2021-02-04 18:16:51 +00:00
kimvde
045048f6f5 Fall back to AVC/HEVC for Dolby Vision levels 10-13
Before, the level was set to null in this case.
MediaCodecUtil.getCodecProfileAndLevel() was therefore returning null
and the fallback to AVC/HEVC was not enabled in MediaCodecVideoRenderer.

Issue:#8530
PiperOrigin-RevId: 355574499
2021-02-04 16:19:46 +00:00
olly
95d9060a30 Suppress SwitchIntDef warning where it makes sense
In both cases it's deliberate that all excluded constants should use
the default branch. Furthermore, there are quite a lot of excluded
constants missing, so it's probably better to suppress the warning
than to include them all.

#minor-release

PiperOrigin-RevId: 355426749
2021-02-04 00:32:03 +00:00
kimvde
b879869a10 Add Transformer "Getting started" page
#minor-release

PiperOrigin-RevId: 355381610
2021-02-04 00:31:46 +00:00
olly
42d3bb42b7 Refine ProGuard config workaround for Function
This is a more targeted workaround, which still allows for the
containing package name to be obfuscated.

#minor-release

PiperOrigin-RevId: 355381201
2021-02-03 15:49:10 +00:00
olly
b419d0ac1d Improve EventLogger static metadata formatting
#minor-release

PiperOrigin-RevId: 355203044
2021-02-03 15:49:04 +00:00
ibaker
b4a9c756b8 Document that DrmSessionManagerProvider doesn't call DSM#prepare()
#minor-release

PiperOrigin-RevId: 355159635
2021-02-03 15:48:53 +00:00