andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 1 | /* |
| 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.org | 281cff8 | 2013-05-17 13:44:48 +0000 | [diff] [blame] | 16 | #include "webrtc/system_wrappers/interface/scoped_ptr.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 17 | |
| 18 | namespace webrtc { |
| 19 | |
| 20 | class BitrateController; |
mflodman@webrtc.org | 78696d3 | 2012-11-26 12:40:15 +0000 | [diff] [blame] | 21 | class CallStats; |
andresp@webrtc.org | ac6d919 | 2013-05-13 10:50:50 +0000 | [diff] [blame] | 22 | class Config; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 23 | class EncoderStateFeedback; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 24 | class ProcessThread; |
andresp@webrtc.org | 0425392 | 2013-05-14 12:10:58 +0000 | [diff] [blame] | 25 | class RemoteBitrateEstimator; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 26 | class ViEChannel; |
| 27 | class ViEEncoder; |
| 28 | class 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. |
| 32 | class ChannelGroup { |
| 33 | public: |
pbos@webrtc.org | 46f7288 | 2013-12-16 12:24:44 +0000 | [diff] [blame] | 34 | ChannelGroup(int engine_id, ProcessThread* process_thread, |
henrik.lundin@webrtc.org | d2f95a8 | 2014-01-29 08:47:15 +0000 | [diff] [blame] | 35 | const Config* config); |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 36 | ~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.org | bea854a | 2013-04-22 12:41:57 +0000 | [diff] [blame] | 43 | bool SetChannelRembStatus(int channel_id, bool sender, bool receiver, |
| 44 | ViEChannel* channel); |
stefan@webrtc.org | 5d8c954 | 2014-03-25 10:37:31 +0000 | [diff] [blame] | 45 | void SetBandwidthEstimationConfig(const webrtc::Config& config); |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 46 | |
| 47 | BitrateController* GetBitrateController(); |
mflodman@webrtc.org | 78696d3 | 2012-11-26 12:40:15 +0000 | [diff] [blame] | 48 | CallStats* GetCallStats(); |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 49 | 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.org | 78696d3 | 2012-11-26 12:40:15 +0000 | [diff] [blame] | 57 | scoped_ptr<CallStats> call_stats_; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 58 | scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; |
| 59 | scoped_ptr<EncoderStateFeedback> encoder_state_feedback_; |
| 60 | ChannelSet channels_; |
henrik.lundin@webrtc.org | d2f95a8 | 2014-01-29 08:47:15 +0000 | [diff] [blame] | 61 | const Config* config_; |
| 62 | // Placeholder for the case where this owns the config. |
| 63 | scoped_ptr<Config> own_config_; |
mflodman@webrtc.org | 78696d3 | 2012-11-26 12:40:15 +0000 | [diff] [blame] | 64 | |
mflodman@webrtc.org | bea854a | 2013-04-22 12:41:57 +0000 | [diff] [blame] | 65 | // Registered at construct time and assumed to outlive this class. |
mflodman@webrtc.org | 78696d3 | 2012-11-26 12:40:15 +0000 | [diff] [blame] | 66 | ProcessThread* process_thread_; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 67 | }; |
| 68 | |
| 69 | } // namespace webrtc |
| 70 | |
| 71 | #endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_ |