3918 Commits

Author SHA1 Message Date
tonihei
ec43ed7e59 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-27 19:41:52 +00:00
tonihei
30941c41c3 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-27 19:41:45 +00:00
olly
c08edc5e0a 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-27 19:41:26 +00:00
olly
84fc24492f 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-27 19:40:58 +00:00
olly
177f3883e9 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-27 19:40:32 +00:00
aquilescanta
f7ed39ee17 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-27 19:39:52 +00:00
andrewlewis
d9462b9d2b Include channel count in capabilities check
Issue: #4690

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220640737
2018-11-27 19:34:04 +00:00
Oliver Woodman
a02a75ba57 Fix audio focus 2018-11-07 19:24:02 +00:00
olly
f5c3b30290 Fix BasePlayer.next()
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220470213
2018-11-07 18:05:32 +00:00
olly
6bc0408222 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 18:05:25 +00:00
olly
fd98d70a11 Make TimelineQueueNavigator shuffle aware
Issue: #5065

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220468285
2018-11-07 18:05:13 +00:00
olly
b8b8844083 Add missing update on repeat toggle mode change
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220461315
2018-11-07 18:04:36 +00:00
borrelli
ac0b11edc0 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 18:03:46 +00:00
andrewlewis
3e35b6d016 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:10:40 +00:00
andrewlewis
e347239ac5 Document error case for generateAudioSessionIdV21
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220132865
2018-11-06 11:09:20 +00:00
aquilescanta
8f57d85881 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:05:07 +00:00
aquilescanta
6d84b2a496 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:04:59 +00:00
andrewlewis
1866e6bfba Double the buffer duration for AC3
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219765107
2018-11-02 16:04:46 +00:00
Oliver Woodman
57042adec7 Remove methods now in BasePlayer 2018-11-01 11:55:40 +00:00
aquilescanta
10511e56cf Add constructor for adding payload reader factory flags
Issue:#4861

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214772527
2018-11-01 11:33:12 +00:00
olly
f9a805070a Bump version to 2.9.1
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219609471
2018-11-01 11:29:52 +00:00
andrewlewis
7876999ae7 Fix extended service number calculation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219597894
2018-11-01 11:24:24 +00:00
tonihei
e4c20aa3de Add convenience methods player.next() and player.previous()
This simplifies code skipping items in a playlist programatically.

Issue:#4863

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214580742
2018-11-01 09:43:12 +00:00
tonihei
bbd82cf5da Add BasePlayer to avoid code duplication for common convenience methods.
A lot of methods just forward to other methods and there is no conceivable
way a player should implement it another way. Moving these methods to a
base player class allows to remove duplicated code across our player
implementations.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215374192
2018-11-01 09:41:38 +00:00
tonihei
7a3447fe9c Simplify some buffered position related code.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215704344
2018-10-31 21:57:48 +00:00
Oliver Woodman
c9c4bd89c7 Fix nullability 2018-10-31 21:55:54 +00:00
Oliver Woodman
9c0bba3b5a Misc fixes / stylistic consistency changes for merged pull requests 2018-10-31 21:55:20 +00:00
ojw28
b88c88e21e Merge pull request #4930 from Comcast/program_information
Add Support for Parsing ProgramInformation
2018-10-31 21:55:12 +00:00
ojw28
22ee67617e Merge pull request #5004 from pakerfeldt/status-message-invalidresponsecodeexception
Provide http status message to InvalidResponseCodeException
2018-10-31 21:54:36 +00:00
ojw28
e4989d1743 Merge pull request #4996 from YukiMatsumura/fix-idle-requirements
fix checkIdleRequirement
2018-10-31 21:54:21 +00:00
ojw28
bb09f5cb12 Merge pull request #4911 from Comcast/feature/hls-audio-text-id-uniqueness
Create unique id for HLS audio and text tracks
2018-10-31 21:54:06 +00:00
andrewlewis
b1d5966ea5 Allow MP4s with truncated stco to be played
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219448836
2018-10-31 21:53:03 +00:00
andrewlewis
e6b49a5410 Fix handling of MP3s with appended data
Issue: #4954

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=218357113
2018-10-24 18:59:38 +01:00
olly
13e0513ea3 Give EventDispatcher more predictable behavior
If EventDispatcher.removeListener is called to remove a listener,
and if the call is made from the same thread that said listener
handles events on, then it should be guaranteed that the listener
will not be subsequently invoked on that thread.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=218331427
2018-10-24 18:58:35 +01:00
tonihei
8b1080d5cc Check if source has been prepared before releasing it.
In ConcatenatingMediaSource, the source may be removed before it started
preparing (this may happen if lazyPreparation=true). In this case, we
shouldn't call releaseSource as the preparation didn't start.

