niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
pwestin@webrtc.org | f6bb77a | 2012-01-24 17:16:59 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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_MODULES_RTP_RTCP_INTERFACE_RTP_RTCP_H_ |
| 12 | #define WEBRTC_MODULES_RTP_RTCP_INTERFACE_RTP_RTCP_H_ |
| 13 | |
perkj@webrtc.org | ce5990c | 2012-01-11 13:00:08 +0000 | [diff] [blame] | 14 | #include <vector> |
| 15 | |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 16 | #include "modules/interface/module.h" |
| 17 | #include "modules/rtp_rtcp/interface/rtp_rtcp_defines.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 18 | |
| 19 | namespace webrtc { |
pwestin@webrtc.org | 571a1c0 | 2012-11-13 21:12:39 +0000 | [diff] [blame] | 20 | // Forward declarations. |
| 21 | class PacedSender; |
stefan@webrtc.org | 9354cc9 | 2012-06-07 08:10:14 +0000 | [diff] [blame] | 22 | class RemoteBitrateEstimator; |
| 23 | class RemoteBitrateObserver; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 24 | class Transport; |
| 25 | |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 26 | class RtpRtcp : public Module { |
| 27 | public: |
| 28 | struct Configuration { |
| 29 | Configuration() |
| 30 | : id(-1), |
| 31 | audio(false), |
| 32 | clock(NULL), |
| 33 | default_module(NULL), |
| 34 | incoming_data(NULL), |
| 35 | incoming_messages(NULL), |
| 36 | outgoing_transport(NULL), |
| 37 | rtcp_feedback(NULL), |
| 38 | intra_frame_callback(NULL), |
| 39 | bandwidth_callback(NULL), |
mflodman@webrtc.org | 7c894b7 | 2012-11-26 12:40:15 +0000 | [diff] [blame] | 40 | rtt_observer(NULL), |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 41 | audio_messages(NULL), |
pwestin@webrtc.org | 571a1c0 | 2012-11-13 21:12:39 +0000 | [diff] [blame] | 42 | remote_bitrate_estimator(NULL), |
| 43 | paced_sender(NULL) { |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 44 | } |
| 45 | /* id - Unique identifier of this RTP/RTCP module object |
| 46 | * audio - True for a audio version of the RTP/RTCP module |
| 47 | * object false will create a video version |
| 48 | * clock - The clock to use to read time. If NULL object |
| 49 | * will be using the system clock. |
| 50 | * incoming_data - Callback object that will receive the incoming |
| 51 | * data |
| 52 | * incoming_messages - Callback object that will receive the incoming |
| 53 | * RTP messages. |
| 54 | * outgoing_transport - Transport object that will be called when packets |
| 55 | * are ready to be sent out on the network |
| 56 | * rtcp_feedback - Callback object that will receive the incoming |
mflodman@webrtc.org | 7c894b7 | 2012-11-26 12:40:15 +0000 | [diff] [blame] | 57 | * RTCP messages. |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 58 | * intra_frame_callback - Called when the receiver request a intra frame. |
| 59 | * bandwidth_callback - Called when we receive a changed estimate from |
| 60 | * the receiver of out stream. |
| 61 | * audio_messages - Telehone events. |
stefan@webrtc.org | 9354cc9 | 2012-06-07 08:10:14 +0000 | [diff] [blame] | 62 | * remote_bitrate_estimator - Estimates the bandwidth available for a set of |
| 63 | * streams from the same client. |
pwestin@webrtc.org | 571a1c0 | 2012-11-13 21:12:39 +0000 | [diff] [blame] | 64 | * paced_sender - Spread any bursts of packets into smaller |
| 65 | * bursts to minimize packet loss. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 66 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 67 | int32_t id; |
| 68 | bool audio; |
| 69 | RtpRtcpClock* clock; |
| 70 | RtpRtcp* default_module; |
| 71 | RtpData* incoming_data; |
| 72 | RtpFeedback* incoming_messages; |
| 73 | Transport* outgoing_transport; |
| 74 | RtcpFeedback* rtcp_feedback; |
| 75 | RtcpIntraFrameObserver* intra_frame_callback; |
| 76 | RtcpBandwidthObserver* bandwidth_callback; |
mflodman@webrtc.org | 7c894b7 | 2012-11-26 12:40:15 +0000 | [diff] [blame] | 77 | RtcpRttObserver* rtt_observer; |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 78 | RtpAudioFeedback* audio_messages; |
stefan@webrtc.org | 9354cc9 | 2012-06-07 08:10:14 +0000 | [diff] [blame] | 79 | RemoteBitrateEstimator* remote_bitrate_estimator; |
pwestin@webrtc.org | 571a1c0 | 2012-11-13 21:12:39 +0000 | [diff] [blame] | 80 | PacedSender* paced_sender; |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 81 | }; |
| 82 | /* |
| 83 | * Create a RTP/RTCP module object using the system clock. |
| 84 | * |
| 85 | * configuration - Configuration of the RTP/RTCP module. |
| 86 | */ |
| 87 | static RtpRtcp* CreateRtpRtcp(const RtpRtcp::Configuration& configuration); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 88 | |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 89 | /************************************************************************** |
| 90 | * |
| 91 | * Receiver functions |
| 92 | * |
| 93 | ***************************************************************************/ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 94 | |
| 95 | /* |
| 96 | * configure a RTP packet timeout value |
| 97 | * |
| 98 | * RTPtimeoutMS - time in milliseconds after last received RTP packet |
| 99 | * RTCPtimeoutMS - time in milliseconds after last received RTCP packet |
| 100 | * |
| 101 | * return -1 on failure else 0 |
| 102 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 103 | virtual WebRtc_Word32 SetPacketTimeout( |
| 104 | const WebRtc_UWord32 RTPtimeoutMS, |
| 105 | const WebRtc_UWord32 RTCPtimeoutMS) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 106 | |
| 107 | /* |
| 108 | * Set periodic dead or alive notification |
| 109 | * |
| 110 | * enable - turn periodic dead or alive notification on/off |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 111 | * sampleTimeSeconds - sample interval in seconds for dead or alive |
| 112 | * notifications |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 113 | * |
| 114 | * return -1 on failure else 0 |
| 115 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 116 | virtual WebRtc_Word32 SetPeriodicDeadOrAliveStatus( |
| 117 | const bool enable, |
| 118 | const WebRtc_UWord8 sampleTimeSeconds) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 119 | |
| 120 | /* |
| 121 | * Get periodic dead or alive notification status |
| 122 | * |
| 123 | * enable - periodic dead or alive notification on/off |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 124 | * sampleTimeSeconds - sample interval in seconds for dead or alive |
| 125 | * notifications |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 126 | * |
| 127 | * return -1 on failure else 0 |
| 128 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 129 | virtual WebRtc_Word32 PeriodicDeadOrAliveStatus( |
| 130 | bool& enable, |
| 131 | WebRtc_UWord8& sampleTimeSeconds) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 132 | |
| 133 | /* |
pwestin@webrtc.org | 1da1ce0 | 2011-10-13 15:19:55 +0000 | [diff] [blame] | 134 | * set voice codec name and payload type |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 135 | * |
| 136 | * return -1 on failure else 0 |
| 137 | */ |
pwestin@webrtc.org | 1da1ce0 | 2011-10-13 15:19:55 +0000 | [diff] [blame] | 138 | virtual WebRtc_Word32 RegisterReceivePayload( |
| 139 | const CodecInst& voiceCodec) = 0; |
| 140 | |
| 141 | /* |
| 142 | * set video codec name and payload type |
| 143 | * |
| 144 | * return -1 on failure else 0 |
| 145 | */ |
| 146 | virtual WebRtc_Word32 RegisterReceivePayload( |
| 147 | const VideoCodec& videoCodec) = 0; |
| 148 | |
| 149 | /* |
| 150 | * get payload type for a voice codec |
| 151 | * |
| 152 | * return -1 on failure else 0 |
| 153 | */ |
| 154 | virtual WebRtc_Word32 ReceivePayloadType( |
| 155 | const CodecInst& voiceCodec, |
| 156 | WebRtc_Word8* plType) = 0; |
| 157 | |
| 158 | /* |
| 159 | * get payload type for a video codec |
| 160 | * |
| 161 | * return -1 on failure else 0 |
| 162 | */ |
| 163 | virtual WebRtc_Word32 ReceivePayloadType( |
| 164 | const VideoCodec& videoCodec, |
| 165 | WebRtc_Word8* plType) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 166 | |
| 167 | /* |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 168 | * Remove a registered payload type from list of accepted payloads |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 169 | * |
| 170 | * payloadType - payload type of codec |
| 171 | * |
| 172 | * return -1 on failure else 0 |
| 173 | */ |
pwestin@webrtc.org | 1da1ce0 | 2011-10-13 15:19:55 +0000 | [diff] [blame] | 174 | virtual WebRtc_Word32 DeRegisterReceivePayload( |
| 175 | const WebRtc_Word8 payloadType) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 176 | |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 177 | /* |
| 178 | * (De)register RTP header extension type and id. |
| 179 | * |
| 180 | * return -1 on failure else 0 |
| 181 | */ |
| 182 | virtual WebRtc_Word32 RegisterReceiveRtpHeaderExtension( |
| 183 | const RTPExtensionType type, |
| 184 | const WebRtc_UWord8 id) = 0; |
| 185 | |
| 186 | virtual WebRtc_Word32 DeregisterReceiveRtpHeaderExtension( |
| 187 | const RTPExtensionType type) = 0; |
| 188 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 189 | /* |
| 190 | * Get last received remote timestamp |
| 191 | */ |
| 192 | virtual WebRtc_UWord32 RemoteTimestamp() const = 0; |
| 193 | |
| 194 | /* |
stefan@webrtc.org | 7c3523c | 2012-09-11 07:00:42 +0000 | [diff] [blame] | 195 | * Get the local time of the last received remote timestamp |
| 196 | */ |
| 197 | virtual int64_t LocalTimeOfRemoteTimeStamp() const = 0; |
| 198 | |
| 199 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 200 | * Get the current estimated remote timestamp |
| 201 | * |
| 202 | * timestamp - estimated timestamp |
| 203 | * |
| 204 | * return -1 on failure else 0 |
| 205 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 206 | virtual WebRtc_Word32 EstimatedRemoteTimeStamp( |
| 207 | WebRtc_UWord32& timestamp) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 208 | |
| 209 | /* |
| 210 | * Get incoming SSRC |
| 211 | */ |
| 212 | virtual WebRtc_UWord32 RemoteSSRC() const = 0; |
| 213 | |
| 214 | /* |
| 215 | * Get remote CSRC |
| 216 | * |
| 217 | * arrOfCSRC - array that will receive the CSRCs |
| 218 | * |
| 219 | * return -1 on failure else the number of valid entries in the list |
| 220 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 221 | virtual WebRtc_Word32 RemoteCSRCs( |
| 222 | WebRtc_UWord32 arrOfCSRC[kRtpCsrcSize]) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 223 | |
| 224 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 225 | * get the currently configured SSRC filter |
| 226 | * |
| 227 | * allowedSSRC - SSRC that will be allowed through |
| 228 | * |
| 229 | * return -1 on failure else 0 |
| 230 | */ |
| 231 | virtual WebRtc_Word32 SSRCFilter(WebRtc_UWord32& allowedSSRC) const = 0; |
| 232 | |
| 233 | /* |
| 234 | * set a SSRC to be used as a filter for incoming RTP streams |
| 235 | * |
| 236 | * allowedSSRC - SSRC that will be allowed through |
| 237 | * |
| 238 | * return -1 on failure else 0 |
| 239 | */ |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 240 | virtual WebRtc_Word32 SetSSRCFilter(const bool enable, |
| 241 | const WebRtc_UWord32 allowedSSRC) = 0; |
| 242 | |
| 243 | /* |
| 244 | * Turn on/off receiving RTX (RFC 4588) on a specific SSRC. |
| 245 | */ |
| 246 | virtual WebRtc_Word32 SetRTXReceiveStatus(const bool enable, |
| 247 | const WebRtc_UWord32 SSRC) = 0; |
| 248 | |
| 249 | /* |
| 250 | * Get status of receiving RTX (RFC 4588) on a specific SSRC. |
| 251 | */ |
| 252 | virtual WebRtc_Word32 RTXReceiveStatus(bool* enable, |
| 253 | WebRtc_UWord32* SSRC) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 254 | |
| 255 | /* |
| 256 | * called by the network module when we receive a packet |
| 257 | * |
| 258 | * incomingPacket - incoming packet buffer |
| 259 | * packetLength - length of incoming buffer |
| 260 | * |
| 261 | * return -1 on failure else 0 |
| 262 | */ |
pwestin@webrtc.org | 1da1ce0 | 2011-10-13 15:19:55 +0000 | [diff] [blame] | 263 | virtual WebRtc_Word32 IncomingPacket(const WebRtc_UWord8* incomingPacket, |
| 264 | const WebRtc_UWord16 packetLength) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 265 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 266 | /************************************************************************** |
| 267 | * |
| 268 | * Sender |
| 269 | * |
| 270 | ***************************************************************************/ |
| 271 | |
| 272 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 273 | * set MTU |
| 274 | * |
| 275 | * size - Max transfer unit in bytes, default is 1500 |
| 276 | * |
| 277 | * return -1 on failure else 0 |
| 278 | */ |
| 279 | virtual WebRtc_Word32 SetMaxTransferUnit(const WebRtc_UWord16 size) = 0; |
| 280 | |
| 281 | /* |
| 282 | * set transtport overhead |
| 283 | * default is IPv4 and UDP with no encryption |
| 284 | * |
| 285 | * TCP - true for TCP false UDP |
| 286 | * IPv6 - true for IP version 6 false for version 4 |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 287 | * authenticationOverhead - number of bytes to leave for an |
| 288 | * authentication header |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 289 | * |
| 290 | * return -1 on failure else 0 |
| 291 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 292 | virtual WebRtc_Word32 SetTransportOverhead( |
| 293 | const bool TCP, |
| 294 | const bool IPV6, |
| 295 | const WebRtc_UWord8 authenticationOverhead = 0) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 296 | |
| 297 | /* |
| 298 | * Get max payload length |
| 299 | * |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 300 | * A combination of the configuration MaxTransferUnit and |
| 301 | * TransportOverhead. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 302 | * Does not account FEC/ULP/RED overhead if FEC is enabled. |
| 303 | * Does not account for RTP headers |
| 304 | */ |
| 305 | virtual WebRtc_UWord16 MaxPayloadLength() const = 0; |
| 306 | |
| 307 | /* |
| 308 | * Get max data payload length |
| 309 | * |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 310 | * A combination of the configuration MaxTransferUnit, headers and |
| 311 | * TransportOverhead. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 312 | * Takes into account FEC/ULP/RED overhead if FEC is enabled. |
| 313 | * Takes into account RTP headers |
| 314 | */ |
| 315 | virtual WebRtc_UWord16 MaxDataPayloadLength() const = 0; |
| 316 | |
| 317 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 318 | * set codec name and payload type |
| 319 | * |
pwestin@webrtc.org | 1da1ce0 | 2011-10-13 15:19:55 +0000 | [diff] [blame] | 320 | * return -1 on failure else 0 |
| 321 | */ |
| 322 | virtual WebRtc_Word32 RegisterSendPayload( |
| 323 | const CodecInst& voiceCodec) = 0; |
| 324 | |
| 325 | /* |
| 326 | * set codec name and payload type |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 327 | * |
| 328 | * return -1 on failure else 0 |
| 329 | */ |
pwestin@webrtc.org | 1da1ce0 | 2011-10-13 15:19:55 +0000 | [diff] [blame] | 330 | virtual WebRtc_Word32 RegisterSendPayload( |
| 331 | const VideoCodec& videoCodec) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 332 | |
| 333 | /* |
| 334 | * Unregister a send payload |
| 335 | * |
| 336 | * payloadType - payload type of codec |
| 337 | * |
| 338 | * return -1 on failure else 0 |
| 339 | */ |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 340 | virtual WebRtc_Word32 DeRegisterSendPayload( |
| 341 | const WebRtc_Word8 payloadType) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 342 | |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 343 | /* |
| 344 | * (De)register RTP header extension type and id. |
| 345 | * |
| 346 | * return -1 on failure else 0 |
| 347 | */ |
| 348 | virtual WebRtc_Word32 RegisterSendRtpHeaderExtension( |
| 349 | const RTPExtensionType type, |
| 350 | const WebRtc_UWord8 id) = 0; |
| 351 | |
| 352 | virtual WebRtc_Word32 DeregisterSendRtpHeaderExtension( |
| 353 | const RTPExtensionType type) = 0; |
| 354 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 355 | /* |
| 356 | * get start timestamp |
| 357 | */ |
| 358 | virtual WebRtc_UWord32 StartTimestamp() const = 0; |
| 359 | |
| 360 | /* |
| 361 | * configure start timestamp, default is a random number |
| 362 | * |
| 363 | * timestamp - start timestamp |
| 364 | * |
| 365 | * return -1 on failure else 0 |
| 366 | */ |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 367 | virtual WebRtc_Word32 SetStartTimestamp( |
| 368 | const WebRtc_UWord32 timestamp) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 369 | |
| 370 | /* |
| 371 | * Get SequenceNumber |
| 372 | */ |
| 373 | virtual WebRtc_UWord16 SequenceNumber() const = 0; |
| 374 | |
| 375 | /* |
| 376 | * Set SequenceNumber, default is a random number |
| 377 | * |
| 378 | * return -1 on failure else 0 |
| 379 | */ |
| 380 | virtual WebRtc_Word32 SetSequenceNumber(const WebRtc_UWord16 seq) = 0; |
| 381 | |
| 382 | /* |
| 383 | * Get SSRC |
| 384 | */ |
| 385 | virtual WebRtc_UWord32 SSRC() const = 0; |
| 386 | |
| 387 | /* |
| 388 | * configure SSRC, default is a random number |
| 389 | * |
| 390 | * return -1 on failure else 0 |
| 391 | */ |
| 392 | virtual WebRtc_Word32 SetSSRC(const WebRtc_UWord32 ssrc) = 0; |
| 393 | |
| 394 | /* |
| 395 | * Get CSRC |
| 396 | * |
| 397 | * arrOfCSRC - array of CSRCs |
| 398 | * |
| 399 | * return -1 on failure else number of valid entries in the array |
| 400 | */ |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 401 | virtual WebRtc_Word32 CSRCs( |
| 402 | WebRtc_UWord32 arrOfCSRC[kRtpCsrcSize]) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 403 | |
| 404 | /* |
| 405 | * Set CSRC |
| 406 | * |
| 407 | * arrOfCSRC - array of CSRCs |
| 408 | * arrLength - number of valid entries in the array |
| 409 | * |
| 410 | * return -1 on failure else 0 |
| 411 | */ |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 412 | virtual WebRtc_Word32 SetCSRCs( |
| 413 | const WebRtc_UWord32 arrOfCSRC[kRtpCsrcSize], |
| 414 | const WebRtc_UWord8 arrLength) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 415 | |
| 416 | /* |
| 417 | * includes CSRCs in RTP header if enabled |
| 418 | * |
| 419 | * include CSRC - on/off |
| 420 | * |
| 421 | * default:on |
| 422 | * |
| 423 | * return -1 on failure else 0 |
| 424 | */ |
| 425 | virtual WebRtc_Word32 SetCSRCStatus(const bool include) = 0; |
| 426 | |
| 427 | /* |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 428 | * Turn on/off sending RTX (RFC 4588) on a specific SSRC. |
| 429 | */ |
| 430 | virtual WebRtc_Word32 SetRTXSendStatus(const bool enable, |
| 431 | const bool setSSRC, |
| 432 | const WebRtc_UWord32 SSRC) = 0; |
| 433 | |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 434 | /* |
| 435 | * Get status of sending RTX (RFC 4588) on a specific SSRC. |
| 436 | */ |
| 437 | virtual WebRtc_Word32 RTXSendStatus(bool* enable, |
| 438 | WebRtc_UWord32* SSRC) const = 0; |
| 439 | |
| 440 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 441 | * sends kRtcpByeCode when going from true to false |
| 442 | * |
| 443 | * sending - on/off |
| 444 | * |
| 445 | * return -1 on failure else 0 |
| 446 | */ |
| 447 | virtual WebRtc_Word32 SetSendingStatus(const bool sending) = 0; |
| 448 | |
| 449 | /* |
| 450 | * get send status |
| 451 | */ |
| 452 | virtual bool Sending() const = 0; |
| 453 | |
| 454 | /* |
| 455 | * Starts/Stops media packets, on by default |
| 456 | * |
| 457 | * sending - on/off |
| 458 | * |
| 459 | * return -1 on failure else 0 |
| 460 | */ |
| 461 | virtual WebRtc_Word32 SetSendingMediaStatus(const bool sending) = 0; |
| 462 | |
| 463 | /* |
| 464 | * get send status |
| 465 | */ |
| 466 | virtual bool SendingMedia() const = 0; |
| 467 | |
| 468 | /* |
| 469 | * get sent bitrate in Kbit/s |
| 470 | */ |
stefan@webrtc.org | d0bdab0 | 2011-10-14 14:24:54 +0000 | [diff] [blame] | 471 | virtual void BitrateSent(WebRtc_UWord32* totalRate, |
stefan@webrtc.org | fbea4e5 | 2011-10-27 16:08:29 +0000 | [diff] [blame] | 472 | WebRtc_UWord32* videoRate, |
stefan@webrtc.org | d0bdab0 | 2011-10-14 14:24:54 +0000 | [diff] [blame] | 473 | WebRtc_UWord32* fecRate, |
| 474 | WebRtc_UWord32* nackRate) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 475 | |
| 476 | /* |
stefan@webrtc.org | 439be29 | 2012-02-16 14:45:37 +0000 | [diff] [blame] | 477 | * Get the receive-side estimate of the available bandwidth. |
| 478 | */ |
| 479 | virtual int EstimatedReceiveBandwidth( |
stefan@webrtc.org | 07b45a5 | 2012-02-02 08:37:48 +0000 | [diff] [blame] | 480 | WebRtc_UWord32* available_bandwidth) const = 0; |
| 481 | |
| 482 | /* |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 483 | * Used by the codec module to deliver a video or audio frame for |
| 484 | * packetization. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 485 | * |
| 486 | * frameType - type of frame to send |
| 487 | * payloadType - payload type of frame to send |
| 488 | * timestamp - timestamp of frame to send |
| 489 | * payloadData - payload buffer of frame to send |
| 490 | * payloadSize - size of payload buffer to send |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 491 | * fragmentation - fragmentation offset data for fragmented frames such |
| 492 | * as layers or RED |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 493 | * |
| 494 | * return -1 on failure else 0 |
| 495 | */ |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 496 | virtual WebRtc_Word32 SendOutgoingData( |
| 497 | const FrameType frameType, |
| 498 | const WebRtc_Word8 payloadType, |
| 499 | const WebRtc_UWord32 timeStamp, |
stefan@webrtc.org | ddfdfed | 2012-07-03 13:21:22 +0000 | [diff] [blame] | 500 | int64_t capture_time_ms, |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 501 | const WebRtc_UWord8* payloadData, |
| 502 | const WebRtc_UWord32 payloadSize, |
| 503 | const RTPFragmentationHeader* fragmentation = NULL, |
| 504 | const RTPVideoHeader* rtpVideoHdr = NULL) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 505 | |
pwestin@webrtc.org | 571a1c0 | 2012-11-13 21:12:39 +0000 | [diff] [blame] | 506 | virtual void TimeToSendPacket(uint32_t ssrc, uint16_t sequence_number, |
| 507 | int64_t capture_time_ms) = 0; |
| 508 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 509 | /************************************************************************** |
| 510 | * |
| 511 | * RTCP |
| 512 | * |
| 513 | ***************************************************************************/ |
| 514 | |
| 515 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 516 | * Get RTCP status |
| 517 | */ |
| 518 | virtual RTCPMethod RTCP() const = 0; |
| 519 | |
| 520 | /* |
| 521 | * configure RTCP status i.e on(compound or non- compound)/off |
| 522 | * |
| 523 | * method - RTCP method to use |
| 524 | * |
| 525 | * return -1 on failure else 0 |
| 526 | */ |
| 527 | virtual WebRtc_Word32 SetRTCPStatus(const RTCPMethod method) = 0; |
| 528 | |
| 529 | /* |
| 530 | * Set RTCP CName (i.e unique identifier) |
| 531 | * |
| 532 | * return -1 on failure else 0 |
| 533 | */ |
pwestin@webrtc.org | f6bb77a | 2012-01-24 17:16:59 +0000 | [diff] [blame] | 534 | virtual WebRtc_Word32 SetCNAME(const char cName[RTCP_CNAME_SIZE]) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 535 | |
| 536 | /* |
| 537 | * Get RTCP CName (i.e unique identifier) |
| 538 | * |
| 539 | * return -1 on failure else 0 |
| 540 | */ |
pwestin@webrtc.org | f6bb77a | 2012-01-24 17:16:59 +0000 | [diff] [blame] | 541 | virtual WebRtc_Word32 CNAME(char cName[RTCP_CNAME_SIZE]) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 542 | |
| 543 | /* |
| 544 | * Get remote CName |
| 545 | * |
| 546 | * return -1 on failure else 0 |
| 547 | */ |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 548 | virtual WebRtc_Word32 RemoteCNAME( |
| 549 | const WebRtc_UWord32 remoteSSRC, |
pwestin@webrtc.org | f6bb77a | 2012-01-24 17:16:59 +0000 | [diff] [blame] | 550 | char cName[RTCP_CNAME_SIZE]) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 551 | |
| 552 | /* |
| 553 | * Get remote NTP |
| 554 | * |
| 555 | * return -1 on failure else 0 |
| 556 | */ |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 557 | virtual WebRtc_Word32 RemoteNTP( |
| 558 | WebRtc_UWord32 *ReceivedNTPsecs, |
| 559 | WebRtc_UWord32 *ReceivedNTPfrac, |
| 560 | WebRtc_UWord32 *RTCPArrivalTimeSecs, |
stefan@webrtc.org | 7c3523c | 2012-09-11 07:00:42 +0000 | [diff] [blame] | 561 | WebRtc_UWord32 *RTCPArrivalTimeFrac, |
| 562 | WebRtc_UWord32 *rtcp_timestamp) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 563 | |
| 564 | /* |
| 565 | * AddMixedCNAME |
| 566 | * |
| 567 | * return -1 on failure else 0 |
| 568 | */ |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 569 | virtual WebRtc_Word32 AddMixedCNAME( |
| 570 | const WebRtc_UWord32 SSRC, |
pwestin@webrtc.org | f6bb77a | 2012-01-24 17:16:59 +0000 | [diff] [blame] | 571 | const char cName[RTCP_CNAME_SIZE]) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 572 | |
| 573 | /* |
| 574 | * RemoveMixedCNAME |
| 575 | * |
| 576 | * return -1 on failure else 0 |
| 577 | */ |
| 578 | virtual WebRtc_Word32 RemoveMixedCNAME(const WebRtc_UWord32 SSRC) = 0; |
| 579 | |
| 580 | /* |
| 581 | * Get RoundTripTime |
| 582 | * |
| 583 | * return -1 on failure else 0 |
| 584 | */ |
| 585 | virtual WebRtc_Word32 RTT(const WebRtc_UWord32 remoteSSRC, |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 586 | WebRtc_UWord16* RTT, |
| 587 | WebRtc_UWord16* avgRTT, |
| 588 | WebRtc_UWord16* minRTT, |
| 589 | WebRtc_UWord16* maxRTT) const = 0 ; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 590 | |
| 591 | /* |
| 592 | * Reset RoundTripTime statistics |
| 593 | * |
| 594 | * return -1 on failure else 0 |
| 595 | */ |
| 596 | virtual WebRtc_Word32 ResetRTT(const WebRtc_UWord32 remoteSSRC)= 0 ; |
| 597 | |
| 598 | /* |
mflodman@webrtc.org | 7c894b7 | 2012-11-26 12:40:15 +0000 | [diff] [blame] | 599 | * Sets the estimated RTT, to be used for receive only modules without |
| 600 | * possibility of calculating its own RTT. |
| 601 | */ |
| 602 | virtual void SetRtt(uint32_t rtt) = 0; |
| 603 | |
| 604 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 605 | * Force a send of a RTCP packet |
| 606 | * normal SR and RR are triggered via the process function |
| 607 | * |
| 608 | * return -1 on failure else 0 |
| 609 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 610 | virtual WebRtc_Word32 SendRTCP( |
| 611 | WebRtc_UWord32 rtcpPacketType = kRtcpReport) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 612 | |
| 613 | /* |
| 614 | * Good state of RTP receiver inform sender |
| 615 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 616 | virtual WebRtc_Word32 SendRTCPReferencePictureSelection( |
| 617 | const WebRtc_UWord64 pictureID) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 618 | |
| 619 | /* |
| 620 | * Send a RTCP Slice Loss Indication (SLI) |
| 621 | * 6 least significant bits of pictureID |
| 622 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 623 | virtual WebRtc_Word32 SendRTCPSliceLossIndication( |
| 624 | const WebRtc_UWord8 pictureID) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 625 | |
| 626 | /* |
| 627 | * Reset RTP statistics |
| 628 | * |
| 629 | * return -1 on failure else 0 |
| 630 | */ |
| 631 | virtual WebRtc_Word32 ResetStatisticsRTP() = 0; |
| 632 | |
| 633 | /* |
| 634 | * statistics of our localy created statistics of the received RTP stream |
| 635 | * |
| 636 | * return -1 on failure else 0 |
| 637 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 638 | virtual WebRtc_Word32 StatisticsRTP( |
| 639 | WebRtc_UWord8* fraction_lost, // scale 0 to 255 |
| 640 | WebRtc_UWord32* cum_lost, // number of lost packets |
| 641 | WebRtc_UWord32* ext_max, // highest sequence number received |
| 642 | WebRtc_UWord32* jitter, |
| 643 | WebRtc_UWord32* max_jitter = NULL) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 644 | |
| 645 | /* |
| 646 | * Reset RTP data counters for the receiving side |
| 647 | * |
| 648 | * return -1 on failure else 0 |
| 649 | */ |
| 650 | virtual WebRtc_Word32 ResetReceiveDataCountersRTP() = 0; |
| 651 | |
| 652 | /* |
| 653 | * Reset RTP data counters for the sending side |
| 654 | * |
| 655 | * return -1 on failure else 0 |
| 656 | */ |
| 657 | virtual WebRtc_Word32 ResetSendDataCountersRTP() = 0; |
| 658 | |
| 659 | /* |
| 660 | * statistics of the amount of data sent and received |
| 661 | * |
| 662 | * return -1 on failure else 0 |
| 663 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 664 | virtual WebRtc_Word32 DataCountersRTP( |
| 665 | WebRtc_UWord32* bytesSent, |
| 666 | WebRtc_UWord32* packetsSent, |
| 667 | WebRtc_UWord32* bytesReceived, |
| 668 | WebRtc_UWord32* packetsReceived) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 669 | /* |
| 670 | * Get received RTCP sender info |
| 671 | * |
| 672 | * return -1 on failure else 0 |
| 673 | */ |
perkj@webrtc.org | ce5990c | 2012-01-11 13:00:08 +0000 | [diff] [blame] | 674 | virtual WebRtc_Word32 RemoteRTCPStat(RTCPSenderInfo* senderInfo) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 675 | |
| 676 | /* |
| 677 | * Get received RTCP report block |
| 678 | * |
| 679 | * return -1 on failure else 0 |
| 680 | */ |
perkj@webrtc.org | ce5990c | 2012-01-11 13:00:08 +0000 | [diff] [blame] | 681 | virtual WebRtc_Word32 RemoteRTCPStat( |
| 682 | std::vector<RTCPReportBlock>* receiveBlocks) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 683 | /* |
| 684 | * Set received RTCP report block |
| 685 | * |
| 686 | * return -1 on failure else 0 |
| 687 | */ |
perkj@webrtc.org | ce5990c | 2012-01-11 13:00:08 +0000 | [diff] [blame] | 688 | virtual WebRtc_Word32 AddRTCPReportBlock( |
| 689 | const WebRtc_UWord32 SSRC, |
| 690 | const RTCPReportBlock* receiveBlock) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 691 | |
| 692 | /* |
| 693 | * RemoveRTCPReportBlock |
| 694 | * |
| 695 | * return -1 on failure else 0 |
| 696 | */ |
| 697 | virtual WebRtc_Word32 RemoveRTCPReportBlock(const WebRtc_UWord32 SSRC) = 0; |
| 698 | |
| 699 | /* |
| 700 | * (APP) Application specific data |
| 701 | * |
| 702 | * return -1 on failure else 0 |
| 703 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 704 | virtual WebRtc_Word32 SetRTCPApplicationSpecificData( |
| 705 | const WebRtc_UWord8 subType, |
| 706 | const WebRtc_UWord32 name, |
| 707 | const WebRtc_UWord8* data, |
| 708 | const WebRtc_UWord16 length) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 709 | /* |
| 710 | * (XR) VOIP metric |
| 711 | * |
| 712 | * return -1 on failure else 0 |
| 713 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 714 | virtual WebRtc_Word32 SetRTCPVoIPMetrics( |
| 715 | const RTCPVoIPMetric* VoIPMetric) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 716 | |
| 717 | /* |
pwestin@webrtc.org | 741da94 | 2011-09-20 13:52:04 +0000 | [diff] [blame] | 718 | * (REMB) Receiver Estimated Max Bitrate |
| 719 | */ |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 720 | virtual bool REMB() const = 0; |
pwestin@webrtc.org | 741da94 | 2011-09-20 13:52:04 +0000 | [diff] [blame] | 721 | |
| 722 | virtual WebRtc_Word32 SetREMBStatus(const bool enable) = 0; |
| 723 | |
| 724 | virtual WebRtc_Word32 SetREMBData(const WebRtc_UWord32 bitrate, |
| 725 | const WebRtc_UWord8 numberOfSSRC, |
| 726 | const WebRtc_UWord32* SSRC) = 0; |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 727 | |
| 728 | /* |
| 729 | * (IJ) Extended jitter report. |
| 730 | */ |
| 731 | virtual bool IJ() const = 0; |
| 732 | |
| 733 | virtual WebRtc_Word32 SetIJStatus(const bool enable) = 0; |
| 734 | |
pwestin@webrtc.org | 741da94 | 2011-09-20 13:52:04 +0000 | [diff] [blame] | 735 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 736 | * (TMMBR) Temporary Max Media Bit Rate |
| 737 | */ |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 738 | virtual bool TMMBR() const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 739 | |
| 740 | /* |
| 741 | * |
| 742 | * return -1 on failure else 0 |
| 743 | */ |
| 744 | virtual WebRtc_Word32 SetTMMBRStatus(const bool enable) = 0; |
| 745 | |
| 746 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 747 | * (NACK) |
| 748 | */ |
| 749 | virtual NACKMethod NACK() const = 0; |
| 750 | |
| 751 | /* |
| 752 | * Turn negative acknowledgement requests on/off |
| 753 | * |
| 754 | * return -1 on failure else 0 |
| 755 | */ |
| 756 | virtual WebRtc_Word32 SetNACKStatus(const NACKMethod method) = 0; |
| 757 | |
| 758 | /* |
stefan@webrtc.org | 6a4bef4 | 2011-12-22 12:52:41 +0000 | [diff] [blame] | 759 | * TODO(holmer): Propagate this API to VideoEngine. |
| 760 | * Returns the currently configured selective retransmission settings. |
| 761 | */ |
| 762 | virtual int SelectiveRetransmissions() const = 0; |
| 763 | |
| 764 | /* |
| 765 | * TODO(holmer): Propagate this API to VideoEngine. |
| 766 | * Sets the selective retransmission settings, which will decide which |
| 767 | * packets will be retransmitted if NACKed. Settings are constructed by |
| 768 | * combining the constants in enum RetransmissionMode with bitwise OR. |
| 769 | * All packets are retransmitted if kRetransmitAllPackets is set, while no |
| 770 | * packets are retransmitted if kRetransmitOff is set. |
| 771 | * By default all packets except FEC packets are retransmitted. For VP8 |
| 772 | * with temporal scalability only base layer packets are retransmitted. |
| 773 | * |
| 774 | * Returns -1 on failure, otherwise 0. |
| 775 | */ |
| 776 | virtual int SetSelectiveRetransmissions(uint8_t settings) = 0; |
| 777 | |
| 778 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 779 | * Send a Negative acknowledgement packet |
| 780 | * |
| 781 | * return -1 on failure else 0 |
| 782 | */ |
| 783 | virtual WebRtc_Word32 SendNACK(const WebRtc_UWord16* nackList, |
stefan@webrtc.org | 6a4bef4 | 2011-12-22 12:52:41 +0000 | [diff] [blame] | 784 | const WebRtc_UWord16 size) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 785 | |
| 786 | /* |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 787 | * Store the sent packets, needed to answer to a Negative acknowledgement |
| 788 | * requests |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 789 | * |
| 790 | * return -1 on failure else 0 |
| 791 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 792 | virtual WebRtc_Word32 SetStorePacketsStatus( |
| 793 | const bool enable, |
| 794 | const WebRtc_UWord16 numberToStore = 200) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 795 | |
| 796 | /************************************************************************** |
| 797 | * |
| 798 | * Audio |
| 799 | * |
| 800 | ***************************************************************************/ |
| 801 | |
| 802 | /* |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 803 | * set audio packet size, used to determine when it's time to send a DTMF |
| 804 | * packet in silence (CNG) |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 805 | * |
| 806 | * return -1 on failure else 0 |
| 807 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 808 | virtual WebRtc_Word32 SetAudioPacketSize( |
| 809 | const WebRtc_UWord16 packetSizeSamples) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 810 | |
| 811 | /* |
| 812 | * Outband TelephoneEvent(DTMF) detection |
| 813 | * |
| 814 | * return -1 on failure else 0 |
| 815 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 816 | virtual WebRtc_Word32 SetTelephoneEventStatus( |
| 817 | const bool enable, |
| 818 | const bool forwardToDecoder, |
| 819 | const bool detectEndOfTone = false) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 820 | |
| 821 | /* |
| 822 | * Is outband TelephoneEvent(DTMF) turned on/off? |
| 823 | */ |
| 824 | virtual bool TelephoneEvent() const = 0; |
| 825 | |
| 826 | /* |
| 827 | * Returns true if received DTMF events are forwarded to the decoder using |
| 828 | * the OnPlayTelephoneEvent callback. |
| 829 | */ |
| 830 | virtual bool TelephoneEventForwardToDecoder() const = 0; |
| 831 | |
| 832 | /* |
| 833 | * SendTelephoneEventActive |
| 834 | * |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 835 | * return true if we currently send a telephone event and 100 ms after an |
| 836 | * event is sent used to prevent the telephone event tone to be recorded |
| 837 | * by the microphone and send inband just after the tone has ended. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 838 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 839 | virtual bool SendTelephoneEventActive( |
| 840 | WebRtc_Word8& telephoneEvent) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 841 | |
| 842 | /* |
| 843 | * Send a TelephoneEvent tone using RFC 2833 (4733) |
| 844 | * |
| 845 | * return -1 on failure else 0 |
| 846 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 847 | virtual WebRtc_Word32 SendTelephoneEventOutband( |
| 848 | const WebRtc_UWord8 key, |
| 849 | const WebRtc_UWord16 time_ms, |
| 850 | const WebRtc_UWord8 level) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 851 | |
| 852 | /* |
| 853 | * Set payload type for Redundant Audio Data RFC 2198 |
| 854 | * |
| 855 | * return -1 on failure else 0 |
| 856 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 857 | virtual WebRtc_Word32 SetSendREDPayloadType( |
| 858 | const WebRtc_Word8 payloadType) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 859 | |
| 860 | /* |
| 861 | * Get payload type for Redundant Audio Data RFC 2198 |
| 862 | * |
| 863 | * return -1 on failure else 0 |
| 864 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 865 | virtual WebRtc_Word32 SendREDPayloadType( |
| 866 | WebRtc_Word8& payloadType) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 867 | |
| 868 | /* |
| 869 | * Set status and ID for header-extension-for-audio-level-indication. |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 870 | * See http://tools.ietf.org/html/rfc6464 for more details. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 871 | * |
| 872 | * return -1 on failure else 0 |
| 873 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 874 | virtual WebRtc_Word32 SetRTPAudioLevelIndicationStatus( |
| 875 | const bool enable, |
| 876 | const WebRtc_UWord8 ID) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 877 | |
| 878 | /* |
| 879 | * Get status and ID for header-extension-for-audio-level-indication. |
| 880 | * |
| 881 | * return -1 on failure else 0 |
| 882 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 883 | virtual WebRtc_Word32 GetRTPAudioLevelIndicationStatus( |
| 884 | bool& enable, |
| 885 | WebRtc_UWord8& ID) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 886 | |
| 887 | /* |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 888 | * Store the audio level in dBov for header-extension-for-audio-level- |
| 889 | * indication. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 890 | * This API shall be called before transmision of an RTP packet to ensure |
| 891 | * that the |level| part of the extended RTP header is updated. |
| 892 | * |
| 893 | * return -1 on failure else 0. |
| 894 | */ |
| 895 | virtual WebRtc_Word32 SetAudioLevel(const WebRtc_UWord8 level_dBov) = 0; |
| 896 | |
| 897 | /************************************************************************** |
| 898 | * |
| 899 | * Video |
| 900 | * |
| 901 | ***************************************************************************/ |
| 902 | |
| 903 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 904 | * Set the estimated camera delay in MS |
| 905 | * |
| 906 | * return -1 on failure else 0 |
| 907 | */ |
| 908 | virtual WebRtc_Word32 SetCameraDelay(const WebRtc_Word32 delayMS) = 0; |
| 909 | |
| 910 | /* |
pwestin@webrtc.org | 49888ce | 2012-04-27 05:25:53 +0000 | [diff] [blame] | 911 | * Set the target send bitrate |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 912 | */ |
pwestin@webrtc.org | 49888ce | 2012-04-27 05:25:53 +0000 | [diff] [blame] | 913 | virtual void SetTargetSendBitrate(const WebRtc_UWord32 bitrate) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 914 | |
| 915 | /* |
| 916 | * Turn on/off generic FEC |
| 917 | * |
| 918 | * return -1 on failure else 0 |
| 919 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 920 | virtual WebRtc_Word32 SetGenericFECStatus( |
| 921 | const bool enable, |
| 922 | const WebRtc_UWord8 payloadTypeRED, |
| 923 | const WebRtc_UWord8 payloadTypeFEC) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 924 | |
| 925 | /* |
| 926 | * Get generic FEC setting |
| 927 | * |
| 928 | * return -1 on failure else 0 |
| 929 | */ |
| 930 | virtual WebRtc_Word32 GenericFECStatus(bool& enable, |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 931 | WebRtc_UWord8& payloadTypeRED, |
| 932 | WebRtc_UWord8& payloadTypeFEC) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 933 | |
marpan@google.com | 80c5d7a | 2011-07-15 21:32:40 +0000 | [diff] [blame] | 934 | |
stefan@webrtc.org | e0d6fa4 | 2012-03-20 22:10:56 +0000 | [diff] [blame] | 935 | virtual WebRtc_Word32 SetFecParameters( |
| 936 | const FecProtectionParams* delta_params, |
| 937 | const FecProtectionParams* key_params) = 0; |
marpan@google.com | 80c5d7a | 2011-07-15 21:32:40 +0000 | [diff] [blame] | 938 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 939 | /* |
| 940 | * Set method for requestion a new key frame |
| 941 | * |
| 942 | * return -1 on failure else 0 |
| 943 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 944 | virtual WebRtc_Word32 SetKeyFrameRequestMethod( |
| 945 | const KeyFrameRequestMethod method) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 946 | |
| 947 | /* |
| 948 | * send a request for a keyframe |
| 949 | * |
| 950 | * return -1 on failure else 0 |
| 951 | */ |
pwestin@webrtc.org | 5e95481 | 2012-02-10 12:13:12 +0000 | [diff] [blame] | 952 | virtual WebRtc_Word32 RequestKeyFrame() = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 953 | }; |
| 954 | } // namespace webrtc |
| 955 | #endif // WEBRTC_MODULES_RTP_RTCP_INTERFACE_RTP_RTCP_H_ |