151 Commits

Author SHA1 Message Date
olly
77d597de5f Parse CHARACTERISTICS attribute for EXT-X-MEDIA tags
PiperOrigin-RevId: 239844963
2019-03-22 19:57:01 +00:00
Oliver Woodman
a86a9137be Merge pull request #5578 from szaboa:dev-v2-5529
PiperOrigin-RevId: 239398940
2019-03-20 23:28:28 +00:00
tonihei
8e80acd18f Use androidx.test and extensions.
This replaces the deprecated usages of RobolectricTestRunner and
RuntimeEnvironent and fully migrates the tests to androidx.

PiperOrigin-RevId: 238011667
2019-03-15 04:53:12 +00:00
Arnold Szabo
d7c2519a5d Fixes according to the code review 2019-03-07 00:09:11 +02:00
Arnold Szabo
854419962a Merge role and accessibility fields into RoleFlags 2019-03-05 23:38:49 +02:00
Arnold Szabo
58d746ecaa Add IntDef for role and accessibility descriptor's value, parse these also for video / audio tracks 2019-03-03 20:26:31 +02:00
olly
0622afe170 Migrate to androidx
Issue: #5489
PiperOrigin-RevId: 234507428

Add missing annotation dependency

Issue: #5489
PiperOrigin-RevId: 234566177
2019-02-19 13:22:54 +00:00
tonihei
edabbd52d0 Update Robolectric and Truth.
PiperOrigin-RevId: 233612344
2019-02-18 15:59:32 +00:00
olly
8401097ead Upgrade gradle plugin and friends
PiperOrigin-RevId: 233390513
2019-02-18 15:57:55 +00:00
tonihei
71d77d7fa0 Remove DownloadHelper subclasses and use static methods instead.
The subclasses only call specific constructor combinations and can easily
replaced by static methods.

PiperOrigin-RevId: 231385606
2019-01-29 16:45:10 +00:00
tonihei
0a8ae74217 Update DownloadHelper to use MediaSource and MediaPeriod directly.
This requires to prepare the media source and the periods in a small helper similar
to the metadata retriever. It also gets rid of the need to have abstract protected
methods to load the manifest, to extract the track groups and to convert to stream keys,
as this can now be handled by the media period.

PiperOrigin-RevId: 231385590
2019-01-29 16:44:56 +00:00
tonihei
9779f2c358 Add DashMediaPeriod getStreamKeys implementation and test.
PiperOrigin-RevId: 231385518
2019-01-29 16:44:25 +00:00
tonihei
92bf8e918c Change getStreamKeys to take a list of TrackSelections.
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
2019-01-29 16:44:15 +00:00
tonihei
22413b8037 Add start position to MediaSource.createPeriod.
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
2019-01-17 17:26:24 +00:00
olly
9ab08bbe5d Fix DRM protected SmoothStreaming with subtitles
Issue: #5378
PiperOrigin-RevId: 229261658
2019-01-14 23:58:45 +00:00
tonihei
e8a7cb2546 Remove player and isTopLevelSource parameters from MediaSource.prepare.
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
2019-01-08 07:38:00 +00:00
tonihei
ee14b1fa40 Add test for SsMediaPeriod.getStreamKeys
PiperOrigin-RevId: 225811310
2018-12-18 19:45:29 +00:00
tonihei
173ddd6ee7 Add simplified adaptive media source stream key filter to factory classes.
This change only simplifies the API by using the ManifestParser internally.

PiperOrigin-RevId: 225516193
2018-12-14 15:42:36 +00:00
tonihei
9ed2a393b0 Add FilterableMediaPeriod interface and SmoothStreaming implementation.
This interface allows to put the mapping from tracks to StreamKeys in the same place
where we map manifest to tracks.

PiperOrigin-RevId: 225377033
2018-12-14 15:41:57 +00:00
tonihei
c03b7e32e2 Remove TrackKey and its remaining usages.
This is no longer needed as the public API uses TrackSelection as the way to specify
selected tracks.

PiperOrigin-RevId: 225158867
2018-12-14 15:40:36 +00:00
tonihei
8d137c2e61 Fix manifest uri in SsDownloadHelper.
This is the same as in SsMediaSource.

