2534 Commits

Author SHA1 Message Date
Oliver Woodman
110c8f6f1f Improvements to ID3 decoder 2016-10-17 22:35:21 +01:00
ojw28
08256eee32 Merge pull request #1955 from google/dev-v2
r2.0.3
2016-10-17 15:55:12 +01:00
olly
cecb1f5f76 Bump version + update release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136339035
2016-10-17 15:43:57 +01:00
aquilescanta
e873b4b6ab Change prepare() for maybePrepare() in HlsSampleStreamWrapper
This will allow asynchronous preparation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136176854
2016-10-17 15:43:57 +01:00
Oliver Woodman
50aeb20cc2 Make Id3Decoder stateless again
One issue with the previous implementation was that
isUnsynchronized would not be set back to false if
previously set to true and if the next header has
majorVersion >= 4. In general, having the decoder be
stateless is clearer (and thread safe, albeit that
this property is not required).
2016-10-17 14:38:56 +01:00
klampert
dca4d16bef Release surfaces created to wrap SurfaceTextures
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136163292
2016-10-14 18:57:30 +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
a22390c29b Parse CEA-708 codec for rawCC
Note that actually handling CEA-708 is not yet implemented,
and so this is a no-op change from a behavior point of view.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136038439
2016-10-14 10:42:43 +01:00
aquilescanta
e685edc179 Make interface implementation consistent among ExtractorOutputs
The method track(int id) currently has different behaviours across
implementations. This CL maps ids to track outputs, which means
that successive calls with the same id will return the same
TrackOutput instance. Also fixes TsExtractor inconsistent behavior
after a seek.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136026721
2016-10-14 10:42:43 +01:00
aquilescanta
ff712aead5 Try not adapting before failing with BehindLiveWindowException in Hls
Issue:#1782

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136025847
2016-10-14 10:42:43 +01:00
olly
64262085a7 Block when surface being replaced is non-null
A blocking call is necessary where we want to guarantee that
the player wont access the surface after the method call has
returned. We currently only do this for the case:

Surface->Null

But we should also do it for the case:

SurfaceA->SurfaceB

Since the caller may reasonably do something like destroy
SurfaceA immediately after it's been replaced.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135921296
2016-10-14 10:42:43 +01:00
aquilescanta
f18373eeb2 Decouple TsExtractor's readers from TrackOutputs
This allows the injectable reader factory to be a stateless factory, allows
the seeking to be consistent and will allow multiple CC channel support later
on.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135909712
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
Oliver Woodman
bffffb0fac Minor ID3 tweaks 2016-10-12 17:27:54 +01:00
ojw28
f4b8d9490a Merge pull request #1935 from google/dev-v2
Update dev-v2-id3 with dev-v2
2016-10-12 17:05:09 +01:00
olly
996fe47f8c Fix NPE releasing HlsMediaPeriod
Issue: #1907

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135798950
2016-10-11 18:16:28 +01:00
olly
29f3eb5e5a Fixes for retries
- Fix issue in ExoPlayerImpl where the timeline was null'd
  but onTimelineChanged was not fired.
- Add the ability to not reset the timeline. This is useful
  for retries where you know the timeline will be the same
  as it was previously.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135797577
2016-10-11 18:16:28 +01:00
olly
83107cc25d Fix missing release calls on loadingPeriodHolder
playingPeriodHolder can be null in the case that the first
period is still being prepared. We need to make sure we
release the period that's being prepared in such cases,
which is loadingPeriodHolder.

Issue: #1914

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135793472
2016-10-11 18:16:28 +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
4fab402274 Fix missing generics
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135700280
2016-10-11 18:16:28 +01:00
olly
d922a21160 Select the cenc sinf atom explicitly
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135692709
2016-10-11 18:16:28 +01:00
eguven
1b81cfdb56 Rename build flavors and remove pre hashing of DataSpec key values.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135682130
2016-10-11 18:16:28 +01:00
olly
91f8328a5f UI component improvements
- Make sure no events are posted on PlaybackControlView
  if it's not attached to a window. This can cause leaks.
  The target hide time is recorded if necessary and
  processed when the view is re-attached.
