400 Commits

Author SHA1 Message Date
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
tonihei
e25b7d2148 Add wrapper for Log messages to allow settig the log level.
Currently there is no way to disable (or reduce) the logcat output generated
by ExoPlayer.

Issue:#4665

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213421072
2018-09-20 12:12:21 +01:00
aquilescanta
c9e4f6b429 Make HlsMediaSource.Factory take a factory of trackers instead of an instance
This allows creating multiple HLS media sources from a single Factory, as
required by the interface.

Issue:#4814

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213297850
2018-09-20 12:10:53 +01:00
olly
a083c29f7e Don't discard when a reset is pending
When a reset is pending the sample queues normally contain pre-seek
samples (which will be emptied when a pending load is canceled). The
position passed to discard will be a post-seek position. I don't
think anything bad happened in any of the cases being changed, but
discarding is unnecessary in such cases, and reasoning about such
cases is difficult.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212435556
2018-09-12 15:18:56 +01:00
olly
ba8c22aba5 Make seeking when there's a pending reset more obviously correct
If there's already a pending reset, we need only update the pending
reset position. We can currently end up calling cancelLoading more
than once on the loader for the same task, which is hard to reason
about (although I don't think anything actually broke in practice).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212432266
2018-09-12 15:14:02 +01:00
aquilescanta
b14e0935b1 Add container format sniffing in HLS
Issue:#2025

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211977802
2018-09-12 15:02:57 +01:00
aquilescanta
f47f1b9f4b Remove BOM check in Webvtt header checks
Reverts the BOM check changes in []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211826731
2018-09-12 14:54:06 +01:00
aquilescanta
7959a691ad Add sniffing to WebvttExtractor
Preparation for sniffing in HLS

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211455454
2018-09-05 12:31:06 +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
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
aquilescanta
24d04a26e4 Add support for variable substition in HLS
Issue:#4422

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209958623
2018-08-24 16:01:08 +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
4bf5e4991c Improve IntDef javadoc.
The doc can be improved by enumerating and linking all possible values from
the interface doc.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209772309
2018-08-24 15:53:30 +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
olly
9ccbb5bd6d Add some missing Nullable annotations
Also remove NonNull, since we assume NonNull by default. Except
where explicitly overriding a method with NonNull annotated args,
in which case we're still expected to use it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209758204
2018-08-24 15:47:31 +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
aquilescanta
f64ec43acd Remove usage of deprecated method from the Demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209390036
2018-08-24 15:22:40 +01:00
aquilescanta
4530944ed7 Rework HlsPlaylist attribute inheritance
The reason for the change is that variable substititution requires
master playlist variable definitions at the moment of parsing.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208997963
2018-08-17 11:14:42 +01:00
Oliver Woodman
32bd69d4b2 Cleanup recent merged pull requests 2018-08-16 17:02:08 +01:00
ojw28
d06b01c220
Merge pull request #4602 from gpinigin/webvtt-extractor-public
WebvttExtractor: make public to allow create custom HlsExtractorFactory outside of library
2018-08-16 16:45:36 +01:00
andrewlewis
9d14a3b31b Remove unneeded null check
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208208099
2018-08-13 14:05:37 +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
d399c00f9e Add support for multiple alternative EXT-X-KEY in HLS
Also add support for parsing PlayReady DRM information

Issue:#4180

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208094290
2018-08-13 14:00:34 +01:00
aquilescanta
c1998da44e Fix missing error handling durations in HLS
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208023954
2018-08-13 13:51:09 +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
f549cf5635 Fix Aes128DataSourceTest portability issue
For background on why doing this works, see below. I don't want to change
how we get our Cipher instance in non-test code, since PKCS7 always works
on Android. It's only when the tests are running on a non-Android host
machine that they can fail. An alternative would be to make it an androidTest,
but androidTests are slow.

------

Background:

"While Java considers PKCS5 and PKCS7 padding to be the "same" (and
one should always use the string "AES/CBC/PKCS5Padding" because
"AES/CBC/PKCS7Padding" will cause NoSuchAlgorithmException to be thrown
when initializing an AES block cipher using the Java crypto API), I
consider this a gross misnaming in the Java platform because the pure
technical definitions of these paddings are not the same."

Ref: https://stackoverflow.com/questions/10193567/java-security-nosuchalgorithmexceptioncannot-find-any-provider-supporting-aes-e

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207234518
2018-08-06 11:25:34 +01:00
aquilescanta
4eee474555 Remove minLoadableRetryCount from HLS components
Remove minLoadableRetryCount from HLS components in favor of
LoadErrorHandlingPolicy#getMinimumLoadableRetryCount.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206298419
2018-08-01 13:49:20 +01:00
tonihei
d3c2cb2aa4 Update remaining DataSource's with new addTransferListener method.
The new method allows to add TransferListeners after the DataSource
has been created. Most implementations just forward to their wrapped
upstream DataSource. Implementation which directly read data implement
BaseDataSource instead.

Also removes the temporary default no-op implementation in DataSource.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206289986
2018-08-01 13:49:20 +01:00
Gleb Pinigin
8f624861e1 WebvttExtractor: make public to allow create custom HlsExtractorFactory outside of library 2018-07-31 19:45:30 +07: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
1d636520ca Auto-register AnalyticsCollector as bandwidth meter listener.
This allows to automatically forward bandwidth estimate events to
AnalyticsListeners.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205642752
2018-07-23 13:32:44 +01:00