328 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
olly
b47f37fbcd Add HlsTrackMetadataEntry.toString
It's printed out by EventLogger, and currently looks pretty ugly

PiperOrigin-RevId: 250772010
2019-06-03 19:15:23 +01:00
eguven
00b26a51df Modify DashDownloaderTest to test if content length is stored
PiperOrigin-RevId: 250655481
2019-05-30 15:26:32 +01:00
olly
94d668567c Migrate org.mockito.Matchers#any* to org.mockito.ArgumentMatchers
The former is deprecated and replaced by the latter in Mockito 2. However, there is a
functional difference: ArgumentMatchers will reject `null` and check the type
if the matcher specified a type (e.g. `any(Class)` or `anyInt()`). `any()` will
remain to accept anything.

PiperOrigin-RevId: 250458607
2019-05-30 15:25:28 +01:00
aquilescanta
04f3888550 Add allowOnlyClearBuffers to SampleQueue#read
Removes the need for duplicate calls to SampleQueue#read when
implementing DecryptionResources acquisition in the MediaSources.

PiperOrigin-RevId: 250298175
2019-05-30 15:25:28 +01:00
olly
3afdd7ac5a Put @Nullable annotation in the right place
PiperOrigin-RevId: 249828748
2019-05-30 15:10:55 +01:00
olly
11c0c6d266 Reset upstream format when empty track selection happens
PiperOrigin-RevId: 249819080
2019-05-30 15:10:40 +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
tonihei
34dd4b1441 Fix NPE in HLS deriveAudioFormat.
Issue:#5868
PiperOrigin-RevId: 247613811
2019-05-15 18:10:07 +01:00
olly
f8cd770d84 Migrate from is(Not)SameAs to is(Not)SameInstanceAs.
They behave identically, and the old names are being removed.

Open-source note: The new methods are available in Truth as of version 0.44.

END_PUBLIC

More information:
  go/issameas-lsc

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:246024032:BASE:246042619:1556672975894:513e7746
PiperOrigin-RevId: 246101315
2019-05-02 13:04:11 +01:00
aquilescanta
f64011ae04 Prevent index out of bounds exceptions in some live HLS scenarios
Can happen if the load position falls behind in every playlist and
when we try to load the next segment, the adaptive selection logic
decides to change variant.

Issue:#5816
PiperOrigin-RevId: 245923006
2019-04-30 22:07:28 +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
aquilescanta
f6de1aa242 Add test for HlsTrackMetadataEntry population in the HlsPlaylistParser
PiperOrigin-RevId: 244168713
2019-04-18 15:17:33 +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
aquilescanta
9ddd39c1c0 Add the HlsMetadataEntry from the Master playlist to the Hls tracks
PiperOrigin-RevId: 243624081
2019-04-16 15:26:44 +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
aquilescanta
97acc681d1 Add HlsMetadataEntries to HlsMasterPlaylist's variants and renditions
PiperOrigin-RevId: 243304549
2019-04-13 01:43:21 +01:00
aquilescanta
936bc244b6 Add an HLS metadata entry sublcass to populate HLS track formats
Include information to facilitate adaptive track selection in HLS.

PiperOrigin-RevId: 243238232
2019-04-13 01:41:23 +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
aquilescanta
73acdcf1e2 Add a flag to enable the preemptive 608 track in HLS
By passing false, users can disable the preemptive 608 track.

Issue:#5736
PiperOrigin-RevId: 242476274
2019-04-13 01:35:47 +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
5db33deef4 HLS: Fix playlist tracker bundle lookup
As of 99f89132c2 an identity check isn't sufficient for the lookup.

PiperOrigin-RevId: 240989848
2019-03-29 16:51:57 +00:00
olly
99f89132c2 Remove HlsUrl and introduce HlsMasterPlaylist.mediaPlaylistUrls
- This removes the need for Variant and Rendition to have a common
  base class, allowing the url field to be marked as @Nullable in
  Rendition but not in Variant.
- The addition of mediaPlaylistUrls is needed for the new StreamKey
  indexing for HLS. It's also convenient in a couple of places (e.g.
  HlsDownloader), where a list of all media playlist URLs is needed.
