2074 Commits

Author SHA1 Message Date
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
olly
f2beec4c82 Fix playback tests
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135100455
2016-10-04 23:40:10 +01:00
olly
b29b4f7e1a MergingMediaPeriod + subtitle fixes
- Correctly null out streams[j] in the case that a renderer
  is being disabled.
- Read discontinuities from all children, not just enabled
  ones. This fixes a failure when reading a discontinuity
  with all renderers disabled.
- Add in some assertions to make incorrect stream selection
  failures obvious and immediate.
- Relocate subtitles so they're above the shutter (needed so
  they continue to be visible when video is disabled but
  text is still enabled).

Issue: #1854

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135089944
2016-10-04 23:39:24 +01:00
aquilescanta
6306c26988 Add support for fragmented MP4 in HLS
This CL adds support for initialization segments in HLS. This is required mainly for(but not limited to) usage of fMP4. The fMP4 support only consists in creating the required extractor if the extension is .mp4, provided the initialization segment is correctly
loaded and passed to the extractor.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134997636
2016-10-04 23:38:47 +01:00
olly
69af389730 Trim allocator on stop/reset by default
This prevents a large amount of memory from being held
in the case that a player instance is released, but the
application is holding dangling references to the player
that are preventing it from being garbage collected.

Issue: #1855

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134992945
2016-10-03 17:44:01 +01:00
olly
f75f3d75b2 Fix sideloaded subtitles
- Fix NPE issue in SingleSampleMediaPeriod.
- Delay handling of EOS in TextRenderer until the last
  subtitle is fully played out.

Issue: #1882

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134979286
2016-10-03 17:43:28 +01:00
cdrolle
37806ee792 Added Basic CEA-708 caption support to ExoPlayer V2, roughly equivalent to the current state of CEA-608. It's still missing window (and the associated positioning and formatting) support, emulating a 3-line rollup.
Currently this has only been tested with the RawCC container, though it should work with anything that makes use of SeiReader (i.e. MPEG2-TS) with minimal changes to SeiReader.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134781660
2016-10-03 17:42:49 +01:00
andrewlewis
c381093a48 Update variable name in comment.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134776852
2016-09-30 14:40:38 +01:00
andrewlewis
ee4d297f22 Fix seeking in the last period.
When reading the last period, the readingPeriodHolder was set to null in
updatePeriods if it was the last period. (This would occur almost immediately
when playing a single-period source.) seekToPeriodPosition suppresses reusing a
loaded/prepared period if the reading period and playing period did not match,
which meant that the whole timeline was recreated when seeking in the last
period.

Leave readingPeriodHolder non-null. This means that at all times either
playingPeriodHolder == readingPeriodHolder (and they could be null or
non-null), or playingPeriodHolder and readingPeriodHolder differ and are both
non-null.

Also fix an issue where streams were never forced to be recreated during track
reselection when reading ahead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134774238
2016-09-30 14:40:06 +01:00
olly
7971a18a83 Revert back to default cue parameters until we support positioning
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134673236
2016-09-30 14:39:25 +01:00
olly
21626c417e Bump version to 2.0.1
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134662367
2016-09-29 16:30:10 +01:00
olly
8bf0243daf Fix mp3 extraction failure for short frames
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134660133
2016-09-29 16:29:35 +01:00
cdrolle
040fe3b194 Refactored the text.eia608 package to text.cea.
All of the classes in the text.eia608 package have been moved to
text.cea, and renamed with the "cea" prefix instead of "eia". All of
the buffering logic has been extracted from Cea608Decoder (formerly
Eia608Decoder) into the abstract CeaDecoder, which Cea608Decoder
extends. Cea608Decoder also now expects a 3-byte sample (i.e. the
entire cc_data_pkt instead of just the cc_data_1 and cc_data_2 bytes).
Classes like RawCcExtractor and SeiReader, responsible for creating
these samples, have also been updated accordingly.

This change is a necessary precursor to adding support for multi
-channel CEA-608 and CEA-708 captions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134537482
2016-09-29 16:28:58 +01:00
andrewlewis
825ec70d31 Move preparation from MediaPeriod constructors to prepare().
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134504088
2016-09-28 11:26:12 +01:00
aquilescanta
c7b5c967ff Remove duplicate methods in DefaultTrackSelector
This encourages a single invalidation when setting different parameters.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134436136
2016-09-28 11:26:12 +01:00
aquilescanta
ed5decfafc Add ElementaryStreamReader's factory to inject custom readers in TSExtractor
Issue:#726

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134433012
2016-09-28 11:26:12 +01:00
eguven
c82fd859be Move build*DataSourceFactory methods to the DemoApplication class for easy customization.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134414869
2016-09-28 11:26:12 +01:00
andrewlewis
4a62b2688c Post onPrepared so it runs after createPeriod has finished.
Issue: #1853

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134409897
2016-09-28 11:26:12 +01:00
andrewlewis
85b61adb32 Call onPrepared/onSourceInfoRefreshed on the playback thread.
HlsSampleStreamWrapper and ExtractorMediaPeriod would call
onPrepared/onSourceInfoRefreshed from their loading threads. That was
problematic for ConcatenatingMediaSource and MergingMediaSource, which assume
that their callbacks are called on the same thread (iterating through timelines
from all sources and updating pendingTimelineSources respectively). This change
makes them post calls to the callbacks on the playback thread.

