2385 Commits

Author SHA1 Message Date
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
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
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
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
olly
8af77acb01 Adjust incorrect looking max-channel counts
Issue: #2940

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159099602
2017-06-15 15:18:04 +01:00
olly
2a353a834d Advance SampleQueue writeAllocationNode earlier
Previously, writeAllocationNode was not advanced to the
terminating node when finishing writing sample data that
fills exactly up to the end of the current write node.
This wasn't actually broken, but is confusing because it
causes edge cases where the start/read references could
temporarily refer the node after the current write node.
This change advances the write reference in this case,
removing this confusion and bringing the implementation
in line with what the design doc says happens.

Also making some simplification and consistency changes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159099522
2017-06-15 15:17:03 +01:00
olly
cdcdf1d37c Log frame counts when we see a spurious audio timestamp
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158977741
2017-06-14 19:35:38 +01:00
andrewlewis
810c120abc Increase MP3 sniffing distance
Issue: #2951

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158960483
2017-06-14 19:34:21 +01:00
olly
e4617567a3 Rename DefaultTrackOutput to SampleQueue
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158842843
2017-06-14 19:31:47 +01:00
olly
6362dfeb98 Replace LinkedBlockingDeque with our own linked list
This will allow us to maintain a reference to the middle
of the queue, which is necessary to efficiently support
decoupling the read position from the start of the buffer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158839336
2017-06-14 19:30:21 +01:00
olly
f3e9166a4e Use DummySurface on S8 where possible
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158838707
2017-06-14 19:29:10 +01:00
olly
fb12a659a2 Fix discarding upstream from DefaultTrackOutput
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158837777
2017-06-14 19:28:01 +01:00
Oliver Woodman
0c1212b309 Fix typo 2017-06-13 14:10:31 +01:00
Oliver Woodman
0f5c30d345 Misc cleanup 2017-06-13 13:35:10 +01:00
ojw28
c6dfccf393 Merge pull request #2756 from kiall/par-debugview
Include Pixel Aspect Ratio in DebugTextViewHelper
2017-06-13 13:21:01 +01:00
ojw28
b95417e783 Merge pull request #2943 from michalliu/dev-v2-fix
check if defaultRefreshRate is reasonable
2017-06-13 13:20:50 +01:00
olly
350998219a Add test for DefaultTrackOutput
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158745843
2017-06-13 13:17:27 +01:00
tonihei
fa4f876668 UI parameter to disable automatically showing playback controls.
(Fixing GitHub issue #2699)

Added controllerAutoShow parameter to decide whether playback controls are
shown automatically. Default is true. Can be overwritten in the XML with
auto_show=false or via SimpleExoPlayerView.setControllerAutoShow(false).

Also inverted the logic of maybeShowControllers and showController.
SimpleExoPlayerView.(show/hide)Controller and PlaybackControlView.(show/hide)
now unconditionally do what they say to allow manual operation.
SimpleExoPlayerView.maybeShowController is used internally to automatically
show playback controls.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158712277
2017-06-13 13:15:13 +01:00
tonihei
dcc2f9bd67 Add meta data class for AbstractConcatenatedTimeline.
(Preparation for GitHub issue #1706)

AbstractConcatenatedTimeline repeatly calls methods of its implementation to
query a specific child timeline. This may be inefficient if the implementation
repeatly executes the same code to find the timeline.

Changed the class such that it now queries all information at once using a meta
data class. As all methods need at least two of four variables anyway, this
doesn't generate unnecessary overhead.

Also generified the UID for the child indices to allow new implementations to
use some other UID besides the index.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158711979
2017-06-13 13:14:01 +01:00
tonihei
629edc2b95 Remove needsContinueLoading from ExoPlayerImplInternal
The same effect can be achieved by checking the isLoading variable of ExoPlayerImplInternal
because this variable is in almost all cases set simultaneously with loadingMediaPeriodHolder.needsContinueLoading.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158697948
2017-06-13 13:11:38 +01:00
michalliu
dbfbcd6312 check if defaultRefreshRate is reasonable
We found getDefaultDisplay has a very small chance returns null
2017-06-13 15:23:34 +08:00
olly
c980eae9c4 Allow overriding of getCodecMaxValues
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158686545
2017-06-12 10:32:56 +01:00
olly
5cd3a9baa0 Fix passing of invalid surface to video renderers
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158684924
2017-06-12 10:31:53 +01:00
andrewlewis
cb5b6fba01 Allow customization of ExtractorMediaSource's check interval
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158683582
2017-06-12 10:30:33 +01:00
aquilescanta
646047f088 Add nullable annotation to onSourceInfoRefreshed's manifest argument
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158522507
2017-06-12 10:29:17 +01:00
andrewlewis
59315cf923 Fix maximum read ahead logic for repeat mode
Separate MediaPeriodHolder.index and MediaPeriodHolder.periodIndex, so that the
latter is always a period index (which may repeat or jump) whereas the holder
index increases by one each time an item is added to the period holder queue.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158497639
2017-06-12 10:27:00 +01:00
andrewlewis
4e006a9616 Move positionUs parameter from createPeriod to prepare
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158494794
2017-06-12 10:25:49 +01:00
olly
047e0eb645 Renames to prepare for upcoming media buffer changes
Currently, media is discarded from DefaultTrackOutput
and SampleMetadataQueue as soon as it's been read. In
upcoming changes we'll decouple discard and read. This
will make it possible to retain already-read media in
these buffer classes, and allow the read position to
be moved backward as far as media is retained. This is
important for fixing an edge case around 608/EMSG
tracks, and could also underpin future features like
allowing retaining of X-seconds past media in the
buffer.

This change renames some variables and methods to
prepare for the upcoming changes. read/write indices
are renamed to start/end. The upcoming changes will
add a read index that's between the two. isEmpty is
inverted and renamed to hasNextSample, since it will
be possible to not have a next sample (because the
read index == end index) but for the buffer to not
be empty (because start index < read index).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158409630
2017-06-12 10:24:42 +01:00
olly
b7b0fef694 Split InfoQueue into its own class
It's pretty big as an inner class, and is going to get a
little more complicated. I think it makes sense to be
able to consider it in isolation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158393754
2017-06-12 10:22:21 +01:00
olly
1b06ce7407 Fix ArrayIndexOutOfBoundsException in DashMediaPeriod
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158269662
2017-06-12 10:21:09 +01:00
olly
5908d2d7e2 Update handled schemes for timing element resolution.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158269487
2017-06-12 10:19:59 +01:00
tonihei
cdad6a4ef1 Move playback test utils to testutils.
This allows other tests to reuse the util classes without having to link to playbacktests.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158214560
2017-06-12 10:18:50 +01:00
Kiall Mac Innes
c24ef592e7 Include Pixel Aspect Ratio in DebugTextViewHelper
Add the video Pixel Aspect Ratio to the DebugTextViewHelper in order
to help debug issues related to PAR changes etc
2017-06-11 16:30:13 +01:00
olly
2439c582d4 Bump version + update release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158153988
2017-06-06 18:13:02 +01:00
olly
39b1c85c27 Expose current scrubber position through onScrubStart
Issue: #2910

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158149904
2017-06-06 18:11:58 +01:00