#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
#include "webrtc/modules/video_coding/main/interface/video_coding_defines.h"
+#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/system_wrappers/interface/tick_util.h"
#include "webrtc/typedefs.h"
class Config;
class CriticalSectionWrapper;
class EncodedImageCallback;
-class Encryption;
class I420FrameCallback;
class PacedSender;
class ProcessThread;
int32_t GetRemoteCSRC(uint32_t CSRCs[kRtpCsrcSize]);
int SetRtxSendPayloadType(int payload_type);
+ // Only has an effect once RTX is enabled.
+ void SetPadWithRedundantPayloads(bool enable);
void SetRtxReceivePayloadType(int payload_type);
// Sets the starting sequence number, must be called before StartSend.
int32_t SetStartSequenceNumber(uint16_t sequence_number);
+ void SetRtpStateForSsrc(uint32_t ssrc, const RtpState& rtp_state);
+ RtpState GetRtpStateForSsrc(uint32_t ssrc);
+
// Sets the CName for the outgoing stream on the channel.
int32_t SetRTCPCName(const char rtcp_cname[]);
- // Gets the CName for the outgoing stream on the channel.
- int32_t GetRTCPCName(char rtcp_cname[]);
-
// Gets the CName of the incoming stream.
int32_t GetRemoteRTCPCName(char rtcp_cname[]);
int32_t RegisterRtpObserver(ViERTPObserver* observer);
void RegisterReceiveChannelRtpStatisticsCallback(
StreamDataCountersCallback* callback);
+ void GetRtcpPacketTypeCounters(RtcpPacketTypeCounter* packets_sent,
+ RtcpPacketTypeCounter* packets_received) const;
+
void GetBandwidthUsage(uint32_t* total_bitrate_sent,
uint32_t* video_bitrate_sent,
uint32_t* fec_bitrate_sent,
uint32_t* nackBitrateSent) const;
+ // TODO(holmer): Deprecated. We should use the SendSideDelayObserver instead
+ // to avoid deadlocks.
bool GetSendSideDelay(int* avg_send_delay, int* max_send_delay) const;
- void GetEstimatedReceiveBandwidth(uint32_t* estimated_bandwidth) const;
+ void RegisterSendSideDelayObserver(SendSideDelayObserver* observer);
+ void GetReceiveBandwidthEstimatorStats(
+ ReceiveBandwidthEstimatorStats* output) const;
// Called on any new send bitrate estimate.
void RegisterSendBitrateObserver(BitrateStatisticsObserver* observer);
virtual int32_t ResendPackets(const uint16_t* sequence_numbers,
uint16_t length);
- int32_t RegisterExternalEncryption(Encryption* encryption);
- int32_t DeRegisterExternalEncryption();
-
int32_t SetVoiceChannel(int32_t ve_channel_id,
VoEVideoSync* ve_sync_interface);
int32_t VoiceChannel();
void RegisterSendFrameCountObserver(FrameCountObserver* observer);
+ void ReceivedBWEPacket(int64_t arrival_time_ms, int payload_size,
+ const RTPHeader& header);
+
protected:
static bool ChannelDecodeThreadFunction(void* obj);
bool ChannelDecodeProcess();
void OnRttUpdate(uint32_t rtt);
private:
+ void ReserveRtpRtcpModules(size_t total_modules)
+ EXCLUSIVE_LOCKS_REQUIRED(rtp_rtcp_cs_);
+ RtpRtcp* GetRtpRtcpModule(size_t simulcast_idx) const
+ EXCLUSIVE_LOCKS_REQUIRED(rtp_rtcp_cs_);
+ RtpRtcp* CreateRtpRtcpModule();
// Assumed to be protected.
int32_t StartDecodeThread();
int32_t StopDecodeThread();
const unsigned char payload_typeFEC);
// Compute NACK list parameters for the buffering mode.
int GetRequiredNackListSize(int target_delay_ms);
+ void SetRtxSendStatus(bool enable);
+
+ // ViEChannel exposes methods that allow to modify observers and callbacks
+ // to be modified. Such an API-style is cumbersome to implement and maintain
+ // at all the levels when comparing to only setting them at construction. As
+ // so this class instantiates its children with a wrapper that can be modified
+ // at a later time.
+ template <class T>
+ class RegisterableCallback : public T {
+ public:
+ RegisterableCallback()
+ : critsect_(CriticalSectionWrapper::CreateCriticalSection()),
+ callback_(NULL) {}
+
+ void Set(T* callback) {
+ CriticalSectionScoped cs(critsect_.get());
+ callback_ = callback;
+ }
+
+ protected:
+ // Note: this should be implemented with a RW-lock to allow simultaneous
+ // calls into the callback. However that doesn't seem to be needed for the
+ // current type of callbacks covered by this class.
+ scoped_ptr<CriticalSectionWrapper> critsect_;
+ T* callback_ GUARDED_BY(critsect_);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RegisterableCallback);
+ };
+
+ class RegisterableBitrateStatisticsObserver:
+ public RegisterableCallback<BitrateStatisticsObserver> {
+ virtual void Notify(const BitrateStatistics& stats, uint32_t ssrc) {
+ CriticalSectionScoped cs(critsect_.get());
+ if (callback_)
+ callback_->Notify(stats, ssrc);
+ }
+ }
+ send_bitrate_observer_;
+
+ class RegisterableFrameCountObserver
+ : public RegisterableCallback<FrameCountObserver> {
+ virtual void FrameCountUpdated(FrameType frame_type,
+ uint32_t frame_count,
+ const unsigned int ssrc) {
+ CriticalSectionScoped cs(critsect_.get());
+ if (callback_)
+ callback_->FrameCountUpdated(frame_type, frame_count, ssrc);
+ }
+ } send_frame_count_observer_;
+
+ class RegisterableSendSideDelayObserver :
+ public RegisterableCallback<SendSideDelayObserver> {
+ virtual void SendSideDelayUpdated(int avg_delay_ms,
+ int max_delay_ms,
+ uint32_t ssrc) OVERRIDE {
+ CriticalSectionScoped cs(critsect_.get());
+ if (callback_)
+ callback_->SendSideDelayUpdated(avg_delay_ms, max_delay_ms, ssrc);
+ }
+ } send_side_delay_observer_;
int32_t channel_id_;
int32_t engine_id_;
scoped_ptr<RtpRtcp> rtp_rtcp_;
std::list<RtpRtcp*> simulcast_rtp_rtcp_;
std::list<RtpRtcp*> removed_rtp_rtcp_;
- VideoCodingModule& vcm_;
+ VideoCodingModule* const vcm_;
ViEReceiver vie_receiver_;
ViESender vie_sender_;
ViESyncModule vie_sync_;
RtcpIntraFrameObserver* intra_frame_observer_;
RtcpRttStats* rtt_stats_;
PacedSender* paced_sender_;
+ bool pad_with_redundant_payloads_;
scoped_ptr<RtcpBandwidthObserver> bandwidth_observer_;
int send_timestamp_extension_id_;
bool wait_for_key_frame_;
ThreadWrapper* decode_thread_;
- Encryption* external_encryption_;
-
ViEEffectFilter* effect_filter_;
bool color_enhancement_;
int nack_history_size_sender_;
int max_nack_reordering_threshold_;
I420FrameCallback* pre_render_callback_;
- const Config& config_;
+
+ std::map<uint32_t, RTCPReportBlock> prev_report_blocks_;
};
} // namespace webrtc