| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/media_stream_video_capturer_source.h" | 5 #include "content/renderer/media/media_stream_video_capturer_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 source_->Resume(); | 190 source_->Resume(); |
| 191 else | 191 else |
| 192 source_->MaybeSuspend(); | 192 source_->MaybeSuspend(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 void MediaStreamVideoCapturerSource::OnCapturingLinkSecured(bool is_secure) { | 195 void MediaStreamVideoCapturerSource::OnCapturingLinkSecured(bool is_secure) { |
| 196 Send(new MediaStreamHostMsg_SetCapturingLinkSecured( | 196 Send(new MediaStreamHostMsg_SetCapturingLinkSecured( |
| 197 device_info().session_id, device_info().device.type, is_secure)); | 197 device_info().session_id, device_info().device.type, is_secure)); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void MediaStreamVideoCapturerSource::GetCurrentSupportedFormats( | |
| 201 int max_requested_width, | |
| 202 int max_requested_height, | |
| 203 double max_requested_frame_rate, | |
| 204 const VideoCaptureDeviceFormatsCB& callback) { | |
| 205 source_->GetCurrentSupportedFormats( | |
| 206 max_requested_width, | |
| 207 max_requested_height, | |
| 208 max_requested_frame_rate, | |
| 209 callback); | |
| 210 } | |
| 211 | |
| 212 void MediaStreamVideoCapturerSource::StartSourceImpl( | 200 void MediaStreamVideoCapturerSource::StartSourceImpl( |
| 213 const media::VideoCaptureFormat& format, | 201 const media::VideoCaptureFormat& format, |
| 214 const blink::WebMediaConstraints& constraints, | 202 const blink::WebMediaConstraints& constraints, |
| 215 const VideoCaptureDeliverFrameCB& frame_callback) { | 203 const VideoCaptureDeliverFrameCB& frame_callback) { |
| 216 is_capture_starting_ = true; | 204 is_capture_starting_ = true; |
| 217 source_->StartCapture( | 205 source_->StartCapture( |
| 218 capture_params_, frame_callback, | 206 capture_params_, frame_callback, |
| 219 base::Bind(&MediaStreamVideoCapturerSource::OnRunStateChanged, | 207 base::Bind(&MediaStreamVideoCapturerSource::OnRunStateChanged, |
| 220 base::Unretained(this))); | 208 base::Unretained(this))); |
| 221 } | 209 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 234 if (is_capture_starting_) { | 222 if (is_capture_starting_) { |
| 235 OnStartDone(is_running ? MEDIA_DEVICE_OK | 223 OnStartDone(is_running ? MEDIA_DEVICE_OK |
| 236 : MEDIA_DEVICE_TRACK_START_FAILURE); | 224 : MEDIA_DEVICE_TRACK_START_FAILURE); |
| 237 is_capture_starting_ = false; | 225 is_capture_starting_ = false; |
| 238 } else if (!is_running) { | 226 } else if (!is_running) { |
| 239 StopSource(); | 227 StopSource(); |
| 240 } | 228 } |
| 241 } | 229 } |
| 242 | 230 |
| 243 } // namespace content | 231 } // namespace content |
| OLD | NEW |