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/browser/renderer_host/media/video_capture_host.h" | 5 #include "content/browser/renderer_host/media/video_capture_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/browser/browser_main_loop.h" | 10 #include "content/browser/browser_main_loop.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 void VideoCaptureHost::OnStartCapture(int device_id, | 173 void VideoCaptureHost::OnStartCapture(int device_id, |
174 media::VideoCaptureSessionId session_id, | 174 media::VideoCaptureSessionId session_id, |
175 const media::VideoCaptureParams& params) { | 175 const media::VideoCaptureParams& params) { |
176 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 176 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
177 DVLOG(1) << "VideoCaptureHost::OnStartCapture:" | 177 DVLOG(1) << "VideoCaptureHost::OnStartCapture:" |
178 << " session_id=" << session_id | 178 << " session_id=" << session_id |
179 << ", device_id=" << device_id | 179 << ", device_id=" << device_id |
180 << ", format=" << params.requested_format.ToString() | 180 << ", format=" << params.requested_format.ToString() |
181 << "@" << params.requested_format.frame_rate | 181 << "@" << params.requested_format.frame_rate |
182 << " (" << (params.resolution_change_policy == | 182 << " (" << (params.resolution_change_policy == |
183 media::RESOLUTION_POLICY_DYNAMIC_WITHIN_LIMIT ? | 183 media::RESOLUTION_POLICY_FIXED_RESOLUTION ? |
184 "variable" : "constant") | 184 "fixed resolution" : |
| 185 (params.resolution_change_policy == |
| 186 media::RESOLUTION_POLICY_FIXED_ASPECT_RATIO ? |
| 187 "fixed aspect ratio" : "variable resolution")) |
185 << ")"; | 188 << ")"; |
186 VideoCaptureControllerID controller_id(device_id); | 189 VideoCaptureControllerID controller_id(device_id); |
187 if (entries_.find(controller_id) != entries_.end()) { | 190 if (entries_.find(controller_id) != entries_.end()) { |
188 Send(new VideoCaptureMsg_StateChanged(device_id, | 191 Send(new VideoCaptureMsg_StateChanged(device_id, |
189 VIDEO_CAPTURE_STATE_ERROR)); | 192 VIDEO_CAPTURE_STATE_ERROR)); |
190 return; | 193 return; |
191 } | 194 } |
192 | 195 |
193 entries_[controller_id] = base::WeakPtr<VideoCaptureController>(); | 196 entries_[controller_id] = base::WeakPtr<VideoCaptureController>(); |
194 media_stream_manager_->video_capture_manager()->StartCaptureForClient( | 197 media_stream_manager_->video_capture_manager()->StartCaptureForClient( |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 return; | 329 return; |
327 | 330 |
328 if (it->second) { | 331 if (it->second) { |
329 media_stream_manager_->video_capture_manager()->StopCaptureForClient( | 332 media_stream_manager_->video_capture_manager()->StopCaptureForClient( |
330 it->second.get(), controller_id, this, on_error); | 333 it->second.get(), controller_id, this, on_error); |
331 } | 334 } |
332 entries_.erase(it); | 335 entries_.erase(it); |
333 } | 336 } |
334 | 337 |
335 } // namespace content | 338 } // namespace content |
OLD | NEW |