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

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

Issue 29423003: Added video capture capabilities retrieval and caching to VideoCaptureManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: perkj@ comments and nits. Created 7 years, 1 month 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
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_controller.h" 5 #include "content/browser/renderer_host/media/video_capture_controller.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 base::ProcessHandle render_process, 146 base::ProcessHandle render_process,
147 const media::VideoCaptureParams& params) { 147 const media::VideoCaptureParams& params) {
148 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 148 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
149 DVLOG(1) << "VideoCaptureController::AddClient, id " << id.device_id 149 DVLOG(1) << "VideoCaptureController::AddClient, id " << id.device_id
150 << ", (" << params.requested_format.width 150 << ", (" << params.requested_format.width
151 << ", " << params.requested_format.height 151 << ", " << params.requested_format.height
152 << ", " << params.requested_format.frame_rate 152 << ", " << params.requested_format.frame_rate
153 << ", " << params.session_id 153 << ", " << params.session_id
154 << ")"; 154 << ")";
155 155
156 video_capture_params_ = params;
157
156 // Signal error in case device is already in error state. 158 // Signal error in case device is already in error state.
157 if (state_ == VIDEO_CAPTURE_STATE_ERROR) { 159 if (state_ == VIDEO_CAPTURE_STATE_ERROR) {
158 event_handler->OnError(id); 160 event_handler->OnError(id);
159 return; 161 return;
160 } 162 }
161 163
162 // Do nothing if this client has called AddClient before. 164 // Do nothing if this client has called AddClient before.
163 if (FindClient(id, event_handler, controller_clients_)) 165 if (FindClient(id, event_handler, controller_clients_))
164 return; 166 return;
165 167
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 } 560 }
559 return NULL; 561 return NULL;
560 } 562 }
561 563
562 int VideoCaptureController::GetClientCount() { 564 int VideoCaptureController::GetClientCount() {
563 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 565 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
564 return controller_clients_.size(); 566 return controller_clients_.size();
565 } 567 }
566 568
567 } // namespace content 569 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698