Releasing the player released the internal playback thread once renderers were
released. Releasing a MediaPeriod queued a Loader.ReleaseTask on the loading
thread which would post back to the playback thread. If the playback thread had
been quit by the time this happened, the release task wouldn't be run.
Release on the loading thread instead of the playback thread. This avoids
needing to block releasing the player until the loading threads have ended, and
ensures that release tasks will run eventually. As part of this change,
ExtractorMediaPeriod's call to Extractor.release will now run on the loading
thread (which means that all Extractor methods are called on that thread) and
other cleanup in ReleaseCallback will run on the loading thread instead of the
playback thread.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185651320
Lint recommends switching to SparseArray<X> instead.
This is done for the DASH case. For the Cast case it's
easier to use a switch statement.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184119312
This is only allowed for user-replaced manifest uris. If the manifest
itself forwards to another manifest, we keep the original manifest in
case the forwarding changes.
Also removed the initialManifest as it can be simplified by using the
sideloadedManifest indicator.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183376209
These parsers can be used to get a manifest which includes only the
representations identified by the given keys.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182932874
This achieves two things:
1. All our tests use the same type of assertions.
2. The tests currently run as instrumentation test can be moved to
Robolectric without changing the assertions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182910542
When a loaded DASH manifest is invalid (either some periods were removed
illegally, or a manifest for a live event is stale), we will retry using 1
logic:
- Retry loading with back-off up-to a limit.
- Throw a DashManifestExpiredException() if we exceed retry limit.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182770028
This fixes a very specific case where the data read has non-cached gaps
and a read-only CDS switches to read from upstream in a gap then the
cached data is deleted. When the CDS reaches the end of the gap, it
tries to open the next source. As there is no cached data, it tries to
continue with the already opened upstream data source but as it reached
end of the gap range, the code starts looping.
Also fixes infinite lock which occurs when in the previous case CDS isn't
readonly. It locks the content while filling the gap in the cache. At the
end of the gap, as the following data is deleted it tries to lock the
content for writing but the content is already locked by itself.
The last fix is preventing removal of CachedContent entry from
CachedContentIndex while associated key is locked.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182595426
- Get handling of "stale" and "out of sync" manifests so
they're right next to each other (to be merged)
- Move startLoadingManifest to be next to the methods that
schedule it, and actually start loading stuff.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182530683
For live streaming, there are several types of DASH `emsg' events that directly
target the player. These events can signal whether the manifest is expired, or
the live streaming has ended, and should be handle directly within the player.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182034591
This allows listeners to get notified of any change to the embedded tracks.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181969023
This lets apps fail-fast when they try to reuse media source instances.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180934445
DASH manifests can now contain non-null but incomplete
DRM init data. Hence using the manifest init data when
non-null is not always the correct thing to do. This
change merges the sample and manifest formats (which
correctly merges the DRM init data) and then uses the
result.
Issue: #3630
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180787784
- Parse multiple kids from default_KID. It's specified as a whitespace
separated list of UUIDs rather than a single UUID.
- Opportunistically proceed with playback in cases where the manifest
only defines a single SchemeData with the common PSSH UUID. In such
cases the manifest isn't saying anything about which specific DRM
schemes it supports.
Issue: #3630
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180675056
This is in preparation for supporting non-extractor MediaSources for ads in
AdsMediaSource.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178377627
In some occasions, we may want to discard a part of the buffered media to
improve playback quality. This CL adds this functionality by allowing the
loading media period to re-evaluate its buffer periodically (every 2s) and discard
chunks as it needs.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177958910
Parse DASH manifest's publishTime node as defined by ISO/IEC 23009-1:2014,
section 5.3.1.2.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176525922
Currently EventMessage's presentationTimeMs is kept separately in
EventSampleStream. However, EventMessage's presentationTimeMs maybe used in
other places besides EventSampleStream, such as when handling `emsg' messages
targeting the player. This CL let EventMessage object to holds its
presentationTimeMs for such use cases.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176502938
Currently for a DASH ChunkSource that consists of multiple sub-streams, we
always use a CompositeSequenceableLoader, which only allows the furthest behind
loader or any loader that are behind current playback position to continue
loading.
This changes allow clients to have more flexibility when deciding the loading
strategy:
- They can construct a different kind of composite SequenceableLoader from
the sub-loaders, and use it by injecting a different CompositeSequeableLoaderFactory accordingly.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176363870
Add Builder pattern to SsMediaSource and mark existing constructors as
deprecated.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175659618
This is a step toward retaining a back-buffer in a way that
works for all MediaSource implementations. It's not possible
to adjust the discardBuffer calls in ExoPlayerImplInternal
to discard up to (position - backBufferDurationUs). Next steps
are to:
1. Find an appropriate place to specify the back buffer value,
to be passed to the discardBuffer calls. I guess the
LoadControl is the appropriate place to define such values.
2. Enhance discardBuffer to support a toKeyframe argument to
pass through to discardTo.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175565363
Start with DASH MediaSource. The number of injected arguments is getting
out-of-control.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175529031
MPD file may include multiple EventStreams in its Periods, which contains Events
that the application may need to handle/respond to.
This change adds support for parsing the EventStream/Event nodes from MPD
file, and exposing these EventStreams as a metadata sample stream that application
can respond in a similar way to other metadata events.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175017697