| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 |
| 11 #include "webrtc/voice_engine/channel_manager.h" | 11 #include "webrtc/voice_engine/channel_manager.h" |
| 12 | 12 |
| 13 #include "webrtc/common.h" | 13 #include "webrtc/common.h" |
| 14 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" | |
| 15 #include "webrtc/voice_engine/channel.h" | 14 #include "webrtc/voice_engine/channel.h" |
| 16 | 15 |
| 17 namespace webrtc { | 16 namespace webrtc { |
| 18 namespace voe { | 17 namespace voe { |
| 19 | 18 |
| 20 ChannelOwner::ChannelOwner(class Channel* channel) | 19 ChannelOwner::ChannelOwner(class Channel* channel) |
| 21 : channel_ref_(new ChannelRef(channel)) {} | 20 : channel_ref_(new ChannelRef(channel)) {} |
| 22 | 21 |
| 23 ChannelOwner::ChannelOwner(const ChannelOwner& channel_owner) | 22 ChannelOwner::ChannelOwner(const ChannelOwner& channel_owner) |
| 24 : channel_ref_(channel_owner.channel_ref_) { | 23 : channel_ref_(channel_owner.channel_ref_) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 42 | 41 |
| 43 return *this; | 42 return *this; |
| 44 } | 43 } |
| 45 | 44 |
| 46 ChannelOwner::ChannelRef::ChannelRef(class Channel* channel) | 45 ChannelOwner::ChannelRef::ChannelRef(class Channel* channel) |
| 47 : channel(channel), ref_count(1) {} | 46 : channel(channel), ref_count(1) {} |
| 48 | 47 |
| 49 ChannelManager::ChannelManager(uint32_t instance_id, const Config& config) | 48 ChannelManager::ChannelManager(uint32_t instance_id, const Config& config) |
| 50 : instance_id_(instance_id), last_channel_id_(-1), config_(config) {} | 49 : instance_id_(instance_id), last_channel_id_(-1), config_(config) {} |
| 51 | 50 |
| 52 ChannelOwner ChannelManager::CreateChannel() { | |
| 53 return CreateChannel(CreateBuiltinAudioDecoderFactory()); | |
| 54 } | |
| 55 | |
| 56 ChannelOwner ChannelManager::CreateChannel(const Config& external_config) { | |
| 57 return CreateChannel(external_config, CreateBuiltinAudioDecoderFactory()); | |
| 58 } | |
| 59 | |
| 60 ChannelOwner ChannelManager::CreateChannel( | 51 ChannelOwner ChannelManager::CreateChannel( |
| 61 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) { | 52 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) { |
| 62 return CreateChannelInternal(config_, decoder_factory); | 53 return CreateChannelInternal(config_, decoder_factory); |
| 63 } | 54 } |
| 64 | 55 |
| 65 ChannelOwner ChannelManager::CreateChannel( | 56 ChannelOwner ChannelManager::CreateChannel( |
| 66 const Config& external_config, | 57 const Config& external_config, |
| 67 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) { | 58 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) { |
| 68 return CreateChannelInternal(external_config, decoder_factory); | 59 return CreateChannelInternal(external_config, decoder_factory); |
| 69 } | 60 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 bool ChannelManager::Iterator::IsValid() { | 145 bool ChannelManager::Iterator::IsValid() { |
| 155 return iterator_pos_ < channels_.size(); | 146 return iterator_pos_ < channels_.size(); |
| 156 } | 147 } |
| 157 | 148 |
| 158 void ChannelManager::Iterator::Increment() { | 149 void ChannelManager::Iterator::Increment() { |
| 159 ++iterator_pos_; | 150 ++iterator_pos_; |
| 160 } | 151 } |
| 161 | 152 |
| 162 } // namespace voe | 153 } // namespace voe |
| 163 } // namespace webrtc | 154 } // namespace webrtc |
| OLD | NEW |