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

Side by Side Diff: content/browser/renderer_host/media/video_capture_host.cc

Issue 541163002: Clarify resolution change behaviors of video capture devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 6 years, 3 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/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/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "content/browser/browser_main_loop.h" 9 #include "content/browser/browser_main_loop.h"
10 #include "content/browser/renderer_host/media/media_stream_manager.h" 10 #include "content/browser/renderer_host/media/media_stream_manager.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 return handled; 214 return handled;
215 } 215 }
216 216
217 void VideoCaptureHost::OnStartCapture(int device_id, 217 void VideoCaptureHost::OnStartCapture(int device_id,
218 media::VideoCaptureSessionId session_id, 218 media::VideoCaptureSessionId session_id,
219 const media::VideoCaptureParams& params) { 219 const media::VideoCaptureParams& params) {
220 DCHECK_CURRENTLY_ON(BrowserThread::IO); 220 DCHECK_CURRENTLY_ON(BrowserThread::IO);
221 DVLOG(1) << "VideoCaptureHost::OnStartCapture:" 221 DVLOG(1) << "VideoCaptureHost::OnStartCapture:"
222 << " session_id=" << session_id 222 << " session_id=" << session_id
223 << ", device_id=" << device_id 223 << ", device_id=" << device_id
224 << ", format=" << params.requested_format.frame_size.ToString() 224 << ", format=" << params.requested_format.ToString()
225 << "@" << params.requested_format.frame_rate 225 << "@" << params.requested_format.frame_rate
226 << " (" << (params.allow_resolution_change ? "variable" : "constant") 226 << " (" << (params.resolution_change_policy ==
227 media::RESOLUTION_POLICY_DYNAMIC_WITHIN_LIMIT ?
228 "variable" : "constant")
227 << ")"; 229 << ")";
228 VideoCaptureControllerID controller_id(device_id); 230 VideoCaptureControllerID controller_id(device_id);
229 if (entries_.find(controller_id) != entries_.end()) { 231 if (entries_.find(controller_id) != entries_.end()) {
230 Send(new VideoCaptureMsg_StateChanged(device_id, 232 Send(new VideoCaptureMsg_StateChanged(device_id,
231 VIDEO_CAPTURE_STATE_ERROR)); 233 VIDEO_CAPTURE_STATE_ERROR));
232 return; 234 return;
233 } 235 }
234 236
235 entries_[controller_id] = base::WeakPtr<VideoCaptureController>(); 237 entries_[controller_id] = base::WeakPtr<VideoCaptureController>();
236 media_stream_manager_->video_capture_manager()->StartCaptureForClient( 238 media_stream_manager_->video_capture_manager()->StartCaptureForClient(
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 return; 356 return;
355 357
356 if (it->second) { 358 if (it->second) {
357 media_stream_manager_->video_capture_manager()->StopCaptureForClient( 359 media_stream_manager_->video_capture_manager()->StopCaptureForClient(
358 it->second.get(), controller_id, this, on_error); 360 it->second.get(), controller_id, this, on_error);
359 } 361 }
360 entries_.erase(it); 362 entries_.erase(it);
361 } 363 }
362 364
363 } // namespace content 365 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698