208 Commits

Author SHA1 Message Date
andrewlewis
f45751872d Move track sample index updates out of getPosition(long).
This requires knowing the seek time in Extractor.seek, so that it's possible to
pick the latest synchronization sample at/before the seek time for each track
(rather than the earliest synchronization sample after the seek position).

Also remove the STATE_AFTER_SEEK state which should no longer be needed.

Issue: #2167

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141432598
2016-12-12 16:15:38 +00:00
andrewlewis
f7132a7a73 Fix compiler warning about assignment in conditional.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140332890
2016-11-30 21:54:45 +00:00
mgersh
cbf5988803 Switch to Cronet 56_0_2924_0
This is the second CL in the 3 CL process to switch Cronet versions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140074017
2016-11-25 20:18:32 +00:00
cchiappini
ba49f51380 Cronet README fix
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140043801
2016-11-25 20:18:32 +00:00
andrewlewis
77715fbfbe Fix some analysis warnings.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139901449
2016-11-25 20:18:32 +00:00
olly
4846146827 Fix internal build to use new Cronet jars
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139803684
2016-11-21 19:14:06 +00:00
andrewlewis
ae0ac55b8d Add support for resetting the AudioTrack stream type.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139797714
2016-11-21 19:13:34 +00:00
andrewlewis
1a62dad980 Remove TODO in ffmpeg extension README.md.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139453745
2016-11-18 12:52:05 +00:00
olly
61c9c16954 Make sure we report video size after Surface is set
Issue: #2077

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139451511
2016-11-18 12:50:41 +00:00
hoangtc
74383716a6 Update exoplayerv2 vp9 extension.
Reset RenderedFirstFrame when setting OuputBufferRenderer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139100783
2016-11-18 12:45:24 +00:00
aquilescanta
6d5d054b45 Fix lint in FlacExtractor
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139064912
2016-11-18 12:44:53 +00:00
vigneshv
ee8a7f17ff vp9_extension: Fix potential integer overflows
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138652561
2016-11-10 21:15:21 +00:00
hoangtc
4cd8c77053 Add layer of indirection for DRM.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138383979
2016-11-10 21:14:29 +00:00
olly
2c54363204 Report track groups and selections through ExoPlayer
TrackSelector no longer has a listener. Instead, tracks
change events are reported through ExoPlayer.EventListener.
Applications interested in retrieving the selection info
should retrieve it directly from the TrackSelector by
calling an exposed getter.

Pretty sure the ref'd issue is fixed as a side effect of
this change.

Issue: #1942

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137183073
2016-10-27 12:27:55 +01:00
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
kapishnikov
d3f78e4808 Deprecate call to new UrlRequest.Builder(...)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136399474
2016-10-19 16:59:38 +01:00
olly
6acf59c4fc Fix Widevine L3 provisioning in V2
1. HttpMediaDrmCallback.executeProvisionRequest needs to specify
   an empty byte[], else we do a GET instead of a POST.
2. Content-Type should not be set when making the provision
   request, since there's no body.
3. DataSource implementations must correctly handle a non-null
   body with zero length. CronetDataSource was not handling this
   case. DefaultHttpDataSource was, but made a code modification
   to make it a little clearer. OkHttpDataSource seems to handle
   the case correctly, and it doens't look like the code can be
   made clearer.

