400 Commits

Author SHA1 Message Date
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
olly
f196630863 Remove contentId from Representation creators/constructor
PiperOrigin-RevId: 223796377
2018-12-04 06:02:23 +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
d650f8e0e3 Remove ability to inject content-id via DashManifestParser
It doesn't make sense for multi-period manifest

PiperOrigin-RevId: 223537958
2018-12-01 00:08:10 +00:00
olly
a1b8e17ed1 Remove Representation.contentId. It doesn't really make sense.
PiperOrigin-RevId: 223535353
2018-12-01 00:08:05 +00:00
olly
beae7c9df5 Don't resolve UtcTiming element for static manifests
It doesn't do anything useful in this case.

PiperOrigin-RevId: 223516909
2018-11-30 16:13:52 +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
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
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
olly
5e6174fe38 DASH: Fix detection of end of live events
The remaining work is to split Window.isDynamic so that it's
possible to represent a window that wont be appended to, but
may still be removed from.

Issue: #4780

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221439220
2018-11-14 18:09:44 +00:00
eguven
d7e23f826b Fix package visibility comments
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220323772
2018-11-07 17:57:42 +00:00
Oliver Woodman
a442c72814 Fix nullability 2018-10-31 20:40:57 +00:00
Oliver Woodman
2dfe7a7ad6 Misc fixes / stylistic consistency changes for merged pull requests 2018-10-31 20:37:59 +00:00
ojw28
16326bae46
Merge pull request #4930 from Comcast/program_information
Add Support for Parsing ProgramInformation
2018-10-31 20:21:44 +00: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
Lieblich, Jonathan
0af9ccc990 added handling of unexpected tags 2018-10-15 15:37:42 -06:00
Lieblich, Jonathan
a7ace58712 Merge branch 'dev-v2' into program_information 2018-10-15 15:35:49 -06:00
olly
d511370338 Fix DashManifestParser to properly skip unknown tags
Robustness fix to make sure we ignore tags with known names, but
which are nested inside of unknown tags. For example we don't want
to parse the third period in:

<Period>...</Period>
<Period>...</Period>
<CustomTag>
  <Period>...</Period>
</CustomTag>

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217101630
2018-10-15 09:36:56 +01:00
olly
c5f9ad9f8b Minor fixes for period clipping
- Always clip to period duration for the last chunk. We previously
  did this only when the last chunk explicitly exceeded the period
  end time. We now also do it when the chunk claims to end at the
  period boundary, but still contains samples that exceed it.
- If pendingResetPositionUs == chunk.startTimeUs == 0 but the
  chunk still contains samples with negative timestamps, we now
  clip them by setting the decode only flag. Previously we only
  clipped such samples if the first chunk explicitly preceeded the
  start of the period.

Issue: #4899

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215763467
2018-10-15 09:23:00 +01:00
Lieblich, Jonathan
ced302fd83 added javadoc for ProgramInformation 2018-10-12 11:00:17 -06:00
Lieblich, Jonathan
6cbac152c9 added attribute parsin 2018-10-11 17:09:00 -06:00
Lieblich, Jonathan
ce0b5e4c44 removed custom element parsing 2018-10-11 16:25:21 -06:00
Lieblich, Jonathan
e42786d6f2 added parsing for program information 2018-10-10 15:34:29 -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
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
olly
a5a7e988e3 Clip DASH periods to their durations
Issue: #4185

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212619419
2018-09-12 15:30:47 +01:00
olly
38386c480a Be explicit about character set.
The default character set is always UTF-8 anyway on Android, but
we don't want our code to behave any differently where it's not
(e.g. robolectric test runs could potentially run in an environment
where UTF-8 isn't the default?).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211953885
2018-09-12 14:58:33 +01:00
josephmarques
aa7134d538 Adds support for the messageData attribute of the Event element in DASH MPDs for ExoPlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211854408
2018-09-12 14:55:34 +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
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
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
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
olly
bd8a956d53 Use lamdas everywhere
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209162373
2018-08-24 15:19:30 +01:00
andrewlewis
1c09af02f7 Fix handling of text codecs strings in DashManifestParser
Also fix an NPE in FfmpegAudioRenderer if sampleMimeType wasn't set.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208230947
2018-08-13 14:06:57 +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
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
7fcd6b6d65 Minimal fix for non-default cenc name prefixes in DASH manifests
For now, just allow any prefix (and don't check the namespace).
Checking the namespace requires turning on the XmlPullParser
namespace awareness feature, but this can only be done before
parsing, and I think requires us to specify the namespace when
querying other attributes. This would also risk breaking services
who currently don't set namespaces correctly.

It's possible we'll run into similar issues with the few other
tags (e.g. mspr:pro). We should revisit enabling namespace
awareness if/when we see this.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207526883
2018-08-06 13:25:33 +01:00
olly
454b106921 Fix freezing playing multi-period DASH with EventStreams
EventSampleStream.readData required eventStreamUpdatable to be
false for END_OF_STREAM to be returned, but it was only being
set to false when the manifest became static. This change also
sets it to false if the period is not the last one in a dynamic
manifest. It also renames it the parameter to appendable, since
that's what it really represents. Events may still be removed
from the start of the EventStream as the period starts moving
out of the live window.

Issue: #4492

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207517265
2018-08-06 11:38:33 +01: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
5933d92394 Add simplified Dash and Ss media source factory constructors.
As the manifest and media data sources can be the same now, we can provide
a simplified constructor with just one data source factory.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205658046
2018-07-23 15:55:57 +01:00
tonihei
a67c73650e Add helper method to get uid of timeline period.
This removes the need to populate the entire period for the common usage of
getting the uid from the period.

Also add default implementation to get period by uid.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205638265
2018-07-23 12:22:57 +01:00
tonihei
97e66ef11b Update period index in DashMediaPeriod event dispatcher after manifest update.
Issue:#4492

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205636634
2018-07-23 12:21:44 +01:00
Oliver Woodman
41345dcb83 Simplify DASH live presentation delay override 2018-07-23 10:39:02 +01:00