| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "content/renderer/media/video_capture_impl_manager.h" | 10 #include "content/renderer/media/video_capture_impl_manager.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 callback); | 230 callback); |
| 231 } | 231 } |
| 232 | 232 |
| 233 void MediaStreamVideoCapturerSource::StartSourceImpl( | 233 void MediaStreamVideoCapturerSource::StartSourceImpl( |
| 234 const media::VideoCaptureFormat& format, | 234 const media::VideoCaptureFormat& format, |
| 235 const VideoCaptureDeliverFrameCB& frame_callback) { | 235 const VideoCaptureDeliverFrameCB& frame_callback) { |
| 236 media::VideoCaptureParams new_params; | 236 media::VideoCaptureParams new_params; |
| 237 new_params.requested_format = format; | 237 new_params.requested_format = format; |
| 238 if (device_info().device.type == MEDIA_TAB_VIDEO_CAPTURE || | 238 if (device_info().device.type == MEDIA_TAB_VIDEO_CAPTURE || |
| 239 device_info().device.type == MEDIA_DESKTOP_VIDEO_CAPTURE) { | 239 device_info().device.type == MEDIA_DESKTOP_VIDEO_CAPTURE) { |
| 240 new_params.allow_resolution_change = true; | 240 new_params.resolution_change_policy = |
| 241 media::RESOLUTION_POLICY_DYNAMIC_WITHIN_LIMIT; |
| 241 } | 242 } |
| 242 delegate_->StartCapture( | 243 delegate_->StartCapture( |
| 243 new_params, | 244 new_params, |
| 244 frame_callback, | 245 frame_callback, |
| 245 base::Bind(&MediaStreamVideoCapturerSource::OnStartDone, | 246 base::Bind(&MediaStreamVideoCapturerSource::OnStartDone, |
| 246 base::Unretained(this))); | 247 base::Unretained(this))); |
| 247 } | 248 } |
| 248 | 249 |
| 249 void MediaStreamVideoCapturerSource::StopSourceImpl() { | 250 void MediaStreamVideoCapturerSource::StopSourceImpl() { |
| 250 delegate_->StopCapture(); | 251 delegate_->StopCapture(); |
| 251 } | 252 } |
| 252 | 253 |
| 253 } // namespace content | 254 } // namespace content |
| OLD | NEW |