2930 Commits

Author SHA1 Message Date
andrewlewis
1dcad4d173 Store a MediaPeriodId in PlaybackInfo
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160271631
2017-06-28 22:26:05 +01:00
andrewlewis
675756d32d Create MediaPeriods based on an identifier not an index
This will allow MediaSources to provide MediaPeriods that correspond to ad
breaks in a timeline period rather than content for a timeline period, in a
future change.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160267841
2017-06-28 22:26:05 +01:00
andrewlewis
d4059ecc65 Use period holder indices to determine if a period was seen
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160257503
2017-06-28 22:26:05 +01:00
eguven
444dbeb4c4 Fix NPE in FakeDataSource.close()
If open() fails because of the file isn't available then fakeData is null.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160249214
2017-06-28 22:26:05 +01:00
tonihei
410228acb8 Rename isLast to isFinal in MediaPeriodHolder.
This better reflects the purpose of this flag and makes code more readable.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160246573
2017-06-28 22:26:05 +01:00
Oliver Woodman
076a77e598 Fix indexing error 2017-06-26 23:41:00 +01:00
eguven
3fbfe29d27 Modify CacheUtil.cache() for polling counters
Getting active status of caching is needed to display on UI. Instead of a listener interface polling was chosen because of simplicity and better suits to UI refreshing.

CachingCounters.downloadedBytes was updated after whole data is downloaded. Now it's updated for each read into buffer. Buffer length defines how finer these updates are.

CachingCounters.totalBytes is added so UI can display a progress bar.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160142048
2017-06-26 17:07:56 +01:00
eguven
a7ed199622 Fix FLAC extension native part compilation
In the latest NDK version (r15) compilation fails because 'memset' isn't defined. Included cstring header.

Issue: #2977

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160139022
2017-06-26 17:07:56 +01:00
olly
acbddbc0a5 Use regular array for SampleQueues in ExtractorMediaPeriod
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160138881
2017-06-26 17:07:56 +01:00
olly
c448463a05 Move DashMediaSource and SsMediaSource to new SampleQueue methods
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160130540
2017-06-26 17:07:56 +01:00
olly
1b71e3b40d Move ExtractorMediaPeriod to new SampleQueue methods
This change allows you to enable/disable tracks within which
all samples are key-frames without any re-buffering (e.g. audio,
text and metadata). This effectively reverts V2 back to the
behavior in V1, only this time we're doing it properly. []ly
disabling/enabling, or disabling/enabling whilst paused, no longer
cause samples to get "lost" between the source and renderers.

Note it also becomes really easy to support a few other things,
although support is not exposed in this change:

- Enable/disable video tracks without any re-buffering, by
  changing the toKeyframe argument passed to discardTo to true.
- Retain media in the buffer for some time after it's been played
  (e.g. to support a single back-5s-seek efficiently), by
  subtracting the desired back-buffer time from the value that's
  passed to discardTo.

