585 Commits

Author SHA1 Message Date
eguven
45c1e9eef3 Add missing Nullable annotation Player.EventListener.onTimelineChanged
Issue: #4593

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206911927
2018-08-01 13:49:21 +01:00
hoangtc
f08ad55892 Supports seeking for MPEG PS Streams.
This CL adds support for seeking within PS streams by using binary search. For
any seek timestamp, it tries to find the location in the stream where SCR
timestamp is close to the target timestamp, and return this position as the
seek position.

Github: #4476.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206787691
2018-08-01 13:49:21 +01:00
andrewlewis
877837c893 Add audio/eac3-joc to FFmpeg supported formats
If compiled with eac3, audio/eac3-joc stream 5.1 bed-channels
can be decoded. The stream will be decoded as 2-D rather than
3-D.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206296930
2018-08-01 13:49:20 +01:00
tonihei
49ef1f3f8c Fix nullness warnings in Util and Assertions, and provide own castNonNull.
Using our own no-op castNonNull prevents linking into checkerframeworks library.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206152148
2018-07-26 18:27:46 +01:00
hoangtc
d810352f2c Refactor FlacBinarySearchSeeker.
Rewrite FlacBinarySearchSeeker and extract out the core binary search algorithm
into BinarySearchSeeker class so it can be re-used for other formats.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206012900
2018-07-26 18:27:46 +01:00
olly
340d846d9b Remove some files from the nullness blacklist
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205816544
2018-07-24 14:59:21 +01:00
tonihei
ffdc17d0e0 Remove generic type parameter from TransferListener.
All known instances use DataSource as generic type and thus code can be simplified
by removing the generic type altogether.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205798542
2018-07-24 14:56:45 +01:00
sammon
01b69854ff Refactoring DataSpec constructor calls to use DataSpec.withUri() and DataSpec.subrange().
This reduces the number of calls to the DataSpec constructor and minimizes the number of files that need to be updated when adding a new DataSpec parameter (ex: followup []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205719005
2018-07-24 14:52:58 +01:00
tonihei
a67c73650e Add helper method to get uid of timeline period.
This removes the need to populate the entire period for the common usage of
getting the uid from the period.

Also add default implementation to get period by uid.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205638265
2018-07-23 12:22:57 +01:00
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