1532 Commits

Author SHA1 Message Date
olly
a31a3f3c73 Simplify DownloadActionTest legacy tests using assets
PiperOrigin-RevId: 222819933
2018-11-26 16:40:34 +00:00
olly
40c65dbcea Move deserialization code to a more natural location
- Add DownloadAction.fromByteArray for symmetry with toByteArray
- Make DownloadService call fromByteArray, for symmetry with calls
  to toByteArray

PiperOrigin-RevId: 222801703
2018-11-26 16:40:08 +00:00
Oliver Woodman
5284ad2e41 Merge pull request #5144 from google:dev-v2-vttfix
PiperOrigin-RevId: 222798467
2018-11-26 11:06:10 +00:00
olly
17eadcc433 Fix Cea608 caption valid
PiperOrigin-RevId: 222797622
2018-11-26 11:05:55 +00:00
Oliver Woodman
166acad93d Noop fix to WebvttDecoder
We already have tests for comment blocks, and they already
pass because we discard the comment when we fail to parse it
as a cue. We should just skip it directly, however.
2018-11-26 10:50:49 +00:00
olly
799bf16764 Pull reading of data bytes back above if(...){continue} clauses
PiperOrigin-RevId: 222633838
2018-11-23 17:59:27 +00:00
Oliver Woodman
e2e1c459c8 Merge #5140: Cea608 - Check parity and valid bits
Imported from GitHub PR https://github.com/google/ExoPlayer/pull/5140

https://github.com/google/ExoPlayer/pull/5086 moved onto the right branch.
Merge 8822e188d24c1d9b3ed101918763b16e46c8debc into 0c385a854d1c54f794789b390a5793a43a0eb147

PiperOrigin-RevId: 222633340
2018-11-23 17:47:40 +00:00
olly
1216068255 Add Lint.IfChange/ThenChange for repeat modes
PiperOrigin-RevId: 222630411
2018-11-23 17:40:54 +00:00
BrainCrumbz
d3095cccfe Merge #5126: fix(playlist): always call onCompletion when moving media sources
Imported from GitHub PR https://github.com/google/ExoPlayer/pull/5126

Closes #5125
Merge 55a4c1e15de7f100f37e38119f1da360910fd1e3 into fe41f17c387b7c18a818c8cf2a1ebcdfbd36836a

PiperOrigin-RevId: 222612873
2018-11-23 12:37:57 +00:00
aquilescanta
fe41f17c38 Move listener invocation classes to BasePlayer
PiperOrigin-RevId: 222609579
2018-11-23 12:31:35 +00:00
tonihei
f8a3c135e5 Use overflow-save add operation for blacklisting duration.
This allows to specify open-ended blacklisting with Long.MAX_VALUE.

PiperOrigin-RevId: 222550939
2018-11-23 12:31:12 +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
aquilescanta
5f12b065a4 Support removal of ranges from ShuffleOrders
This allows more efficient range removals and is consistent with addition,
which supports adding multiple elements in a single operation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222396310
2018-11-22 12:50:01 +00:00
olly
265462bcbd Support Opus and Flac in MP4/DASH
Issue: #4883

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222392621
2018-11-22 12:48:24 +00:00
tonihei
1699fbfa74 Add experimental option to subtract non-allocatable bandwidth.
This allows to account for bandwidth used by fixed track selections.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222383736
2018-11-22 12:42:32 +00:00
eguven
10eaa7d748 Replace BandwidthMeter with BandwidthProvider in AdaptiveTrackSelection
BandwidthProvider allows bandwidth allocation logic to be customized.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222293581
2018-11-22 12:41:05 +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
eguven
527f2cf730 Add TrackSelection.Factory createTrackSelections
createTrackSelections decides whether to create an adaptive or a fixed track seletion to create.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222231011
2018-11-20 17:43:01 +00:00
tonihei
55cc0df558 Create actual copy of listener list instead of just copying the reference.
Forwarding the listeners to the notification update is meant to ensure we
only notify the listeners which were registered at the time the event happened

However, we currently just copy the reference to the actual list instead of
doing a deep copy of the listeners.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222227735
2018-11-20 17:41:24 +00:00
tonihei
b7ab570094 Use serialized listener notification for all listener notifications.
This ensures that all callbacks use the same notification mechanism.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222226913
2018-11-20 17:39:40 +00:00
tonihei
771db2c9fc Move playWhenReady update out of PlaybackInfoUpdate.
The update is actually unrelated and putting it all in one large update
object complicates adding the same update mechanism for other values.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222226825
2018-11-20 17:38:04 +00:00
tonihei
edff52ba5f Add buffer size based adaptive track selection.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222221294
2018-11-20 17:36:28 +00:00
eguven
f48ad85b19 Add experiment to use WindowedTrackBitrateEstimator
WindowedTrackBitrateEstimator, uses future and past chunks in a window
of time to estimate track bitrate values.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222065409
2018-11-20 17:30:04 +00:00
mdoucleff
c096e156b1 Interpret single-item audio stream edit lists as audio padding specification. Use the information to strip out padding from decoded audio streams.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221865861
2018-11-20 17:26:46 +00:00
tonihei
9dd814fcfe Improve DefaultLoadControl.shouldContinueLoading for the minBuffer=maxBuffer case.
Currently no path may be chosen if
minBufferUs == maxBufferUs == bufferedDurationUs.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221639199
2018-11-20 17:25:06 +00:00
tonihei
7cf62a03f0 Ensure DefaultLoadControl.Builder is single-use.
This is needed because the allocator can't be reused for example.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221638233
2018-11-20 17:23:22 +00:00
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
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
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
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
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
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
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
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