- Lots of places where HlsUrl was passed only needed the actual
  URL (not the Format, which is the other piece of HlsUrl). Passing
  just the URL is a little simpler, and resolves some of the naming
  confusion.

Issue: #5596
Issue: #2600
PiperOrigin-RevId: 240970466
2019-03-29 16:51:42 +00:00
olly
2623b4b382 Pre-resolve HlsUrl urls
This is to make it possible to use equality of HlsUrl.url fields
to determine whether two HlsUrls point at the same media playlist.
This doesn't work currently because it's possible to mix absolute
and relative urls, which will not be equal until after the relative
url is resolved against the playlist baseUrl.

Issue: #5596
Issue: #2600
PiperOrigin-RevId: 240966503
2019-03-29 16:51:27 +00:00
olly
0810fe9159 Remove "variant" terminology from HlsChunkSource
HlsChunkSource may also be downloading segments from demuxed
renditions, which are not variants.

PiperOrigin-RevId: 240625139
2019-03-29 16:49:41 +00:00
olly
65bab95f72 Add video and closed caption renditions to HlsMasterPlaylist
Still skipping any renditions that have a null URL, which means that
closedCaptions in particular is always empty. This restriction will
be removed in a subsequent change, which will also remove muxedAudioFormat
and muxedAudioCaptions from HlsMasterPlaylist and instead derive them
from the Variant and Rendition information in HlsMediaPeriod.

Issue: #5596
Issue: #2600
PiperOrigin-RevId: 240623500
2019-03-29 16:49:26 +00:00
olly
e3a8429ee2 More faithfully parse content of HLS master playlists
- Split HlsUrl into Rendition and Variant
- Add Rendition/Variant specific information to the new types

Issue: #5596
PiperOrigin-RevId: 240419763
2019-03-29 16:48:09 +00:00
olly
30d66f5031 Rollback of be69d5b747
Issue: #5596

This arguably made a worse problem than it solved, and also I think subtly broken HLS
downloads by changing which renditions HlsMasterPlaylist.copy would retain in some
cases. Reverting as a mini step toward removing smart logic from the HLS playlist parser.

*** Original commit ***

Expand check for muxed audio media tags to include uris that match variants

Issue:#5313

***

PiperOrigin-RevId: 240348969
2019-03-26 15:37:24 +00:00
olly
07e3509dd9 Support providing all keys via EXT-X-SESSION-KEY tags
PiperOrigin-RevId: 240333415
2019-03-26 13:18:48 +00:00
olly
e4b49477ec Some nullability cleanup for HLS playlists
PiperOrigin-RevId: 240318686
2019-03-26 13:17:52 +00:00
Toni
5da4c67c8a Merge pull request #5303 from DolbyLaboratories:dev-v2-ac4
PiperOrigin-RevId: 239957730
2019-03-26 10:40:18 +00: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
aquilescanta
eea1ce3e0a Fix channel count propagation on HLS traditional preparation
PiperOrigin-RevId: 235189983
2019-03-06 16:54:08 +00:00
aquilescanta
6682580ad7 Extract HlsMediaChunk#feedDataToExtractor method
Deduplicates the call to Extractor#read and sorrounding logic.

PiperOrigin-RevId: 235165499
2019-03-06 16:53:15 +00: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
Arnold Szabo
06ed877845 Pass role and accessibility descriptor values from adaptation set to format 2019-02-27 23:53:52 +02:00
aquilescanta
6b4c48a329 Replace initLoadCompleted with initDataLoadRequired
PiperOrigin-RevId: 234966936
2019-02-21 11:56:10 +00:00
aquilescanta
e502672b89 Encapsulate the key cache in HlsChunkSource
PiperOrigin-RevId: 234773649
2019-02-20 13:57:01 +00:00
aquilescanta
16f41dbaab Fix HlsSampleStream#read non-fatal lack of mapping
HlsSampleStream#read should return end of stream when
there is no mapping for the sample stream, instead of
nothing read. This allows the player to transition to
ended.

Issue:#5524
PiperOrigin-RevId: 234764027
2019-02-20 13:56:26 +00:00
aquilescanta
28434cff4c Support customization of the PlaylistStuckException waiting period
Issue:#5487
PiperOrigin-RevId: 234586819
2019-02-19 15:56:35 +00:00