2356 Commits

Author SHA1 Message Date
andrewlewis
4373e63fac Make the period and initial window positions match for all HLS streams
Before this change, HlsMediaSource timelines had a period starting at the epoch.
For VOD streams the window position in the period was the program date time.

This change makes period and initial window positions match. For live streams
the window position advances as segments are removed, so its position in the
period is the difference between the initial program date time and the program
date time of the latest playlist.

This also makes it possible to insert ads in VOD HLS content with program date
time, as the period and window are now aligned.

Issue: #3865

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187590948
2018-03-02 09:30:40 +00:00
hoangtc
a3c8062e52 Add support for listening to AspectRatioFrameLayout's aspect ratio update
Currently, AspectRatioFrameLayout may need to resize itself if it could not
satisfy a target aspect ratio. User may want to know when this happen, or
whether this can happen, so they can update their UI accordingly. For
example: show/hide a button to toggle different resize mode only when the
aspect ratio of the view and the content is very different.

GitHub: #3736

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187484241
2018-03-02 09:24:41 +00:00
hoangtc
fcb796a80c Migrate ExoPlayer Gradle build files.
- Change 'compile' configuration (deprecared) to using 'implementation'
and 'api' configurations instead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187311778
2018-03-02 09:20:02 +00:00
tonihei
2f4a3d2e5d Replace ConcatenatingMediaSource with DynamicConcatenatingMediaSource.
The non-dynamic media source has a strict subset of features of the dynamic one and
thus can be replaced.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187299432
2018-03-02 09:16:00 +00:00
andrewlewis
38914f0ba5 Allow clipping offset windows
ClippingMediaSource provides a timeline where the period and window have the
same start/end positions, so when clipping a child timeline with a non-zero
offset between the window and period it is necessary to clear the offset then
apply the offset to the start/end positions used in the ClippingMediaPeriod.

Also add a message to clipping exceptions.

Also fix adjustment of seeks to the start of the clipped view.

Issue: #3888

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187292506
2018-03-02 09:12:54 +00:00
tonihei
b2c445776a Allow parallel reuse of media sources.
This is achieved by adding a BaseMediaSource which keeps a reference count of the
number of times the source has been prepared and forwards to the actual implementations
only once, such that only minimal changes are needed for each media source.

Issue:#3498

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187186691
2018-03-02 09:08:28 +00:00
olly
69496eb17e Bump to 2.7.0 and prepare release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=186200840
2018-02-19 13:24:51 +00:00
andrewlewis
6c3b677ddb Catch exceptions in all IMA callbacks
If an exception is thrown in an IMA callback it crashes the process with lots of
logging from WebView (including several stack traces, etc.). This change wraps
ImaAdsLoader code that might throw, skips any remaining ads (as the errors are
not recoverable, in general) and notifies a new load error callback so that the
application can implement its own handling. The intention is to make the loader
robust to unexpected requests from IMA and avoid crashes.

Also handle IMA loading an ad in an ad group that has no available ads. In rare
cases IMA will try to load an ad for which an error was previously notified, so
this drops those load requests allowing playback of the content to continue.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185985850
2018-02-19 13:20:15 +00:00
aquilescanta
8ffd40ab9a Add little endian and 14-bit mode support for DtsReader
Issue:#3340

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185973510
2018-02-16 12:11:46 +00:00
andrewlewis
da08b65f3b Fix handling of ad tags with only preroll and postroll ads
Content progress is only polled if there are midroll ad groups. If the ad tag
had only preroll/postroll ads, the pending content position was not provided to
IMA, which meant that the postroll ad could never play.

Only set the pending content position if there are midroll ads.

Issue: #3715

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185680803
2018-02-16 12:05:07 +00:00
aquilescanta
1d4bc7dda7 Add initial support for EXT-X-GAP
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185676652
2018-02-16 12:03:49 +00:00
olly
55f2b09340 Use stable order for subtitle buffers with identical timestamps
Issue: #3782

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185673731
2018-02-16 12:01:19 +00:00
aquilescanta
4d26b316cc Make ID3 GEOB frames parsing more robust
Issue:#3792

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185668919
2018-02-16 11:58:52 +00:00
andrewlewis
43cfb08207 Handle VAST_LINEAR_ASSET_MISMATCH
This error marks the current ad group as unplayable.

Issue: #3801

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185663472
2018-02-16 11:57:22 +00:00
tonihei
09de29d534 Add Meizu M5C, Lenovo K4 Note, and Sony Xperia E5 to surface workaround.
Also added comments for all existing devices for easier reference.

