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

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: nits and reverting callback change 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
« no previous file with comments | « media/cast/video_receiver/video_decoder_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..98922b2edadcfb76af5a6d9b63f46f0a3ae5dc6d 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,12 @@ 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(),
- 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 (!(video_decoder_->DecodeVideoFrame(encoded_frame.get(), render_time,
+ frame_decoded_callback))) {
// 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));
}
}
« no previous file with comments | « media/cast/video_receiver/video_decoder_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698