265 Commits

Author SHA1 Message Date
tonihei
6b9e1824ad Extend updateSelectedTrack method with additional information.
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
2018-09-03 14:04:45 +01:00
olly
38f2f352f9 Move playback tests off deprecated APIs
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210077548
2018-08-24 16:05:40 +01:00
tonihei
74e2384fb6 Add response headers to LoadEventInfo.
The response headers of the last load are available from the loading source
when creating media source events and can be easily forwarded.

Issue:#4361
Issue:#4615

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209900693
2018-08-24 15:55:01 +01:00
tonihei
d51b98dd1f Replace period index with uid in MediaPeriodId.
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
2018-08-24 15:32:11 +01:00
olly
bd8a956d53 Use lamdas everywhere
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209162373
2018-08-24 15:19:30 +01:00
andrewlewis
1c09af02f7 Fix handling of text codecs strings in DashManifestParser
Also fix an NPE in FfmpegAudioRenderer if sampleMimeType wasn't set.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208230947
2018-08-13 14:06:57 +01:00
olly
bac597cb07 Update dependencies + misc fixes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208195761
2018-08-13 14:02:51 +01:00
aquilescanta
d5c7bff643 Use LoadErrorHandlingPolicy in SsMediaSource and DashMediaSource
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208020030
2018-08-13 13:49:45 +01:00
olly
7fcd6b6d65 Minimal fix for non-default cenc name prefixes in DASH manifests
For now, just allow any prefix (and don't check the namespace).
Checking the namespace requires turning on the XmlPullParser
namespace awareness feature, but this can only be done before
parsing, and I think requires us to specify the namespace when
querying other attributes. This would also risk breaking services
who currently don't set namespaces correctly.

It's possible we'll run into similar issues with the few other
tags (e.g. mspr:pro). We should revisit enabling namespace
awareness if/when we see this.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207526883
2018-08-06 13:25:33 +01:00
olly
454b106921 Fix freezing playing multi-period DASH with EventStreams
EventSampleStream.readData required eventStreamUpdatable to be
false for END_OF_STREAM to be returned, but it was only being
set to false when the manifest became static. This change also
sets it to false if the period is not the last one in a dynamic
manifest. It also renames it the parameter to appendable, since
that's what it really represents. Events may still be removed
from the start of the EventStream as the period starts moving
out of the live window.

Issue: #4492

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207517265
2018-08-06 11:38:33 +01:00
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