blob: 40ce71ef194a88b9defcb3c239983027e5f7a579 [file] [log] [blame]
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +00001/*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
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 */
10
11#ifndef WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_
12#define WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_
13
14#include <set>
15
pbos@webrtc.org281cff82013-05-17 13:44:48 +000016#include "webrtc/system_wrappers/interface/scoped_ptr.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000017
18namespace webrtc {
19
20class BitrateController;
mflodman@webrtc.org78696d32012-11-26 12:40:15 +000021class CallStats;
andresp@webrtc.orgac6d9192013-05-13 10:50:50 +000022class Config;
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000023class EncoderStateFeedback;
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000024class ProcessThread;
andresp@webrtc.org04253922013-05-14 12:10:58 +000025class RemoteBitrateEstimator;
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000026class ViEChannel;
27class ViEEncoder;
28class VieRemb;
29
30// Channel group contains data common for several channels. All channels in the
31// group are assumed to send/receive data to the same end-point.
32class ChannelGroup {
33 public:
pbos@webrtc.org46f72882013-12-16 12:24:44 +000034 ChannelGroup(int engine_id, ProcessThread* process_thread,
henrik.lundin@webrtc.orgd2f95a82014-01-29 08:47:15 +000035 const Config* config);
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000036 ~ChannelGroup();
37
38 void AddChannel(int channel_id);
39 void RemoveChannel(int channel_id, unsigned int ssrc);
40 bool HasChannel(int channel_id);
41 bool Empty();
42
mflodman@webrtc.orgbea854a2013-04-22 12:41:57 +000043 bool SetChannelRembStatus(int channel_id, bool sender, bool receiver,
44 ViEChannel* channel);
stefan@webrtc.org5d8c9542014-03-25 10:37:31 +000045 void SetBandwidthEstimationConfig(const webrtc::Config& config);
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000046
47 BitrateController* GetBitrateController();
mflodman@webrtc.org78696d32012-11-26 12:40:15 +000048 CallStats* GetCallStats();
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000049 RemoteBitrateEstimator* GetRemoteBitrateEstimator();
50 EncoderStateFeedback* GetEncoderStateFeedback();
51
52 private:
53 typedef std::set<int> ChannelSet;
54
55 scoped_ptr<VieRemb> remb_;
56 scoped_ptr<BitrateController> bitrate_controller_;
mflodman@webrtc.org78696d32012-11-26 12:40:15 +000057 scoped_ptr<CallStats> call_stats_;
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000058 scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
59 scoped_ptr<EncoderStateFeedback> encoder_state_feedback_;
60 ChannelSet channels_;
henrik.lundin@webrtc.orgd2f95a82014-01-29 08:47:15 +000061 const Config* config_;
62 // Placeholder for the case where this owns the config.
63 scoped_ptr<Config> own_config_;
mflodman@webrtc.org78696d32012-11-26 12:40:15 +000064
mflodman@webrtc.orgbea854a2013-04-22 12:41:57 +000065 // Registered at construct time and assumed to outlive this class.
mflodman@webrtc.org78696d32012-11-26 12:40:15 +000066 ProcessThread* process_thread_;
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000067};
68
69} // namespace webrtc
70
71#endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_