1707 Commits

Author SHA1 Message Date
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
andrewlewis
af3452d231 Make SampleSources reusable and implement SampleSourceProvider.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126888556
2016-07-08 10:15:14 +01:00
andrewlewis
42d78b3559 Fix seeking before a source is set.
Before this change, calling seekTo then setPlayWhenReady would cause the player
throw an error, due to using the sample source provider before it's set.

Transition to the buffering state in seekToInternal only if we have a sample
source provider.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126804528
2016-07-07 20:50:35 +01:00
olly
e02ca775f3 Optimize release of multiple allocations.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126799524
2016-07-07 20:50:05 +01:00
olly
1a3de408ac A few bug fixes.
1. Suppress onContinueLoadingRequested until a source is
   prepared (since such calls are not supposed to be made
   until after preparation has completed).
2. Don't use the format evaluator in HlsChunkSource prior
   to prepration completing.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126794616
2016-07-07 20:49:31 +01:00
olly
8c0e0b690e Don't abbreviate String as Str
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126792706
2016-07-07 20:48:53 +01:00
olly
85741ff2d3 TTML: Parse and use frameRate/Multiplier + tickRate
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126792535
2016-07-07 20:48:17 +01:00
olly
2426907f34 Fix positioning issues with ttml regions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126790829
2016-07-07 20:47:41 +01:00
olly
d3cd0c2ee4 Fix another broken link (by removal).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126789395
2016-07-07 20:47:03 +01:00
aquilescanta
b523ff8d81 Added javadoc to DefaultTrackSelectionPolicy methods
Also fixed language comparison using Locale's.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126703125
2016-07-07 20:46:26 +01:00
olly
19d65a7a9d Report loading on/off changes via ExoPlayer.
Also attempt to clear up naming a little, using "buffering" to
mean the user visible buffering state, and "loading" to mean a
source being loaded.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126693592
2016-07-07 20:45:53 +01:00
andrewlewis
f4239eb571 Release Extractors when ExtractorSampleSource is released.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126691912
2016-07-07 20:45:20 +01:00
olly
660b26e3ad Make NetworkLock non-static and less specific.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126682871
2016-07-07 20:44:46 +01:00
andrewlewis
dd031691b0 Pass an ExtractorsFactory to ExtractorSampleSource.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126672854
2016-07-07 20:44:12 +01:00
olly
06fd826a5c Restore injection of non-default retry count.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126646585
2016-07-07 20:43:38 +01:00
olly
49a93daf9e Restore HLS playback tests.
This fixes HlsChunkSource to allow selection of variants
other than the first one (as originally ordered in the
master playlist) in the case that the first one is
blacklisted. Having done this, the two disabled tests can
be restored.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126646547
2016-07-07 20:43:03 +01:00
olly
8db06a332f Fix HlsTrackStreamWrapper chunk queue updating
Also fix possible repeat-preparation for HlsTrackStreamWrapper
and ExtractorSampleSource.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126640380
2016-07-07 20:42:27 +01:00
olly
7b9e47ec6b Event based buffering.
At a high level, everything that we need to load in sync
with anything else now implements a new SequenceableLoader
class. This includes ChunkTrackStream, since multiple
demuxed tracks in DASH/SS need to be loaded in sync with
one another. At a higher level, SampleSources are also
SequenceableLoaders, which allows them to be kept in sync
by MultiSampleSource.

CompositeSequenceableLoader is able to load multiple
instances SequenceableLoaders in sync with one another,
and is used in various places where this is required.

