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