1237 Commits

Author SHA1 Message Date
Dmitry Kostyrev
db88222660 Opt out of using DummySurface on Asus Zenfone Go
Issue: #4460
2018-07-03 11:46:23 +03:00
olly
557fa17945 Simplify DefaultTrackSelector documentation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202623116
2018-06-29 12:07:13 +01:00
olly
f934df7780 Improve DefaultTrackSelector documentation
It's quite hard to find the defaults currently. Placing them
on each variable makes them easier to find.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202495929
2018-06-29 12:06:15 +01:00
Oliver Woodman
94784249eb Cleanup 2018-06-28 17:51:05 +01:00
ojw28
7d489a8893
Merge pull request #4441 from murdly/dev-v2
opt out of using DummySurface on specific Fire TV device
2018-06-28 16:22:28 +01:00
hoangtc
4f57c46560 Do not discard TS PES payload readers on Seek for TSExtractor in non-HLS mode.
Currently, we are discarding all TS PES payload readers on seek. This is to fix
a bug that makes PES stream readers read packets inconsistently after seeking (first
time, the readers ignore all packets before PMT, second seek time after PMT is
read, the readers will read all packets before PMT).
This works fine if we don't support seeking to arbitrary position within the TS
stream. However, this may lead to a problem if we want to support seeking, because
some TS streams only have track format at the begining of the stream, and reseting
the payload readers after seeking can lead to track format not available anymore.

This change reverts the original fix (do not discard TS PES payload readers on seek
anymore). Instead, in non-HLS mode, after we have processed all PMTs packets in
the strea, we will re-seek to the beginning and perform readin again to make sure
the result will be consistent across multiple seeks. This is a prepare step to
support seeking in TS streams.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202466233
2018-06-28 16:18:50 +01:00
tonihei
dd14500eba Add url (after redirection) to LoadEventInfo.
This url is readily available when creating media source events (from the
data source) but so far not published to external listeners. This change
adds a new field to LoadEventInfo which corresponds to DataSource.getUri().

Issue:#2054

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202459049
2018-06-28 16:18:50 +01:00
tonihei
236eb5cef6 Add some leeway for finding additional tracks in PsExtractor.
Currently we immediately stop searching after we found one video and one
audio track. This change adds some leeway to detect additional tracks.

Issue:#4406

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202455491
2018-06-28 16:18:50 +01:00
aquilescanta
fc2168eb61 Add an errorCount argument to onLoadError
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202313695
2018-06-28 16:18:50 +01:00
eguven
93cbae5bff Use default Deserializers if non given to DownloadManager
Also moved shared code to SegmentDownloadAction between its subclasses.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202294880
2018-06-28 16:18:50 +01:00
tonihei
65a58ffcb5 Add DRM workaround for Asus Zenfone 2.
Issue: #4413

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202277924
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
Keith Thompson
8342b1dae4
Add withSkippedAd method to AdPlaybackState. Currently it is only possible to skip entire ad groups but not individual ads within a given ad group. 2018-06-27 16:19:22 +01:00
Arek Karbowy
99d3e8f1d3
opt out of using DummySurface on specific Fire TV device 2018-06-27 11:29:04 +01:00
aquilescanta
a1f89bec0d Allow configuration of the Loader retry delay
Issue:#3370

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201996109
2018-06-25 22:38:29 +01:00
hoangtc
eb8c686243 Fix a bug with MetadataRetriever getMedatadata query.
When getMedatadata from an ExtractorMediaPeriod, due to the MediaPeriod refreshing its Timeline twice, the MetadataRetriever may wrongly reset periodIndex of the current trackGroup to C.TIME_UNSET, which makes it unable to handle subsequent metadata queries.

This CL changes the MetadataRetriever to keep track of periodUid of the current trackGroup instead of period index. PeriodUid is not changed on timeline refreshing, so is not prone the existing problem.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201969350
2018-06-25 22:37:15 +01:00
hoangtc
de57f09801 Refactor TS Extractor.
Refactor sniff(), and extract a few methods out from read() to make it look clearer. This CL does not change any functionality.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201933207
2018-06-25 22:35:55 +01:00
tonihei
24c21a292f Deprecate DefaultAnalyticsListener in favor of default no-ops in interface.
The DefaultAnalyticsListener 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=201931770
2018-06-25 22:34:35 +01:00
olly
a407c028d4 Wait for DRM keys before codec configuration on FireOS devices
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201695876
2018-06-22 17:50:33 +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
olly
78d83304af Extract scheme specific data from PSSH for some FireOS devices
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201679215
2018-06-22 17:45:23 +01:00
olly
04d1d5a8b6 Add some FireOS workarounds for max input buffer size limitations
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201678686
2018-06-22 17:44:16 +01:00
olly
2043d90a73 Enable EOS workaround for FireTV Gen 2
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201678261
2018-06-22 17:43:12 +01:00
tonihei
fcc0bd403f Report uri and response headers of chunks.
Both values are helpful for event reporting, but are only available while
the data source is open. Similar to bytesLoaded, they need to be reported
through the Chunk.

