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

Side by Side Diff: webrtc/api/localaudiosource.cc

Issue 1717583002: Non-constraint interfaces for all constrainable interfaces (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix an ambiguous function Created 4 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 rtc::scoped_refptr<LocalAudioSource> LocalAudioSource::Create( 71 rtc::scoped_refptr<LocalAudioSource> LocalAudioSource::Create(
72 const PeerConnectionFactoryInterface::Options& options, 72 const PeerConnectionFactoryInterface::Options& options,
73 const MediaConstraintsInterface* constraints) { 73 const MediaConstraintsInterface* constraints) {
74 rtc::scoped_refptr<LocalAudioSource> source( 74 rtc::scoped_refptr<LocalAudioSource> source(
75 new rtc::RefCountedObject<LocalAudioSource>()); 75 new rtc::RefCountedObject<LocalAudioSource>());
76 source->Initialize(options, constraints); 76 source->Initialize(options, constraints);
77 return source; 77 return source;
78 } 78 }
79 79
80 rtc::scoped_refptr<LocalAudioSource> LocalAudioSource::Create(
81 const PeerConnectionFactoryInterface::Options& options,
82 const cricket::AudioOptions* audio_options) {
83 rtc::scoped_refptr<LocalAudioSource> source(
84 new rtc::RefCountedObject<LocalAudioSource>());
85 source->Initialize(options, audio_options);
86 return source;
87 }
88
80 void LocalAudioSource::Initialize( 89 void LocalAudioSource::Initialize(
81 const PeerConnectionFactoryInterface::Options& options, 90 const PeerConnectionFactoryInterface::Options& options,
82 const MediaConstraintsInterface* constraints) { 91 const MediaConstraintsInterface* constraints) {
83 if (!constraints) 92 if (!constraints)
84 return; 93 return;
85 94
86 // Apply optional constraints first, they will be overwritten by mandatory 95 // Apply optional constraints first, they will be overwritten by mandatory
87 // constraints. 96 // constraints.
88 FromConstraints(constraints->GetOptional(), &options_); 97 FromConstraints(constraints->GetOptional(), &options_);
89 98
90 cricket::AudioOptions mandatory_options; 99 cricket::AudioOptions mandatory_options;
91 FromConstraints(constraints->GetMandatory(), &mandatory_options); 100 FromConstraints(constraints->GetMandatory(), &mandatory_options);
92 options_.SetAll(mandatory_options); 101 options_.SetAll(mandatory_options);
93 source_state_ = kLive; 102 source_state_ = kLive;
94 } 103 }
95 104
105 void LocalAudioSource::Initialize(
106 const PeerConnectionFactoryInterface::Options& options,
107 const cricket::AudioOptions* audio_options) {
108 if (!audio_options)
perkj_webrtc 2016/02/23 11:40:18 I think you should allow audio_options == nullptr
hta-webrtc 2016/02/23 14:30:34 The constructor sets source_state_(kInitializing).
nisse-webrtc 2016/02/23 15:11:02 If it's possible to delete all code dealing with a
perkj_webrtc 2016/03/01 08:41:26 It is probably correct in the base class since for
hta-webrtc 2016/03/02 09:33:40 It is actually not present in the base class. It's
109 return;
110
111 options_ = *audio_options;
112 source_state_ = kLive;
113 }
114
96 } // namespace webrtc 115 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698