Bug 797671: Import Webrtc.org code from stable branch 3.12 (rev 2820) rs=jesup
[gecko.git] / media / webrtc / trunk / src / video_engine / vie_channel_group.h
blobbcd58b2b2727bb700a3a7b66fdc64799f29a2214
1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
11 #ifndef WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_
12 #define WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_
14 #include <set>
16 #include "system_wrappers/interface/scoped_ptr.h"
18 namespace webrtc {
20 class BitrateController;
21 struct OverUseDetectorOptions;
22 class ProcessThread;
23 class RemoteBitrateEstimator;
24 class RemoteBitrateObserver;
25 class ViEChannel;
26 class ViEEncoder;
27 class VieRemb;
29 // Channel group contains data common for several channels. All channels in the
30 // group are assumed to send/receive data to the same end-point.
31 class ChannelGroup {
32 public:
33 ChannelGroup(ProcessThread* process_thread,
34 const OverUseDetectorOptions& options);
35 ~ChannelGroup();
37 void AddChannel(int channel_id);
38 void RemoveChannel(int channel_id, unsigned int ssrc);
39 bool HasChannel(int channel_id);
40 bool Empty();
42 bool SetChannelRembStatus(int channel_id,
43 bool sender,
44 bool receiver,
45 ViEChannel* channel,
46 ViEEncoder* encoder);
48 BitrateController* GetBitrateController();
49 RemoteBitrateEstimator* GetRemoteBitrateEstimator();
51 private:
52 typedef std::set<int> ChannelSet;
54 scoped_ptr<VieRemb> remb_;
55 scoped_ptr<BitrateController> bitrate_controller_;
56 scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
57 ChannelSet channels_;
60 } // namespace webrtc
62 #endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_