| 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 #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_MANAGER_H | 11 #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_MANAGER_H |
| 12 #define WEBRTC_VOICE_ENGINE_CHANNEL_MANAGER_H | 12 #define WEBRTC_VOICE_ENGINE_CHANNEL_MANAGER_H |
| 13 | 13 |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "webrtc/base/constructormagic.h" | 16 #include "webrtc/base/constructormagic.h" |
| 17 #include "webrtc/base/scoped_ptr.h" | 17 #include "webrtc/base/scoped_ptr.h" |
| 18 #include "webrtc/system_wrappers/interface/atomic32.h" | 18 #include "webrtc/system_wrappers/interface/atomic32.h" |
| 19 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" | 19 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" |
| 20 #include "webrtc/typedefs.h" | 20 #include "webrtc/typedefs.h" |
| 21 #include "webrtc/video/rtc_event_log.h" |
| 21 | 22 |
| 22 namespace webrtc { | 23 namespace webrtc { |
| 23 | 24 |
| 24 class Config; | 25 class Config; |
| 25 | 26 |
| 26 namespace voe { | 27 namespace voe { |
| 27 | 28 |
| 28 class Channel; | 29 class Channel; |
| 29 | 30 |
| 30 // Shared-pointer implementation for keeping track of Channels. The underlying | 31 // Shared-pointer implementation for keeping track of Channels. The underlying |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // ChannelOwner.channel() will be NULL if channel_id is invalid or no longer | 105 // ChannelOwner.channel() will be NULL if channel_id is invalid or no longer |
| 105 // exists. This should be checked with ChannelOwner::IsValid(). | 106 // exists. This should be checked with ChannelOwner::IsValid(). |
| 106 ChannelOwner GetChannel(int32_t channel_id); | 107 ChannelOwner GetChannel(int32_t channel_id); |
| 107 void GetAllChannels(std::vector<ChannelOwner>* channels); | 108 void GetAllChannels(std::vector<ChannelOwner>* channels); |
| 108 | 109 |
| 109 void DestroyChannel(int32_t channel_id); | 110 void DestroyChannel(int32_t channel_id); |
| 110 void DestroyAllChannels(); | 111 void DestroyAllChannels(); |
| 111 | 112 |
| 112 size_t NumOfChannels() const; | 113 size_t NumOfChannels() const; |
| 113 | 114 |
| 115 // Returns a pointer to the event log object stored within the ChannelManager. |
| 116 RtcEventLog* GetEventLog() const; |
| 117 |
| 114 private: | 118 private: |
| 115 // Create a channel given a configuration, |config|. | 119 // Create a channel given a configuration, |config|. |
| 116 ChannelOwner CreateChannelInternal(const Config& config); | 120 ChannelOwner CreateChannelInternal(const Config& config); |
| 117 | 121 |
| 118 uint32_t instance_id_; | 122 uint32_t instance_id_; |
| 119 | 123 |
| 120 Atomic32 last_channel_id_; | 124 Atomic32 last_channel_id_; |
| 121 | 125 |
| 122 rtc::scoped_ptr<CriticalSectionWrapper> lock_; | 126 rtc::scoped_ptr<CriticalSectionWrapper> lock_; |
| 123 std::vector<ChannelOwner> channels_; | 127 std::vector<ChannelOwner> channels_; |
| 124 | 128 |
| 125 const Config& config_; | 129 const Config& config_; |
| 130 rtc::scoped_ptr<RtcEventLog> event_log_; |
| 126 | 131 |
| 127 DISALLOW_COPY_AND_ASSIGN(ChannelManager); | 132 DISALLOW_COPY_AND_ASSIGN(ChannelManager); |
| 128 }; | 133 }; |
| 129 } // namespace voe | 134 } // namespace voe |
| 130 } // namespace webrtc | 135 } // namespace webrtc |
| 131 | 136 |
| 132 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_MANAGER_H | 137 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_MANAGER_H |
| OLD | NEW |