| Index: media/base/android/media_codec_decoder.h
|
| diff --git a/media/base/android/media_codec_decoder.h b/media/base/android/media_codec_decoder.h
|
| index 1301e12e5fde1bc35b512d628d308dd7114c5908..ca06078c2fb2bb839e218e96b6a056ad3e4cf138 100644
|
| --- a/media/base/android/media_codec_decoder.h
|
| +++ b/media/base/android/media_codec_decoder.h
|
| @@ -144,6 +144,7 @@ class MediaCodecDecoder {
|
| const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
|
| const base::Closure& external_request_data_cb,
|
| const base::Closure& starvation_cb,
|
| + const base::Closure& preroll_done_cb,
|
| const base::Closure& stop_done_cb,
|
| const base::Closure& error_cb,
|
| const char* decoder_thread_name);
|
| @@ -172,6 +173,7 @@ class MediaCodecDecoder {
|
|
|
| // Returns corresponding conditions.
|
| bool IsPrefetchingOrPlaying() const;
|
| + bool IsPrerollDone() const;
|
| bool IsStopped() const;
|
| bool IsCompleted() const;
|
|
|
| @@ -184,8 +186,13 @@ class MediaCodecDecoder {
|
| // Configures MediaCodec.
|
| ConfigStatus Configure();
|
|
|
| + // Sets preroll timestamp. The rendering starts after we reached it.
|
| + void SetPrerollTimestamp(base::TimeDelta preroll_timestamp);
|
| +
|
| // Starts the decoder thread and resumes the playback.
|
| - bool Start(base::TimeDelta current_time);
|
| + bool Start(base::TimeDelta start_timestamp);
|
| +
|
| + void ResumeAfterPreroll();
|
|
|
| // Stops the playback process synchronously. This method stops the decoder
|
| // thread synchronously, and then releases all MediaCodec buffers.
|
| @@ -199,6 +206,9 @@ class MediaCodecDecoder {
|
| // Notification posted when asynchronous stop is done or playback completed.
|
| void OnLastFrameRendered(bool completed);
|
|
|
| + // Notification posted when last prerolled frame has been returned to codec.
|
| + void OnPrerollDone();
|
| +
|
| // Puts the incoming data into AccessUnitQueue.
|
| void OnDemuxerDataAvailable(const DemuxerData& data);
|
|
|
| @@ -214,7 +224,10 @@ class MediaCodecDecoder {
|
|
|
| // Associates PTS with device time so we can calculate delays.
|
| // We use delays for video decoder only.
|
| - virtual void SynchronizePTSWithTime(base::TimeDelta current_time) {}
|
| + virtual void AssociateCurrentTimeWithPTS(base::TimeDelta current_time) {}
|
| +
|
| + // Invalidate delay calculation. We use delays for video decoder only.
|
| + virtual void DissociatePTSFromTime() {}
|
|
|
| // Processes the change of the output format, varies by stream.
|
| virtual void OnOutputFormatChanged() = 0;
|
| @@ -268,6 +281,8 @@ class MediaCodecDecoder {
|
| kStopped = 0,
|
| kPrefetching,
|
| kPrefetched,
|
| + kPrerolling,
|
| + kPrerolled,
|
| kRunning,
|
| kStopping,
|
| kInEmergencyStop,
|
| @@ -311,6 +326,7 @@ class MediaCodecDecoder {
|
| // These notifications are called on corresponding conditions.
|
| base::Closure prefetch_done_cb_;
|
| base::Closure starvation_cb_;
|
| + base::Closure preroll_done_cb_;
|
| base::Closure stop_done_cb_;
|
| base::Closure error_cb_;
|
|
|
| @@ -320,10 +336,19 @@ class MediaCodecDecoder {
|
| // Callback used to post OnCodecError method.
|
| base::Closure internal_error_cb_;
|
|
|
| + // Callback for posting OnPrerollDone method.
|
| + base::Closure internal_preroll_done_cb_;
|
| +
|
| // Internal state.
|
| DecoderState state_;
|
| mutable base::Lock state_lock_;
|
|
|
| + // Preroll timestamp is set if we need preroll and cleared after we done it.
|
| + base::TimeDelta preroll_timestamp_;
|
| +
|
| + // Frame period used in the calculations related to prerolling.
|
| + base::TimeDelta estimated_frame_period_;
|
| +
|
| // Flag is set when the EOS is enqueued into MediaCodec. Reset by Flush.
|
| bool eos_enqueued_;
|
|
|
|
|