prepare(SampleSource) is renamed to setSource(SampleSource). The player
immediately transitions to STATE_BUFFERING when the source is set, at which
point doSomeWork is called.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119838825
TrackRenderer and SampleSourceTrackRenderer both now use a TrackStream
so they can be merged.
(This may also be useful for adding playlist support, in case TrackStreams need
to be replaced during playback.)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119743228
FrameworkSampleSource will still be useful for audio, where
sample interleaving isn't an issue. We could optionally add
a "don't wait for first frame" boolean to the video renderer
if we *really* need to keep some form of this workaround in
place, but I'd rather not do so for now.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119733224
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
When a seek is performed, renderers currently perform the
actions that they need to take in two places: Some changes
are performed in seekTo implementations. Other changes are
performed when discontinuities are read from the source.
In HLS we need to perform what is effectively a seek
originating in the source. To support this, this CL allows
discontinuities read from the source to modify the playback
position. All actions that renderers perform as a result
of a seek are moved to be performed when a discontinuity is
received.
Best way to understand CL:
- Look at SampleSource interface change and then at the
concrete implementations, to make sure they've been
changed properly.
- Look at SampleSourceTrackRenderer change.
- Look at concrete renderers. The general pattern is that
code previously performed in seekTo and READ_DISCONTINUITY
is merged into onDiscontinuity().
Note: This will be further untangled in V2.
Issue #676
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112720746
Currently, input/output buffers can 'leak' if they are dequeued then the decoder
is flush()ed. This happens if an input buffer is dequeued then a discontinuity
is read, or an output buffer is dequeued and is early. If this happens several
times, no more buffers are available.
This change makes flush() work like MediaCodec: it returns all dequeued
input/output buffers to the codec. Keeping the behavior in line with MediaCodec
might make it easier to factor out a common decoder interface in the future.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=109054178
1. Change package name (rm "datasource")
2. Require injection of OkHttpClient through all constructors, and
remove allowCrossProtocolRedirect/connectTimeout/readTimeout
constructor arguments. The client should be configured with these
prior to injection.
3. Fix code style to be consistent with the project.
4. Simplify call to get contentLength. I'm pretty sure okhttp returns
the correct value when gzip is enabled, so there's no need to check
this in the data source.
5. Misc cleanups.
- The old approach was technically incorrect, because the checks
were "capacity < sampleSize" and hence neglected the fact that
the buffer position may be greater than 0 (e.g. if the caller
wants to prefix the sample with some additional data).
- Also proactively throw an exception if the buffer is too small,
rather than wait for the failure when we actually do the write.