All known instances use DataSource as generic type and thus code can be simplified
by removing the generic type altogether.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205798542
As the manifest and media data sources can be the same now, we can provide
a simplified constructor with just one data source factory.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205658046
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
Until now, the streams were released and re-enabled for each type of stream
(primary, event, embedded) in that order. That leads to problems when replacing
streams from one type to another (for example embedded to primary).
This change restructures the track selection to:
1. Release and reset all streams that need to be released or replaced.
1(a). Including embedded orphan streams.
2. Select new streams.
Issue:#4477
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203751233
This wires up recent changes of passing a transfer listener to the MediaSource and
allowing DataSources to accept new listeners.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203280818
This allows to use this queue in the track selection in the future.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202954871
This will allow to provide available information about future chunks to the
track selection.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202940994
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 url is readily available when creating media source events (from the
data source) but so far not published to external listeners. This change
adds a new field to LoadEventInfo which corresponds to DataSource.getUri().
Issue:#2054
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202459049
Also moved shared code to SegmentDownloadAction between its subclasses.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202294880
Both values are helpful for event reporting, but are only available while
the data source is open. Similar to bytesLoaded, they need to be reported
through the Chunk.
Issue:#2054
Issue:#4361
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201664907
The helper method only reported DATA_TYPE_UNKNOWN even if the actual type
is known.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200067296
Using new Handler(this) in a constructor potentially leaks an uninitialized
object. This is mostly not a problem because we don't use the Handler within
the constructor. Added a Util method to keep the warning suppression local.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199605377
If a MediaPeriod uses a Loadable, then there are typically
reference chains of the form:
LoadingThread[GCroot]->Loadable->MediaPeriod->Player
Where the player is the MediaPeriod callback. When the
player is released, this reference chain prevents the
player from being GC'd until Loadable cancellation
completes, which may not always be fast. This in turn
will typically prevent the application's activity from
being GC'd, since it'll normally be registered as a
listener on the player (directly or indirectly via
something like a view).
This change mitigates the issue by removing references
that the MediaPeriod holds back to the player. The
MediaPeriod will still not be eligible for GC, but the
player and application activity will be, which in most
cases will be most of the leak (in terms of size).
Issue: #4249
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199143646
The lint error suppression only works locally and not for external developers
who still see the lint error and need to suppress it themselves.
This changes 'implementation' to 'compileOnly' in gradle to prevent the
dependency from being exported. Also removes the local lint suppression.
Issue:#4234
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196251407
This is useful to get hold of the manifest to then obtain DRM init data in
the download flow for protected content (without having to download the
manifest again).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196168938
This type of flicker was visible (at least on my S8) whenever starting
the demo app process (from being properly killed) when other notifications
(e.g. completed download notification) was present.
This change passes whether the service was started as foreground through
the intent, and only applies the show-notification-on-stop hack if it
was. It's only necessary to start as foreground if your app is not already
in the foreground, so it's not necessary to do this from activity/ui
components.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195594930
Also convert them to exposing periods and track groups, like
regular MediaSources do. This gets us much closer to being
able to use standard track selection components during offline
initialization. The helper is responsible for reverse mapping
selected tracks onto physical streams when generating the
download action. This is trivial except for the HLS case, which
is a TODO for now.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195500826
This may be preferable for using custom binary data,
and it's still easy to store Strings if needed.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195486817