576 Commits

Author SHA1 Message Date
olly
d2eb3fbefa Cleanup: Remove unnecessary generic types
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205409290
2018-07-23 10:25:23 +01:00
olly
7551d98087 Cleanup: Use lambdas for extractor factories
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205407693
2018-07-23 10:24:09 +01:00
bachinger
1699876aab call stop(true) when media action stop is received
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205377624
2018-07-20 16:09:49 +01:00
andrewlewis
b654806996 Add support for setting companion ad slots
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205373398
2018-07-20 16:07:31 +01:00
tonihei
a076924caa Simplify using DataSource factories without a TransferListener.
Setting the transfer listener on the data source factories is only needed for debug
purposes, logging and for custom bandwidth metering which doesn't use the
player-provided bandwidth meter. As such, it is not compulsary and it should be easy
to set up the data source factory without a transfer listener.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204926083
2018-07-17 20:40:56 +01:00
olly
972fd0ced8 Use maxInputSize for extension decoders where possible
Issue: #3120

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204898773
2018-07-17 20:37:13 +01:00
andrewlewis
a26bb350ee Add IMA and FLAC tests to the codebase
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204302135
2018-07-17 20:10:20 +01:00
Oliver Woodman
05a31dfd24 Format cleanup 2018-07-12 16:08:11 +01:00
tonihei
c3df64f102 Extend TransferListener with onTransferInitializing and additional parameters.
This allows more fine-grained analysis of transfers.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203950327
2018-07-11 14:54:35 +01:00
tonihei
2b1434dfcb Change DataSource.Type to a boolean.
There are only two types at the moment and we can therefore use a boolean.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203937357
2018-07-11 14:53:14 +01:00
anjalibh
e60de62588 Libvpx: Support directly outputting YUV to SurfaceView. This is supposed to use hardware (not GPU) to convert YUV to RGB and overall use less power.
Power Comparison:

TextureView                          1080p         720p
                H264 HW              498, 496      507, 478
                VP9 RGB              1050, 1104    1185, 1152
                VP9 ANativeWindow    1070, 985     700, 674
GLSurfaceView
                VP9 YUV              1075, 1112    716, 635
SurfaceView
                H264 HW              419, 409      397, 377
                VP9 RGB              1044, 1139    654, 671
                VP9 ANativeWindow    975, 835      617, 623
                VP9 MediaCodec       683, 679      488, 476

Measures average current drawn mAH on a Nexus 6 at full brightness from time t=3 to t=95 seconds. The same clip was used for all tests. Two measurements were taken for each category.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203847744
2018-07-10 14:01:50 +01:00
tonihei
abb4d6ff70 Use correct generics type bounds for TransferListener in MediaSources.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203260699
2018-07-06 14:32:46 +01:00
tonihei
55ce085a0d Add transferInitializing to BaseDataSource.
This allows implementations to notify when the transfer is about to be started.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203102117
2018-07-06 14:24:21 +01:00
tonihei
985160a47d Use BaseDataSource for all internal leaf data sources.
This allows all leaf data sources (i.e. ones which do not forward the requests
to other data sources) to accept multiple listeners.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203097587
2018-07-06 14:23:02 +01:00
tonihei
98afaa60d0 Forward TransferListener to media sources.
In the future, this allows to register the BandwidthMeter (managed by the player)
as a listener to all media transfers related to this media source.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202643946
2018-07-03 11:47:15 +01:00
andrewlewis
f94cef43e8 Fix ImaAdsLoader @Override for unreleased method
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202625377
2018-06-29 12:08:30 +01:00
borrelli
4e35d1a47b MediaSession extension: Allow setting of custom errors.
Add methods setCustomErrorMessage(@Nullable CharSequence message)
and setCustomErrorMessage(@Nullable CharSequence message, int code)
to MediaSessionConnector to report errors to the MediaSession
which are not player errors.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202352083
2018-06-28 16:18:50 +01:00
nickchavez
6b9fb456a1 Roll forward of CL 201223315 with ExoPlayer IMA extension fix
Original change by nickchavez@nickchavez:andcsvol:3257:citc on 2018/06/19 12:41:18.

Add VolumeProvider interface to VideoAdPlayer and VideoStreamPlayer.
  - Send volume on videoDisplay.start so that it can be sent to OMID.
  - Add unit tests for AdPlayerCalback and ExoPlayerVideoAdPlayerImpl.
  - Add functional tests for client side and DAI volume updates.

Add onVolumeChanged() to VideoAdPlayerCallback and VideoStreamPlayerCallback.
  - Implement volume updates for SDK owned video player.
  - Remove mute/unmute events, which are handled in JS instead (like iOS).
  - Collect volume changes from client side and DAI video players.