Issue: #2956
Issue: #2926

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160128586
2017-06-26 17:07:56 +01:00
olly
b3c6f6fb31 Merge ContentDataSource fixes + tests from GitHub
https://github.com/google/ExoPlayer/pull/2963/files
8bb643976f

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160128047
2017-06-26 17:07:56 +01:00
hoangtc
70e6dd5930 Update DrmSessionException.
Make DrmSessionException takes in Throwable cause instead of Exception cause, which is more limiting and doesn't add any benefit.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160121486
2017-06-26 17:05:21 +01:00
Oliver Woodman
b0a873df25 Clean up okhttp datasource. 2017-06-25 15:16:11 +01:00
ojw28
ea2f5cce85 Merge pull request #2994 from alexbirkett/feature/make-ok-http-data-source-ua-optional
Make OkHttpDataSource userAgent parameter optional
2017-06-25 15:10:56 +01:00
olly
c007e93ab0 Fix setSelectionOverride(index, tracks, null)
Issue: #2988

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159958591
2017-06-24 14:42:15 +01:00
tonihei
363f2414d1 Fix check for last period index in ExoPlayerImplInternal
The if clause was never executed because nextLoadingPeriodIndex is set
to C.INDEX_UNSET instead of loadingPeriodIndex + 1.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159948661
2017-06-24 14:42:15 +01:00
Alex Birkett
0572d190fe Make OkHttpDataSource userAgent parameter optional 2017-06-23 18:56:40 +02:00
Oliver Woodman
555eb9d423 Mini cleanup 2017-06-23 17:37:28 +01:00
Oliver Woodman
8bb643976f Fix ContentDataSource and enhance tests to validate read data 2017-06-23 17:20:51 +01:00
ojw28
2da22e9e0f Merge pull request #2963 from DroidsOnRoids/dev-v2
Source length calculation in ContentDataSource changed
2017-06-23 15:45:21 +01:00
tonihei
6cde8335ff Add setter method to child data holder of abstract concatenated timeline.
Prevents that we forget to set variables.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159939180
2017-06-23 15:43:58 +01:00
olly
499f9370a2 Remove use of mod operator from SampleMetadataQueue
It's no more complicated to avoid it, and according to the
Art team it should be faster without.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159816746
2017-06-22 20:26:03 +01:00
olly
950c2159b0 Discard upstream allocations more aggressively + doc cleanup
- If we have <s1>garbage<s2> and discard <s2>, throw away
  the garbage too.
- Cleanup some documentation to consistently refer to the
  queue as "queue" rather than "buffer".

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159816309
2017-06-22 20:24:53 +01:00
aquilescanta
aca80b8347 Add support for pattern encryption and default initialization vectors
This will extend our CENC modes support to cbcs and cens. The change was
not split into two different CLs due to lack of test content for
default initialization vectors, aside from AES-CBCS encrypted ones.

Issue:#1661
Issue:#1989
Issue:#2089

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159810371
2017-06-22 20:23:42 +01:00
andrewlewis
73b17a7e7b Use HTTPS for all GCS URLs
Also update the dizzy sample to use HTTPS as it has moved
permanently.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159805004
2017-06-22 20:22:28 +01:00
olly
9bad78dce6 Fix SampleMetadataQueue.getLargestQueuedTimestampUs
This was broken prior to my recent changes, since
largestDequeuedTimestampUs was only being updated in readData.
It should have been updated in the skip methods. as well.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159704945
2017-06-22 20:21:14 +01:00
eguven
531eb15ff4 Move DashDownloadTestBase assert methods to CacheAsserts
CacheAsserts contains cache assertion methods for testing. It's easier to use in tests than DashDownloadTestBase which requires to be extended.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159688808
2017-06-22 20:20:05 +01:00
olly
8e49cab865 Start finalizing SampleQueue methods
It's a bit messy at the moment with the deprecated methods
in there, but on the read side the new set of methods is as
follows:

Modifies the start of buffer:
- discardTo(time, keyframe, ...) [this is new]
- discardToRead()
- discardToEnd()

Modifies the read position:
- rewind()
- advanceTo(time, keyframe, ...) [this is a generalization of skipToKeyframeBefore]
- advanceToEnd() [previously called skipAll]
- read(...)

Which seems quite nice and self-consistent, and is powerful
enough for everything that we need to do as we move MediaSource
implementations over to the new methods.

TODOs for subsequent changes:
- Re-order methods in the two classes so that they're actually in
  the same order, and move the deprecated ones out of the way
- Enhance SampleQueueTest to also cover new functionality, as we
  start transitioning MediaSource implementations over to use it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159688660
