112 Commits

Author SHA1 Message Date
olly
2f8bd42b0e Remove Utils.equals() check for object equality that is fragile.
PiperOrigin-RevId: 254046126
2019-06-21 18:21:22 +01:00
andrewlewis
b449269552 Remove Objects.equals use from CronetDataSource
Objects was added in API 19.

PiperOrigin-RevId: 253567490
2019-06-18 17:46:18 +01:00
olly
e525c1c59e Add CronetDataSource.read(ByteBuffer) method that writes directly into caller's buffer.
PiperOrigin-RevId: 251915459
2019-06-14 16:32:59 +01:00
tonihei
b8ec05aea1 Handle gzip in DefaultHttpDataSource.
Setting the requested encoding in all cases ensures we receive the relevant
response headers indicating whether gzip was used. Doing that allows to
detect the content length in cases where gzip was requested, but the server
replied with uncompressed content.

PiperOrigin-RevId: 250660890
2019-05-30 15:26:32 +01:00
olly
94d668567c Migrate org.mockito.Matchers#any* to org.mockito.ArgumentMatchers
The former is deprecated and replaced by the latter in Mockito 2. However, there is a
functional difference: ArgumentMatchers will reject `null` and check the type
if the matcher specified a type (e.g. `any(Class)` or `anyInt()`). `any()` will
remain to accept anything.

PiperOrigin-RevId: 250458607
2019-05-30 15:25:28 +01:00
olly
14c46bc406 Remove contentTypePredicate from DataSource constructors
The only known use case for contentTypePredicate is to catch
the case when a paywall web page is returned via a DataSource,
rather than the data that was being requested. These days streaming
providers should be using HTTPS, where this problem does not exist.
Devices have also gotten a lot better at showing their own
notifications when paywalls are detected, which largely mitigates
the need for the app to show a more optimal error message or
redirect the user to a browser.

It therefore makes sense to deprioritize this feature. In
particular by removing the arg from constructors, where nearly
all applications are probably passing null.

PiperOrigin-RevId: 249634594
2019-05-30 15:10:08 +01:00
olly
118218cc73 Remove cronet extension nullness blacklist
PiperOrigin-RevId: 249432337
2019-05-23 13:29:35 +01:00
olly
52888ab55b Remove CronetEngineWrapper from nullness test blacklist
PiperOrigin-RevId: 249275623
2019-05-23 13:27:20 +01:00
tonihei
33c677846a Use versioned manifest in all Robolectric tests.
We are currently defaulting to targetSdk=1 as no targetSdk is specified. Only
tests which explicitly ask for another SDK use another test SDK. With the
versioned manifest, all tests run using the targetSDK by default.

PiperOrigin-RevId: 249060796
2019-05-21 13:51:43 +01:00
olly
8edce41ff3 Add simpler HttpDataSource constructors
PiperOrigin-RevId: 248350557
2019-05-15 18:14:25 +01:00
olly
d89f3eeb29 Update dependency versions
PiperOrigin-RevId: 244816212
2019-04-26 18:28:13 +01:00
eguven
f9f009645d Add missing DownloadService build*Intent and startWith* methods
PiperOrigin-RevId: 244196081
2019-04-18 23:22:35 +01:00
tonihei
1ee51518ae Use new exoplayer.dev domain everywhere.
The old domain automatically forwards to the new one. For consistency, change
all doc and code references regardless.

Also adds GitHub CNAME config file which configures our page for the custom
domain.

PiperOrigin-RevId: 243592110
2019-04-16 15:25:27 +01:00
tonihei
8e80acd18f Use androidx.test and extensions.
This replaces the deprecated usages of RobolectricTestRunner and
RuntimeEnvironent and fully migrates the tests to androidx.

PiperOrigin-RevId: 238011667
2019-03-15 04:53:12 +00:00
olly
0622afe170 Migrate to androidx
Issue: #5489
PiperOrigin-RevId: 234507428

Add missing annotation dependency

