andrew@webrtc.org | a7b57da | 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_RTP_RTCP_IMPL_H_ |
| 12 | #define WEBRTC_VIDEO_ENGINE_VIE_RTP_RTCP_IMPL_H_ |
| 13 | |
pbos@webrtc.org | f2e6fb3 | 2013-05-17 13:44:48 +0000 | [diff] [blame] | 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" |
andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 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; |
mflodman@webrtc.org | 06077c9 | 2013-04-12 14:55:46 +0000 | [diff] [blame] | 42 | virtual int SetRtxSendPayloadType(const int video_channel, |
| 43 | const uint8_t payload_type); |
stefan@webrtc.org | 508e748 | 2014-06-11 13:41:36 +0000 | [diff] [blame] | 44 | virtual int SetPadWithRedundantPayloads(int video_channel, bool enable); |
mflodman@webrtc.org | 06077c9 | 2013-04-12 14:55:46 +0000 | [diff] [blame] | 45 | virtual int SetRtxReceivePayloadType(const int video_channel, |
| 46 | const uint8_t payload_type); |
andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 47 | virtual int SetStartSequenceNumber(const int video_channel, |
| 48 | uint16_t sequence_number); |
pbos@webrtc.org | 49e6306 | 2014-07-07 13:06:48 +0000 | [diff] [blame] | 49 | virtual void SetRtpStateForSsrc(int video_channel, |
| 50 | uint32_t ssrc, |
| 51 | const RtpState& rtp_state) OVERRIDE; |
| 52 | virtual RtpState GetRtpStateForSsrc(int video_channel, |
| 53 | uint32_t ssrc) OVERRIDE; |
andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 54 | virtual int SetRTCPStatus(const int video_channel, |
| 55 | const ViERTCPMode rtcp_mode); |
| 56 | virtual int GetRTCPStatus(const int video_channel, |
| 57 | ViERTCPMode& rtcp_mode) const; |
| 58 | virtual int SetRTCPCName(const int video_channel, |
| 59 | const char rtcp_cname[KMaxRTCPCNameLength]); |
| 60 | virtual int GetRTCPCName(const int video_channel, |
| 61 | char rtcp_cname[KMaxRTCPCNameLength]) const; |
| 62 | virtual int GetRemoteRTCPCName(const int video_channel, |
| 63 | char rtcp_cname[KMaxRTCPCNameLength]) const; |
| 64 | virtual int SendApplicationDefinedRTCPPacket( |
| 65 | const int video_channel, |
| 66 | const unsigned char sub_type, |
| 67 | unsigned int name, |
| 68 | const char* data, |
| 69 | uint16_t data_length_in_bytes); |
| 70 | virtual int SetNACKStatus(const int video_channel, const bool enable); |
| 71 | virtual int SetFECStatus(const int video_channel, const bool enable, |
| 72 | const unsigned char payload_typeRED, |
| 73 | const unsigned char payload_typeFEC); |
| 74 | virtual int SetHybridNACKFECStatus(const int video_channel, const bool enable, |
| 75 | const unsigned char payload_typeRED, |
| 76 | const unsigned char payload_typeFEC); |
mikhal@webrtc.org | 4db69af | 2013-02-15 23:22:18 +0000 | [diff] [blame] | 77 | virtual int SetSenderBufferingMode(int video_channel, |
| 78 | int target_delay_ms); |
| 79 | virtual int SetReceiverBufferingMode(int video_channel, |
| 80 | int target_delay_ms); |
andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 81 | virtual int SetKeyFrameRequestMethod(const int video_channel, |
| 82 | const ViEKeyFrameRequestMethod method); |
| 83 | virtual int SetTMMBRStatus(const int video_channel, const bool enable); |
| 84 | virtual int SetRembStatus(int video_channel, bool sender, bool receiver); |
andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 85 | virtual int SetSendTimestampOffsetStatus(int video_channel, |
| 86 | bool enable, |
| 87 | int id); |
| 88 | virtual int SetReceiveTimestampOffsetStatus(int video_channel, |
| 89 | bool enable, |
| 90 | int id); |
solenberg@webrtc.org | 967320b | 2013-05-20 12:00:23 +0000 | [diff] [blame] | 91 | virtual int SetSendAbsoluteSendTimeStatus(int video_channel, |
| 92 | bool enable, |
| 93 | int id); |
| 94 | virtual int SetReceiveAbsoluteSendTimeStatus(int video_channel, |
| 95 | bool enable, |
| 96 | int id); |
asapersson@webrtc.org | 3fe2e7f | 2013-11-21 08:57:04 +0000 | [diff] [blame] | 97 | virtual int SetRtcpXrRrtrStatus(int video_channel, bool enable); |
andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 98 | virtual int SetTransmissionSmoothingStatus(int video_channel, bool enable); |
pbos@webrtc.org | 9420a1f | 2014-03-13 12:52:27 +0000 | [diff] [blame] | 99 | virtual int SetMinTransmitBitrate(int video_channel, |
| 100 | int min_transmit_bitrate_kbps); |
solenberg@webrtc.org | 37f807f | 2014-03-26 14:32:47 +0000 | [diff] [blame] | 101 | virtual int SetReservedTransmitBitrate( |
| 102 | int video_channel, unsigned int reserved_transmit_bitrate_bps); |
sprang@webrtc.org | 13a4d31 | 2013-11-20 16:47:07 +0000 | [diff] [blame] | 103 | virtual int GetReceiveChannelRtcpStatistics(const int video_channel, |
| 104 | RtcpStatistics& basic_stats, |
| 105 | int& rtt_ms) const; |
| 106 | virtual int GetSendChannelRtcpStatistics(const int video_channel, |
| 107 | RtcpStatistics& basic_stats, |
| 108 | int& rtt_ms) const; |
| 109 | virtual int GetRtpStatistics(const int video_channel, |
| 110 | StreamDataCounters& sent, |
| 111 | StreamDataCounters& received) const; |
asapersson@webrtc.org | 2fa9f7e | 2014-02-19 11:59:02 +0000 | [diff] [blame] | 112 | virtual int GetRtcpPacketTypeCounters( |
| 113 | int video_channel, |
| 114 | RtcpPacketTypeCounter* packets_sent, |
| 115 | RtcpPacketTypeCounter* packets_received) const; |
andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 116 | virtual int GetBandwidthUsage(const int video_channel, |
| 117 | unsigned int& total_bitrate_sent, |
| 118 | unsigned int& video_bitrate_sent, |
| 119 | unsigned int& fec_bitrate_sent, |
| 120 | unsigned int& nackBitrateSent) const; |
| 121 | virtual int GetEstimatedSendBandwidth( |
| 122 | const int video_channel, |
| 123 | unsigned int* estimated_bandwidth) const; |
| 124 | virtual int GetEstimatedReceiveBandwidth( |
| 125 | const int video_channel, |
| 126 | unsigned int* estimated_bandwidth) const; |
jiayl@webrtc.org | a68379b | 2014-02-10 19:12:14 +0000 | [diff] [blame] | 127 | virtual int GetReceiveBandwidthEstimatorStats( |
| 128 | const int video_channel, ReceiveBandwidthEstimatorStats* output) const; |
jiayl@webrtc.org | ecee063 | 2014-02-27 22:32:40 +0000 | [diff] [blame] | 129 | virtual int GetPacerQueuingDelayMs(const int video_channel, |
| 130 | int* delay_ms) const; |
andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 131 | virtual int StartRTPDump(const int video_channel, |
| 132 | const char file_nameUTF8[1024], |
| 133 | RTPDirections direction); |
| 134 | virtual int StopRTPDump(const int video_channel, RTPDirections direction); |
| 135 | virtual int RegisterRTPObserver(const int video_channel, |
| 136 | ViERTPObserver& observer); |
| 137 | virtual int DeregisterRTPObserver(const int video_channel); |
| 138 | virtual int RegisterRTCPObserver(const int video_channel, |
| 139 | ViERTCPObserver& observer); |
| 140 | virtual int DeregisterRTCPObserver(const int video_channel); |
| 141 | |
sprang@webrtc.org | 13a4d31 | 2013-11-20 16:47:07 +0000 | [diff] [blame] | 142 | virtual int RegisterSendChannelRtcpStatisticsCallback( |
| 143 | int channel, RtcpStatisticsCallback* callback); |
| 144 | virtual int DeregisterSendChannelRtcpStatisticsCallback( |
| 145 | int channel, RtcpStatisticsCallback* callback); |
| 146 | virtual int RegisterReceiveChannelRtcpStatisticsCallback( |
| 147 | int channel, RtcpStatisticsCallback* callback); |
| 148 | virtual int DeregisterReceiveChannelRtcpStatisticsCallback( |
| 149 | int channel, RtcpStatisticsCallback* callback); |
| 150 | virtual int RegisterSendChannelRtpStatisticsCallback( |
| 151 | int channel, StreamDataCountersCallback* callback); |
| 152 | virtual int DeregisterSendChannelRtpStatisticsCallback( |
| 153 | int channel, StreamDataCountersCallback* callback); |
| 154 | virtual int RegisterReceiveChannelRtpStatisticsCallback( |
| 155 | int channel, StreamDataCountersCallback* callback); |
| 156 | virtual int DeregisterReceiveChannelRtpStatisticsCallback( |
| 157 | int channel, StreamDataCountersCallback* callback); |
| 158 | virtual int RegisterSendBitrateObserver( |
| 159 | int channel, BitrateStatisticsObserver* callback); |
| 160 | virtual int DeregisterSendBitrateObserver( |
| 161 | int channel, BitrateStatisticsObserver* callback); |
| 162 | virtual int RegisterSendFrameCountObserver( |
| 163 | int channel, FrameCountObserver* callback); |
| 164 | virtual int DeregisterSendFrameCountObserver( |
| 165 | int channel, FrameCountObserver* callback); |
| 166 | |
andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 167 | protected: |
| 168 | explicit ViERTP_RTCPImpl(ViESharedData* shared_data); |
| 169 | virtual ~ViERTP_RTCPImpl(); |
| 170 | |
| 171 | private: |
| 172 | ViESharedData* shared_data_; |
| 173 | }; |
| 174 | |
| 175 | } // namespace webrtc |
| 176 | |
| 177 | #endif // WEBRTC_VIDEO_ENGINE_VIE_RTP_RTCP_IMPL_H_ |