1499 Commits

Author SHA1 Message Date
olly
42c9b244ee Make context non-optional in AudioFocusManager
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217897796
2018-10-24 18:20:54 +01:00
tonihei
6977fdbc1d 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:17:33 +01:00
olly
ca4b5d0a0d Make context non-optional for DefaultBandwidthMeter
- Added ability to override the DefaultBandwidthMeter network type.
- These methods currently only work properly if called before the
  meter is used, but the plan is for them to be handled in the same
  way as internally detected network changes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217887019
2018-10-24 18:15:53 +01:00
tonihei
4c6507e7a0 Remove deprecated MediaSource.prepareSource.
This method only ensured backward compatibility while the new version was not
public yet. Now ExoPlayer 2.9.0. is public, this workaround can be removed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217881691
2018-10-24 18:14:09 +01:00
olly
bf57d44023 Update VR video player sample app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217874381
2018-10-24 18:12:29 +01:00
eguven
8f3c3e2841 Add GlUtil createBuffer overload which doesn't copy values
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217846755
2018-10-24 18:10:43 +01:00
tonihei
70ccbc6eb8 Fix review comments
See https://github.com/google/ExoPlayer/pull/5004
2018-10-24 11:47:36 +02:00
Patrik Åkerfeldt
8c5703e931 Provide http status message to InvalidResponseCodeException
When response code alone is not enough to distinguish error responses, the http status message is helpful.
2018-10-23 16:51:46 +02:00
Yuki312
9d114b1ccb fix checkIdleRequirement 2018-10-23 17:13:26 +09:00
olly
1ef3efaa90 Automated g4 rollback of changelist 217356705.
*** Reason for rollback ***

Photos regression is resolved by []

*** Original change description ***

Automated g4 rollback of changelist 217189082.

*** Reason for rollback ***

Broke photos (b/117818304)

*** Original change description ***

Add ExoPlayer.setForegroundMode

Issue: #2826

***

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217773278
2018-10-18 23:39:51 +01:00
olly
3805717026 Decouple dummySurface lifespan from codec lifespans
I don't think there's any particular reason for releasing
dummySurface when we release the codec. It seems to make
more sense to decouple the two, and treat a dummySurface as
a resource that should be released on reset.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217711788
2018-10-18 23:39:51 +01:00
olly
1c6abc8b03 Set output on surface in all states
setSurface only sets the output surface on the codec if the
renderer is enabled or started. This was fine in the past
because the codec was always null in other states, however
the recent codec reuse work means this is no longer the case.

The output surface should always be set if the codec is
non-null. If setting the surface requires releasing the codec
instance, we should only instantiate the new instance if
enabled or started. This is in line with what onDisabled does
if flushing requires releasing the codec

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217676434
2018-10-18 23:39:51 +01:00
olly
05a98a7b79 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-18 23:39:51 +01:00
eguven
86fdcb08d8 Fix documentation confusion in MediaChunkIterator subclasses
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217505571
2018-10-18 23:39:51 +01:00
falhassen
423a954e1b Automated g4 rollback of changelist 217189082.
*** Reason for rollback ***

Broke photos (b/117818304)

*** Original change description ***

Add ExoPlayer.setForegroundMode

Issue: #2826

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217356705
2018-10-18 23:39:31 +01:00
andrewlewis
ee02c6789a Support seeking based on MLLT metadata
Issue: #3241

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217252254
2018-10-18 23:20:54 +01:00
olly
bfd67992f4 Add ExoPlayer.setForegroundMode
Issue: #2826

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217189082
2018-10-18 23:19:09 +01:00
olly
dbf5b073a6 Network type cleanup
1. Remove option to pass null context to Util.getNetworkType. IMO it's
   clearer for the caller to just not call the method in this case.
2. Stop using deprecated DefaultBandwidthMeter.Builder constructor in
   all but one place.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217147091
2018-10-18 23:17:16 +01:00
olly
6e7b41512f No-op cleanup of DefaultDrmSessionManager
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217139869
2018-10-18 23:15:34 +01:00
olly
6fb8f66ba6 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-15 11:14:56 +01:00
olly
ba6a118998 Retain decoder instance after the renderer is disabled
Issue: #2826

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=216852679
2018-10-15 09:35:23 +01:00
olly
842f622d29 Allow codec flushing without re-initialization
For decoder reuse, we want disable() to flush the decoder. However,
if the flush needs to release the decoder for some reason, it seems
non-ideal to immediately re-initialize it. Re-initialization can
also throw ExoPlaybackException, which we don't want for disabling.

This change allows a variant of flush that wont re-initialize the
decoder if it has to be released, which will be used from disable().

Issue: #2826

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=216834862
2018-10-15 09:33:37 +01:00
andrewlewis
42c3ff3934 Handle rotation signaled in MKV track name from HTC devices
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=216704331
2018-10-15 09:31:51 +01:00
andrewlewis
81a9293072 Project start position for preroll ad to content transitions
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=216675981
2018-10-15 09:30:06 +01:00
tonihei
0a7745bc03 Fix some random Android Studio warnings.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215904019
2018-10-15 09:26:36 +01:00
olly
c5f9ad9f8b 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-15 09:23:00 +01:00
olly
cc7684d09f Introduce Renderer.reset
- It's a no-op for now
- Renderers that want to support retaining resources will move
  some functionality from their disable() implementations into
  reset()
