37 Commits

Author SHA1 Message Date
andrewlewis
a0fe258e8d Fix/suppress some analysis warnings.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136710546
2016-10-24 11:44:49 +01:00
olly
0cff74dc70 Clean up okhttp extension Javadoc
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136702598
2016-10-24 11:41:52 +01:00
Oliver Woodman
aa660acf03 Fix typo in comments 2016-10-20 12:00:35 +01:00
olly
aa1002a0d6 Rollback "Add REQUIRE_HTTPS flag"
*** Reason for rollback ***

Flag doesn't enforce what it says it enforces, due to redirects

*** Original change description ***

Add REQUIRE_HTTPS flag

Note that it's not possible for the library to enforce that
the flag is adhered to, since it's possible for applications
to inject custom implementations of DataSource (there's no
requirement they even extend HttpDataSource for network
requesting implementations). It's possible for applications
to replace pretty much anything in the library, so there's
no other place we could put the flag where we could make
this guarantee. Hence this is a best-effort that will work
when...

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136583459
2016-10-19 17:00:03 +01:00
olly
1cfc432bb8 Add REQUIRE_HTTPS flag
Note that it's not possible for the library to enforce that
the flag is adhered to, since it's possible for applications
to inject custom implementations of DataSource (there's no
requirement they even extend HttpDataSource for network
requesting implementations). It's possible for applications
to replace pretty much anything in the library, so there's
no other place we could put the flag where we could make
this guarantee. Hence this is a best-effort that will work
when using HttpDataSource implementations that we provide.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136500947
2016-10-19 17:00:03 +01:00
olly
907b9bf4f6 Sanitize threading in CronetDataSource
- Move nearly all logic onto the calling thread (i.e. the thread
  calling open/read/close), to make threading correctness more
  obvious.
- Document which variables are read/written from which thread, and
  why the call sequences are safe.
- Fix thread safety issue that I think could probably cause data
  corruption in the case of a read timeout followed by another
  request into the DataSource.

Also:

- Relaxed content length checking to be consistent with the other
  http DataSource implementations, and avoided parsing the headers
  where they're not used.
- Fixed missing generics in CronetDataSourceFactory.
- Added TODO to work with servers that don't support partial range
  requests.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135702217
2016-10-11 18:16:28 +01:00
ojw28
93c2133f29 Merge pull request #1909 from kaorimatz/okhttp-call-factory
Use Call.Factory instead of OkHttpClient
2016-10-09 14:41:46 +01:00
Satoshi Matsumoto
880bdc181a Use Call.Factory instead of OkHttpClient
This allows using alternate implementation of an HTTP client. We can use
OkHttpClient as before as it implements Call.Factory.
2016-10-07 21:00:27 +09:00
olly
2cf339e095 Bump version to 2.0.2 + document inclusion of OkHttp extension
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135260806
2016-10-05 21:20:34 +01:00
olly
1b90b7c12c Factor out common variables for publishing
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135215320
2016-10-05 18:07:13 +01:00
olly
f8ed4cfdee Clean up some DataSource implementations
- Make read return 0 if readLength==0
- Return RESULT_END_OF_INPUT properly in the case that
  bytesRemaining is unset (this was broken previously,
  but only applies for assets > 2^31 bytes, so it's
  unlikely anyone ever hit this issue)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135136541
