While disabled the renderer does not have non-null stream formats. This means
that setting the operating rate could cause a NullPointerException if there was
a codec for reuse.
Check for being enabled/started before trying to set the operating rate. After
the renderer is enabled it should receive a new input format which will update
the operating rate as needed.
PiperOrigin-RevId: 235494384
If the DefaultAudioSink was reconfigured in a way that was compatible with the
previous configuration just after having been reset, we would try to drain audio
processors despite not having an AudioTrack. This could result in a
NullPointerException if speed adjustment was active.
Fix this behavior by only trying to drain audio processors if we actually have
an AudioTrack.
PiperOrigin-RevId: 235355466
- Expose constructor (package private for now, for tests only)
- Add some tests for cache initialization
- Add some TODOs for handling initialization failure
PiperOrigin-RevId: 235188386
*** Reason for rollback ***
Breaks ExoPlayer's gradle build
*** Original change description ***
Migrate Mockito Matchers.{hamcrestMethods} to MockitoHamcrest.{hamcrestMethods}
All methods accepting a hamcrest Matcher in org.mockito.Matchers have been changed
to only accept an ArgumentMatcher. The corresponding methods are now available on
MockitoHamcrest.
For more information see http://go/mockito-2-lsc
Tested:
TAP --sample for global presubmit queue
http://test/OCL:235033293:BASE:234998256:1550793421835:c2ccbbda
***
PiperOrigin-RevId: 235186705
All methods accepting a hamcrest Matcher in org.mockito.Matchers have been changed
to only accept an ArgumentMatcher. The corresponding methods are now available on
MockitoHamcrest.
For more information see http://go/mockito-2-lsc
Tested:
TAP --sample for global presubmit queue
http://test/OCL:235033293:BASE:234998256:1550793421835:c2ccbbda
PiperOrigin-RevId: 235153912
*** Reason for rollback ***
Reverting as this may break playback on other Amlogic devices and/or playback of non-interlaced content.
*** Original change description ***
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: 234967314
Currently IMA determines that the overlay is obstructing, even
if it's empty. Register it as friendly, which means we're
assuming that anything the apps puts in it is necessary for
playback.
PiperOrigin-RevId: 234963065
HlsSampleStream#read should return end of stream when
there is no mapping for the sample stream, instead of
nothing read. This allows the player to transition to
ended.
Issue:#5524
PiperOrigin-RevId: 234764027
- Use Cache UID for CacheContentIndex and CacheFileMetadataIndex. This
enables SD card swapping for a single device.
- I'm hopeful of finding a way to get the Cache UID to DefaultDownloadIndex
so we can do the same there.
PiperOrigin-RevId: 234662753
Horizontal orientation doesn't make sense. I thought about
overriding the setter to throw something, but it's probably
not worth the extra lines.
PiperOrigin-RevId: 234632530
This bug affects any playlist that uses initialization segments. In practice,
almost exclusively fragmented mp4 segmented playlists are affected.
The bottom line is that extractors are chosen for reuse after the
initialization segment connection is open. However, reused extractors
do not need re-parsing the init segment, so loading the initialization is
wasteful.
PiperOrigin-RevId: 234479467
TrackSelectionView requires an initialization with a call to init(...).
That's why we shouldn't let the view retain its view hierarchy automatically
as the views won't be backed by data if restored. Instead add a listener
which lets the containing activity/fragment save and restore the state if
needed.
PiperOrigin-RevId: 234152491
This is a temporary fix to prevent NullPointerException exceptions.
Though writing to cache will still fail if the cache folder isn't a real
folder.
There are a few thing we can try:
* The listing might be failing because the cache folder is just created.
We can wait and try again.
* If the cache folder is a regular file, we can try deleting and creating
a folder with the same name.
PiperOrigin-RevId: 234121925
Previously we would get a new AudioTrack and flush all audio processors if any
AudioProcessor needed to be flushed on reconfiguration. This was problematic for
the case of TrimmingAudioProcessor because it could become active or inactive
due to transitioning to a period with gapless metadata or without it (we don't
keep it active all the time because it is wasteful to populate its end buffer
for content that is not gapless).
This change handles the case where we don't need an AudioTrack but
AudioProcessors do need to be flushed. In this case we drain all the audio
processors when next handling data then switch to the new configuration.
This avoids truncation when period transitions change whether
TrimmingAudioProcessor is active but don't require a new AudioTrack, and is also
a step towards draining the AudioTrack when transitioning between periods if we
do need a new AudioTrack.
To do this, it needs to be possible to drain any pending output data from an
AudioProcessor after it's configured to a new format, so this change makes sure
AudioProcessors allow calling playToEndOfStream and getOutput after
reconfiguration and before flush.
PiperOrigin-RevId: 234033552
This cleanup is in preparation for draining audio processors on reconfiguration
to a format that doesn't require a new AudioTrack to be created.
PiperOrigin-RevId: 233990983
Stop encoding/decoding presentation time as part of the message.
What's actually in emsg boxes is a presentation time delta,
which is why it's only 32 bits, and hence why it doesn't handle
large absolute timestamps. We were using this field to hold
absolute timestamps only for the purpose of passing presentation
times from DashManifestParser.parseEvent back to the calling
method. After this change, we return Pair<Long, EventMessage>
instead.
Issue: #5490
PiperOrigin-RevId: 233561731
builder.mActions is marked as @RestrictTo(LIBRARY_GROUP). We'll
just have to put up with notification flicker on KitKat if the
actions change.
PiperOrigin-RevId: 233420076
Switch from passing an ad UI ViewGroup to passing an object that can also
provide information about controls overlays.
Also switch to using a dedicated overlay for ads instead of the overlay frame
layout, which apps have easy access to.
PiperOrigin-RevId: 233393500
Supporting multiple overrides allows to select tracks from multiple groups, if
enabled. As more options are added, the creation of the dialog is moved to a
separate builder class.
PiperOrigin-RevId: 233366282
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