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

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

Issue 13616004: Switch event type when a capture device has been stopped from the render process. This make sure th… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix review comments. Created 7 years, 8 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
« no previous file with comments | « content/renderer/media/rtc_video_capture_delegate.h ('k') | content/renderer/media/rtc_video_capturer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/rtc_video_capture_delegate.cc
diff --git a/content/renderer/media/rtc_video_capture_delegate.cc b/content/renderer/media/rtc_video_capture_delegate.cc
index 33a1917fc2d1b672818663813a2a8d479c3afa67..3c433179dcefaa4540d390186bf56c7ad356c2c2 100644
--- a/content/renderer/media/rtc_video_capture_delegate.cc
+++ b/content/renderer/media/rtc_video_capture_delegate.cc
@@ -59,14 +59,15 @@ void RtcVideoCaptureDelegate::OnPaused(media::VideoCapture* capture) {
void RtcVideoCaptureDelegate::OnError(media::VideoCapture* capture,
int error_code) {
- message_loop_proxy_->PostTask(
- FROM_HERE,
- base::Bind(&RtcVideoCaptureDelegate::OnErrorOnCaptureThread,
- this, capture, error_code));
}
void RtcVideoCaptureDelegate::OnRemoved(media::VideoCapture* capture) {
DVLOG(3) << " RtcVideoCaptureDelegate::OnRemoved";
+ message_loop_proxy_->PostTask(
+ FROM_HERE,
+ base::Bind(&RtcVideoCaptureDelegate::OnRemovedOnCaptureThread,
+ this, capture));
+
// Balance the AddRef in StartCapture.
// This means we are no longer registered as an event handler and can safely
// be deleted.
@@ -103,8 +104,8 @@ void RtcVideoCaptureDelegate::OnBufferReadyOnCaptureThread(
capture->FeedBuffer(buf);
}
-void RtcVideoCaptureDelegate::OnErrorOnCaptureThread(
- media::VideoCapture* capture, int error_code) {
+void RtcVideoCaptureDelegate::OnRemovedOnCaptureThread(
+ media::VideoCapture* capture) {
if (!state_callback_.is_null())
state_callback_.Run(got_first_frame_ ? CAPTURE_STOPPED : CAPTURE_FAILED);
wjia(left Chromium) 2013/04/05 18:39:17 This could still have problem since OnRemoved is c
perkj_chrome 2013/04/08 11:15:54 Do you know why we have have got_first_frame_ ? Wh
}
« no previous file with comments | « content/renderer/media/rtc_video_capture_delegate.h ('k') | content/renderer/media/rtc_video_capturer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698