blob: 4b6e927c18b37f8d60d4ea8bde82e99e41ea249a [file] [log] [blame]
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_
#define WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_
#include <set>
#include "modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
#include "system_wrappers/interface/scoped_ptr.h"
namespace webrtc {
class BitrateController;
class EncoderStateFeedback;
struct OverUseDetectorOptions;
class ProcessThread;
class ViEChannel;
class ViEEncoder;
class VieRemb;
// Channel group contains data common for several channels. All channels in the
// group are assumed to send/receive data to the same end-point.
class ChannelGroup {
public:
ChannelGroup(ProcessThread* process_thread,
const OverUseDetectorOptions& options,
RemoteBitrateEstimator::EstimationMode mode);
~ChannelGroup();
void AddChannel(int channel_id);
void RemoveChannel(int channel_id, unsigned int ssrc);
bool HasChannel(int channel_id);
bool Empty();
bool SetChannelRembStatus(int channel_id,
bool sender,
bool receiver,
ViEChannel* channel,
ViEEncoder* encoder);
BitrateController* GetBitrateController();
RemoteBitrateEstimator* GetRemoteBitrateEstimator();
EncoderStateFeedback* GetEncoderStateFeedback();
private:
typedef std::set<int> ChannelSet;
scoped_ptr<VieRemb> remb_;
scoped_ptr<BitrateController> bitrate_controller_;
scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
scoped_ptr<EncoderStateFeedback> encoder_state_feedback_;
ChannelSet channels_;
};
} // namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_VIE_CHANNEL_GROUP_H_