432 Commits

Author SHA1 Message Date
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
aquilescanta
a174af0d70 Remove deprecated HLS-related constructors
PiperOrigin-RevId: 234586744
2019-02-19 15:56:17 +00: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
aquilescanta
0ceff589b3 HLS Bugfix: Avoid loading initialization segment when reusing extractor
This bug affects any playlist that uses initialization segments. In practice,
almost exclusively fragmented mp4 segmented playlists are affected.

The bottom line is that extractors are chosen for reuse after the
initialization segment connection is open. However, reused extractors
do not need re-parsing the init segment, so loading the initialization is
wasteful.

PiperOrigin-RevId: 234479467
2019-02-18 17:40:48 +00:00
aquilescanta
8982da4b75 Support encrypted initialization segment
Defined in RFC 8216 Section 4.3.2.5.

Issue:#5441
PiperOrigin-RevId: 234114119
2019-02-18 17:40:48 +00:00
aquilescanta
12ed18c74c Add encryption information to initialization segments
PiperOrigin-RevId: 233953493
2019-02-18 17:40:48 +00:00
aquilescanta
04e6061498 Reduce the number of parameters required to create an HlsMediaChunk
PiperOrigin-RevId: 233765839
2019-02-18 17:40:48 +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
aquilescanta
36da5fb511 Group audio renditions by name
Allows the player to adapt between audio renditions with different
names.

PiperOrigin-RevId: 233052105
2019-02-18 15:56:59 +00:00
aquilescanta
fc2a99a688 Generalize selectedVariantIndices in preparation for non-main adaptation
After this change, multiple HlsSampleStreamWrappers may contain an apdaptive
track group.

PiperOrigin-RevId: 232507292
2019-02-06 15:45:54 +00:00
tonihei
ef8335fc50 Ensure normalized language code is used everywhere and update documentation.
Issue:#2867
PiperOrigin-RevId: 231385677
2019-01-29 16:45:32 +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
32b40502fc Add HlsMediaPeriod getStreamKeys implementation and tests.
PiperOrigin-RevId: 231385563
2019-01-29 16:44:46 +00:00
tonihei
6a52cd7445 Ensure HlsMediaPeriod works with playlists without variants.
Currently, we remove all variants if none of the stream keys contains any
variants. This causes HlsMediaPeriod to throw exceptions as it expects at least
one variant.

Change it to support master playlists without variants.

PiperOrigin-RevId: 231385547
2019-01-29 16:44:36 +00:00
aquilescanta
6dde1e67d3 Parse CHANNELS attribute from EXT-X-MEDIA
PiperOrigin-RevId: 230743198
2019-01-29 16:42:18 +00:00
aquilescanta
9d19a7a4b6 Move parseSelectionFlags with the rest of the parse{attribute} methods
PiperOrigin-RevId: 230734189
2019-01-29 16:42:07 +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
aquilescanta
be69d5b747 Expand check for muxed audio media tags to include uris that match variants
Issue:#5313
PiperOrigin-RevId: 228155222
2019-01-08 07:38:21 +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
ybai001
ae40208d92 Add AC-4 format support
* Add AC-4 MIME type definition
 * Add AC-4 format support in Mp4Extractor and TsExtractor
 * Add AC-4 Extractor
 * Add AC-4 playback support in MPEG-4, MPEG-DASH, TS and HLS
2018-12-26 16:53:37 +08: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
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
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
olly
1ce33362c9 Strip private ID3 data from HLS sample formats
Issue: #5063
PiperOrigin-RevId: 222975020
2018-11-27 15:45:58 +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
d6b6600a28 Fix unnecessary media playlist requests when playing live streams
Issue: #5059
PiperOrigin-RevId: 222803511
2018-11-26 16:40:14 +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
dd47bfffb0 Fix HLS ID3 sniffing
The input.getLength() check is invalid because the length may be
unknown (i.e. if the server doesn't include a Content-Length
response header when serving chunks).

Issue: #5063 (tangentially related only)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222406347
2018-11-22 12:51:35 +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
aquilescanta
34797651c2 Add support for .cmf* extension in DefaultHlsExtractorFactory
This makes extractor selection a bit more efficient for some CMAF files.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219795105
2018-11-02 16:02:02 +00:00
Oliver Woodman
2dfe7a7ad6 Misc fixes / stylistic consistency changes for merged pull requests 2018-10-31 20:37:59 +00:00
ojw28
0501b677ad
Merge pull request #4911 from Comcast/feature/hls-audio-text-id-uniqueness
Create unique id for HLS audio and text tracks
2018-10-31 19:17:14 +00:00
andrewlewis
bb5a9ef8ad Remove extra blank line
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217907544
2018-10-24 18:22:31 +01: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
Brandon Davis
35cc479f76 Create unique id for hls audio and text tracks
Combine groupId and name for uniqueness
2018-10-04 11:44:59 -06:00
tonihei
5c8dabade6 Add @Documented to @IntDef and @StringDef annotations.
This makes the annotations appear in the generated JavaDoc.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214952419
2018-10-01 19:22:34 +01:00
aquilescanta
e50214a5a1 Add constructor for adding payload reader factory flags
Issue:#4861

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214772527
2018-09-27 17:48:10 +01:00
aquilescanta
db33b3bbd1 Allow HlsSampleStreamWrapper to cancel partial media chunk loads
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213439145
2018-09-20 12:16:47 +01:00
aquilescanta
a89645d092 For HLS segment sniffing, fall back on extractor creation by file extension
This reduces the possiblity of regressions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213436912
2018-09-20 12:13:50 +01:00