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

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

Issue 11783059: Ensures that WebRTC works for device selection using a different sample rate than default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix after review from Chris Created 7 years, 11 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/media_stream_ui_controller.h" 5 #include "content/browser/renderer_host/media/media_stream_ui_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 ProcessNextRequestForView(request->render_process_id, 195 ProcessNextRequestForView(request->render_process_id,
196 request->render_view_id); 196 request->render_view_id);
197 197
198 if (devices.size() > 0) { 198 if (devices.size() > 0) {
199 // Build a list of "full" device objects for the accepted devices. 199 // Build a list of "full" device objects for the accepted devices.
200 StreamDeviceInfoArray device_list; 200 StreamDeviceInfoArray device_list;
201 // TODO(xians): figure out if it is all right to hard code in_use to false, 201 // TODO(xians): figure out if it is all right to hard code in_use to false,
202 // though DevicesAccepted seems to do so. 202 // though DevicesAccepted seems to do so.
203 for (MediaStreamDevices::const_iterator dev = devices.begin(); 203 for (MediaStreamDevices::const_iterator dev = devices.begin();
204 dev != devices.end(); ++dev) { 204 dev != devices.end(); ++dev) {
205 device_list.push_back(StreamDeviceInfo( 205 device_list.push_back(StreamDeviceInfo(
206 dev->type, dev->name, dev->id, false)); 206 dev->type, dev->name, dev->id,
207 dev->sample_rate, dev->channel_layout, false));
207 } 208 }
208 209
209 requester_->DevicesAccepted(label, device_list); 210 requester_->DevicesAccepted(label, device_list);
210 } else { 211 } else {
211 requester_->SettingsError(label); 212 requester_->SettingsError(label);
212 } 213 }
213 } 214 }
214 215
215 void MediaStreamUIController::NotifyUIIndicatorDevicesOpened( 216 void MediaStreamUIController::NotifyUIIndicatorDevicesOpened(
216 int render_process_id, 217 int render_process_id,
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 } 341 }
341 } 342 }
342 343
343 BrowserThread::PostTask( 344 BrowserThread::PostTask(
344 BrowserThread::IO, FROM_HERE, 345 BrowserThread::IO, FROM_HERE,
345 base::Bind(&MediaStreamUIController::PostResponse, 346 base::Bind(&MediaStreamUIController::PostResponse,
346 weak_ptr_factory_.GetWeakPtr(), label, devices_to_use)); 347 weak_ptr_factory_.GetWeakPtr(), label, devices_to_use));
347 } 348 }
348 349
349 } // namespace content 350 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698