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

Side by Side Diff: content/renderer/media/video_capture_impl.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 // Notes about usage of this object by VideoCaptureImplManager. 5 // Notes about usage of this object by VideoCaptureImplManager.
6 // 6 //
7 // VideoCaptureImplManager access this object by using a Unretained() 7 // VideoCaptureImplManager access this object by using a Unretained()
8 // binding and tasks on the IO thread. It is then important that 8 // binding and tasks on the IO thread. It is then important that
9 // VideoCaptureImpl never post task to itself. All operations must be 9 // VideoCaptureImpl never post task to itself. All operations must be
10 // synchronous. 10 // synchronous.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } else if (!device_id_) { 96 } else if (!device_id_) {
97 clients_pending_on_filter_[client_id] = client_info; 97 clients_pending_on_filter_[client_id] = client_info;
98 } else { 98 } else {
99 // Note: |state_| might not be started at this point. But we tell 99 // Note: |state_| might not be started at this point. But we tell
100 // client that we have started. 100 // client that we have started.
101 state_update_cb.Run(VIDEO_CAPTURE_STATE_STARTED); 101 state_update_cb.Run(VIDEO_CAPTURE_STATE_STARTED);
102 if (state_ == VIDEO_CAPTURE_STATE_STARTED) { 102 if (state_ == VIDEO_CAPTURE_STATE_STARTED) {
103 clients_[client_id] = client_info; 103 clients_[client_id] = client_info;
104 // TODO(sheu): Allowing resolution change will require that all 104 // TODO(sheu): Allowing resolution change will require that all
105 // outstanding clients of a capture session support resolution change. 105 // outstanding clients of a capture session support resolution change.
106 DCHECK_EQ(params_.allow_resolution_change, 106 DCHECK_EQ(params_.resolution_change_policy,
107 params.allow_resolution_change); 107 params.resolution_change_policy);
108 } else if (state_ == VIDEO_CAPTURE_STATE_STOPPING) { 108 } else if (state_ == VIDEO_CAPTURE_STATE_STOPPING) {
109 clients_pending_on_restart_[client_id] = client_info; 109 clients_pending_on_restart_[client_id] = client_info;
110 DVLOG(1) << "StartCapture: Got new resolution " 110 DVLOG(1) << "StartCapture: Got new resolution "
111 << params.requested_format.frame_size.ToString() 111 << params.requested_format.frame_size.ToString()
112 << " during stopping."; 112 << " during stopping.";
113 } else { 113 } else {
114 clients_[client_id] = client_info; 114 clients_[client_id] = client_info;
115 if (state_ == VIDEO_CAPTURE_STATE_STARTED) 115 if (state_ == VIDEO_CAPTURE_STATE_STARTED)
116 return; 116 return;
117 params_ = params; 117 params_ = params;
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 ClientInfoMap::iterator it = clients->find(client_id); 434 ClientInfoMap::iterator it = clients->find(client_id);
435 if (it != clients->end()) { 435 if (it != clients->end()) {
436 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); 436 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED);
437 clients->erase(it); 437 clients->erase(it);
438 found = true; 438 found = true;
439 } 439 }
440 return found; 440 return found;
441 } 441 }
442 442
443 } // namespace content 443 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_video_capturer_source.cc ('k') | content/renderer/pepper/pepper_video_capture_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698