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_RTP_RTCP_IMPL_H_ 12 #define WEBRTC_VIDEO_ENGINE_VIE_RTP_RTCP_IMPL_H_ 13 14 #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" 15 #include "webrtc/typedefs.h" 16 #include "webrtc/video_engine/include/vie_rtp_rtcp.h" 17 #include "webrtc/video_engine/vie_ref_count.h" 18 19 namespace webrtc { 20 21 class ViESharedData; 22 23 class ViERTP_RTCPImpl 24 : public ViERTP_RTCP, 25 public ViERefCount { 26 public: 27 // Implements ViERTP_RTCP. 28 virtual int Release(); 29 virtual int SetLocalSSRC(const int video_channel, 30 const unsigned int SSRC, 31 const StreamType usage, 32 const unsigned char simulcast_idx); 33 virtual int GetLocalSSRC(const int video_channel, 34 unsigned int& SSRC) const; // NOLINT 35 virtual int SetRemoteSSRCType(const int video_channel, 36 const StreamType usage, 37 const unsigned int SSRC) const; 38 virtual int GetRemoteSSRC(const int video_channel, 39 unsigned int& SSRC) const; // NOLINT 40 virtual int GetRemoteCSRCs(const int video_channel, 41 unsigned int CSRCs[kRtpCsrcSize]) const; 42 virtual int SetRtxSendPayloadType(const int video_channel, 43 const uint8_t payload_type); 44 virtual int SetPadWithRedundantPayloads(int video_channel, bool enable); 45 virtual int SetRtxReceivePayloadType(const int video_channel, 46 const uint8_t payload_type); 47 virtual int SetStartSequenceNumber(const int video_channel, 48 uint16_t sequence_number); 49 virtual int SetRTCPStatus(const int video_channel, 50 const ViERTCPMode rtcp_mode); 51 virtual int GetRTCPStatus(const int video_channel, 52 ViERTCPMode& rtcp_mode) const; 53 virtual int SetRTCPCName(const int video_channel, 54 const char rtcp_cname[KMaxRTCPCNameLength]); 55 virtual int GetRTCPCName(const int video_channel, 56 char rtcp_cname[KMaxRTCPCNameLength]) const; 57 virtual int GetRemoteRTCPCName(const int video_channel, 58 char rtcp_cname[KMaxRTCPCNameLength]) const; 59 virtual int SendApplicationDefinedRTCPPacket( 60 const int video_channel, 61 const unsigned char sub_type, 62 unsigned int name, 63 const char* data, 64 uint16_t data_length_in_bytes); 65 virtual int SetNACKStatus(const int video_channel, const bool enable); 66 virtual int SetFECStatus(const int video_channel, const bool enable, 67 const unsigned char payload_typeRED, 68 const unsigned char payload_typeFEC); 69 virtual int SetHybridNACKFECStatus(const int video_channel, const bool enable, 70 const unsigned char payload_typeRED, 71 const unsigned char payload_typeFEC); 72 virtual int SetSenderBufferingMode(int video_channel, 73 int target_delay_ms); 74 virtual int SetReceiverBufferingMode(int video_channel, 75 int target_delay_ms); 76 virtual int SetKeyFrameRequestMethod(const int video_channel, 77 const ViEKeyFrameRequestMethod method); 78 virtual int SetTMMBRStatus(const int video_channel, const bool enable); 79 virtual int SetRembStatus(int video_channel, bool sender, bool receiver); 80 virtual int SetSendTimestampOffsetStatus(int video_channel, 81 bool enable, 82 int id); 83 virtual int SetReceiveTimestampOffsetStatus(int video_channel, 84 bool enable, 85 int id); 86 virtual int SetSendAbsoluteSendTimeStatus(int video_channel, 87 bool enable, 88 int id); 89 virtual int SetReceiveAbsoluteSendTimeStatus(int video_channel, 90 bool enable, 91 int id); 92 virtual int SetRtcpXrRrtrStatus(int video_channel, bool enable); 93 virtual int SetTransmissionSmoothingStatus(int video_channel, bool enable); 94 virtual int SetMinTransmitBitrate(int video_channel, 95 int min_transmit_bitrate_kbps); 96 virtual int SetReservedTransmitBitrate( 97 int video_channel, unsigned int reserved_transmit_bitrate_bps); 98 virtual int GetReceiveChannelRtcpStatistics(const int video_channel, 99 RtcpStatistics& basic_stats, 100 int& rtt_ms) const; 101 virtual int GetSendChannelRtcpStatistics(const int video_channel, 102 RtcpStatistics& basic_stats, 103 int& rtt_ms) const; 104 virtual int GetRtpStatistics(const int video_channel, 105 StreamDataCounters& sent, 106 StreamDataCounters& received) const; 107 virtual int GetRtcpPacketTypeCounters( 108 int video_channel, 109 RtcpPacketTypeCounter* packets_sent, 110 RtcpPacketTypeCounter* packets_received) const; 111 virtual int GetBandwidthUsage(const int video_channel, 112 unsigned int& total_bitrate_sent, 113 unsigned int& video_bitrate_sent, 114 unsigned int& fec_bitrate_sent, 115 unsigned int& nackBitrateSent) const; 116 virtual int GetEstimatedSendBandwidth( 117 const int video_channel, 118 unsigned int* estimated_bandwidth) const; 119 virtual int GetEstimatedReceiveBandwidth( 120 const int video_channel, 121 unsigned int* estimated_bandwidth) const; 122 virtual int GetReceiveBandwidthEstimatorStats( 123 const int video_channel, ReceiveBandwidthEstimatorStats* output) const; 124 virtual int GetPacerQueuingDelayMs(const int video_channel, 125 int* delay_ms) const; 126 virtual int StartRTPDump(const int video_channel, 127 const char file_nameUTF8[1024], 128 RTPDirections direction); 129 virtual int StopRTPDump(const int video_channel, RTPDirections direction); 130 virtual int RegisterRTPObserver(const int video_channel, 131 ViERTPObserver& observer); 132 virtual int DeregisterRTPObserver(const int video_channel); 133 virtual int RegisterRTCPObserver(const int video_channel, 134 ViERTCPObserver& observer); 135 virtual int DeregisterRTCPObserver(const int video_channel); 136 137 virtual int RegisterSendChannelRtcpStatisticsCallback( 138 int channel, RtcpStatisticsCallback* callback); 139 virtual int DeregisterSendChannelRtcpStatisticsCallback( 140 int channel, RtcpStatisticsCallback* callback); 141 virtual int RegisterReceiveChannelRtcpStatisticsCallback( 142 int channel, RtcpStatisticsCallback* callback); 143 virtual int DeregisterReceiveChannelRtcpStatisticsCallback( 144 int channel, RtcpStatisticsCallback* callback); 145 virtual int RegisterSendChannelRtpStatisticsCallback( 146 int channel, StreamDataCountersCallback* callback); 147 virtual int DeregisterSendChannelRtpStatisticsCallback( 148 int channel, StreamDataCountersCallback* callback); 149 virtual int RegisterReceiveChannelRtpStatisticsCallback( 150 int channel, StreamDataCountersCallback* callback); 151 virtual int DeregisterReceiveChannelRtpStatisticsCallback( 152 int channel, StreamDataCountersCallback* callback); 153 virtual int RegisterSendBitrateObserver( 154 int channel, BitrateStatisticsObserver* callback); 155 virtual int DeregisterSendBitrateObserver( 156 int channel, BitrateStatisticsObserver* callback); 157 virtual int RegisterSendFrameCountObserver( 158 int channel, FrameCountObserver* callback); 159 virtual int DeregisterSendFrameCountObserver( 160 int channel, FrameCountObserver* callback); 161 162 protected: 163 explicit ViERTP_RTCPImpl(ViESharedData* shared_data); 164 virtual ~ViERTP_RTCPImpl(); 165 166 private: 167 ViESharedData* shared_data_; 168 }; 169 170 } // namespace webrtc 171 172 #endif // WEBRTC_VIDEO_ENGINE_VIE_RTP_RTCP_IMPL_H_ 173