| OLD | NEW |
| 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 Loading... |
| 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 source_state_ = kLive; |
| 93 } | 102 } |
| 94 | 103 |
| 104 void LocalAudioSource::Initialize( |
| 105 const PeerConnectionFactoryInterface::Options& options, |
| 106 const cricket::AudioOptions* audio_options) { |
| 107 if (!audio_options) |
| 108 return; |
| 109 |
| 110 options_ = *audio_options; |
| 111 source_state_ = kLive; |
| 112 } |
| 113 |
| 95 } // namespace webrtc | 114 } // namespace webrtc |
| OLD | NEW |