6630 Commits

Author SHA1 Message Date
ibaker
44c2ddb076 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

Issue: #8103
PiperOrigin-RevId: 339050634
2020-11-18 19:09:41 +00:00
andrewlewis
1264dbcd36 Handle stream volume register/unregister errors
Issue: #8106
Issue: #8087
PiperOrigin-RevId: 338664455
2020-11-18 19:07:04 +00:00
aquilescanta
da663aa081 Avoid chunkless preparation if the codec mapping is ambiguous
Issue: #7877
PiperOrigin-RevId: 338659937
2020-11-18 18:54:37 +00:00
aquilescanta
806681dd16 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-11-18 18:50:35 +00:00
aquilescanta
3d8c9b0bf8 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-11-18 18:48:46 +00:00
olly
d7e8238b88 Bump version to 2.12.1
PiperOrigin-RevId: 338261975
2020-10-21 22:36:32 +01:00
insun
de2b58e7e1 Fix bottom area to have even paddings and make seekbar slimmer.
Also removed unused thumb resources.

PiperOrigin-RevId: 338184661
2020-10-21 10:27:24 +01:00
Oliver Woodman
452f68fb6c Merge pull request #7867 from GeneticGenesis:pc/update-expected-http-statuses-for-failover
PiperOrigin-RevId: 338051017
2020-10-20 22:16:12 +01:00
Oliver Woodman
d2fb9dda82 Merge pull request #8088 from xufuji456:dev-v2
PiperOrigin-RevId: 338024866
2020-10-20 22:16:12 +01:00
krocard
e72082710c AudioSink: Remove comment about unconfirmed crash
Consensus is that the NoClassDefFoundError does not
causes a crash but only a warning.

PiperOrigin-RevId: 338022354
2020-10-20 22:16:12 +01:00
Oliver Woodman
7303005873 Merge pull request #8030 from yqritc:add-output-surface-workaround
PiperOrigin-RevId: 338016707
2020-10-20 22:16:12 +01:00
andrewlewis
fac3515016 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-20 22:16:12 +01:00
krocard
0de938c4aa Do not inherit directly from AudioTrack.StreamEventCallback
This was causing issues old devices where the class
inheriting StreamEventCallback was loaded even though
it was not used.

Instead use an anonymous class that seem to be loaded
more lazily.

PiperOrigin-RevId: 337252687
2020-10-20 22:16:12 +01:00
krocard
ec96e0c495 Add MiTV devices requiring the output surface workaround
Issue: #8014
PiperOrigin-RevId: 337142176
2020-10-20 22:16:12 +01:00
ibaker
a635bdd4ba 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-20 22:16:12 +01:00
andrewlewis
53c4a393f3 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-20 22:16:12 +01:00
kimvde
947b637441 Small fix in IndexSeekMap
This change was meant to be in 2e5f2f12ad but
was not added my mistake.

PiperOrigin-RevId: 337041686
2020-10-20 22:16:12 +01:00
bachinger
36c2fe1053 Add missing properties of MediaItem.Subtitle
Issue: #8044
PiperOrigin-RevId: 336955479
2020-10-20 22:16:12 +01:00
kim-vde
8f04968fb1 Merge pull request #7378 from shenwill:dev-v2
PiperOrigin-RevId: 336875300
2020-10-20 22:16:12 +01:00
olly
3149dd0ffc Fix a couple of StyledPlayerControlView bugs
1. The first time the player controls are are made visible,
   there is no animation.
2. The first time the player controls are made visible, the
   "select tracks" button isn't displayed. When tapping to
   subsequently hide the player controls, the button briefly
   becomes visible and then is hidden again. This bug is due
   to state in StyledPlayerControlViewLayoutManager being
   out of sync, resulting in StyledPlayerControlView's
   onVisibilityChange not being called properly.

After this change both of these issues should be resolved.

PiperOrigin-RevId: 336704031
2020-10-20 22:16:10 +01:00
andrewlewis
8dc6b7e8c5 Update translations for UI module
This should fix gradle errors like: "warn: removing resource
com.google.android.exoplayer2.demo:string/exo_controls_fastforward_by_amount_description
without required default value."

PiperOrigin-RevId: 336670827
2020-10-20 22:11:34 +01:00
ibaker
907d10705a Use MP4VTT MIME type in DashManifestParser (again)
We stopped using using this MIME type in
74a9d8f680