Issue:#4986

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=218141658
2018-10-24 18:58:14 +01:00
tonihei
9607c6de1b Properly reset period id and start position in ExoPlayerImpl.
This is a no-op change as the respective values are not used so far but
the change makes the current state cleaner and is less error-prone.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217892421
2018-10-24 18:56:31 +01:00
tonihei
6ae015ecbd Replace DefaultBandwidthMeter with CountryAndNetworkTypeBandwidthMeter.
This removes the experimental bandwidth meter and uses it as the new default.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215404065
2018-10-20 14:37:22 +01:00
olly
e346707199 Code shrinking doesn't like Class.super.defaultMethodName
Just not doing it seems simplier and more obviously correct
than suppressing the warnings in our proguard file.

Issue: #4890

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217675527
2018-10-20 14:16:00 +01:00
andrewlewis
225230b984 Support seeking based on MLLT metadata
Issue: #3241

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217252254
2018-10-20 14:15:43 +01:00
olly
0d169ca456 Remove assertion causing failure on some Samsung devices
The assertion was so weak it probably wouldn't detect genuine
misuse of the DefaultAllocator API, so it seems fine just to
remove it.

We don't really know what happens when the player is allowed to
continue on the affected devices, but hopefully it either "just
works" or fails in a more graceful way.

Issue: #4532

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217113060
2018-10-20 14:15:21 +01:00
olly
8bf8b44799 Fix DashManifestParser to properly skip unknown tags
Robustness fix to make sure we ignore tags with known names, but
which are nested inside of unknown tags. For example we don't want
to parse the third period in:

<Period>...</Period>
<Period>...</Period>
<CustomTag>
  <Period>...</Period>
</CustomTag>

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217101630
2018-10-20 14:15:11 +01:00
andrewlewis
362a21e17b Handle rotation signaled in MKV track name from HTC devices
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=216704331
2018-10-20 14:14:56 +01:00
andrewlewis
db0f107fb3 Project start position for preroll ad to content transitions
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=216675981
2018-10-20 14:14:44 +01:00
olly
4d8b6803af Minor fixes for period clipping
- Always clip to period duration for the last chunk. We previously
  did this only when the last chunk explicitly exceeded the period
  end time. We now also do it when the chunk claims to end at the
  period boundary, but still contains samples that exceed it.
- If pendingResetPositionUs == chunk.startTimeUs == 0 but the
  chunk still contains samples with negative timestamps, we now
  clip them by setting the decode only flag. Previously we only
  clipped such samples if the first chunk explicitly preceeded the
  start of the period.

Issue: #4899

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215763467
2018-10-20 14:13:05 +01:00
tonihei
a35bf5151d Fix updates of loading period and buffered positions in PlaybackInfo.
This makes the following changes to improve consistency among the PlaybackInfo
values:
 1. Update buffered position and total buffered duration after loading period
    is set as both values are affected by a loading period update.
 2. Add copyWithPosition to allow updating the position without resetting the
    loading period.
 3. Forward the total buffered duration to playing position updates
    as it may have changed with the new playing position.

Issue:#4899

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215712328
2018-10-20 14:12:30 +01:00
Oliver Woodman
4347bf0416 Subrip cleanup 2018-10-20 14:11:34 +01:00
ojw28
4d6b008ef6 Merge pull request #4582 from szaboa/feature/4306_srt_position_tags
#4306 - Extract tags from SubRip subtitles, add support for alignment
2018-10-20 14:11:00 +01:00
tonihei
6ee946515a Fix left position for subtitles.
When SubtitlePainter positions the cues centred in the given box, it must add
the left offset of the box to get the correct position.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215535289
2018-10-20 14:07:26 +01:00
tonihei
e2c82a256e Fix positioning of subtitles.
SubtitleView forwards the cue box position to SubtitlePainter. This should be
the position relative to the canvas of the SubtitleView. Currently, however,
we forward the position relative to the parent of SubtitleView. That causes
problems if SubtitleView has a non-zero offset position to its parent.

Issue:#4788

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215535281
2018-10-20 14:07:15 +01:00
tonihei
4921595041 Fix prepare position of DeferredMediaPeriods for windows with non-zero offset.
If we prepare a deferred media period before the actual timeline is available,
we either prepare with position zero (= the default) or with a non-zero
initial seek position.

So far, the zero (default) position got replaced by the actual default position
(including any potential non-zero window offset) when the timeline became known.

However, a non-zero initial seek position was not corrected by the non-zero
window offset. This is fixed by this change.

Related to that, we always assumed that the deferred media period will the
first period in the actual timeline. This is not true if we prepare with an
offset (either because of an initial seek position or because of a default
window position). So, we also determine the actual first period when the
timeline becomes known.

Issue:#4873

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215213030
2018-10-20 14:04:16 +01:00