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

Unified Diff: content/renderer/media/video_capture_impl.cc

Issue 8528045: corresponding change in CaptureVideoDecoder and RTCVideoDecoder due to pull model used in medi... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: add more tests Created 9 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: content/renderer/media/video_capture_impl.cc
===================================================================
--- content/renderer/media/video_capture_impl.cc (revision 109978)
+++ content/renderer/media/video_capture_impl.cc (working copy)
@@ -79,20 +79,21 @@
}
void VideoCaptureImpl::DeInit(base::Closure task) {
+ ml_proxy_->PostTask(FROM_HERE,
+ base::Bind(&VideoCaptureImpl::DoDeInit,
+ base::Unretained(this), task));
+}
+
+void VideoCaptureImpl::DoDeInit(base::Closure task) {
if (state_ == kStarted)
Send(new VideoCaptureHostMsg_Stop(device_id_));
base::MessageLoopProxy* io_message_loop_proxy =
ChildProcess::current()->io_message_loop_proxy();
- if (!io_message_loop_proxy->BelongsToCurrentThread()) {
- io_message_loop_proxy->PostTask(FROM_HERE,
- base::Bind(&VideoCaptureImpl::RemoveDelegateOnIOThread,
- base::Unretained(this), task));
- return;
- }
-
- RemoveDelegateOnIOThread(task);
+ io_message_loop_proxy->PostTask(FROM_HERE,
+ base::Bind(&VideoCaptureImpl::RemoveDelegateOnIOThread,
+ base::Unretained(this), task));
}
void VideoCaptureImpl::StartCapture(
@@ -237,14 +238,14 @@
if (clients_.find(handler) == clients_.end())
return;
- handler->OnStopped(this);
- handler->OnRemoved(this);
clients_.erase(handler);
if (clients_.empty()) {
DVLOG(1) << "StopCapture: No more client, stopping ...";
StopDevice();
}
+ handler->OnStopped(this);
+ handler->OnRemoved(this);
}
void VideoCaptureImpl::DoFeedBuffer(scoped_refptr<VideoFrameBuffer> buffer) {
@@ -420,8 +421,8 @@
}
void VideoCaptureImpl::RemoveDelegateOnIOThread(base::Closure task) {
- base::ScopedClosureRunner task_runner(task);
message_filter_->RemoveDelegate(this);
+ ml_proxy_->PostTask(FROM_HERE, task);
}
void VideoCaptureImpl::Send(IPC::Message* message) {
« content/renderer/media/rtc_video_decoder.h ('K') | « content/renderer/media/video_capture_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698