5989 Commits

Author SHA1 Message Date
aquilescanta
67b662158c Add binarySearchCeil method for integers
This matches the binarySearchFloor method overload.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221617114
2018-11-20 17:21:39 +00:00
olly
b77109148e Workaround for TS seeking
- Increase the search window size to fix TS seeking for problematic
  media we've had provided to us.
- As per my comments on the issue, we should look at doing more here
  to better fix the problem. This will solve the worst of the
  immediate problem, however.
- The memory usage is non-trivial, particularly with the increased
  search window size. I've made the allocations only live whilst
  determining duration and seeking to address this. I've done the same
  for PS just for consistency.

Issue: #5097

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221449988
2018-11-14 18:11:12 +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
aquilescanta
76eb06d6f2 Add Timeline to nullness check
This allows client code to run nullability checks.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221437215
2018-11-14 18:08:08 +00:00
olly
866b088d0b Noop cleanup of binary seeking / duration reading.
This is a precursor for fixing the ref'd issue. These classes are
well tested, so the tests passing should give you reasonable
confidence I didn't break anything :).

Issue: #5097

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221435824
2018-11-14 18:06:31 +00:00
olly
c20b157bd7 Wire up experiment to use AdaptiveTrackSelection based selections
LegacyVideoTrackSelection is the previous implementation (unchanged).
VideoTrackSelection is rewritten to extend AdaptiveTrackSelection.

An experiment is added to allow use of the new VideoTrackSelection
implementation. It's envisaged that this transition will be more or
less a no-op change. The experiment flag is only in case of bugs
during roll-out, and will be removed with LegacyVideoTrackSelection
upon successful transition.

VideoTrackSelection also implements discard-on-trick-play-exit, which
was a TODO in the previous implementation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221153827
2018-11-14 18:04:52 +00:00
olly
f5af6e8f16 Document need to call MediaSessionCompat.setActive
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221078075
2018-11-14 18:03:15 +00:00
olly
9ca019b8f8 PlaybackNotificationManager should show play button in ENDED state
- This brings it in line with PlayerControlView. The play action is displayed
instead, and pressing it seeks to the default position of the current window.
- Do the same for MediaSessionConnector
- Add support for PlaybackPreparer consistent with PlayerControlView

Issue: #5072

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221076008
2018-11-14 18:01:34 +00:00
aquilescanta
51461d7e00 Add constructor to DefaultShuffleOrder to support sideloaded shuffle orders
Issue: #4915

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221075615
2018-11-14 17:59:56 +00:00
olly
afebaed0c5 Make support-media-compat an API dependency
The extension cannot be used without also using support-media-compat
(e.g. to instantiate a MediaSessionCompat). So it may as well be an
API dependency.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221072128
2018-11-14 17:58:18 +00:00
olly
eb6859e436 Align navigation implementation across UI components
This change also paves the way for splitting out functionality into a utility class.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221070262
2018-11-14 17:56:39 +00:00
olly
7508219416 Simplify PlayerControlView fast forward and rewind implementation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221065798
2018-11-14 17:54:58 +00:00
olly
063f5704cd Simplify MediaSessionConnector
- Make MediaSessionConnector use a ControlDispatcher and add setControlDispatcher,
  setFastForwardIncrementMs and setRewindIncrementMs methods. This brings it in line
  with our other UI components, including PlayerControlView and
  PlayerNotificationManager.
- Collapsed DefaultPlaybackController into MediaSessionConnector, since I'm not
  sure there's a legitimate alternative implementation (note ControlDispatcher does
  provide some equivalent functionality e.g. to modify calls being made on the
  player).
- Pass the Player and ControlDispatcher to command receivers and custom actions,
  so they don't need their own references.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220822082
2018-11-14 17:53:18 +00:00
olly
8ec757ad2b Some MediaSessionConnector simplifications
- Simplify logic for dispatching to the rating callback
- Simplify CommandReceiver by removing getCommands. Simply calling
  receivers is simpler, and more flexible because it doesn't force
  implementations to define a static set of things that they handle
  up front.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220788423
2018-11-14 17:51:37 +00:00
eguven
4754aa59bd Use estimated bitrates in AdaptiveTrackSelection
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220643861
2018-11-14 17:48:20 +00:00
andrewlewis
bce1fab03c Include channel count in capabilities check
Issue: #4690

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220640737
2018-11-14 17:46:39 +00:00
bachinger
91d9fbd95d pass the notification listener to the constructor
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220616166
2018-11-14 17:41:45 +00:00
olly
b44f837d1b Update release notes for 2.9.1
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220592303
2018-11-14 17:40:06 +00:00
eguven
158bc1edac Add TrackBitrateEstimator and WindowedTrackBitrateEstimator
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220529628
2018-11-14 17:35:16 +00:00
Arnold Szabo
78ef90f61c Correcting default sizing of bitmaps, code review adjustments 2018-11-12 23:11:44 +02:00
Arnold Szabo
d159050eeb #1583 - Set default region attrs in SubtitlePainter, extend TtmlDecoderTest 2018-11-10 17:07:07 +02:00
Arnold Szabo
c7f763a369 #1583 - Modify in event time generation of TtmlNode
Look for "div" tags when generating the set of times.
2018-11-08 22:22:23 +02:00
olly
f895be6b1f AudioFocusManager - Treat idle state consistently
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220500268
2018-11-07 20:31:33 +00:00
olly
8d833c319d Fix BasePlayer.next()
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220470213
2018-11-07 17:57:42 +00:00
olly
e82d29f47a Make BasePlayer.get[Next/Previous]WindowIndex more useful
When in REPEAT_MODE_ONE, it's unlikely apps want next/previous methods
on the player to keep them in the same window. Music apps in particular
tend to implement next/previous functionality as though repeat mode were
off when in this mode (i.e. current song loops forever during playback,
but next/previous navigation still navigates to next/previous items).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220469655
2018-11-07 17:57:42 +00:00
olly
15dda17905 Make TimelineQueueNavigator shuffle aware
Issue: #5065

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220468285
2018-11-07 17:57:42 +00:00
olly
2d606f26f7 Minor cleanup to mediasession extension
- Make units of time clear for seeking
- Remove option to specify supported repeat modes in default
  playback controller. It doesn't seem useful, given we can't
  control what the session is sent.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220464529
