| 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 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 ChannelOwner::ChannelRef::ChannelRef(class Channel* channel) | 45 ChannelOwner::ChannelRef::ChannelRef(class Channel* channel) |
| 46 : channel(channel), ref_count(1) {} | 46 : channel(channel), ref_count(1) {} |
| 47 | 47 |
| 48 ChannelManager::ChannelManager(uint32_t instance_id, const Config& config) | 48 ChannelManager::ChannelManager(uint32_t instance_id, const Config& config) |
| 49 : instance_id_(instance_id), | 49 : instance_id_(instance_id), |
| 50 last_channel_id_(-1), | 50 last_channel_id_(-1), |
| 51 config_(config), | 51 config_(config), |
| 52 event_log_(RtcEventLog::Create(Clock::GetRealTimeClock())) {} | 52 event_log_(RtcEventLog::Create(Clock::GetRealTimeClock())) {} |
| 53 | 53 |
| 54 ChannelOwner ChannelManager::CreateChannel() { | 54 ChannelOwner ChannelManager::CreateChannel( |
| 55 return CreateChannelInternal(config_); | 55 std::shared_ptr<AudioDecoderFactory> decoder_factory) { |
| 56 return CreateChannelInternal(config_, std::move(decoder_factory)); |
| 56 } | 57 } |
| 57 | 58 |
| 58 ChannelOwner ChannelManager::CreateChannel(const Config& external_config) { | 59 ChannelOwner ChannelManager::CreateChannel( |
| 59 return CreateChannelInternal(external_config); | 60 const Config& external_config, |
| 61 std::shared_ptr<AudioDecoderFactory> decoder_factory) { |
| 62 return CreateChannelInternal(external_config, std::move(decoder_factory)); |
| 60 } | 63 } |
| 61 | 64 |
| 62 ChannelOwner ChannelManager::CreateChannelInternal(const Config& config) { | 65 ChannelOwner ChannelManager::CreateChannelInternal( |
| 66 const Config& config, |
| 67 std::shared_ptr<AudioDecoderFactory> decoder_factory) { |
| 63 Channel* channel; | 68 Channel* channel; |
| 64 Channel::CreateChannel(channel, ++last_channel_id_, instance_id_, | 69 Channel::CreateChannel(channel, ++last_channel_id_, instance_id_, |
| 65 event_log_.get(), config); | 70 event_log_.get(), config, std::move(decoder_factory)); |
| 66 ChannelOwner channel_owner(channel); | 71 ChannelOwner channel_owner(channel); |
| 67 | 72 |
| 68 rtc::CritScope crit(&lock_); | 73 rtc::CritScope crit(&lock_); |
| 69 | 74 |
| 70 channels_.push_back(channel_owner); | 75 channels_.push_back(channel_owner); |
| 71 | 76 |
| 72 return channel_owner; | 77 return channel_owner; |
| 73 } | 78 } |
| 74 | 79 |
| 75 ChannelOwner ChannelManager::GetChannel(int32_t channel_id) { | 80 ChannelOwner ChannelManager::GetChannel(int32_t channel_id) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 bool ChannelManager::Iterator::IsValid() { | 152 bool ChannelManager::Iterator::IsValid() { |
| 148 return iterator_pos_ < channels_.size(); | 153 return iterator_pos_ < channels_.size(); |
| 149 } | 154 } |
| 150 | 155 |
| 151 void ChannelManager::Iterator::Increment() { | 156 void ChannelManager::Iterator::Increment() { |
| 152 ++iterator_pos_; | 157 ++iterator_pos_; |
| 153 } | 158 } |
| 154 | 159 |
| 155 } // namespace voe | 160 } // namespace voe |
| 156 } // namespace webrtc | 161 } // namespace webrtc |
| OLD | NEW |