Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(708)

Unified Diff: media/base/android/media_codec_video_decoder.cc

Issue 1254293003: MediaCodecPlayer implementation (stage 4 - preroll) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mtplayer-browserseek
Patch Set: Removed unused var, fixed unit test compilation Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/android/media_codec_video_decoder.cc
diff --git a/media/base/android/media_codec_video_decoder.cc b/media/base/android/media_codec_video_decoder.cc
index 92bf40c51476e5eee95d7bd036f9eeaf27032b5a..ccd6e924d813a593be46b09cab001265d9ff63b0 100644
--- a/media/base/android/media_codec_video_decoder.cc
+++ b/media/base/android/media_codec_video_decoder.cc
@@ -20,6 +20,7 @@ MediaCodecVideoDecoder::MediaCodecVideoDecoder(
const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
const base::Closure& 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 SetTimeCallback& update_current_time_cb,
@@ -28,6 +29,7 @@ MediaCodecVideoDecoder::MediaCodecVideoDecoder(
: MediaCodecDecoder(media_task_runner,
request_data_cb,
starvation_cb,
+ preroll_done_cb,
stop_done_cb,
error_cb,
"VideoDecoder"),
@@ -159,13 +161,18 @@ MediaCodecDecoder::ConfigStatus MediaCodecVideoDecoder::ConfigureInternal() {
return CONFIG_OK;
}
-void MediaCodecVideoDecoder::SynchronizePTSWithTime(
- base::TimeDelta current_time) {
+void MediaCodecVideoDecoder::AssociateCurrentTimeWithPTS(base::TimeDelta pts) {
DCHECK(media_task_runner_->BelongsToCurrentThread());
start_time_ticks_ = base::TimeTicks::Now();
- start_pts_ = current_time;
- last_seen_pts_ = current_time;
+ start_pts_ = pts;
+ last_seen_pts_ = pts;
+}
+
+void MediaCodecVideoDecoder::DissociatePTSFromTime() {
+ DCHECK(media_task_runner_->BelongsToCurrentThread());
+
+ start_pts_ = last_seen_pts_ = kNoTimestamp();
}
void MediaCodecVideoDecoder::OnOutputFormatChanged() {
@@ -206,7 +213,7 @@ void MediaCodecVideoDecoder::Render(int buffer_index,
last_seen_pts_ = pts;
}
- if (!render_output) {
+ if (!render_output || start_pts_ == kNoTimestamp()) {
ReleaseOutputBuffer(buffer_index, pts, size, false, eos_encountered);
return;
}
« media/base/android/media_codec_decoder.cc ('K') | « media/base/android/media_codec_video_decoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698