Generally, implementing a composite MediaSource is easier if
MediaPeriod.Callback's methods are all called on the same (playback) thread, so
this change makes that part of its contract.

Also post onContinueLoadingRequested from ExtractingLoadable because
MergingMediaPeriod.onContinueLoadingRequested reads trackGroups written on the
playback thread.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134407280
2016-09-28 11:26:12 +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
anjalibh
d74166cd35 Parse Projection, ProjectionPrivate
As described in https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md.
Also parse StereoMode as per standard matroska spec.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134302208
2016-09-28 11:26:00 +01:00
cdrolle
f5ebcb8d04 Modified the default position parameters of the Cue objects created by
Eia608Decoder.

Full preamble positioning will be provided in a subsequent CL. This CL
also contains some minor cleanup in Eia608Decoder and adds some TODOs
to handle the second channel.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134299337
2016-09-28 11:25:40 +01:00
aquilescanta
7273237b28 Add an immutable holder for track selection parameters
This solves the thread unsafety issue of the default track selector and
allows atomic configuration changes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134288525
2016-09-28 11:25:40 +01:00
olly
65eda1d105 Add missing generic types
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134099118
2016-09-28 11:25:40 +01:00
olly
88b9e8c615 Clear the selection override even if renderer is disabled
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134078455
2016-09-28 11:25:40 +01:00
aquilescanta
94cc606091 Export variant codecs in HLS
Issue:#1772

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134073672
2016-09-28 11:25:40 +01:00
andrewlewis
8cf107408d Replace stbl consistency assertions with a warning.
Issue: #1850

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134073096
2016-09-28 11:25:40 +01:00
olly
654d914bb6 Fix DefaultHttpDataSource read when requested length is 0
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134063990
2016-09-28 11:25:40 +01:00
[]inger
669cf6804a Mention jcenter and gradle dependency in dev guide and Github readme.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134056007
2016-09-28 11:25:40 +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
olly
57a2749a9d Fix playback of short duration content
Issue #1837

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133944552
2016-09-28 11:25:34 +01:00
[]inger
e1ab1e3256 Update test vectors
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133944105
2016-09-28 11:25:24 +01:00
olly
a7d5f4b069 Automated rollback of "Upgrade gradle to 2.14.1"
*** Reason for rollback ***

2.14.1 not compatible with 2.1.2. Oops.

*** Original change description ***

Upgrade gradle to 2.14.1

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133939282
2016-09-28 11:25:11 +01:00
olly
06b96bfa8e Upgrade gradle to 2.14.1
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133938559
2016-09-28 11:25:11 +01:00
[]inger
57e486a44a Reorganize test vectors
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133935070
2016-09-28 11:25:02 +01:00
andrewlewis
1546da899b Use @IntDef where possible.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133932812
2016-09-28 11:25:02 +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
59ee4341c5 Fix buffering issue for live streams
Issue: #1825

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133401980
2016-09-16 18:56:40 +01:00
andrewlewis
22728d9ae4 Use new ParsableByteArray.reset where possible.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133384105
2016-09-16 18:56:02 +01:00
olly
c17190319b Rename assets to avoid naming conflicts
Issue #1823

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133267642
2016-09-16 18:54:09 +01:00
aquilescanta
70351bfae2 Create one HlsSampleStreamWrapper per track group
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133243031
2016-09-16 18:53:27 +01:00
andrewlewis
6a099f1c57 Clean up MP3 synchronization and fix handling < 4 frames.
Also add a test MP3 stream with one frame.

Make FakeExtractorInput's end of input detection to apply also for peekFully, and
make its skip and read methods read at least one byte.

Issue: #1732

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133241641
2016-09-16 18:52:42 +01:00
andrewlewis
b1f9798b89 Fix peeking the end of the stream then reading it.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133240502
2016-09-16 18:51:52 +01:00
olly
ab49425e43 Fix crash on pre-api-21 devices.
The four-arg constructor didn't exist in ViewGroup for
earlier API levels. I think it can probably be safely
omitted, unless you know otherwise?

Issue: #1820

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133156975
2016-09-14 20:18:13 +01:00
eguven
5512aae451 Revert CacheSpan EOS changes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133123235
2016-09-14 16:34:27 +01:00