1387 Commits

Author SHA1 Message Date
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
Oliver Woodman
52c5342158 getBufferedPosition can't return unknown anymore 2016-07-07 20:15:27 +01:00
olly
4c434005d4 Remove/simplify some extractor tests.
We have our snazzy new file-based extractor tests now,
and the other ones have historically proven way more
hassle than they're worth (e.g. I spent a good few hours
once just trying to work out how to fix the Mp4 extractor
test, having established it was the test and not the
code that was broken!).

I think some more can go from the ogg package, but leaving
in place for now because it's a bit less clear what to
get rid of.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125330072
2016-07-07 20:11:18 +01:00
eguven
53cc88e2dc DefaultOggSeeker small optimization.
skipToNextPage() isn't necessary anymore.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125147444
2016-07-07 20:09:28 +01:00
olly
4fe6e5d755 Misc fixes for playback tests.
- AllowedVideoJoiningTimeMs must be set to 0 for tests so
  that tests which disable/enable video renderers don't
  register a large number of dropped frames.
- Fixed a threading issue that could cause occassional test
  failure.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124978843
2016-06-15 20:28:17 +01:00
olly
aab551e907 Add HlsTest to V2.
The ones that are commented out are legitimately broken
and will need a library fix.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124978438
2016-06-15 20:27:48 +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
66a5c96c5a Calculate ExtractorSampleSource duration if unknown (playlists #4).
When buffering playlist items after the currently-playing one,
continueBuffering should take a position that is negative because the playback
position is before the start of the source being buffered. This change makes
sure that ExtractorSampleSources always have a known duration when they are
fully buffered, which means that the correct (negative) source-relative
position can be calculated.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124949409
2016-06-15 20:25:26 +01:00
eguven
e6267cd253 DefaultOggSeeker: use skipFully() instead skip().
skip() may skip less than what we want here.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124930478
2016-06-15 19:43:17 +01:00
andrewlewis
365812e820 Remove FrameworkSampleSource.
ExtractorSampleSource covers almost all use cases (except for AMR, AVI and
legacy Widevine). The FLAC extension must be compiled for support for FLAC
extraction.

FrameworkSampleSource has device-specific issues, makes blocking calls to the
underlying MediaExtractor, and does not provide much control over buffering.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124850102
2016-06-15 19:43:17 +01:00
andrewlewis
a6b7cfb5e4 Close ParsingLoadable input streams that fail to open.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124836804
2016-06-15 19:43:17 +01:00
olly
bd248ffee5 Ahem (fix bad constant value).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124836700
2016-06-15 19:43:17 +01:00
eguven
61df9aeb26 DashChunkSource: Workaround for missing segment at the end of the period.
Issue: #836
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124832221
2016-06-15 19:43:17 +01:00
olly
266c0dce40 Add DashTest to V2
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124831095
2016-06-15 19:43:17 +01:00
olly
f4e4fd51c6 Clean up chunked media source event listeners.
- Event listener is now at the SampleSource level, since the
  individual ChunkTrackStream instances are created internally.
- Event listener receives events corresponding to loads made
  at the SampleSource level (e.g. manifest fetches) in addition
  to those made by the ChunkTrackStream instances.
- Added ability for FormatEvaluators to propagate arbitrary
  information (as an Object) through to the listeners. This was
  a request from YouTube.
- Added significantly more information to each event, for example
  the DataSpec that defines the load being made is now passed, as
  is timing information.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124732984
2016-06-15 19:43:17 +01:00
eguven
172bc4e8d8 Increase mkv test sample file seek granularity to have better seek results.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124724113
2016-06-15 19:43:17 +01:00
olly
5cd7deffe7 Add playback tests to V2.
DashTest will be migrated separately, since it's a little
more work.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124722462
2016-06-15 19:43:17 +01:00
olly
0978227a84 Create a new CodecCounters on enable
If the same instance is reset then rapidly re-enabling the
renderer after disabling it can prevent an application from
reading the final values at the time when the renderer was
disabled. Hence we now instantiate a new CodecCounters each
time. This is needed to migrate DashTest to V2.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124721106
2016-06-15 19:42:58 +01:00
andrewlewis
7ae9bf409b Play a sequence of sources (playlists #3).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124713796
2016-06-15 19:42:58 +01:00
olly
df4e4a72fa Print the name of the decoder we failed to query.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124712775
2016-06-15 19:42:58 +01:00
andrewlewis
189a2502c5 Fix order of arguments in Format.copyWithDrmInitData.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124705921
2016-06-15 19:42:58 +01:00
sharjeel
41b86f660c sgpd support in ExoV2
This is basically clone of [] for Exo V2.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124682237
2016-06-15 19:42:58 +01:00
andrewlewis
2a3b4f6780 Don't flip() TextTrackRenderer EoS input buffers.
TextTrackRenderer would unconditionally flip input buffers read from its
source TrackStream, but the data could be null in the case where the buffer
signaled end of stream. Only flip if the corresponding flag is not set.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124559077
2016-06-15 19:42:58 +01:00
eguven
4279e22138 TestUtil.assertOutput() also tests seeking.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124556278
2016-06-15 19:42:58 +01:00
aquilescanta
461751b194 Add codec profiles for video container/sample formats.
This allows better decoding support checking.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124550351
2016-06-15 19:42:58 +01:00
olly
ca9bd5e8e4 Define DATA_TYPE constants in C.
Things like manifests are loaded not in the context of a Chunk,
but we want to eventually be reporting all loading events. So
it makes senes to define data types at a global level.

Also added {@code} in a few places for consistency.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124549737
2016-06-15 19:42:58 +01:00
tasnimsunny
b4746eddb3 Add cache initializtion signal to CacheEvictor
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124374161
2016-06-15 19:42:12 +01:00
eguven
544d88ca56 PsExtractorTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124355441
2016-06-15 19:42:12 +01:00