Issue:#3835
Issue:#3236

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185661900
2018-02-16 11:56:08 +00:00
andrewlewis
5b6344a006 Skip ads for which the media failed to prepare
Also make ad group skipping more robust. After calling onError for an ad, IMA
will sometimes trigger an ad group load error, so this needs to be handled in a
way that allows some ads to be loaded already for the ad group.

This change also fixes calculation of the expected ad index to take into account
whether the position is being faked to trigger loading an ad or is the actual
player position.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185655844
2018-02-16 11:55:02 +00:00
andrewlewis
b9f9232b9d Release Extractors on the loading thread
Releasing the player released the internal playback thread once renderers were
released. Releasing a MediaPeriod queued a Loader.ReleaseTask on the loading
thread which would post back to the playback thread. If the playback thread had
been quit by the time this happened, the release task wouldn't be run.

Release on the loading thread instead of the playback thread. This avoids
needing to block releasing the player until the loading threads have ended, and
ensures that release tasks will run eventually. As part of this change,
ExtractorMediaPeriod's call to Extractor.release will now run on the loading
thread (which means that all Extractor methods are called on that thread) and
other cleanup in ReleaseCallback will run on the loading thread instead of the
playback thread.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185651320
2018-02-16 11:53:51 +00:00
olly
2dab21ab4e Add Y611 to setOutputSurfaceWorkaround
Issue: #3724

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185548632
2018-02-16 11:52:37 +00:00
andrewlewis
4cb2d255ab Fix handling of ad tags where ad groups are out of order
IMA's cue points may not be in order, so sort them. It looks like IMA events use
time ordered ad indices, so it is not necessary to map between the original cue
point order and the time order.

Issue: #3716

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185495798
2018-02-16 11:48:58 +00:00
andrewlewis
34a318d348 Check sys.display-size on Philips ATVs
Device models are from
https://support.google.com/googleplay/answer/1727131?hl=en. It looks like among
these devices Build.MANUFACTURER can be set to either "PHILIPS" or "Philips",
based on looking at internal bug reports.

Issue: #3807

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185121182
2018-02-16 11:39:15 +00:00
andrewlewis
0384ff07ef Add issue link to release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184844870
2018-02-08 14:49:00 +00:00
andrewlewis
aa63ad3af0 Handle LOG AdEvents for ad group load errors.
If IMA loads an empty VAST document for an ad group it notifies via a LOG
AdEvent. Handle the event by updating the AdPlaybackState accordingly.

The error state will be handled in ExoPlayerImplInternal in a separate change.

Issue: #3584

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184516585
2018-02-08 14:49:00 +00:00
eguven
b3da82dc1c Open source DownloadService, DownloadManager and related classes
Issue: #2643

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184844484
2018-02-08 14:47:54 +00:00
aquilescanta
677fc291cf Use long for HLS media sequences
Issue:#3747

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183366339
2018-02-01 14:25:01 +00:00
aquilescanta
8716c0ee32 Implement a best-effort DRM session acquisition approach
Try to delay failure for as long as possible. That is, propagate
DRM session failures only after an encrypted buffer arrives or clear
sample playback without session is not allowed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183076348
2018-01-24 19:56:41 +00:00
Oliver Woodman
d098effa69 Cleanup merged pull requests 2018-01-24 10:51:05 +00:00
olly
a1274591b1 Defer retries for progressive live audio streams
Issue: #1606

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183058160
2018-01-24 10:36:26 +00:00
andrewlewis
d240249b6c Work around missed ad LOADED events
Track the expected next ad group index so that it can be used as a fallback if
IMA does not notify the ad index via a LOADED event.

Also do some miscellaneous minor cleanup (including logging all LOG events, and
logging at debug level where appropriate).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183048612
2018-01-24 10:33:29 +00:00
olly
196f5f7917 Include P8 in setOutputSurfaceWorkaround
Also disable use of dummy surface for devices that require the
workaround. It's only useful in the case that we can use
setOutputSurfaceWorkaround, so if it's disabled the dummy surface
has no purpose (it actually makes things worse by consuming past
the key-frame prior to the current position, which doesn't happen
if you have no surface at all).

Issue: #3724

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182750068
2018-01-23 19:20:16 +00:00
olly
4828f275c7 Make play button behave differently in IDLE and ENDED states
- In IDLE, the button will now call a preparer. This allows
  removal of the separate retry button from the demo app.
- In ENDED, the button will seek back to the default position
  and play.
- Behavior is made consistent with LeanbackPlayerAdapter.

