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

Side by Side Diff: content/renderer/media/rtc_video_capturer.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: Addressed code 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/rtc_video_capturer.h" 5 #include "content/renderer/media/rtc_video_capturer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 frame.time_stamp); 127 frame.time_stamp);
128 128
129 // This signals to libJingle that a new VideoFrame is available. 129 // This signals to libJingle that a new VideoFrame is available.
130 // libJingle have no assumptions on what thread this signal come from. 130 // libJingle have no assumptions on what thread this signal come from.
131 SignalFrameCaptured(this, &frame); 131 SignalFrameCaptured(this, &frame);
132 } 132 }
133 133
134 void RtcVideoCapturer::OnStateChange( 134 void RtcVideoCapturer::OnStateChange(
135 RtcVideoCaptureDelegate::CaptureState state) { 135 RtcVideoCaptureDelegate::CaptureState state) {
136 cricket::CaptureState converted_state = cricket::CS_FAILED; 136 cricket::CaptureState converted_state = cricket::CS_FAILED;
137 DVLOG(3) << " RtcVideoCapturer::OnStateChange " << state;
137 switch (state) { 138 switch (state) {
138 case RtcVideoCaptureDelegate::CAPTURE_STOPPED: 139 case RtcVideoCaptureDelegate::CAPTURE_STOPPED:
139 converted_state = cricket::CS_STOPPED; 140 converted_state = cricket::CS_STOPPED;
140 break; 141 break;
141 case RtcVideoCaptureDelegate::CAPTURE_RUNNING: 142 case RtcVideoCaptureDelegate::CAPTURE_RUNNING:
142 converted_state = cricket::CS_RUNNING; 143 converted_state = cricket::CS_RUNNING;
143 break; 144 break;
144 case RtcVideoCaptureDelegate::CAPTURE_FAILED: 145 case RtcVideoCaptureDelegate::CAPTURE_FAILED:
146 // TODO(perkj): Update the comments in the the definition of
147 // cricket::CS_FAILED. According to the comments, cricket::CS_FAILED
148 // means that the capturer failed to start. But here and in libjingle it
149 // is also used if an error occur during capturing.
145 converted_state = cricket::CS_FAILED; 150 converted_state = cricket::CS_FAILED;
146 break; 151 break;
147 default: 152 default:
148 NOTREACHED(); 153 NOTREACHED();
149 break; 154 break;
150 } 155 }
151 SignalStateChange(this, converted_state); 156 SignalStateChange(this, converted_state);
152 } 157 }
153 158
154 } // namespace content 159 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/rtc_video_capture_delegate.cc ('k') | content/renderer/media/video_capture_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698