Issue #1925

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136042641
2016-10-14 10:42:43 +01:00
olly
94c7ee7252 Cronet - Skip if server doesn't support range requests
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135819142
2016-10-14 10:42:43 +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
olly
97020e0bab CronetDataSource: Fix getContentLength logging
This is a minor cleanup. The main thing it fixes is that
the "Inconsistent headers" and "Unexpected Content-Range"
log messages were printing List<String> objects, rather
than the actual headers they are supposed to print.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135378074
2016-10-11 18:16:28 +01:00
olly
d95baa3ee9 CronetDataSource: Fix thread safety issue with requestProperties
The access in fillCurrentRequestPostBody wasn't protected with
synchronization. Furthermore, just synchronizing it wouldn't be
sufficient, since what we really need to check is whether the
Content-Type header has been added to the UrlRequest.Builder.
The contents of requestProperties may have changed between the
headers being added to UrlRequest.Builder and the call to
fillCurrentRequestPostBody.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135376904
2016-10-11 18:16:28 +01:00
olly
661b14020e Partial cleanup of CronetDataSource II
- Allow null Content-Type in response headers.
- Inline validateResponse, just because it makes it clearer
  what thread it's being executed on when inlined.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135375063
2016-10-11 18:16:28 +01:00
olly
ba56f9165c Partial cleanup of CronetDataSource
- Fix bug in getCurrentRequestStatus where we weren't
  blocking on the condition variable.
- Make methods static where possible.
- Clean up getUri implementation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135373586
2016-10-11 18:16:28 +01:00
olly
5803b2538d No-op reorder of CronetDataSource methods
This change is a no-op reodering, as a precursor to
further cleanup. The public methods are grouped by
the class/interface they implement. The private methods
are ordered with things that will become static in
a subsequent change at the bottom.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135372629
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
b3c6f1caae Finish cleaning DataSource implementations.
- Enfroce read returns 0 if readLength==0 everywhere.
- Fixes and simplifications for CronetDataSource.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135138232
2016-10-04 23:42:55 +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
olly
eaf8218855 Fix shutter open/close behavior
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134389619
2016-09-28 11:26:12 +01:00
falhassen
f2cf086d76 Fix content length calculation for gzipped files
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134011959
2016-09-28 11:25:34 +01:00
mgersh
e20d7034c7 Switch to Cronet 55_0_2860_0
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133850026
2016-09-28 11:24:55 +01:00
olly
20757a1980 Update some documentation for V2 + Rm extra blank line
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132985566
2016-09-13 17:46:27 +01:00
olly
f2229d920b Move FlacJni to FlacDecoderJni
If/when we add the ability to query version information,
such methods will go into FlacLibrary for consistency with
the other extensions. The difference for Flac is that
since the decoder JNI is used by the extractor too, it
needs splitting into a separate from from FlacDecoder.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132904665
2016-09-13 17:44:55 +01:00
olly
de67fa5017 Allow replacement of libraries for Opus/Flac/Ffmpeg too
- Also make some of the naming more concise + misc style cleanup.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132899979
2016-09-13 17:44:10 +01:00
benm
45a5331e30 Add support to VP9 extension for overriding the native library names
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132874777
2016-09-13 17:40:41 +01:00
olly
04c28c6d7d Minimal change to fix seeking before prepare + finalize API
- This change fixes seeking before the prepare (or more
  accurately, before the timeline is set). The fix a minimal
  one to fix the behavior. It's inefficient compared to
  posting the pending seek onto the playback thread, which
  will be the long term solution.
- As of this change, I think we can call V2 "done". There are
  some loose ends to tie up, but the API is effectively
  finalized and the implementation is in a state where you
  can take it, use it and expect it to work.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132468107
2016-09-08 16:29:48 +01:00
benm
36df5bcd84 Fix a warning in libvpxJNI
v2/extensions/vp9/src/main/jni/vpx_jni.cc:63:31: warning: missing field 'w' initializer [-Wmissing-field-initializers]
  vpx_codec_dec_cfg_t cfg = {0};
                              ^

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132461351
2016-09-08 16:29:48 +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
962b5940c2 Update ExoPlayer documentation + tweak method naming
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131843222
2016-09-02 16:08:45 +01:00
olly
9adce6b007 Make sure Cronet extension/tests are pushed to GitHub
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131825185
2016-09-02 16:08:00 +01:00
olly
1fbe62c662 Update Opus decoder, move init ouput buffer to native code
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131692317
2016-08-31 15:25:35 +01:00