- Deduplicated PlaybackControlView.VisibilityListener
  invocations.
- Fixed timeouts to be more intuitive (I think).
- Fixed initial visibility of PlaybackControlView when
  used as part of SimpleExoPlayerView.
- Made some more attributes configurable from layout xml.

Issue: #1908
Issue: #1919
Issue: #1923

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135679988
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
Oliver Woodman
97e7fb85a7 ID3: Clean up logging + only add to audio track for MP4 2016-10-09 18:00:59 +01:00
Oliver Woodman
ba1da140c6 Further modifications to ID3 support
- Lots of misc cleanup
- Remove GaplessInfo from Metadata. IMO it doesn't quite belong there,
  and means it ends up being represented twice inside Format.
- Note: Changes untested, but will be tested in due course!
2016-10-09 16:27:58 +01:00
Oliver Woodman
3b34f850f2 Clean up ID3 frame implementations 2016-10-09 14:58:12 +01:00
Oliver Woodman
6a3b66987a Revert unrelated ContentDataSource change 2016-10-09 14:52:38 +01:00
Oliver Woodman
5a72ca6b36 Merge branch 'cbfiddle-albumMetadataV2.1' into dev-v2-id3 2016-10-09 14:48:06 +01:00
Oliver Woodman
5a097a4c9d Merge branch 'albumMetadataV2.1' of git://github.com/cbfiddle/ExoPlayer into cbfiddle-albumMetadataV2.1 2016-10-09 14:47:48 +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
ojw28
f94218a758 Merge pull request #1905 from google/dev-v2
r2.0.2
2016-10-06 17:40:16 +01:00
olly
6c12ec629a Some minor UI refinements
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135353593
2016-10-06 15:05:34 +01:00
[]inger
08965c03d0 Avoid memory leaks by removing callbacks from surface when SimpleExoPlayer is released.
Without this developers which reuse a SurfaceHolder with multiple instances of
SimpleExoPlayer need to call simpleExoPlayer.setVideoSurfaceHolder(null) to get
the SimpleExoPlayer.ComponentListener removed from the surface holder. If they
don't, the component listener is still registered and as a member class leaks
an instance of simpleExoPlayer.

Issue #1855

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135292439
2016-10-06 15:04:57 +01:00
olly
d334dfdcba Fix merging of selected streams.
Playback would fail if a renderer is toggled from consuming from
one child to another in a single step.

Issue: #1900

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135270356
2016-10-05 21:21:47 +01:00
[]inger
053dc27a3e Introduce resize mode for AspectRatioFrameLayout.
https://github.com/google/ExoPlayer/issues/1827

Three different modes available: fit (default), fixed_width, fixed_height
Developers need to use wrap_content for the dimension which is not fixed:

app:resize_mode="fixed_width"
android:layout_width="320dp"
android:layout_height="wrap_content"

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135264861
2016-10-05 21:21:13 +01: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
89c438078e Fix retry crash in edge case
Configuration of retry currently fails if all of the
following are true, which is highly unlikely but does
occur in the ref'd issue.

1. Loading/extraction fails
2. Neither length of stream of a seek map is known
3. At least one track has been output by the extractor

Issue: #1899

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135228687
2016-10-05 18:07:48 +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
7c3fe15426 Add convenience getPlayer methods to UI components
Issue: #1895

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135211179
2016-10-05 18:06:34 +01:00
olly
85d749d2d5 Change mavenCentral -> jcenter
Ref: https://blog.bintray.com/2015/02/09/android-studio-migration-from-maven-central-to-jcenter/

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135211072
2016-10-05 18:05:54 +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
aquilescanta
e288880aaf Fix Ac3 extractor sniff
Issue:#1875

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135100986
2016-10-04 23:40:53 +01:00