This broke subtitle decoding in some cases (Issue: #7985), which I
fixed in
7b8895d655.

After some discussion we've decided SubtitleDecoderFactory shouldn't
depend on Format.containerMimeType (since the samples have already been
extracted by this point, so the container shouldn't matter). So this
change fixes DashManifestParser to use MimeTypes.APPLICATION_MP4VTT (and
reverts the no-longer-needed SubtitleDecoderFactory change).

PiperOrigin-RevId: 336668450
2020-10-20 22:11:34 +01:00
ibaker
d4a0dfda77 Ensure ParsableByteArray is large enough when appending in VorbisReader
PiperOrigin-RevId: 336643621
2020-10-20 22:11:34 +01:00
insun
1e315e47d6 Expand bottom button's height and extend greyed background area to seekbar
Adjusted the bottom layout of StyledPlayerControlView :
- Enlarged bottom button's height to make tapping easier.
- Extended greyed background area to upper edge of seekbar.
- Gave padding between bottom edge of the overall layout and bottom buttons.
- Reduced horizontal margins between bottom buttons.

PiperOrigin-RevId: 336041160
2020-10-20 22:11:34 +01:00
bachinger
c8879392ab Make resetPosition reset the position if true
Issue: #8024
PiperOrigin-RevId: 335846035
2020-10-17 12:18:39 +01:00
aquilescanta
5b0b4479ae Fix HLS chunkful preparation bug affecting certain master playlists
The bug affects playlists that start with an I-FRAME only variant.

Issue: #8025
PiperOrigin-RevId: 335819497
2020-10-17 12:18:32 +01:00
andrewlewis
837cdc4f67 Fix miscellaneous nits/typos
PiperOrigin-RevId: 335642909
2020-10-17 12:18:13 +01:00
kimvde
bddaaf022c Ignore negative payload size in TS PesReader
Issue: #8005
PiperOrigin-RevId: 335625992
2020-10-17 12:18:05 +01:00
kimvde
1cca9ffd01 Add search bytes parameter to TsExtractor
Context: Issue: #7988
PiperOrigin-RevId: 335608610
2020-10-17 12:17:42 +01:00
ibaker
13d8860221 Tweak null-checking in TextRenderer#getNextEventTime()
`subtitle` is only guaranteed to be non-null if
`nextSubtitleEventIndex != C.INDEX_UNSET`. The null check added in
0efec5f6c1
was too early.

Issue: #8017
PiperOrigin-RevId: 334777742
2020-10-17 12:09:20 +01:00
ibaker
b8c8ce0ee0 Use Mp4WebvttDecoder for WebVTT content in DASH MP4 containers
This was broken by 74a9d8f680
because DashManifestParser switched to setting Format.sampleMimeType to
text/vtt while SubtitleDecoderFactory was still expecting
application/x-mp4-vtt. This change teaches SubtitleDecoderFactory to
check both Format.containerMimeType and Format.sampleMimeType.

I'll investigate a follow-up change to remove
MimeTypes.APPLICATION_MP4VTT completely (it's currently still used in
AtomParsers).

Issue: #7985
PiperOrigin-RevId: 334771672
2020-10-17 12:09:13 +01:00
ibaker
9ce2ac8a8c Create a robolectricutils module
This holds shared test infrastructure that needs to depend on
Robolectric.

PiperOrigin-RevId: 334604041
2020-10-17 12:08:59 +01:00
ibaker
bd312ec906 Preserve limit when resetting ParsableByteArray in OggPacket#populate
When I moved ParsableByteArray#data behind a getter I replaced some
assignments with calls to reset(byte[]):
ce2e6e2fd6

reset(byte[]) deliberately sets `limit` to `data.length`, in order to
handle cases that were reassigning `data` but not updating `limit`.
However OggPacket was already using `limit` to track where to write
'new' data into the array, so changing `limit` to `data.length` caused
us to try and write new data beyond the end of the array.

I looked at other uses of reset(byte[]) in ce2e6e2fd6
and condluded the only other usage in MatroskaExtractor is legit and
shouldn't be updated like this (because MatroskaExtractor previously
*wasn't* correctly updating/maintaining `limit`).

Issue: #7992
PiperOrigin-RevId: 334601586
2020-10-17 11:53:40 +01:00
andrewlewis
824b2a7305 Fix position ramping behavior with AudioTrack speed params
Non-realtime AudioTrack playback speed was not taken into account when
extrapolating the old mode's position, causing the position not to
advance smoothly.

This should be a no-op when not using AudioTrack playback params for
speed adjustment.

Issue: #7982
PiperOrigin-RevId: 334151163
2020-10-17 11:53:06 +01:00
samrobinson
89cd796bf6 Do not require subtitleButton in custom layouts of StyledPlayerView
Every other subtitleButton has an if not null check, but does not force non null.

Issue: #7962
PiperOrigin-RevId: 334124323
2020-10-17 11:52:45 +01:00
Oliver Woodman
9819664bd1 Merge pull request #7798 from yoobi:trackSelectionView
PiperOrigin-RevId: 333751261
2020-10-17 11:51:53 +01:00
kimvde
57f11d1556 Parse TLEN duration in Mp3Extractor
Issue: #7949
PiperOrigin-RevId: 333733615
2020-10-17 11:51:36 +01:00
bachinger
19530866c7 Always pass true for ongoing with the first notification
ISSUE: #7977
PiperOrigin-RevId: 333726625
2020-10-17 11:51:30 +01:00
christosts
300bee5f0b Bring back setRenderTimeLimitMs
PiperOrigin-RevId: 333712782
2020-10-17 11:51:18 +01:00
samrobinson
973d23543e Add support for mp2 boxes.
Issue: #7967
PiperOrigin-RevId: 333709003
2020-10-17 11:49:06 +01:00
christosts
a1999ef854 Util.getStringForTime() prefixes negative times
Fix bug to place the negative sign in the beginning
of the returned String.

PiperOrigin-RevId: 333504868
2020-10-17 11:48:24 +01:00
kim-vde
31251a40c1 Merge pull request #7968 from DolbyLaboratories:dev-v2-channelConfiguration
PiperOrigin-RevId: 333485323
2020-10-17 11:48:14 +01:00
tonihei
30be792a15 Switch SntpClient to time.android.com and allow to set host.
PiperOrigin-RevId: 333480727
2020-10-17 11:48:08 +01:00
krocard
64aa634f9b Fix offload buffer full detection after setEndOfStream
This issue has been observed on a test app stress
testing setEndOfStream.

The issue has not been observed on ExoPlayer,
probably due to timing differences, but it is fixed
preventively.

#exo-offload

PiperOrigin-RevId: 333472136
2020-10-17 11:48:02 +01:00
ibaker
92f9de8ea3 Delete sample_cbs.adts test asset
This seems to be an exact copy of sample.adts. Update the test to use
the same sample but just output to a different dump file.

PiperOrigin-RevId: 333469714
2020-10-17 11:47:54 +01:00
andrewlewis
79638d1e3d Add support for 'mett' sample description
PiperOrigin-RevId: 333272292
2020-10-17 11:47:44 +01:00
andrewlewis
884a0f52cd Remove unused MP4 atom type
PiperOrigin-RevId: 333051018
2020-10-17 11:47:35 +01:00
tonihei
93948471c8 Don't require the existence of the next period to wait for its stream.
We have a workaround for uneven sample stream durarions in playlists that
assumes a renderer allows playback if it's reading ahead or waiting for
the next stream.

652c2f9c18 changed this logic to no longer require to
wait until the next stream is prepared due to a change in how we advance
media periods in the queue. However, the code falsely still requires the
next stream to exist (even if it's not prepared). This can cause a stuck
buffering state when the difference in the duration of the streams is more
than what we buffer ahead because we never create the next stream in such
a case.

Note: DefaultMediaClock.shouldUseStandaloneClock has roughly the same logic
and also doesn't require the next stream to be present.

Also fix a test that seemed to rely on this stuck buffering case to test
stuck buffering detection. Changed the test to not read the end of stream
to ensure it runs into the desired stuck buffering case.

Issue:#7943
PiperOrigin-RevId: 333050285
2020-10-17 11:47:27 +01:00
olly
a837e7a3b0 Cleanup layout XMLs to be consistent with others
PiperOrigin-RevId: 333023580
2020-10-17 11:44:43 +01:00
ibaker
77249bdf0e Use replace() instead of replaceAll() in SsaDecoder
We're not using regex so there's no need to use replaceAll()

PiperOrigin-RevId: 332865724
2020-10-17 11:44:17 +01:00