3786 Commits

Author SHA1 Message Date
Nate Roy
2f622b8bd8 Allow passing of HlsPlaylistParser to HlsMediaSource.
Also create helper method in HlsMasterPlaylist to allow the copying of
the playlist to another, but with the variants reordered based on a
passed comparator. Also added an implementation of HlsPlaylistParser
which will reorder the variants returned.
2017-10-06 14:31:46 -04:00
olly
1495b9a473 Fix stuck playback when media has uneven track end times
* Always assume a renderer is ready if it's read to the end of
  its current stream and there's a subsequent period already
  prepared. This prevents getting stuck when a non-clock renderer
  has a short stream.
* Switch to the standalone clock if the renderer providing the
  media clock has read to the end of its current stream, is no
  longer ready, and there's a subsequent period already prepared.
  This prevents getting stuck when a clock renderer has a short
  stream.
* Remove unnecessary clock synchronization logic (since it would
  need to be made more complicated as a result of this change).
* Don't update the playing period holder when playWhenReady is
  false. This avoids the position jumping to the start of the
  next period when seeking to the very end of the current period
  whilst paused (we still end up showing the first frame of video
  from the next period, but fixing that will have to wait).

Github: #1874

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170717481
2017-10-03 08:58:25 +01:00
tonihei
7e7fea4068 Add WaitForPlaybackStateChanged action to action schedule.
This works similar to the existing WaitForXXXX actions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170687058
2017-10-03 08:57:14 +01:00
olly
fd576d2189 Smoother PlaybackControlView updates when speed != 1
* If speed <= 0.1, update every second.
* If 0.1 < speed < 1, update approximately once per
  second in real time, aligned so that each second boundary
  in media time has a corresponding updatae.
* If speed == 1, keep existing behavior.
* If 1 < speed <= 5, update every second in media time
* If speed > 5, update every 200ms.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170559037
2017-10-03 08:55:52 +01:00
tonihei
096d7651d2 Execute actions in action schedule immediately.
Run next action immediately without using the handler when the requested
delay is zero. This ensures that no other code can run between these two
actions to improve deterministic test behaviour.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170456852
2017-10-03 08:54:28 +01:00
tonihei
28173991d1 Return requested position when selecting tracks in FakeMediaPeriod.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170360487
2017-10-03 08:53:01 +01:00
olly
a3a9c0f3b0 Sanity check current position <= written frame position
This avoids spurious position reports following an underrun.

Github: #1874

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170344399
2017-10-03 08:51:36 +01:00
hoangtc
7665571ff9 Do not copy data to output frame in libvpx unless necessary.
In out libvpx extension, currently we always call vpxGetFrame and copy the data
from the native decoder to output frame. However, if the inputBuffer has
isDecoderOnly set, we can avoid populating the output buffer, but only setting
BUFFER_FLAG_DECODE_ONLY.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170318527
2017-10-03 08:50:10 +01:00
andrewlewis
60de157410 Add a few initial tests for SimpleDecoderAudioRenderer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170318174
2017-10-03 08:48:46 +01:00
andrewlewis
9c7950f342 Add AudioSink interface and use it from audio renderers
This change allows applications to provide custom AudioSinks, which could be
based on android.media.AudioTrack like AudioTrackAudioSink, or could be
completely custom.

The refactoring is mostly mechanical and shouldn't result in any functionality
changes.

Some android.media.AudioTrack-specific details have to appear in the AudioSink
interface so this change modifies the javadoc on the AudioTrack (now AudioSink)
to note that some methods will have no effect.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170311083
2017-10-03 08:47:20 +01:00
zhihuichen
b14b3d43de Expose OnKeyStatusChange events, this is required to learn the usabilities of the keys.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170268043
2017-10-03 08:45:53 +01:00
tonihei
52de36c5eb Add abstract, default Player event listener.
This allows simplified listener implementations as most listeners
will not listen to all possible notifications.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170177821
2017-10-03 08:44:33 +01:00
olly
55f696e11d Fix spurious failures due to late decoding.
By default, if a codec is instantiated during an ongoing
playback, ExoPlayer will render the first frame that it
receives (so that there's "something other than black"
drawn to the surface). This frame is the key-frame before
the current playback position, and may be as much as 5
seconds behind the current position. ExoPlayer then drops
subsequent frames that are late until it's caught up to
the current position again.

