169 Commits

Author SHA1 Message Date
tonihei
2a765f6b5a Visibility clean-up: Don't extend visibility of protected methods in overrides.
PiperOrigin-RevId: 255412493
2019-07-02 17:46:30 +01:00
Oliver Woodman
ae969397bb Merge pull request #6055 from xirac:dev-v2
PiperOrigin-RevId: 254182080
2019-06-21 18:22:42 +01:00
Yannick RUI
b29731d501 Parse text track subtype into Format.roleflags. 2019-06-18 11:27:37 +02:00
olly
3afdd7ac5a Put @Nullable annotation in the right place
PiperOrigin-RevId: 249828748
2019-05-30 15:10:55 +01:00
tonihei
33c677846a Use versioned manifest in all Robolectric tests.
We are currently defaulting to targetSdk=1 as no targetSdk is specified. Only
tests which explicitly ask for another SDK use another test SDK. With the
versioned manifest, all tests run using the targetSDK by default.

PiperOrigin-RevId: 249060796
2019-05-21 13:51:43 +01:00
eguven
4ca670bed3 Use MediaSourceFactory interface to simplify DownloadHelper
PiperOrigin-RevId: 248367983
2019-05-15 20:13:59 +01:00
aquilescanta
cf389268b0 Add links to the developer guide in some READMEs
PiperOrigin-RevId: 248221982
2019-05-15 18:14:07 +01:00
olly
82061e9afb Improve progress reporting logic
- Listener based reporting of progress allows the content length
  to be persisted into the download index (and notified via a
  download state change) as soon as it's available.
- Moved contentLength back into Download proper. It should only
  ever change once, so I'm not sure it belongs in the mutable part
  of Download.
- Made a DownloadProgress class, for naming sanity.

PiperOrigin-RevId: 244242487
2019-04-18 23:24:11 +01:00
eguven
f9f009645d Add missing DownloadService build*Intent and startWith* methods
PiperOrigin-RevId: 244196081
2019-04-18 23:22:35 +01:00
olly
af5131e393 Rename Shadow*Looper classes (PR#4868)
ShadowLooper -> ShadowLegacyLooper
ShadowRealisticLooper -> ShadowPausedLooper
ShadowBaseLooper -> ShadowLooper

And all public methods from ShadowLegacyLooper get pushed up to ShadowLooper

Pull Request: https://github.com/robolectric/robolectric/pull/4868

Copybara: OK

Also adjust Google3 tests  using custom looper shadows where necessary.
Convert exoplayer to paused looper to eliminate reliance on custom shadows

PiperOrigin-RevId: 243839311
2019-04-18 15:13:07 +01:00
eguven
5856e75781 Rename DownloadAction to DownloadRequest
PiperOrigin-RevId: 243806888
2019-04-16 16:41:29 +01:00
eguven
c2c7c43a36 Remove redundant proguard files
PiperOrigin-RevId: 243781000
2019-04-16 15:28:39 +01:00
tonihei
1ee51518ae Use new exoplayer.dev domain everywhere.
The old domain automatically forwards to the new one. For consistency, change
all doc and code references regardless.

Also adds GitHub CNAME config file which configures our page for the custom
domain.

PiperOrigin-RevId: 243592110
2019-04-16 15:25:27 +01:00
aquilescanta
1bf1790edc Extract factory method for FragmentedMp4Extractor in DefaultHlsExtractorFactory
PiperOrigin-RevId: 243582468
2019-04-16 15:24:48 +01:00
tonihei
c1e25f7768 Add check for retryDelayMs==C.TIME_UNSET in DASH and SS manifest onLoadError.
If the returned retry delay is unset, we should use a DONT_RETRY_FATAL action
instead and dispatch the event with the "canceled" flag.

PiperOrigin-RevId: 243251554
2019-04-13 01:42:42 +01:00
tonihei
c830c8dc63 Use LoadErrorHandlingPolicy.getRetryDelayMsFor for DASH/SS manifest loads.
Both manifest loads currently use the default retry delay although a
LoadErrorHandlingPolicy is provided to the MediaSource.

PiperOrigin-RevId: 242852672
2019-04-13 01:39:05 +01:00
olly
d3b63a97ad Remove DownloadAction serialization
Implement Parcelable instead, which is a more intented way of
passing structured data via Intents.

PiperOrigin-RevId: 242646441
2019-04-13 01:36:46 +01:00
olly
47601980d9 Use DownloadAction.id properly
- Fix ID being dropped when DownloadAction is serialized and
  de-serialized as it's passed to DownloadService
- Properly set DownloadAction.id when building an action from
  a DownloadState
- Make ID a required constructor argument. Else it's too easy
  to not propagate it by accident.

PiperOrigin-RevId: 242457831
2019-04-13 01:34:07 +01:00
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