637 Commits

Author SHA1 Message Date
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
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
olly
b25a124239 HLS: Fill primary sample formats with track format info (e.g. bitrate)
Issue: #3297

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204732266
2018-07-17 20:28:52 +01:00
aquilescanta
e247a08a36 Parameterize load error handling in HLS
Issue:#2844
Issue:#2981

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204718939
2018-07-17 20:25:18 +01:00
olly
450448b220 Fix bug where sourceId wasn't set for the first chunk
The sample queues haven't been created when the first init call
occurs. In this case we need to set sourceId when we subsequently
create the queues.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204467538
2018-07-17 20:21:10 +01:00
olly
ef728178a8 Improve format derivation for chunkless preparation
1. Copy label into derived formats
2. If audio is the primary track type, copy additional fields from
   the variant formats. This is probably a no-op in practice, since
   I don't think variant formats have these fields set anyway, but
   it seems like the right thing to do in case they ever are set in
   the future.

Note: It's a bit strange to use createXContainerFormat rather than
createXSampleFormat, but in practice the methods used here are
better matched for what we're trying to do.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204467287
2018-07-17 20:19:57 +01:00
olly
18ab4b9112 Fix / improve format merging
1. Prefer label and language values in the manifest to those in
   the media. This is particularly helpful if the sample format
   contains "und" as the language.
2. Copy label when deriving formats in HlsSampleStreamWrapper
3. When there's only one variant in HlsSampleStreamWrapper, use
   the regular copyWithManifestFormatInfo. This allows more
   information to be retained from the sample format.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204340008
2018-07-17 20:13: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
Oliver Woodman
e4b05a5ae6 Merge branch 'dev-v2' of https://github.com/JungleGenius/ExoPlayer into JungleGenius-dev-v2 2018-07-12 15:54:47 +01:00
tonihei
095c6e4bf8 Add MediaChunkIterator for HLS media playlists.
This allows to iterate through the available segments of the playlist.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204100116
2018-07-11 14:57:49 +01:00
tonihei
264bed06f2 Forward addTransferListener for all wrapping data sources.
This allows to register a listener on an outer wrapping data source which
receives data transfer events from the wrapped source.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203358981
2018-07-06 14:37:19 +01:00
tonihei
acbe52d0d7 Forward TransferListener from MediaSources to DataSources.
This wires up recent changes of passing a transfer listener to the MediaSource and
allowing DataSources to accept new listeners.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203280818
2018-07-06 14:35:17 +01:00
tonihei
abb4d6ff70 Use correct generics type bounds for TransferListener in MediaSources.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203260699
2018-07-06 14:32:46 +01:00