This change also removes LoadControl registration, which
was complicated and error prone.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126632861
2016-07-07 20:41:52 +01:00
andrewlewis
7b673fe432 Fix miscellaneous consistency/formatting things.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126631393
2016-07-07 20:41:18 +01:00
olly
f0f25aef83 Support playlists in exolist.json.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126622342
2016-07-07 20:40:44 +01:00
aquilescanta
9f017d71ef Add HD content filtering to DefaultTrackSelectionPolicy
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126324788
2016-07-07 20:40:00 +01:00
andrewlewis
a476e090bc Use getConstructor().newInstance() in ExtractorSampleSource.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126306436
2016-07-07 20:39:22 +01:00
andrewlewis
2e77f02e7e Remove non-standard color constant.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126286809
2016-07-07 20:38:49 +01:00
andrewlewis
33fc6126a7 Improve track selection with renderers reading ahead (playlists #6)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126202210
2016-07-07 20:38:13 +01:00
olly
bd3574dfba Allow SampleSourceProvider concatenation, simplify demo.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126196431
2016-07-07 20:37:35 +01:00
olly
5c2bb2a852 Use the correct format for init segments loads.
This is causing getTrackIndex to fail for live playbacks.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126189387
2016-07-07 20:36:59 +01:00
olly
e33278436f Misc bugfixes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126175948
2016-07-07 20:36:25 +01:00
olly
ca81444f95 Event based preparation.
- Removes the load delay that was previously present after
  source preparation.
- Prevents premature failure in the case that the buffering
  source fails to prepare.
- SampleSource.Callback will get a second method in a
  subsequent CL, approximately meaning "tell me if I can load
  more stuff". This will remove the need for LoadControl and
  the complexity that comes with it.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126172573
2016-07-07 20:35:41 +01:00
olly
76f426e944 Introduce a global buffering policy.
This is required for buffering to work properly across
playlist transitions. It's also much simpler, since
specifying the buffering policy becomes independent of
the type of media being played (i.e. the source).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126051755
2016-07-07 20:34:57 +01:00
andrewlewis
fdd90256f4 Allow renderers to read ahead further than the next source.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125951381
2016-07-07 20:34:04 +01:00
andrewlewis
6031f89fe9 Limit the maximum number of sources to buffer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125698923
2016-07-07 20:32:47 +01:00
andrewlewis
aa313f234d Set TrackStreams to be final on renderers that will be disabled.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125691172
2016-07-07 20:32:11 +01:00
olly
494510d6ad Fix ready and ended conditions.
1. The readiness of the timeline is only relevant if there
   aren't any enabled renderers. It's also only ready if
   the source after the playing source is actually prepared
   (if not, we're waiting for preparation).
2. Prevent early transition to the ENDED state when the
   playback position hits the duration, but we're not at the
   final entry in the playlist.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125685193
2016-07-07 20:31:38 +01:00
olly
a8883baa69 Start cleaning up buffering.
- Always continue loading if we've got less than the minimum
  amount of media in the buffer.
- Use LoadControl in ExtractorSampleSource.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125679669
2016-07-07 20:31:04 +01:00
olly
5055a4aa91 Some restructing to make ExoPlayerImplInternal clearer.
- Update playbackInfo duration/position/bufferedPosition in a
  single place.
- Remove sampleSource variable, and remove side effects from
  getSampleSource. There was actually a subtle bug where
  getSampleSource wasn't called by anything where no renderers
  where enabled (meaning the source never transitioned).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125676540
2016-07-07 20:30:22 +01:00
olly
8eb1f3f57c Remove resumeInternal from ExoPlayerImplInternal.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125670965
2016-07-07 20:29:45 +01:00
olly
291b210be3 A source is fully buffered if it has no enabled tracks.
Also, getBufferedPosition shouldn't be called if no tracks
are selected.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125670213
2016-07-07 20:29:11 +01:00
olly
2746d59ea8 Handle TrackStream transitions in isSourceReady.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125669080
2016-07-07 20:28:27 +01:00
olly
79cbd390ab bufferedPositionUs cannot be UNSET.
Also do some naming cleanup + do ms->us seek conversion
in ExoPlayerImpl, since that's where we now do all the
conversions coming out of the player.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125662973
2016-07-07 20:27:53 +01:00
andrewlewis
e1d3c932fa Only update track streams in updateTrackStreams.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125661172
2016-07-07 20:27:14 +01:00
andrewlewis
fc2cdef208 Don't return a TrackStream from TrackRenderer.disable.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125659817
2016-07-07 20:26:37 +01:00
eguven
adc7ecec09 Support MPEG-TS streams that start/end with an incomplete TS packet or lost sync.
Issue: #1332
Issue: #1101
Issue: #1083
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125659191
2016-07-07 20:25:59 +01:00
aquilescanta
762ec41f95 Add support for HLS track selection flags
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125658752
2016-07-07 20:25:22 +01:00
olly
3e6c0ced82 A mini bit of Timeline simplification.
Pretty sure this does the same thing.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125581858
2016-07-07 20:24:45 +01:00
olly
5eca669474 Move renderers into Timeline.
The outer class should only deal with the enabled renderers.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125579652
2016-07-07 20:24:01 +01:00
andrewlewis
2073f3fce3 Expose source indices via ExoPlayer (playlists #5).
ExoPlayer.EventListener.onPositionDiscontinuity is notified during seeking and
transitioning from one source to the next.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125578976
2016-07-07 20:23:21 +01:00
olly
f9fa54cd5d Have seekTo return new position directly.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125476407
2016-07-07 20:22:38 +01:00
aquilescanta
e71cdb1bad Filter track support by profile and level
This CL only provides checks for HEVC codecs and adds codec information to Format
instances in DASH. Right now, we check that the supported profiles are advertised
individually and that the supported level is equal or higher than the requested codec
level.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125470489
2016-07-07 20:22:02 +01:00
eguven
0139f3f276 Remove unnecessary cloning.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125454697
2016-07-07 20:21:26 +01:00
eguven
6376f3a898 Upgrade gradle to benefit from instant run 'again'.
Now it needs to be 2.1.2 to support instant run.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125445366
2016-07-07 20:17:07 +01:00