2017-06-22 20:18:50 +01:00
olly
59ccd63544 Remove weird nextOffset state from SampleMetadataQueue
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159681714
2017-06-22 20:17:30 +01:00
tonihei
9154d54df9 Fix resolveSubsequentPeriod in EPII.
getNextPeriod might return C.INDEX_UNSET.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159676949
2017-06-22 20:16:05 +01:00
eguven
ed060a8f33 Add FakeDataSource.setTestData() to simplify adding random test data
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159676653
2017-06-22 20:14:53 +01:00
eguven
40039ed0a1 Fix and move Util.getRemainderDataSpec() to DataSpec.subrange()
Made the method copy all of the fields of DataSpec in to the new instance. Also converted
it to an instance method of DataSpec for ease of usage, discovery and maintenance.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159670314
2017-06-22 20:13:43 +01:00
eguven
44f6dbb0cc Work around the error prone warning
Error prone check doesn't like we pass a variable named 'end' as start parameter and 'start' as end.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159567308
2017-06-22 20:12:24 +01:00
olly
467fd2535c Expose new non-discarding SampleQueue read/skip methods
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159555748
2017-06-22 20:11:09 +01:00
aquilescanta
0ffc3ffd29 Fix DrmInitDataTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159554717
2017-06-22 20:09:57 +01:00
aquilescanta
8d74ba4850 Add support for cbc1 encryption scheme
Issue:#1661
Issue:#1989
Issue:#2089

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159553419
2017-06-22 20:08:42 +01:00
eguven
1c8f14b5fd Add support to run actions into FakeDataSource
An actions is triggered when the reading reaches action's position. This can be
used to make sure the code is in a certain state while testing.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159545923
2017-06-22 20:07:26 +01:00
olly
ce8634507d Add a read reference into our linked list of Allocations
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159538997
2017-06-22 20:05:59 +01:00
aquilescanta
317a994499 Add type to DrmInitData.SchemeData
At the moment, only CENC-defined scheme types are known values.
This will allow having more information about the encryption
scheme through the format, which in turn will allow more informed
decisions on format support.

Issue:#1661
Issue:#1989
Issue:#2089

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159538907
2017-06-22 20:04:26 +01:00
olly
2c09f8e0e3 Decouple start and read indices in SampleMetadataQueue
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159426366
2017-06-22 20:03:03 +01:00
olly
86f06faa8d Move clearing of joining deadline back to onStopped
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159421000
2017-06-22 20:01:03 +01:00
tonihei
de4ff4c5ec Extend HostActivity for reuse and silent timeout.
Added option to fail on timeout. Also reset internals in all cases
such that the activity can be used more than once.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159419176
2017-06-22 19:59:48 +01:00
hoangtc
56ff2ef598 Add getPlaybackLooper() to ExoPlayer v2.
A few components in ExoPlayer requires playback looper to operate (such as:
DrmSessionManager#acquireSession), so this CL add back getPlaybackLooper()
to facilitate such cases.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159416012
2017-06-22 19:58:34 +01:00
andrewlewis
d9ea8f7143 Allow disabling the initial discontinuity on ClippingMediaSource
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159227077
2017-06-22 19:57:23 +01:00
tonihei
56205893e5 Remove initial discontinuity from ClippingMediaSource
(Fixing GitHub issue #2923)

Cuurently, ClippingMediaSource issues an initial discontinuity. This causes the
renderers to be disabled and re-enabled when this media source is used in a sequence
with other sources (or in a loop).

This change disables the use of an initial discontinuity for audio-only media under
the assumption that audio streams have random access capabilities.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159221963
2017-06-22 19:56:10 +01:00
olly
c7948f2f7a TTML: Ignore regions that don't declare origin and extent
Issue: #2953

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159218386
2017-06-22 19:54:52 +01:00
tonihei
023c9d56a9 Simplify timeline test stub class.
Use an actual class for the stub media source instead of an anomymous class.
Allows to call assertReleased() on that class.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159109143
2017-06-22 19:53:36 +01:00
andrewlewis
ed27017b0c Update MIME type in FLAC test data
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159104188
2017-06-22 19:52:08 +01:00
Karol Wrótniak
86ff19b55b
null AssetFileDescriptors support added in ContentDataSource 2017-06-19 16:09:54 +02:00