Commit graph

27 commits

Author SHA1 Message Date
olly
6cb20525cb ExoPlayer V2 Refactor - Step 3
Move binding of tracks<->renderers to ExoPlayerImplInternal.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=113046018
2016-06-15 18:54:26 +01:00
olly
cdae9ac5d2 ExoPlayer V2 Refactor - Steps 1/2.
GitHub note - Apologies for the cryptic change descriptions,
they relate to a design doc that's not externally visible.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=113043764
2016-06-15 18:53:40 +01:00
olly
be2aedbd53 Don't consider switching tracks as "joining".
I'm not really sure how best to document this in TrackRenderer;
it's a bit of a weird feature. For now, I've gone with the vague
approach.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112150939
2016-01-14 17:13:32 +00:00
Oliver Woodman
d96fe37c05 Don't use getClass().getSimpleName() where it's pointless to do so 2015-11-17 15:52:58 +00:00
Oliver Woodman
765d1659be Return "seeked to" position immediately after seek. 2015-09-18 18:25:25 +01:00
Oliver Woodman
8db1331021 Propagate MediaFormat instead of TrackInfo.
Issue #514.
2015-08-11 18:23:22 +01:00
Oliver Woodman
6085d185fa Internal plumbing for multi-track support.
- Generalize rendererEnabledFlags to be selected track indices through
  ExoPlayerImpl/ExoPlayerImplInternal.
- Selecting an out-of-bound track index (e.g. -1) is equivalent to
  disabling a renderer prior to the generalization.
- A prepared TrackRenderer that exposes 0 tracks is equivalent to a
  TrackRenderer in the STATE_IGNORE state prior to the generalization.

Issue #514.
2015-08-11 18:06:21 +01:00
Oliver Woodman
adf98b0fcc Make seekTo(currentPosition) a no-op in ExoPlayer.
- Also avoid boxing when passing the seek position to the background
  thread.

Issue: #654
2015-08-11 17:55:19 +01:00
Oliver Woodman
a2f10399e7 Improve error propagation 2015-07-21 10:07:49 +01:00
Oliver Woodman
fb31fe0fe4 Fix stale comment 2015-06-26 14:27:17 +01:00
Oliver Woodman
8e58a3f5f5 Steps toward full multi-track support.
1. Remove requirement for TrackRenderer implementations to report
   current position, unless they are time sources.
2. Expose whether renderers have media to play. The immediate benefit
   of this is to solve the referenced GitHub issue, and also to only
   display the appropriate Audio/Video/Text buttons in the demo app
   for the media being played. This is also a natural step toward
   multi-track support.

Github issue: #541
2015-06-18 14:27:24 +01:00
Oliver Woodman
0ee8c07fe5 Better handle duration + disabled renderers
- Fix bug where duration of initially disabled tracks wasn't correctly
  incorporated into the overall duration reported by the player.
- Don't transition to STATE_ENDED unless the position has reached the
  duration, if the duration is known. This allows for "playback" to
  continue when all renderers are disabled, rather than jumping straight
  to STATE_ENDED.
2015-06-18 14:21:32 +01:00
Oliver Woodman
ead25a9dfe Call incrementalPrepare directly from prepare 2015-06-12 17:44:44 +01:00
Oliver Woodman
67d0154960 Use Java7 <> syntax 2015-05-22 21:40:22 +01:00
Oliver Woodman
64cc380fe1 Avoid loading first chunk when preparing HLS for non-zero position.
This also fixes a technical mistake where HlsChunkSource is fed
seekPositionUs=-1 when obtaining the first chunk. This is wrong,
but the usage of this variable within HlsChunkSource enforces that
the seek must stay within bounds, so we get away with it.

Issue: #385
2015-05-11 21:10:20 +01:00
Oliver Woodman
0c5a1a6c35 Distinguish exceptions caught at top level. 2015-05-01 20:31:49 +01:00
Oliver Woodman
b787852e71 Correctly stop previous renderers if prepare is called again. 2015-05-01 20:11:57 +01:00
Oliver Woodman
a968e5535b Continue playback of tracks with longer duration than the timesource.
If the timesource track renderer ends, but other track renderers
haven't finished, the player would get stuck in a pending state.
This change enables automatic switching to the media clock in the
case that the timesource renderer has ended, which allows other
renderers to continue to play.
2015-02-06 11:32:46 +00:00
Oliver Woodman
685e1d1f06 Minimize memory leak risks.
Remove implicit back-reference from playback thread to player.
2014-11-18 18:54:45 +00:00
Oliver Woodman
027d9eefbd Smoother playback #1.
Propagate elapsedRealtimeUs to the video renderer. This allows
the renderer to calculate and adjust for the elapsed time since
the start of the current rendering loop. Typically this is <2ms,
but there situations where it can go higher (normally when the
video renderer ends up processing more than 1 output buffer in
a single loop).

Also made variable naming more consistent throughout the package.
2014-10-09 17:26:01 +01:00
Oliver Woodman
fc230733ae Ignore blockingSendMessage calls after release.
Previously we'd end up blocking forever in this case, which
is the worst thing we could do :). We could either throw an
exception or just print a warning. Printing a warning is more
in line with what other methods do (Handler prints a "sending
message to dead thread" warning).
2014-09-23 11:21:44 +01:00
Oliver Woodman
f52742b100 Ensure that we try and call release on a renderer
Do this even if stop/disable fails.
2014-09-19 18:32:21 +01:00
Oliver Woodman
e4b35e884a Transition ExoPlayer to use longs for ms timestamps. 2014-09-11 16:26:43 +01:00
Oliver Woodman
8ec8840261 Minor cleanup.
- Add constants class. Currently housing a single lonely variable,
which is used generally throughout the library, and so no longer
nicely fits into a specific class.

- Rename a few other constants to add clear units.

- Made minor tweak to ExoPlayer documentation.
2014-08-11 18:38:39 +01:00
Oliver Woodman
25a532656c Optimize some CodecCounter inefficiency.
1. Use ints rather than longs.
2. Remove some counters that dont seem hugely useful.
3. Replace use of volatile with explicit method calls that
   cause a memory barrier. This is a lot more efficient than
   using volatile because it can be invoked only once per
   doSomeWork.
2014-08-11 17:42:08 +01:00
Oliver Woodman
b1992c3848 Don't call doSomeWork if we're preparing 2014-08-01 15:53:49 +01:00
Oliver Woodman
27ab5c83a6 Initial drop. 1.0.10. 2014-06-16 12:56:04 +01:00