OLD | NEW |
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 Loading... |
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 |
OLD | NEW |