5060 Commits

Author SHA1 Message Date
Oliver Woodman
28bb3ba73e Merge branch 'JungleGenius-dev-v2' into dev-v2 2018-07-12 15:55:03 +01:00
Oliver Woodman
e4b05a5ae6 Merge branch 'dev-v2' of https://github.com/JungleGenius/ExoPlayer into JungleGenius-dev-v2 2018-07-12 15:54:47 +01:00
ojw28
423cfa3b73
Merge pull request #4442 from keiththompson/keiththompson__/skip_ad_within_ad_group
Add withSkippedAd method to AdPlaybackState.
2018-07-12 15:48:05 +01:00
ojw28
651cfd9ebb
Merge pull request #4480 from drhill/dev-v2_mkv_forced_default_flipped
MKV Extractor flip default and forced flag values to their proper names
2018-07-12 15:46:49 +01:00
andrewlewis
44c253058e Ignore all edit lists if one track's edits can't be applied
Issue: #4348

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204261718
2018-07-12 15:40:11 +01:00
tonihei
78d7754f29 Add addListener/removeListener to BandwidthMeter.
That allows to add listeners after the BandwidthMeter has been created which is
helpful as the BandwidthMeter instances are often long-lived static instances.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204255299
2018-07-12 15:39:05 +01:00
matttt
9914587894 Remove the static modifier from DefaultDashChunkSource::newMediaChunk and DefaultDashChunkSource::newInitializationChunk allowing for overrides.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204167521
2018-07-12 15:37:52 +01:00
aquilescanta
32a91b5689 Add LoadErrorHandlingPolicy to customize blacklisting and backoff logic
Issue:#2844
Issue:#3370
Issue:#2981

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204149284
2018-07-12 15:36:35 +01:00
tonihei
095c6e4bf8 Add MediaChunkIterator for HLS media playlists.
This allows to iterate through the available segments of the playlist.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204100116
2018-07-11 14:57:49 +01:00
hoangtc
39b812298d Add supports for reading duration for a PS stream.
Add supports for reading duration for a PS stream by reading SCR values from
the header of packs at the start and at the end of the stream, calculating the
difference, and converting that into stream duration.

Github: #4476

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203954752
2018-07-11 14:56:54 +01:00
tonihei
68822c0c41 Remove BandaidTransferListener.
It has now become an empty shell as the real TransferListener provides all its
methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203950443
2018-07-11 14:55:54 +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
Srikanth Peddibhotla
2a388ff852 Support CEA 608/708 captions in MPEG2 TS stream
[Problem] Sarnoff spec complaince tests streams are MPEG2 TS.
Currently, parsing CC data from MPEG2 TS is not supported

[Solution] Parsed CC data from MPEG2 stream because all Sarnoff streams are MPEG2
2018-07-11 18:41:00 +05:30
eguven
18d208ab93 Fix DownloadService doesn't stop when the app is killed
Also fixed showing "remove notification" when download is completed.

Issue:#4469
Issue:#4488

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203927268
2018-07-10 14:03:05 +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
olly
17a58969af Move subsampleOffset in Format
It's no longer text specific (it's used for metadata as well, and
in theory could apply to any stream in which samples contain multiple
sub-samples)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203767825
2018-07-10 14:00:30 +01:00
tonihei
5c9fd1649a Fix wrong loop variable in DashMediaPeriod.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203766579
2018-07-10 13:59:19 +01:00
tonihei
74d8f89cb6 Restructure track selection in DashMediaPeriod.
Until now, the streams were released and re-enabled for each type of stream
(primary, event, embedded) in that order. That leads to problems when replacing
streams from one type to another (for example embedded to primary).

This change restructures the track selection to:
1. Release and reset all streams that need to be released or replaced.
 1(a). Including embedded orphan streams.
2. Select new streams.

Issue:#4477

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203751233
2018-07-10 13:58:18 +01:00
olly
dc8b73d372 Apply setOutputSurface workaround to all non-Google decoders
Where a device has this issue, it most likely applies to all
SOC vendor provided decoders, which are normally the only
video decoders other than the OMX.google software decoders
on the device. The fact we currently only blacklist for AVC
decoders is likely just a side effect of AVC's popularity.

I checked two devices already on the blacklist, and both
failed with other SOC vendor decoders on the device as well
(but passed if forced to use OMX.google decoders instead)

Issue: #4468

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203728285
2018-07-10 13:57:10 +01:00
olly
13789a3c1d Tweak DefaultTrackSelector documentation
Viewport constraints apply to adaptive content even if the
actual playback isn't adaptive (i.e. because the selector
ends up making a fixed track selection).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203726831
2018-07-10 13:55:51 +01:00
Drew Hill
e807212514 flip flag values to their proper names so that trackselector parameters can be useful 2018-07-07 12:28:58 -04:00
Oliver Woodman
8fa34c1ed6 Delete stray file 2018-07-06 18:26:49 +01:00
hoangtc
c1acf87fba Support handling frame queries for MetadataRetriever.
- Support handling frame queries (i.e get frames at times, output to certain
sizes) from MetadataRetriever.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203489788
2018-07-06 17:59:21 +01:00
tonihei
2c00be1aa3 Add workaround for unmatched track indices in tkhd and tfhd.
If there is only one track, we can assume that both boxes refer to the same track
even if the track indices don't match.

Issue:#4083

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203485872
2018-07-06 17:58:08 +01:00
olly
3b70d1d889 Avoid providing invalid responses to MediaDrm
MediaDrm.provideXResponse methods only accept the response
corresponding to the most recent MediaDrm.getXRequest call.
Previously, our code allowed the following incorrect call
sequence:

a = getKeyRequest
b = getKeyRequest
provideKeyResponse(responseFor(a));

This would occur in the edge case of a second key request
being triggered whilst the first was still in flight. The
provideKeyResponse call would then fail.

This change fixes the problem by treating responseFor(a)
as stale. Note that a slightly better fix would be to
defer calling getKeyRequest the second time until after
processing the response corresponding to the first one,
however this is significantly harder to implement, and is
probably not worth it for what should be an edge case.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203481685
2018-07-06 17:56:58 +01:00
tonihei
1cf8b255dc Add workaround for unmatched track indices in trex and tkhd.
Both boxes should contain the same list of track indices. However, if only one
track index in each list does not match, we can just assume that these belong
together.

Issue:#4477

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203481258
2018-07-06 17:55:47 +01:00
olly
bd952a802a Re-merge output surface workarounds and add TODO list
Issue: #4468

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203479944
2018-07-06 17:54:33 +01:00
Oliver Woodman
3b29eeaef8 Merge branch 'joomcode-dev-v2' into dev-v2 2018-07-06 14:50:24 +01:00
olly
0ed8e86ba4 Allow overriding of setOutputSurface workarounds
Since this is an ongoing problem, it's reasonable that we allow
developers to toggle these workarounds without too much hassle.

Issue: #4468

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203364488
2018-07-06 14:38:23 +01:00
tonihei
264bed06f2 Forward addTransferListener for all wrapping data sources.
This allows to register a listener on an outer wrapping data source which
receives data transfer events from the wrapped source.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203358981
2018-07-06 14:37:19 +01:00
andrewlewis
5047a5a4da Fix pre-L codec buffer initialization
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203341457
2018-07-06 14:36:19 +01:00
tonihei
acbe52d0d7 Forward TransferListener from MediaSources to DataSources.
This wires up recent changes of passing a transfer listener to the MediaSource and
allowing DataSources to accept new listeners.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203280818
2018-07-06 14:35:17 +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
hoangtc
2237603a4d Add supports for reading duration for a TS stream.
Add supports for reading duration for a TS stream by reading PCR values of the PCR PID packets at the start and at the end of the stream, calculating the difference, and converting that into stream duration.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203254626
2018-07-06 14:31:27 +01:00
andrewlewis
0b631b05c2 Optionally fall back to other decoders if init fails
Codec initialization may fail in creation, configuration or when start()ing the
codec. If codec initialization fails, there may be other codecs available that
could handle the same format, but currently ExoPlayer can only try to use the
first listed codec for the input format and gives up if it fails to initialize.

This change implements support for optionally falling back to alternative
decoders if initialization fails. MediaCodecSelector can now return a list of
decoders to try in priority order, and use the Format when choosing a codec.
With the default implementation, the codecs and order come from MediaCodecList,
and matches the order used internally by MediaCodec.createDecoderByType (which
implements the same kind of fallback though only to the creation step, without
configuring/starting the codec).

This feature is useful for apps that want to play several videos concurrently on
devices that have software decoders (like OMX.google.h264.decoder), as the new
behavior allows new codecs to be created when no hardware-accelerated decoders
are available.

The list of available codecs is queried when initializing the codec after a
format change that requires a new codec to be instantiated. When a decoder fails
to initialize it is removed from the list of available decoders and won't be
tried again until the next format change (or until the renderer is disabled).

Note: this change does not affect the renderer capabilities API, as when
checking format support we don't know which codec will be used.

Issue: #273

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203242285
2018-07-06 14:30:16 +01:00
andrewlewis
930833627f Use androidx test runner in gradle configuration
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203141421
2018-07-06 14:29:14 +01:00
tonihei
f2b01275cb Add back old deprecated MediaSource.prepareSource - remove for next release!
This ensures compatiblity of other apps depending on our public GitHub code.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203129076
2018-07-06 14:28:14 +01:00
tonihei
f4bcfe082d Add MediaChunkIterator for SmoothStreaming stream elements.
This allows to iterate through the available chunks of the stream.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203105813
2018-07-06 14:26:56 +01:00
tonihei
97120bc6cb Add MediaChunkIterator for FakeAdaptiveDataSet.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203102464
2018-07-06 14:25:38 +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
olly
e48b712a32 Fail tests quickly if they don't start within the host activity
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202965785
2018-07-03 11:58:20 +01:00
tonihei
c8af6d176f Forward queue of media chunks to getNextChunk.
This allows to use this queue in the track selection in the future.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202954871
2018-07-03 11:57:26 +01:00
olly
04341394a3 Add section to guide about track selection
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202948642
2018-07-03 11:56:12 +01:00
tonihei
8ca9a32d8e Add MediaChunkIterator interface and DASH implementation.
This will allow to provide available information about future chunks to the
track selection.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202940994
2018-07-03 11:54:58 +01:00
bachinger
e50167ef54 prevent controls from hiding whilst the user is interacting with it
Issue:#2395

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202926448
2018-07-03 11:53:43 +01:00
aquilescanta
caa90844c6 Allow overridable empty closed caption format list in DefaultTsPayloadReaderFactory
Issue:#4451

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202923630
2018-07-03 11:52:31 +01:00
olly
c23910ad3a Exclude text streams from duration calculations
Issue: #4029

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202912333
2018-07-03 11:51:32 +01:00
brettchabot
1ee36101f6 Replace references to android.support.test with androidx.test.
The Android Test Support Library is being renamed to AndroidX Test, with its root java namespace changing from android.support.test to androidx.test.
And code location changing from tp/android/android_test_support to tp/android/androidx_test.

More information: []

TAP global presubmit: []

BUG:
79205333

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202796842
2018-07-03 11:50:39 +01:00