Issue: #3689

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182506855
2018-01-23 19:07:52 +00:00
olly
68387f98ee Simplify demo app by moving EventLogger into core
It seems good to have EventLogger available from the library.
In particular because when app developers use it and then
submit bug reports, it makes it much easier to work out what
happened. It will also allow EventLogger to be used across
our (now multiple) demo apps.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182389407
2018-01-23 19:03:31 +00:00
olly
c577d9d351 Let SimpleExoPlayerView/LeanbackPlayerAdapter bind with any Player
Also sanitize naming (PlayerView/PlayerControlView).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182364487
2018-01-23 19:00:20 +00:00
aquilescanta
605aeb3a42 Make id3 context usage robust against container format changes
Issue:#3622

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182363243
2018-01-23 18:58:47 +00:00
aquilescanta
0697fb3955 Fail on HLS+TS loss of sync
Issue:#3632

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182202289
2018-01-23 18:51:40 +00:00
aquilescanta
be304486e0 Fix HLS' mime type propagation
Issue:#3653

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182064250
2018-01-23 18:47:13 +00:00
hoangtc
6749623cd1 Handle DASH `emsg' events targeting player.
For live streaming, there are several types of DASH `emsg' events that directly
target the player. These events can signal whether the manifest is expired, or
the live streaming has ended, and should be handle directly within the player.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182034591
2018-01-23 18:42:49 +00:00
Oliver Woodman
141f3aa836 Simplify PGS captions + sync with internal tree 2018-01-15 14:13:30 +00:00
tonihei
f977ba256f Add ad insertion discontinuity reason.
This it to distinguish between actual period transitions and the
transitions occuring to and from ads within one timeline period.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181606023
2018-01-15 11:50:15 +00:00
olly
ff1bb2f702 Apply SeekParameters to DASH + SmoothStreaming playbacks
Issue: #2882

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181314086
2018-01-15 11:34:48 +00:00
andrewlewis
67d4626701 Add support for non-Extractor content MediaSources in IMA demo
Issue: #3676

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181140929
2018-01-15 11:29:11 +00:00
olly
d533a83ae4 Partial revert of DRM fixes
----------------------------------
Original change description:

DRM fixes

- Parse multiple kids from default_KID. It's specified as a whitespace
  separated list of UUIDs rather than a single UUID.
- Opportunistically proceed with playback in cases where the manifest
  only defines a single SchemeData with the common PSSH UUID. In such
  cases the manifest isn't saying anything about which specific DRM
  schemes it supports.

Issue: #3630

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181137621
2018-01-15 11:27:48 +00:00
hoangtc
5364962dca Automatically apply rotation for TextureView in SimpleExoPlayer.
If SimpleExoPlayer is using TextView as output, we can handle video rotation by
automatically applying a matrix transformation to the TextureView when we have
this information available from the video (from video's metadata).

GitHub: #91

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180925571
2018-01-15 11:20:41 +00:00
eguven
373935aeb6 Make CacheDataSource detect cache availability change
In certain conditions CacheDataSource switch to reading from upstream
without writing back to cache. This change makes it detect the change of
these conditions and switch to reading from or writing to cache.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180901463
2018-01-15 11:16:25 +00:00
andrewlewis
8e8e53c42d Add support for Dolby TrueHD passthrough
Issue: #2147

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180678595
2018-01-04 15:50:59 +00:00
olly
7314e9bddc DRM fixes
- Parse multiple kids from default_KID. It's specified as a whitespace
  separated list of UUIDs rather than a single UUID.
- Opportunistically proceed with playback in cases where the manifest
  only defines a single SchemeData with the common PSSH UUID. In such
  cases the manifest isn't saying anything about which specific DRM
  schemes it supports.

Issue: #3630

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180675056
2018-01-04 15:49:34 +00:00
olly
a29fb7b989 Update release notes to cherry-pick 32-bit WAVE support
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180661355
2018-01-04 15:46:49 +00:00
olly
884f64017f Typo fix
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180543378
2018-01-03 13:34:36 +00:00
olly
88abb153bb Force audio renderers to report same position when not started
Whilst the previous behavior was WAI and had the advantage of
updating the position to be more exact when known, there were
a couple of disadvantages:

1. If seeking to the very end of a period in a playlist when
   paused, the position adjustment could trigger a position
   discontinuity to the next period.
2. We de-duplicate seeks to the current playback position.
   The position adjustment can prevent this from being
   effective. This is particularly important with the new
   SeekParameters support. When seeking to nearest sync point
   it's often possible to de-duplicate seeks, but we cannot
   do so if the playback position adjusts away from the sync
   point's time.

Issue: #2439
Issue: #2882

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180540736
2018-01-03 13:34:36 +00:00
eguven
8f1ef6a29a Typo fixes
Issue:#3631

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180197723
2018-01-03 13:34:36 +00:00
andrewlewis
f2bb2d27be Add support for extracting 32-bit float WAVE
Issue: #3379

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179925320
2018-01-03 13:34:36 +00:00