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

Side by Side Diff: content/common/media/media_stream_options.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: Had to restore usage of UTF16ToUTF8() in MediaStreamImpl::OnCreateNativeSourcesComplete to build on… 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/common/media/media_stream_options.h" 5 #include "content/common/media/media_stream_options.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace content { 9 namespace content {
10 10
(...skipping 18 matching lines...) Expand all
29 StreamDeviceInfo::StreamDeviceInfo() 29 StreamDeviceInfo::StreamDeviceInfo()
30 : in_use(false), 30 : in_use(false),
31 session_id(kNoId) {} 31 session_id(kNoId) {}
32 32
33 StreamDeviceInfo::StreamDeviceInfo(MediaStreamType service_param, 33 StreamDeviceInfo::StreamDeviceInfo(MediaStreamType service_param,
34 const std::string& name_param, 34 const std::string& name_param,
35 const std::string& device_param, 35 const std::string& device_param,
36 bool opened) 36 bool opened)
37 : device(service_param, device_param, name_param), 37 : device(service_param, device_param, name_param),
38 in_use(opened), 38 in_use(opened),
39 session_id(kNoId) {} 39 session_id(kNoId) {
40 DCHECK(IsVideoMediaType(service_param));
41 }
42
43 StreamDeviceInfo::StreamDeviceInfo(MediaStreamType service_param,
44 const std::string& name_param,
45 const std::string& device_param,
46 int sample_rate,
47 int channel_layout,
48 bool opened)
49 : device(service_param, device_param, name_param, sample_rate,
50 channel_layout),
51 in_use(opened),
52 session_id(kNoId) {
53 DCHECK(IsAudioMediaType(service_param));
54 }
40 55
41 // static 56 // static
42 bool StreamDeviceInfo::IsEqual(const StreamDeviceInfo& first, 57 bool StreamDeviceInfo::IsEqual(const StreamDeviceInfo& first,
43 const StreamDeviceInfo& second) { 58 const StreamDeviceInfo& second) {
44 return first.device.type == second.device.type && 59 return first.device.type == second.device.type &&
45 first.device.name == second.device.name && 60 first.device.name == second.device.name &&
46 first.device.id == second.device.id && 61 first.device.id == second.device.id &&
62 first.device.sample_rate == second.device.sample_rate &&
63 first.device.channel_layout == second.device.channel_layout &&
47 first.in_use == second.in_use && 64 first.in_use == second.in_use &&
48 first.session_id == second.session_id; 65 first.session_id == second.session_id;
49 } 66 }
50 67
51 } // namespace content 68 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698