205 Commits

Author SHA1 Message Date
tonihei
ffdc17d0e0 Remove generic type parameter from TransferListener.
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
2018-07-24 14:56:45 +01:00
tonihei
5933d92394 Add simplified Dash and Ss media source factory constructors.
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
2018-07-23 15:55:57 +01:00
tonihei
a67c73650e Add helper method to get uid of timeline period.
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
2018-07-23 12:22:57 +01:00
tonihei
97e66ef11b Update period index in DashMediaPeriod event dispatcher after manifest update.
Issue:#4492

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205636634
2018-07-23 12:21:44 +01:00
Oliver Woodman
41345dcb83 Simplify DASH live presentation delay override 2018-07-23 10:39:02 +01:00
ojw28
58fcf52b17
Merge pull request #4534 from Chimerapps/dev-v2
Allow specifying the default live presentation delay
2018-07-23 10:37:45 +01:00
olly
d2eb3fbefa Cleanup: Remove unnecessary generic types
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205409290
2018-07-23 10:25:23 +01:00
Nicola Verbeeck
cf99963aab Typo in docs 2018-07-19 11:53:42 +02:00
Nicola Verbeeck
26a7516b55 Updated formatting 2018-07-19 11:22:03 +02:00
Nicola Verbeeck
fbc0db965a Updated formatting
Added constructor and field in source itself
2018-07-19 11:20:18 +02:00
Nicola Verbeeck
e6d32d3fb5 Updated formatting 2018-07-19 11:04:28 +02:00
Nicola Verbeeck
fbef465ca8 Allow specifying the default live presentation delay instead of using hardcoded constant 2018-07-19 10:58:58 +02:00
eguven
7b2da629ea Make it possible to disable DownloadService notifications
Issue: #4389

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204728270
2018-07-17 20:27:30 +01:00
olly
cba6da8906 No-op cleanup of DashTimeline
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204451894
2018-07-17 20:16:14 +01:00
Oliver Woodman
05a31dfd24 Format cleanup 2018-07-12 16:08:11 +01:00
ojw28
41636ada88
Merge pull request #4391 from kaltura/add-label
Add label attribute support for DASH audio/text
2018-07-12 16:05:19 +01:00
matttt
9914587894 Remove the static modifier from DefaultDashChunkSource::newMediaChunk and DefaultDashChunkSource::newInitializationChunk allowing for overrides.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204167521
2018-07-12 15:37:52 +01:00
tonihei
5c9fd1649a Fix wrong loop variable in DashMediaPeriod.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203766579
2018-07-10 13:59:19 +01:00
tonihei
74d8f89cb6 Restructure track selection in DashMediaPeriod.
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
2018-07-10 13:58:18 +01:00
tonihei
acbe52d0d7 Forward TransferListener from MediaSources to DataSources.
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
2018-07-06 14:35:17 +01:00
tonihei
abb4d6ff70 Use correct generics type bounds for TransferListener in MediaSources.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203260699
2018-07-06 14:32:46 +01:00
tonihei
97120bc6cb Add MediaChunkIterator for FakeAdaptiveDataSet.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203102464
2018-07-06 14:25:38 +01:00
tonihei
c8af6d176f Forward queue of media chunks to getNextChunk.
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
2018-07-03 11:57:26 +01:00
tonihei
8ca9a32d8e Add MediaChunkIterator interface and DASH implementation.
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
2018-07-03 11:54:58 +01:00
olly
c23910ad3a Exclude text streams from duration calculations
Issue: #4029

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202912333
2018-07-03 11:51:32 +01:00
tonihei
98afaa60d0 Forward TransferListener to media sources.
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
2018-07-03 11:47:15 +01:00
tonihei
dd14500eba Add url (after redirection) to LoadEventInfo.
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
2018-06-28 16:18:50 +01:00
aquilescanta
fc2168eb61 Add an errorCount argument to onLoadError
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202313695
2018-06-28 16:18:50 +01:00
eguven
93cbae5bff Use default Deserializers if non given to DownloadManager
Also moved shared code to SegmentDownloadAction between its subclasses.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202294880
2018-06-28 16:18:50 +01:00
tonihei
f2ce0d8981 Make RepresentationHolder immutable.
This allows to use it as a snapshot of the representation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202287466
2018-06-28 16:18:50 +01:00
aquilescanta
a1f89bec0d Allow configuration of the Loader retry delay
Issue:#3370

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201996109
2018-06-25 22:38:29 +01:00
aquilescanta
b031c3d6bb Parse ms:laurl from ContentProtection in DASH
Issue:#3393

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201694813
2018-06-22 17:46:45 +01:00
tonihei
fcc0bd403f Report uri and response headers of chunks.
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
2018-06-22 17:41:51 +01:00
Itay Kinnrot
cd9041c089 Parse the label of audio and text from stream and add it to Format type + add it to default ui + update from dev-v2 2018-06-19 11:32:04 +03:00
eguven
e4f9ff5d91 Add ability to update download requirements to DownloadService
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200689527
2018-06-18 11:18:20 +01:00
tonihei
877c6965c3 Correctly report type of ParsingLoadable.
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
2018-06-18 11:09:43 +01:00
olly
d6878f152c Offset SIDX timestamps by presentationTimeOffset
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199856613
2018-06-18 11:06:51 +01:00
eguven
a406dc8bee Use TrackKey in place of RepresentetionKey, StreamKey, RenditionKey
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199767518
2018-06-18 10:58:52 +01:00
tonihei
9f20683a6c Factor out Handler creation in construtor to prevent warning suppression.
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
2018-06-18 10:49:16 +01:00
olly
a5820b7535 Explicitly null MediaPeriod callbacks on release
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
2018-06-05 12:43:59 +01:00
tonihei
27f009d239 Enable Java 8 support.
This enables compiler support for Java 8 features.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198709705
2018-06-05 12:29:14 +01:00
tonihei
74df3766f9 Include checkerframework annotatons with compileOnly and remove lint exclusion
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
2018-05-12 18:56:12 +01:00
olly
d6d7c41065 Expose manifests/playlists from download helpers
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
2018-05-12 18:51:47 +01:00
olly
590edf5288 Fix checker-framework build issues
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195689456
2018-05-07 19:17:07 +01:00
olly
7afdf84a9d Fix DownloadService notification flicker
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
2018-05-07 07:25:02 +01:00
olly
b9aaf1ebab Improve offline support in the demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195593235
2018-05-07 07:22:53 +01:00
olly
051da40dc3 Misc cleanup
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195552434
2018-05-07 07:17:33 +01:00
olly
4e42c547ac Small cleanup
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195504064
2018-05-07 07:13:50 +01:00
olly
416d6c9eeb Move download helpers into core library
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
2018-05-07 07:12:46 +01:00
andrewlewis
4ee1daef0e Make download action custom data a byte[]
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
2018-05-07 07:10:46 +01:00