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