Issue:#2054
Issue:#4361

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201664907
2018-06-22 17:41:51 +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
a610857017 Fix download cancellation
Issue: #4403

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201525284
2018-06-22 17:37:41 +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
andrewlewis
8ab8b86a7b Fully clean up resources in EGLSurfaceTexture
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201376315
2018-06-22 17:33:56 +01:00
hoangtc
8dbec616c4 Use isAtLeast() instead of (>=) to make the tests clearer.
Replace assertThat(a >= b).isTrue() with assertThat(a).isAtLeast(b) because it
reads more natural, and in case the assertion fails, it will print out the
actual values to help debugging.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201371993
2018-06-20 18:34:22 +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
a75b5fb6a9 Pass through all ID3 internal data from udta
Also switch from using a CommentFrame to a new InternalFrame type for ID3 data
stored with ID '----', to distinguish internal data from actual ID3 comments.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201315254
2018-06-20 18:03:01 +01:00
hoangtc
3d3ab1f72e Add VideoRendererOutputCapturer
Added a capturer that can capture output from video renderer into bitmaps. This
class uses SurfaceCapturer to setup a surface, then configures this surface as the
output for a video renderer. Once the output is set, it will capture the
output frames from the video renderer and return them as bitmaps.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201148184
2018-06-20 18:00:03 +01:00
Itay Kinnrot
cd9041c089 Parse the label of audio and text from stream and add it to Format type + add it to default ui + update from dev-v2 2018-06-19 11:32:04 +03:00
andrewlewis
6c733702de Make no context current when releasing DummySurface
This avoids a small native leak.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200955086
2018-06-18 11:20:28 +01:00
eguven
e4f9ff5d91 Add ability to update download requirements to DownloadService
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200689527
2018-06-18 11:18:20 +01:00
olly
afc19bf6db CEA608 - Add space when handling mid-row codes
Issue: #3906

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200526335
2018-06-18 11:16:59 +01:00
tonihei
4dc6c85de4 Use proper buffered duration in AnalyticsCollector.
This replaces the workaround calculation which was needed before the
referenced bug was fixed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200217241
2018-06-18 11:15:36 +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
877c6965c3 Correctly report type of ParsingLoadable.
The helper method only reported DATA_TYPE_UNKNOWN even if the actual type
is known.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200067296
2018-06-18 11:09:43 +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
tonihei
fcb9ca7b81 Replace onViewportSizeChanged with onSurfaceSizeChanged in AnalyticsListener.
This allows the AnalyticsCollector to register itself as a VideoListener to
get these updates automatically instead of relying on the user to provide
updates.

The ViewportSizeReporter was amended to do the pixel to dp conversion itself.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199796532
2018-06-18 11:05:07 +01:00
tonihei
0beff72452 Remove onNetworkTypeChanged from AnalyticsListener.
It doesn't really serve a purpose and is not automatically triggered.
Apps need to trigger it manually through
AnalyticsCollector.notifyNetworkTypeChanged which is easy to forget.
Moreover, the current network type can be obtained by Util.getNetworkType
at any time when it's needed without the need for a listener.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199790033
2018-06-18 11:01:27 +01:00
andrewlewis
f02788af4b Add support for registering custom MIME types
Also add a few missing MP4 object types.

Issue: #4264

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199778373
2018-06-18 11:00:05 +01:00
eguven
a406dc8bee Use TrackKey in place of RepresentetionKey, StreamKey, RenditionKey
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199767518
2018-06-18 10:58:52 +01:00
andrewlewis
4256759011 Fix some javadoc errors
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199650794
2018-06-18 10:55:22 +01:00
aquilescanta
4bbc93b022 Add license server URL to SchemeData
Allows DrmInitData to carry a license server URL when the media declares one.

Issue:#3393

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199643743
2018-06-18 10:54:04 +01:00
tonihei
48193e2901 Add QoE field reporter for formats.
This reports video and audio format selections.
See [] for spec details.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199627176
2018-06-18 10:52:41 +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
tonihei
ccc41f1adf Add surface size change callback to VideoListener.
This allows to detect changes in the surface size. SimpleExoPlayer already
has the necessary listeners to report size changes for all surfaces whose
lifecycle are managed by SimpleExoPlayer.

In a subsequent change, AnalyticsCollector can be registered as a
VideoListener to automatically notify of surface size changes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199605434
2018-06-18 10:50:28 +01:00
tonihei
9f20683a6c Factor out Handler creation in construtor to prevent warning suppression.
Using new Handler(this) in a constructor potentially leaks an uninitialized
object. This is mostly not a problem because we don't use the Handler within
the constructor. Added a Util method to keep the warning suppression local.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199605377
2018-06-18 10:49:16 +01:00