- ExoPlayerImplInternal will be updated to not always call reset()
  immediately after disable(), which is what will enable resources
  to actually be retained.

Issue: #2826

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215729783
2018-10-15 09:19:30 +01:00
tonihei
d4b87cdc23 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-15 09:17:34 +01:00
tonihei
9ca6544311 Simplify some buffered position related code.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215704344
2018-10-15 09:14:04 +01:00
Oliver Woodman
7849a5eb52 Subrip cleanup 2018-10-03 22:19:13 +01:00
ojw28
16fe67bfce
Merge pull request #4582 from szaboa/feature/4306_srt_position_tags
#4306 - Extract tags from SubRip subtitles, add support for alignment
2018-10-03 22:15:11 +01:00
eguven
645f08af73 Prevent binding to DownloadService
DownloadService isn't designed to be bound.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215552423
2018-10-03 22:12:02 +01:00
eguven
9f8c22d719 Make it possible to use CacheKeyFactory with CacheDataSourceFactory and DownloaderConstructorHelper
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215541062
2018-10-03 22:10:30 +01:00
tonihei
4386d5d466 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-03 22:05:52 +01:00
tonihei
a8b851ce34 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-10-03 22:02:47 +01:00
tonihei
8b2d998440 Remove deprecated ExoPlayer members with same name as non-deprecated version.
For example, using ExoPlayer.STATE_IDLE falls back to the Player.STATE_IDLE
automatically and thus there is no need to keep the deprecated members.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215363841
2018-10-03 22:01:17 +01:00
olly
687756ed31 Update moe equivalence
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215261807
2018-10-03 21:59:44 +01:00
Arnold Szabo
56c7e1ff47 #4306 - grouping line/lineAnchor and position/positionAnchor assignments, setting Cue's textAlignment to def value - null 2018-10-02 18:45:06 +03:00
Arnold Szabo
75a7385bbb #4306 - extends test case with line and position anchor verifications 2018-10-01 23:16:48 +03:00
Arnold Szabo
fc5eb12e79 #4306 - breaking after the first alignment tag is found 2018-10-01 22:45:15 +03:00
ojw28
b4ba913008
Merge pull request #4886 from talklittle/protected-audiotrackscore
Make DefaultTrackSelector.AudioTrackScore protected
2018-10-01 20:05:08 +01:00
eguven
7940fdfc5e Fix DownloadManager.TaskState javadoc
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215213255
2018-10-01 19:36:06 +01:00
tonihei
46731cdd1d 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-01 19:34:29 +01:00
tonihei
90ca3716aa Improve MediaPeriodHolder documentation and member access.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215205796
2018-10-01 19:32:49 +01:00
tonihei
d97d289b6b Clarify and improve TrackSelection .enable() and .disable() calls.
These two methods are meant to indicate to the track selection that it's
started or stopped being used. This is helpful to schedule background tasks
related to track selection (e.g. register network change listeners etc.).
This intention is not clearly stated in the method docs.

Also, all track selections of all prebuffered periods stay enabled in
parallel at the moment. As the whole purpose of these methods is to know
whether dynamic updates via updateSelectedTrack may happen, it's better to
only enable track selections of the current loading media period. That's
similar to how we always forward the loading track selections to the
LoadControl.

This change:
 1. Improves the JavaDoc of TrackSelection.
 2. Disables track selections if loading moves to another period.
 3. Reenables track selection if loading moves back to a previous period.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215199987
2018-10-01 19:31:09 +01:00
andrewlewis
f59f557704 Use recommended way of checking for TV
Switch to the recommended way of checking whether the app is running on a TV
device.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215177587
2018-10-01 19:26:00 +01:00
andrewlewis
5d5b641c1d Extend physical display size workaround for ATVs
Extend Sony workaround up to and including Oreo.

Due to a platform issue the Display API couldn't report 1080p UI
and 4k SurfaceView support until Oreo. Since Oreo it is still
common for devices to misreport their display sizes via Display,
so this change switches to using system properties up to and
including Pie.

On Pie treble may prevent writing sys.display-size so check for
vendor.display-size instead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214987203
2018-10-01 19:24:17 +01:00
tonihei
5c8dabade6 Add @Documented to @IntDef and @StringDef annotations.
This makes the annotations appear in the generated JavaDoc.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214952419
2018-10-01 19:22:34 +01:00
Andrew Shu
9b111fbd95 Make DefaultTrackSelector.AudioTrackScore protected
This allows selectAudioTrack() to be overridden.
2018-09-27 18:37:21 -07:00
olly
028f3e6438 Don't recreate the audio decoder if Format is unchanged
More specifically, if the parts of the Format that are used
for decoder configuration are unchanged.

Issue: #2826

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214791234
2018-09-27 19:53:03 +01:00