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

Unified Diff: media/cast/video_receiver/video_receiver.cc

Issue 59753007: Passing frame decoded callback to the codec (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up Created 7 years, 1 month 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/cast/video_receiver/video_receiver.cc
diff --git a/media/cast/video_receiver/video_receiver.cc b/media/cast/video_receiver/video_receiver.cc
index 03ec0ea9565519fb4fbce52c552fa6b33246537e..8cec9e1a90c6f350ceba3e4bbdc280d8852704bc 100644
--- a/media/cast/video_receiver/video_receiver.cc
+++ b/media/cast/video_receiver/video_receiver.cc
@@ -131,7 +131,7 @@ VideoReceiver::VideoReceiver(scoped_refptr<CastEnvironment> cast_environment,
video_config.decoder_faster_than_max_frame_rate,
max_unacked_frames));
if (!video_config.use_external_decoder) {
- video_decoder_.reset(new VideoDecoder(video_config));
+ video_decoder_.reset(new VideoDecoder(video_config, cast_environment));
}
rtcp_.reset(
@@ -180,23 +180,14 @@ void VideoReceiver::DecodeVideoFrameThread(
DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::VIDEO_DECODER));
DCHECK(video_decoder_);
- // TODO(mikhal): Allow the application to allocate this memory.
- scoped_ptr<I420VideoFrame> video_frame(new I420VideoFrame());
+ bool success = video_decoder_->DecodeVideoFrame(encoded_frame.get(),
Alpha Left Google 2013/11/06 02:22:06 nit: I'd drop this local variable. You can call th
mikhal 2013/11/06 18:29:16 Done.
+ render_time, frame_decoded_callback);
- bool success = video_decoder_->DecodeVideoFrame(encoded_frame.get(),
- render_time, video_frame.get());
-
- if (success) {
- VLOG(1) << "Decoded frame " << static_cast<int>(encoded_frame->frame_id);
- // Frame decoded - return frame to the user via callback.
- cast_environment_->PostTask(CastEnvironment::MAIN, FROM_HERE,
- base::Bind(frame_decoded_callback,
- base::Passed(&video_frame), render_time));
- } else {
+ if (!success) {
// This will happen if we decide to decode but not show a frame.
cast_environment_->PostTask(CastEnvironment::MAIN, FROM_HERE,
base::Bind(&VideoReceiver::GetRawVideoFrame,
- weak_factory_.GetWeakPtr(), frame_decoded_callback));
+ weak_factory_.GetWeakPtr(), frame_decoded_callback));
}
}

Powered by Google App Engine
This is Rietveld 408576698