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

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: 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 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 8
9 namespace content { 9 namespace content {
10 10
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 frame.pixel_width = 1; 106 frame.pixel_width = 1;
107 107
108 // This signals to libJingle that a new VideoFrame is available. 108 // This signals to libJingle that a new VideoFrame is available.
109 // libJingle have no assumptions on what thread this signal come from. 109 // libJingle have no assumptions on what thread this signal come from.
110 SignalFrameCaptured(this, &frame); 110 SignalFrameCaptured(this, &frame);
111 } 111 }
112 112
113 void RtcVideoCapturer::OnStateChange( 113 void RtcVideoCapturer::OnStateChange(
114 RtcVideoCaptureDelegate::CaptureState state) { 114 RtcVideoCaptureDelegate::CaptureState state) {
115 cricket::CaptureState converted_state = cricket::CS_FAILED; 115 cricket::CaptureState converted_state = cricket::CS_FAILED;
116 DVLOG(3) << " RtcVideoCapturer::OnStateChange " << state;
116 switch (state) { 117 switch (state) {
117 case RtcVideoCaptureDelegate::CAPTURE_STOPPED: 118 case RtcVideoCaptureDelegate::CAPTURE_STOPPED:
118 converted_state = cricket::CS_STOPPED; 119 converted_state = cricket::CS_STOPPED;
119 break; 120 break;
120 case RtcVideoCaptureDelegate::CAPTURE_RUNNING: 121 case RtcVideoCaptureDelegate::CAPTURE_RUNNING:
121 converted_state = cricket::CS_RUNNING; 122 converted_state = cricket::CS_RUNNING;
122 break; 123 break;
123 case RtcVideoCaptureDelegate::CAPTURE_FAILED: 124 case RtcVideoCaptureDelegate::CAPTURE_FAILED:
124 converted_state = cricket::CS_FAILED; 125 converted_state = cricket::CS_FAILED;
125 break; 126 break;
126 default: 127 default:
127 NOTREACHED(); 128 NOTREACHED();
128 break; 129 break;
129 } 130 }
130 SignalStateChange(this, converted_state); 131 SignalStateChange(this, converted_state);
131 } 132 }
132 133
133 } // namespace content 134 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698