PiperOrigin-RevId: 225001911
2018-12-14 15:39:33 +00:00
tonihei
6a6b211233 Update DownloadHelper constructors and their usage in the demo app.
PiperOrigin-RevId: 224797598
2018-12-10 18:17:52 +00:00
Oliver Woodman
556dd7e9e0 Merge pull request #5187 from BrainCrumbz:feat/get-tag
PiperOrigin-RevId: 224166374
2018-12-05 17:49:07 +00:00
olly
22a8aa311b Clean up requesting non-media segments in downloader implementations
- Enable GZIP for media playlist + encryption key chunk requests in
  HLS, as we do during playback
- Pass around DataSpecs rather than Uris. This will be needed for if
  we add manifest cacheKey support (which seems like a good idea for
  completeness, if nothing else)

PiperOrigin-RevId: 224057139
2018-12-05 17:48:45 +00:00
tonihei
8a566fb330 Converge DownloadHelper implementations.
Moving most of the logic to the base DownloaderHelper helps to implement track
selection for downloading in a single place instead of multiple places.

PiperOrigin-RevId: 223964869
2018-12-05 17:48:18 +00:00
GiuseppePiscopo
b278b02816 chore(MediaSource): move getTag after removeEventListener 2018-12-03 18:21:37 +01:00
GiuseppePiscopo
8a359bb1fb feat(MediaSource): client code can get the tag of a MediaSource 2018-12-03 15:17:36 +01:00
tonihei
ea483f8c8e Fix some potential Uri nullness violations.
PiperOrigin-RevId: 223476569
2018-11-30 16:13:42 +00:00
olly
e317305909 Remove custom data from remove actions
A remove action will eventually just be the unique ID of the download
that should be removed. This is a step toward that goal.

PiperOrigin-RevId: 222832456
2018-11-27 15:45:38 +00:00
olly
3e150b54f4 Assume text tracks in protected SmoothStreaming are not protected
Issue: #4838
PiperOrigin-RevId: 222805051
2018-11-26 16:40:21 +00:00
Oliver Woodman
56e4860cb0 Remove stray proguard files 2018-11-23 12:28:23 +00:00
olly
dd2cba04dd Offline refactor step 1b - Consolidate tests
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222529260
2018-11-22 13:40:38 +00:00
olly
6ebb6124bb Offline refactor step 1a - Make DownloadAction concrete
1. Pull up all subclasses of DownloadAction into DownloadAction
2. Add DownloaderFactory for Downloader instantiation, and DefaultDownloaderFactory
   to replace the instantiation logic being removed from the DownloadAction
   subclasses.

This change will upgrade existing action files gracefully (i.e. it does not
lose compatibility with the existing offline implementation, other than some
minor breaking changes to the API).

TODOs:

1. Move test methods from the XDownloadActionTest classes into DownloadActionTest.
   This will be done in a subsequent CL. There's a lot of consolidation that can
   be done here, including de-duplicating some of the test code added in this CL.
2. Look at merging DownloaderConstructorHelper into DefaultDownloaderFactory.
3. Use customCacheKey in DASH/HLS/SS Downloaders, for completeness.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222258983
2018-11-22 12:39:37 +00:00
eguven
86fdcb08d8 Fix documentation confusion in MediaChunkIterator subclasses
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217505571
2018-10-18 23:39:51 +01:00
olly
b09e36dcb7 SmoothStreaming: Test for fourCC equal to DFXP
Issue: #4824

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213285790
2018-09-17 17:58:03 +01:00
olly
a5a7e988e3 Clip DASH periods to their durations
Issue: #4185

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212619419
2018-09-12 15:30:47 +01:00
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
924a76d532 Clean up use of deprecated APIs
- 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
2018-08-24 16:12:44 +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
olly
9f0303b079 Fix a bunch of misc analysis warnings
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209758330
2018-08-24 15:48:58 +01:00
tonihei
56aecf6614 Make HLS and SS chunk iterators private.
They don't need to be accessed publicly and are can be moved into the
respective chunk sources. This is the same structure used for Dash.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209507217
2018-08-24 15:33:41 +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
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
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
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
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