External: Publisher players will now have to implement getVolume() and onVolumeChanged() for custom video players.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202324636
2018-06-28 16:18:50 +01:00
bachinger
5dd9ef0086 add invalidate methods for playback state, metadata and queue of the media session
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202136530
2018-06-28 16:18:50 +01:00
andrewlewis
9a6a72521f Make ImaAdsLoader robust to calls after it's released
Issue: #3879

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202100576
2018-06-28 16:18:50 +01:00
andrewlewis
57b7e18b23 Add a test for preroll ad playback with ImaAdsLoader
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202080962
2018-06-28 16:18:50 +01:00
tonihei
156e2317cc Deprecate Player.DefaultEventListener in favor of default no-ops in interface.
The DefaultEventListener was added for selective overrides. Now that Java 8
support is enabled, these selective listener overrides can be implemented
more easily and more flexible using default methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201695490
2018-06-22 17:49:25 +01:00
andrewlewis
ddda4a026d Add AudioComponent to the Player interface
This will make it possible for ImaAdsLoader to access the player volume when
used with SimpleExoPlayer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201664189
2018-06-22 17:40:28 +01:00
andrewlewis
38096fb734 Add some Robolectric tests for ImaAdsLoader
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201484853
2018-06-22 17:35:22 +01:00
bachinger
62ee13b11d allow apps to set custom metadata
[]

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201350930
2018-06-20 18:06:57 +01:00
tonihei
4f2b596062 Allow to specify player looper at the time of ExoPlayer creation.
Currently, the looper of the thread the player is created on is used (or the
main looper if this thread doesn't have a looper). To allow more control over
the threading, this change lets users specificy the looper which must be used
to call player methods and which is used for event callbacks.

Issue:#4278

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201331564
2018-06-20 18:05:52 +01:00
andrewlewis
7b10e637e7 Support mu-law and A-law PCM with ffmpeg
Issue: #4360

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200186465
2018-06-18 11:12:10 +01:00
tonihei
c1181000f9 Correctly report buffered position for multi-period window.
Currently only the buffered position in the current media period can be queried.

To achieve this, we save the buffered positions of all MediaPeriods to the
PlaybackInfo together with a list of MediaPeriodIds. ExoPlayerImpl can then
determine the correct buffered position for multi-period windows and windows
with midroll ads.

In addition, this change adds two new convenience methods to the Player interface
to query the total buffered duration across all windows and to get the buffered
duration of the content while playing an ad.

Issue:#4023

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200041791
2018-06-18 11:08:22 +01:00
olly
8e65696f02 Update forced dependencies to fix release
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199758072
2018-06-18 10:57:43 +01:00
aquilescanta
bb684b528e Promote getResponseHeaders to DataSource
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199607604
2018-06-18 10:51:31 +01:00
andrewlewis
199f686fe1 Set METADATA_KEY_TITLE
Issue: #4292

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199478946
2018-06-06 19:02:33 +01:00
aquilescanta
17ab9da5b6 Enable java 8 for some missing projects
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199265539
2018-06-05 12:44:56 +01:00
andrewlewis
9852af7372 Don't advertise support for video/mpeg ads
Issue: #4297

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198536888
2018-06-05 12:26:21 +01:00
andrewlewis
c7081ed764 Update IMA and Play Services
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198536438
2018-06-05 12:25:22 +01:00
tonihei
a98d8fedfa Fix nullness errors in at least one file per module to be able to use test.
Some module/extensions couldn't use the static test so far because all files
needed to be put on the blacklist. To ensure the test it set up for all
modules, this fixes at least one file for each of the modules.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197731449
2018-06-05 12:17:54 +01:00
andrewlewis
5140341094 Make ffmpeg build instructions repeatable
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197531723
2018-05-22 10:28:26 +01:00
Andrew Lewis
203f737b0a
Merge pull request #4242 from ened/patch-2
[extension-ffmpeg] repeatable build instructions
2018-05-22 10:13:09 +01:00
hoangtc
972304f16b Supports seeking for FLAC files without a SEEKTABLE.
Currently, ExoPlayer only supports seeking for FLAC files with a SEEKTABLE.
This CL adds support seeking for cases when the FLAC files do not have a
SEEKTABLE by searching for individual frames within the file using binary
search.

Github: #1088.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196816398
2018-05-18 15:04:55 +01:00
hoangtc
8a0af84c42 Supports seeking for FLAC stream using binary search.
Added FlacBinarySearchSeeker, which supports seeking in a FLAC stream by searching for individual frames within the file using binary search.

Github: #1808.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196587198
2018-05-18 14:28:18 +01:00
andrewlewis
36d24c7aaa Catch all errors in loadAd
Issue: #4231

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196180271
2018-05-12 18:52:57 +01:00
olly
f7d4fa8829 Update moe equivalence
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196024195
2018-05-12 18:49:30 +01:00
Sebastian Roth
8d5cab8acf
[extension-ffmpeg] repeatable build instructions
Ensure the build instructions are repeatable once the ffmpeg repository is checked out.
2018-05-11 16:53:41 +08:00
tonihei
81c3769880 Add missing @Nullable to equals implementations.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195947382
2018-05-09 21:23:45 +01:00
Justin Yorke
d709df8e1a
Merge remote-tracking branch 'upstream/dev-v2' into dev-v2 2018-05-08 13:28:46 -07:00
olly
5adfd7e9d9 Simplify OkHttp extension build.gradle
The lint workaround and org.json exclusion aren't needed any more.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195557066
2018-05-07 07:19:42 +01:00
andrewlewis
2a06e00201 Expose ad load errors via MediaSourceEventListener
The old event listener on AdsMediaSource is deprecated, in favor of
reporting in the normal way (via MediaSourceEventListener).

Add AdLoadException with information on what ad/ads failed to load.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195426144
2018-05-07 07:08:33 +01:00
andrewlewis
d5034ca889 Set interrupted flag when throwing InterruptedIOE
This avoids the interrupted flag being lost if the exception
is handled as an IOException.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195366244
2018-05-07 07:04:09 +01:00
olly
b23eabd939 Add error and buffering views to PlayerView
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195203362
2018-05-07 06:49:47 +01:00
olly
c8ec77ef96 Make MediaSessionConnector use getPlaybackError
It's no longer necessary to stash a reference to the
error yourself. This also correctly handles the case
where setPlayer is called with a player that's already
in an error state.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194828387
2018-05-07 06:36:43 +01:00
olly
c68e00e28f Fix crash in CronetEngineWrapper
Cronet now returns an unmodifiable list, so we need to copy it

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194790506
2018-05-07 06:32:59 +01:00