2018-11-07 17:57:42 +00:00
olly
0dfd478a20 Add missing update on repeat toggle mode change
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220461315
2018-11-07 17:57:42 +00:00
eguven
5a18a98fbd Add TrackSelectionUtil getBitratesUsingPastAndFutureInfo
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220447459
2018-11-07 17:57:42 +00:00
eguven
7a114cb374 Uncomment VisibleForTesting annotations
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220432564
2018-11-07 17:57:42 +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
borrelli
0c4d0ee1c1 Fix for #5055 - Cannot disable audio focus after enabled.
This fixes an issue where disabling audio focus handling
while audio focus is held would not release audio focus.

A new test was added for this situation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220316866
2018-11-07 17:57:42 +00:00
andrewlewis
abb7d8a2d5 Include UI module tests in open source push
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220277660
2018-11-07 17:57:42 +00:00
andrewlewis
bc5e12013b Remove executable bit from some resources
Copybara propagates this bit on the files, so removing it avoids some
unnecessary changes in the first migrated commit.

Also losslessly optimize two PNG files.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220268951
2018-11-07 17:57:42 +00:00
Arnold Szabo
eafca5402a #1583 - Correcting comment in TtmlNode#getCues() 2018-11-06 21:54:34 +02:00
Arnold Szabo
254a586e27 #1583 - Parsing base64 encoded image data from metadata 2018-11-06 21:25:08 +02:00
andrewlewis
032883e1d2 Work around non-empty EoS buffers with timestamp 0
Issue: #5045

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220237752
2018-11-06 11:07:06 +00:00
andrewlewis
a8d1f04f92 Document error case for generateAudioSessionIdV21
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220132865
2018-11-06 11:07:06 +00:00
olly
8844694dfd Automated g4 rollback of changelist 219585084.
*** Reason for rollback ***

Rolling forward again as [] should fix issue that prompted the rollback

*** Original change description ***

Automated g4 rollback of changelist 219130576.

*** Original change description ***

Re-enable codec re-use

Issue: #2826

***

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220124362
2018-11-06 11:07:06 +00:00
eguven
0afd9c17e6 Add TrackSelectionUtil getBitratesUsingPastInfo
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220066159
2018-11-06 11:07:06 +00:00
olly
894bac6173 Tweak dev guide / readme
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220059244
2018-11-06 11:07:06 +00:00
eguven
37f4540156 Move BaseGvrPlayerActivity to com.google.android.exoplayer2.ext.gvr
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219829614
2018-11-06 11:07:06 +00:00
olly
c5db69d22c Fix further issues with decoder re-use
It's no longer guaranteed that onOutputFormatChanged will always be
called when the renderer is re-enabled, since the codec may be kept
and its output format may not change. Hence we need to avoid resetting
state in onDisabled that we need when the renderer is enabled again.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219821519
2018-11-06 11:07:06 +00:00
olly
251c420767 Experimental parameter for setting a render time limit in MediaCodecRenderer
Currently, MediaCodecRenderer's render loop does not have any time limit. We
always try to drain and feed as much buffers as possible. This may lead to a
pattern of feeding phase takes too much time from previous loop, which makes
the next draining phase drops all buffers, making these buffers available for
feeding all at once, and the pattern keeps repeating.

This CL adds an experimental parameter for setting a time limit. If the time
limit is exceeded, the feeding process stops even if more input could be fed.
The default behavior is unchanged

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219820386
2018-11-06 11:07:06 +00:00
aquilescanta
34797651c2 Add support for .cmf* extension in DefaultHlsExtractorFactory
This makes extractor selection a bit more efficient for some CMAF files.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219795105
2018-11-02 16:02:02 +00:00
aquilescanta
32927bb62c Update the DefaultExtractorInput's peek buffer length on each write
This prevents leaving an inconsistent state after a EOF exception.

Issue:#5039

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219785275
2018-11-02 16:00:33 +00:00
aquilescanta
b0555315cb Move all messaging constants to ExoCastConstants
Also make ExoCastMessage#mediaItemAsJsonObject protected.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219780620
2018-11-02 15:58:57 +00:00
andrewlewis
3b1d0e270b Double the buffer duration for AC3
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219765107
2018-11-02 15:57:20 +00:00
eguven
76688589d2 Add TrackSelectionUtil.getAverageBitrates method
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219636548
2018-11-02 15:54:10 +00:00
olly
e1c6229cc8 Bump version to 2.9.1
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219609471
2018-11-01 11:22:39 +00:00