Issue: #5489
PiperOrigin-RevId: 234566177
2019-02-19 13:22:54 +00:00
tonihei
edabbd52d0 Update Robolectric and Truth.
PiperOrigin-RevId: 233612344
2019-02-18 15:59:32 +00:00
olly
a21572f0dd Fix minor issues and lint errors
PiperOrigin-RevId: 233428556
2019-02-18 15:58:37 +00:00
olly
8401097ead Upgrade gradle plugin and friends
PiperOrigin-RevId: 233390513
2019-02-18 15:57:55 +00:00
olly
2ab91bf08a Update OkHttp and Cronet dependencies
PiperOrigin-RevId: 231644908
2019-01-30 20:32:18 +00:00
olly
355b3d6334 Increase minSdkVersion to 16
The combination of pre-16 API levels accounting for ~0.5% of the device
population, and that the most important components in ExoPlayer (e.g.
the MediaCodec renderers) have always required API level 16, mean it's
very unlikely this will negatively impact on anyone.

PiperOrigin-RevId: 230701808
2019-01-29 16:41:45 +00:00
Oliver Woodman
be2636c365 Merge pull request #4993 from saschpe:icy
PiperOrigin-RevId: 226031838
2018-12-18 19:46:54 +00:00
tonihei
30e753ea1d Provide Cronet request and response data for subclasses.
Subclasses may want to analyze, log and react to the Cronet-specific
connection data.

Issue:#5134
PiperOrigin-RevId: 222809441
2018-11-26 16:40:27 +00:00
Oliver Woodman
2dfe7a7ad6 Misc fixes / stylistic consistency changes for merged pull requests 2018-10-31 20:37:59 +00:00
tonihei
70ccbc6eb8 Fix review comments
See https://github.com/google/ExoPlayer/pull/5004
2018-10-24 11:47:36 +02:00
Patrik Åkerfeldt
8c5703e931 Provide http status message to InvalidResponseCodeException
When response code alone is not enough to distinguish error responses, the http status message is helpful.
2018-10-23 16:51:46 +02:00
tonihei
5c8dabade6 Add @Documented to @IntDef and @StringDef annotations.
This makes the annotations appear in the generated JavaDoc.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214952419
2018-10-01 19:22:34 +01:00
tonihei
e25b7d2148 Add wrapper for Log messages to allow settig the log level.
Currently there is no way to disable (or reduce) the logcat output generated
by ExoPlayer.

Issue:#4665

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213421072
2018-09-20 12:12:21 +01:00
tonihei
d0161ad18b Fix all error-prone, style, optional suggestion, etc. issues.
This fixes or suppresses all reported issues by the code review linter tools.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210107759
2018-08-28 16:37:14 +01:00
olly
3196bc40db Fix CronetDataSource redirect logic
- Remove usage of deprecated postBody field
- Transform POST to GET on redirect, as in DefaultHttpDataSource

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210092576
2018-08-24 16:14:51 +01:00
tonihei
4bf5e4991c Improve IntDef javadoc.
The doc can be improved by enumerating and linking all possible values from
the interface doc.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209772309
2018-08-24 15:53:30 +01:00
olly
bd8a956d53 Use lamdas everywhere
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209162373
2018-08-24 15:19:30 +01:00
olly
63bfa3d413 Use gradle dependencies for Cronet extension
This also allows us to distribute the extension via jCenter

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207874626
2018-08-13 13:43:02 +01:00
sammon
d3686cf8a2 Updating DefaultHttpDataSource to allow for http methods other than GET and POST,
as specified by DataSpec.httpMethod.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207769779
2018-08-13 13:39:10 +01:00
olly
af507efb2a Deprecate/remove DataSource constructors that accept listeners
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207713478
2018-08-07 16:28:02 +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
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
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
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
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
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
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
tonihei
66d2b76a6c Remove test max SDK version overrides.
These don't seem to be needed anymore. All tests run without them in gradle
and Blaze.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191867518
2018-04-08 16:39:57 +01:00
olly
82c71378eb Remove unnecessary testInstrumentationRunner lines
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191418665
2018-04-03 15:35:40 +01:00
olly
8b5a34769f Remove unnecessary line from test manifests
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191409777
2018-04-03 15:30:40 +01: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
b47fb2826b Move extension tests to Robolectric.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187021822
2018-02-27 11:03:50 +00:00
aquilescanta
8f81abee86 Prevent "unexpected read attempt" illegal state exception
When using cronet data source, calling read after the end of input has
been read will trigger this.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184667794
2018-02-08 14:49:00 +00:00