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

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: Review comments Created 4 years, 9 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
« no previous file with comments | « webrtc/api/localaudiosource.h ('k') | webrtc/api/localaudiosource_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 rtc::scoped_refptr<LocalAudioSource> LocalAudioSource::Create( 70 rtc::scoped_refptr<LocalAudioSource> LocalAudioSource::Create(
71 const PeerConnectionFactoryInterface::Options& options, 71 const PeerConnectionFactoryInterface::Options& options,
72 const MediaConstraintsInterface* constraints) { 72 const MediaConstraintsInterface* constraints) {
73 rtc::scoped_refptr<LocalAudioSource> source( 73 rtc::scoped_refptr<LocalAudioSource> source(
74 new rtc::RefCountedObject<LocalAudioSource>()); 74 new rtc::RefCountedObject<LocalAudioSource>());
75 source->Initialize(options, constraints); 75 source->Initialize(options, constraints);
76 return source; 76 return source;
77 } 77 }
78 78
79 rtc::scoped_refptr<LocalAudioSource> LocalAudioSource::Create(
80 const PeerConnectionFactoryInterface::Options& options,
81 const cricket::AudioOptions* audio_options) {
82 rtc::scoped_refptr<LocalAudioSource> source(
83 new rtc::RefCountedObject<LocalAudioSource>());
84 source->Initialize(options, audio_options);
85 return source;
86 }
87
79 void LocalAudioSource::Initialize( 88 void LocalAudioSource::Initialize(
80 const PeerConnectionFactoryInterface::Options& options, 89 const PeerConnectionFactoryInterface::Options& options,
81 const MediaConstraintsInterface* constraints) { 90 const MediaConstraintsInterface* constraints) {
82 if (!constraints) 91 if (!constraints)
83 return; 92 return;
84 93
85 // Apply optional constraints first, they will be overwritten by mandatory 94 // Apply optional constraints first, they will be overwritten by mandatory
86 // constraints. 95 // constraints.
87 FromConstraints(constraints->GetOptional(), &options_); 96 FromConstraints(constraints->GetOptional(), &options_);
88 97
89 cricket::AudioOptions mandatory_options; 98 cricket::AudioOptions mandatory_options;
90 FromConstraints(constraints->GetMandatory(), &mandatory_options); 99 FromConstraints(constraints->GetMandatory(), &mandatory_options);
91 options_.SetAll(mandatory_options); 100 options_.SetAll(mandatory_options);
92 source_state_ = kLive; 101 }
102
103 void LocalAudioSource::Initialize(
104 const PeerConnectionFactoryInterface::Options& options,
105 const cricket::AudioOptions* audio_options) {
106 if (!audio_options)
107 return;
108
109 options_ = *audio_options;
93 } 110 }
94 111
95 } // namespace webrtc 112 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/localaudiosource.h ('k') | webrtc/api/localaudiosource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698