2016-10-04 23:42:20 +01:00
olly
7838a16dd8 Publish OkHttp extension to Bintray.
It'll be a TODO to clean up some of the commonality between
publishing this and the core library (e.g. the version number
should really be spec'd in one place only). Just getting this
submitted for now so that we don't lose track of how I created
https://bintray.com/google/exoplayer/extension-okhttp

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135102459
2016-10-04 23:41:36 +01:00
eguven
06a644eccd DataSourceException: Used to specify a DataSource error.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132053698
2016-09-02 16:20:06 +01:00
eguven
860c6588c0 created DefaultHttpDataSourceFactory
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131931668
2016-09-02 16:15:18 +01:00
olly
a779eabdc5 Update SDK / Tools.
- Centralise compileSdkVersion, targetSdkVersion and
  buildToolsVersion in a single place for gradle.
- Bump compileSdkVersion and targetSdkVersion to 24.
- Bump com.android.tools.build version to re-enable
  instant start.
- Bump targetSdkVersion in manifests (needed for
  internal builds).
- Use standard expandable_list_item from Android in
  the demo app, since ours doesn't look right when
  targeting API level 24. We were also setting the
  theme on the wrong element in the manifest, so I'm
  removing that line.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131929216
2016-09-02 16:12:55 +01:00
olly
1579b68cf6 Sanitize constants
- Use a single constant for unset/unknown times across
  all time bases. Note also that this moves away from
  use of -1 for unset/unknown times in ms, which was a
  bad choice (it might conflict with real times, such
  as a time representing being just behind the start
  of a live window).
- Add a few other unset constants, and use them.
- Fix some hardcoding of -1 where existing constants
  should have been used.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130775594
2016-08-31 15:25:18 +01:00
olly
5783272444 Fix missing generics
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129624395
2016-08-10 20:04:19 +01:00
olly
a7cb98d991 Pass source to TransferListener events
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129622239
2016-08-10 20:03:30 +01:00
andrewlewis
8d122a101d Use new import ordering.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128967776
2016-08-08 11:06:48 +01:00
olly
242bdffc80 Fix a few warnings.
- Suppress spurious resource type warnings.
- Make AS happy by making private method non-final.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128584391
2016-07-28 20:04:40 +01:00
olly
5360ddc519 Allow injection of custom FormatEvaluators
This was possible previously, but now we support things
like multi-period DASH we need to do the injection in
the form of factories rather than concrete instances.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127735816
2016-07-22 22:20:32 +01:00
olly
dbb43567a3 Finalize v2 directory + package name
- The package is renamed to avoid conflicts with v1, should any
app wish to include both v1 and v2 for a period of time. This is
similar to the approach used by some other open source projects
(e.g. okhttp).
- Copyright year is updated everywhere for completeness.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126895326
2016-07-08 12:12:09 +01:00
olly
ec4c7d3acf Remove Eclipse support. Simplify manifests.
It looks like the manifests are essentially pointless,
but various tools are unhappy if I delete them.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124976509
2016-06-15 20:26:37 +01:00
andrewlewis
e684e42994 Clean up DefaultDataSources and add factory for okhttp DataSources.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123991352
2016-06-15 19:42:04 +01:00
cblay
d2c524d726 Add open/read http exception classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121871799
2016-06-15 19:40:39 +01:00
olly
e9fcbafcb4 Make OkHttp extension work in Eclipse/[].
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118921673
2016-06-15 19:39:05 +01:00
olly
e4d815d164 Add OkHttp extension to V2.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118775995
2016-06-15 19:39:05 +01:00
olly
cdae9ac5d2 ExoPlayer V2 Refactor - Steps 1/2.
GitHub note - Apologies for the cryptic change descriptions,
they relate to a design doc that's not externally visible.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=113043764
2016-06-15 18:53:40 +01:00
olly
949317a41a Minor tweaks to merged pull requests.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112161860
2016-01-14 18:12:28 +00:00
Yu-Hsuan Lin
9cdd246a55 support okhttp3 2016-01-07 19:50:15 +00:00
Oliver Woodman
c0f0cbcb7a Move to target API level 23 2015-10-26 15:02:32 +00:00
Oliver Woodman
5b81612c3b Tweak okhttp package name 2015-10-01 17:33:02 +01:00
Oliver Woodman
ba6cb05e0a Update ReadMe files. 2015-09-29 21:55:51 +01:00
Oliver Woodman
0ff03e40bd Okhttp extension - Update gradle build 2015-09-29 21:27:37 +01:00
Oliver Woodman
af1ffeccc7 OkHttp extension - Add eclipse project 2015-09-29 21:24:45 +01:00
Oliver Woodman
434a2733a3 OkHttp extension modifications.
1. Change package name (rm "datasource")
2. Require injection of OkHttpClient through all constructors, and
   remove allowCrossProtocolRedirect/connectTimeout/readTimeout
   constructor arguments. The client should be configured with these
   prior to injection.
3. Fix code style to be consistent with the project.
4. Simplify call to get contentLength. I'm pretty sure okhttp returns
   the correct value when gzip is enabled, so there's no need to check
   this in the data source.
5. Misc cleanups.
2015-09-29 21:10:34 +01:00
Yu-Hsuan Lin
0df29a6497 Add an extension that provide DataSource using OkHttp 2015-08-24 00:49:41 +08:00