Also add explicit Lint.IfChange/ThenChange rules to make it
clearer what needs to be done when changing one of the code
paths that's accessed via reflection.
PiperOrigin-RevId: 233406709
Without this change, any prepare() operation that requires posting to
the DummyMainThread's handler cannot complete preparation.
PiperOrigin-RevId: 233050367
Converting a single track selection to stream keys is only possible if the output
is independent from other track selections being made.
This is not the case for DASH and HLS embedded track groups which should select the
already selected primary track if possible (and thus needs to know whether a primary
track group is selected).
Also, update the test method to take a period index.
PiperOrigin-RevId: 231385490
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
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
Made DownloadState top level class.
Replaced action field DownloadAction fields.
Added removing, removed and restarting states.
Renamed started state to downloading.
PiperOrigin-RevId: 227664735
This is useful to write integration tests for MediaSources which check that the
stream keys returned by getStreamKeys are compatible with the respective manifest
parser.
PiperOrigin-RevId: 225542606
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
We currently default to not caching data if the content length
cannot be resolved once the DataSource has been open. The
reason for this is to avoid caching progressive live streams.
By doing this we were accidentally not caching in other places
where caching is possible, such as DASH/SS/HLS segments during
playback if the server doesn't include a Content-Length header.
Also HLS encryption key chunks, which were very unlikely to be
cached during playback because we explicitly set FLAG_ALLOW_GZIP
(which normally stops content length from resolving) without
setting FLAG_ALLOW_CACHING_UNKNOWN_LENGTH.
It seems like a good idea to flip the default at this point,
and explicitly disable caching in the one case where we want
that to happen.
PiperOrigin-RevId: 223994110
This allows more efficient range removals and is consistent with addition,
which supports adding multiple elements in a single operation.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222396310
createTrackSelections decides whether to create an adaptive or a fixed track seletion to create.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222231011
A lot of methods just forward to other methods and there is no conceivable
way a player should implement it another way. Moving these methods to a
base player class allows to remove duplicated code across our player
implementations.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215374192
This simplifies code skipping items in a playlist programatically.
Issue:#4863
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214580742
This provides the list of currently buffered media chunks and iterators over
the potential next chunks to the track selection. Having these two parameters
enables more advanced decision logic based on this data.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210551812
- Add @Deprecated on overrides of deprecated method.
- Suppress deprecation warnings where appropriate.
- Use non-deprecated alternatives where appropriate.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210092434
Similar to getBufferedPosition and getCurrentPosition, getDuration should
mention that it also returns the duration of the current ad.
And, also similar to getContentBufferedDuration and getContentPosition, a
new method getContentDuration simplifies querying the content duration while
playing an ad.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209914696
The MediaPeriodId with index is only properly defined together with a
timeline containing the index. Changing it to the period uid allows to use
the MediaPeriodId independent of the corresponding timeline.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209430257
LSC: []
Additional details: []
Cleanup change automatically generated by javacflume/refactory
Refactoring: //third_party/java_src/robolectric/errorprone:ShadowUsageCheck
Tested:
TAP --sample for global presubmit queue
[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207014379
The looping media source doesn't convert the media period id to the externally
visible media period id. And the merging media source reports media period
creations multiple times which will break listeners assuming a media period
with a specific id will only be created once.
Also amend the doc for MediaSource.createPeriod to reflect that media periods
created in parallel do not actually have the same id.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206327241
This removes the need to populate the entire period for the common usage of
getting the uid from the period.
Also add default implementation to get period by uid.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205638265
For the MetadataRetriever, for certain queries, after setting up the player to
render a frame (by seeking to the position), sometimes the player will seek to
the same position and ignore the seek, leading to the frame not being captured,
leaving the retriever in deadlock, waiting for the frame forever. This CL adds
a retry timer to avoid this and make sure we can return query result after some
time.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204460200
- Support handling frame queries (i.e get frames at times, output to certain
sizes) from MetadataRetriever.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203489788
In the future, this allows to register the BandwidthMeter (managed by the player)
as a listener to all media transfers related to this media source.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202643946
This will make it possible for ImaAdsLoader to access the player volume when
used with SimpleExoPlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201664189
Currently, the looper of the thread the player is created on is used (or the
main looper if this thread doesn't have a looper). To allow more control over
the threading, this change lets users specificy the looper which must be used
to call player methods and which is used for event callbacks.
Issue:#4278
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201331564
Currently only the buffered position in the current media period can be queried.
To achieve this, we save the buffered positions of all MediaPeriods to the
PlaybackInfo together with a list of MediaPeriodIds. ExoPlayerImpl can then
determine the correct buffered position for multi-period windows and windows
with midroll ads.
In addition, this change adds two new convenience methods to the Player interface
to query the total buffered duration across all windows and to get the buffered
duration of the content while playing an ad.
Issue:#4023
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200041791
Use PixelCopy API for the first SurfaceCapturer implementation. This supports
devices from API 24+.
Github: #3609.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197732711