For GTS tests that are counting dropped frames, this is
not desirable behavior, since it will cause spurious test
failures in cases where DummySurface is not supported.
This change overrides the default behavior so that the
player instead skips (rather than drops) frames until it's
caught up to the current playback position, and only then
renders the first frame.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170175944
2017-10-03 08:43:10 +01:00
olly
a3be937650 Prevent unnecessary consecutive playlist loads
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170078933
2017-09-26 19:19:57 +01:00
Oliver Woodman
792f046c02 Clean up HlsPlaylistTracker 2017-09-26 17:06:36 +01:00
ojw28
8ee6da1fe9 Merge pull request #3280 from yqritc/fix-primary-playlist-update
Fix primary hls playlist update
2017-09-26 16:54:47 +01:00
olly
b17a6ba51d Add TODO to respect FLAG_ALLOW_GZIP in CronetDataSource
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169927989
2017-09-26 14:05:16 +01:00
strobe
c6bc30bab7 Add NEON-accelerated HDR conversion routines to VPX.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169919087
2017-09-26 14:03:50 +01:00
andrewlewis
06f7b6be6a Use IntDef for AudioTrack.startMediaTimeState
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169880369
2017-09-26 14:00:59 +01:00
olly
505d5cd0a4 Fix a few lint warnings
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169830938
2017-09-26 13:59:23 +01:00
eguven
1f8a8dbfa3 Add version number to serialized DownloadAction data
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169681768
2017-09-26 13:57:32 +01:00
aquilescanta
4fb18453e1 Add a "forceLowestBitrate" option to DefaultTrackSelector
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169668371
2017-09-26 13:56:04 +01:00
aquilescanta
25a9177ce3 Deduplicate DefaultTrackSelector javadocs
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169552239
2017-09-26 13:54:10 +01:00
hoangtc
324339b88f Tweak live-streaming track selection logic.
Follow-up on the update to ABR logic in AdaptiveTrackSelection for live
streaming case:
- Do not reset liveEdgeTimeUs when user seek to a different position.
- For HlsChunkSource, for non-independent segments, currently the
bufferedDuration calculate will subtract previousChunk's duration. So to make
it work with live-streaming ABR logic, we subtract timeToLiveEdgeUs a similar
amount to compensate for that operation.
- Minor update to DefaultSSChunkSource, only perform TrackSelection when needed
(after checking necessary conditions).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169531275
2017-09-26 13:48:23 +01:00
eguven
d71400d280 Add DashDownloadActionTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169522830
2017-09-26 13:45:42 +01:00
yqritc
455f9fb9f0 remove space 2017-09-21 16:01:32 +09:00
yqritc
cac16f1647 remove keep alive check for updating primary url to avoid redundant playlist loading 2017-09-21 14:18:59 +09:00
yqritc
ff2ece56dd fix primarySnapshotAccessAgeMs 2017-09-21 12:01:25 +09:00
olly
ce7aaab3c6 Handle bracket params on the end of SmoothStreaming URLs
Issue: #3230

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169421873
2017-09-20 19:29:17 +01:00
aquilescanta
6314a0ec82 Add support for Widevine encrypted HLS
This includes both cbcs and cenc. Will only work for streams that require a single
pssh.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169382884
2017-09-20 19:28:02 +01:00
ojw28
1fdc11f2b3 Merge pull request #3277 from google/dev-v2-r2.5.3
r2.5.3
2017-09-20 14:59:47 +01:00
Oliver Woodman
a8136cbb99 Rm test class from release 2017-09-20 14:49:23 +01:00
olly
eb3cc0b350 Tweak release notes for 2.5.3
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169374725
2017-09-20 13:57:47 +01:00
olly
48bc420d02 Bump version + release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169257339
2017-09-20 13:57:16 +01:00
eguven
c127a577d7 Notify span listeners even if index store fails in SimpleCache.removeSpan
This fixes infinite loop in LeastRecentlyUsedCacheEvictor.evictCache when index store fails.

Also made CachedContentIndex not final so it can be mocked and added a package protected SimpleCache
constructor so mock index can be injected.

Issue: #3260

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169249517
2017-09-20 13:57:16 +01:00
eguven
8b43d896f1 Workaround a cipher issue in Android 4.3
[]

Issue: #2755

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169249093
2017-09-20 13:57:16 +01:00
aquilescanta
ca4d482b59 Fix PTS wraparound in HLS+Webvtt
Issue:#2928

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169246424
2017-09-20 13:57:16 +01:00
eguven
06bba08be7 Check if the cache is already empty before trying to evict more span
This case may happen if the max span size is more than the max size the
evictor is configured.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169101093
2017-09-20 13:57:16 +01:00
aquilescanta
961f01a850 Fix 2 CEA decoder bugs
1- Avoid dropped buffers by using a PriorityQueue instead of a set.
2- Process the end of stream after non-EOS buffers.

Issue:#3250

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169077365
2017-09-20 13:57:16 +01:00
andrewlewis
30a04fd14b Work around broken AAC decoders on Galaxy S6
Issue: #3249

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168844850
2017-09-20 13:57:16 +01:00
andrewlewis
642e95beaa Workaround the skip ad button not being focused
Issue: #3258

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168669969
2017-09-20 13:57:16 +01:00
olly
26d789e6d3 Tweak release notes for 2.5.3
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169374725
2017-09-20 11:59:01 +01:00
olly
67567ffa6c TsExtractor: Do less work if payload reader does not exist
There's no reason to perform the discontinuity check or skip
the adaptation field if we don't have a payload reader for
the packet.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169374609
2017-09-20 11:57:47 +01:00
olly
aacfb37dff De-dupe ACTION_DOWN events
Issue: #3259

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168378650
2017-09-19 19:25:33 +01:00
olly
ed76882271 Bump version + release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169257339
2017-09-19 18:26:05 +01:00
olly
d346266dc9 Workaround Samsung tablet reboot playing adaptive secure content
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169256059
2017-09-19 18:23:28 +01:00
olly
89f66924d5 Use IntDef for MediaCodecRenderer internal states
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169254794
2017-09-19 18:22:03 +01:00
eguven
09248608c0 Notify span listeners even if index store fails in SimpleCache.removeSpan
This fixes infinite loop in LeastRecentlyUsedCacheEvictor.evictCache when index store fails.

Also made CachedContentIndex not final so it can be mocked and added a package protected SimpleCache
constructor so mock index can be injected.

Issue: #3260

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169249517
2017-09-19 18:20:34 +01:00
eguven
8a0e148041 Workaround a cipher issue in Android 4.3
[]

Issue: #2755

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169249093
2017-09-19 18:19:08 +01:00
aquilescanta
fed2a1a6ea Fix PTS wraparound in HLS+Webvtt
Issue:#2928

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169246424
2017-09-19 18:17:43 +01:00