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 | |
turaj@webrtc.org | b7edd06 | 2013-03-12 22:27:27 +0000 | [diff] [blame] | 16 | #include "webrtc/modules/interface/module.h" |
| 17 | #include "webrtc/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; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 22 | class ReceiveStatistics; |
stefan@webrtc.org | 9354cc9 | 2012-06-07 08:10:14 +0000 | [diff] [blame] | 23 | class RemoteBitrateEstimator; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 24 | class RtpReceiver; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 25 | class Transport; |
| 26 | |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 27 | class RtpRtcp : public Module { |
| 28 | public: |
| 29 | struct Configuration { |
phoglund@webrtc.org | a22a9bd | 2013-01-14 10:01:55 +0000 | [diff] [blame] | 30 | Configuration(); |
| 31 | |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 32 | /* id - Unique identifier of this RTP/RTCP module object |
| 33 | * audio - True for a audio version of the RTP/RTCP module |
| 34 | * object false will create a video version |
| 35 | * clock - The clock to use to read time. If NULL object |
| 36 | * will be using the system clock. |
| 37 | * incoming_data - Callback object that will receive the incoming |
phoglund@webrtc.org | a22a9bd | 2013-01-14 10:01:55 +0000 | [diff] [blame] | 38 | * data. May not be NULL; default callback will do |
| 39 | * nothing. |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 40 | * incoming_messages - Callback object that will receive the incoming |
phoglund@webrtc.org | a22a9bd | 2013-01-14 10:01:55 +0000 | [diff] [blame] | 41 | * RTP messages. May not be NULL; default callback |
| 42 | * will do nothing. |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 43 | * outgoing_transport - Transport object that will be called when packets |
| 44 | * are ready to be sent out on the network |
| 45 | * rtcp_feedback - Callback object that will receive the incoming |
mflodman@webrtc.org | 7c894b7 | 2012-11-26 12:40:15 +0000 | [diff] [blame] | 46 | * RTCP messages. |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 47 | * intra_frame_callback - Called when the receiver request a intra frame. |
| 48 | * bandwidth_callback - Called when we receive a changed estimate from |
| 49 | * the receiver of out stream. |
phoglund@webrtc.org | a22a9bd | 2013-01-14 10:01:55 +0000 | [diff] [blame] | 50 | * audio_messages - Telehone events. May not be NULL; default callback |
| 51 | * will do nothing. |
stefan@webrtc.org | 9354cc9 | 2012-06-07 08:10:14 +0000 | [diff] [blame] | 52 | * remote_bitrate_estimator - Estimates the bandwidth available for a set of |
| 53 | * streams from the same client. |
pwestin@webrtc.org | 571a1c0 | 2012-11-13 21:12:39 +0000 | [diff] [blame] | 54 | * paced_sender - Spread any bursts of packets into smaller |
| 55 | * bursts to minimize packet loss. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 56 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 57 | int32_t id; |
| 58 | bool audio; |
stefan@webrtc.org | 20ed36d | 2013-01-17 14:01:20 +0000 | [diff] [blame] | 59 | Clock* clock; |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 60 | RtpRtcp* default_module; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 61 | ReceiveStatistics* receive_statistics; |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 62 | Transport* outgoing_transport; |
| 63 | RtcpFeedback* rtcp_feedback; |
| 64 | RtcpIntraFrameObserver* intra_frame_callback; |
| 65 | RtcpBandwidthObserver* bandwidth_callback; |
asapersson@webrtc.org | 1ae1d0c | 2013-11-20 12:46:11 +0000 | [diff] [blame] | 66 | RtcpRttStats* rtt_stats; |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 67 | RtpAudioFeedback* audio_messages; |
stefan@webrtc.org | 9354cc9 | 2012-06-07 08:10:14 +0000 | [diff] [blame] | 68 | RemoteBitrateEstimator* remote_bitrate_estimator; |
pwestin@webrtc.org | 571a1c0 | 2012-11-13 21:12:39 +0000 | [diff] [blame] | 69 | PacedSender* paced_sender; |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 70 | }; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 71 | |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 72 | /* |
| 73 | * Create a RTP/RTCP module object using the system clock. |
| 74 | * |
| 75 | * configuration - Configuration of the RTP/RTCP module. |
| 76 | */ |
| 77 | static RtpRtcp* CreateRtpRtcp(const RtpRtcp::Configuration& configuration); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 78 | |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 79 | /************************************************************************** |
| 80 | * |
| 81 | * Receiver functions |
| 82 | * |
| 83 | ***************************************************************************/ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 84 | |
stefan@webrtc.org | a5cb98c | 2013-05-29 12:12:51 +0000 | [diff] [blame] | 85 | virtual int32_t IncomingRtcpPacket(const uint8_t* incoming_packet, |
| 86 | uint16_t incoming_packet_length) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 87 | |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 88 | virtual void SetRemoteSSRC(const uint32_t ssrc) = 0; |
| 89 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 90 | /************************************************************************** |
| 91 | * |
| 92 | * Sender |
| 93 | * |
| 94 | ***************************************************************************/ |
| 95 | |
| 96 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 97 | * set MTU |
| 98 | * |
| 99 | * size - Max transfer unit in bytes, default is 1500 |
| 100 | * |
| 101 | * return -1 on failure else 0 |
| 102 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 103 | virtual int32_t SetMaxTransferUnit(const uint16_t size) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 104 | |
| 105 | /* |
| 106 | * set transtport overhead |
| 107 | * default is IPv4 and UDP with no encryption |
| 108 | * |
| 109 | * TCP - true for TCP false UDP |
| 110 | * IPv6 - true for IP version 6 false for version 4 |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 111 | * authenticationOverhead - number of bytes to leave for an |
| 112 | * authentication header |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 113 | * |
| 114 | * return -1 on failure else 0 |
| 115 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 116 | virtual int32_t SetTransportOverhead( |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 117 | const bool TCP, |
| 118 | const bool IPV6, |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 119 | const uint8_t authenticationOverhead = 0) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 120 | |
| 121 | /* |
| 122 | * Get max payload length |
| 123 | * |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 124 | * A combination of the configuration MaxTransferUnit and |
| 125 | * TransportOverhead. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 126 | * Does not account FEC/ULP/RED overhead if FEC is enabled. |
| 127 | * Does not account for RTP headers |
| 128 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 129 | virtual uint16_t MaxPayloadLength() const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 130 | |
| 131 | /* |
| 132 | * Get max data payload length |
| 133 | * |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 134 | * A combination of the configuration MaxTransferUnit, headers and |
| 135 | * TransportOverhead. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 136 | * Takes into account FEC/ULP/RED overhead if FEC is enabled. |
| 137 | * Takes into account RTP headers |
| 138 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 139 | virtual uint16_t MaxDataPayloadLength() const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 140 | |
| 141 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 142 | * set codec name and payload type |
| 143 | * |
pwestin@webrtc.org | 1da1ce0 | 2011-10-13 15:19:55 +0000 | [diff] [blame] | 144 | * return -1 on failure else 0 |
| 145 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 146 | virtual int32_t RegisterSendPayload( |
pwestin@webrtc.org | 1da1ce0 | 2011-10-13 15:19:55 +0000 | [diff] [blame] | 147 | const CodecInst& voiceCodec) = 0; |
| 148 | |
| 149 | /* |
| 150 | * set codec name and payload type |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 151 | * |
| 152 | * return -1 on failure else 0 |
| 153 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 154 | virtual int32_t RegisterSendPayload( |
pwestin@webrtc.org | 1da1ce0 | 2011-10-13 15:19:55 +0000 | [diff] [blame] | 155 | const VideoCodec& videoCodec) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 156 | |
| 157 | /* |
| 158 | * Unregister a send payload |
| 159 | * |
| 160 | * payloadType - payload type of codec |
| 161 | * |
| 162 | * return -1 on failure else 0 |
| 163 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 164 | virtual int32_t DeRegisterSendPayload( |
| 165 | const int8_t payloadType) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 166 | |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 167 | /* |
| 168 | * (De)register RTP header extension type and id. |
| 169 | * |
| 170 | * return -1 on failure else 0 |
| 171 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 172 | virtual int32_t RegisterSendRtpHeaderExtension( |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 173 | const RTPExtensionType type, |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 174 | const uint8_t id) = 0; |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 175 | |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 176 | virtual int32_t DeregisterSendRtpHeaderExtension( |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 177 | const RTPExtensionType type) = 0; |
| 178 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 179 | /* |
| 180 | * get start timestamp |
| 181 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 182 | virtual uint32_t StartTimestamp() const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 183 | |
| 184 | /* |
| 185 | * configure start timestamp, default is a random number |
| 186 | * |
| 187 | * timestamp - start timestamp |
| 188 | * |
| 189 | * return -1 on failure else 0 |
| 190 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 191 | virtual int32_t SetStartTimestamp( |
| 192 | const uint32_t timestamp) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 193 | |
| 194 | /* |
| 195 | * Get SequenceNumber |
| 196 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 197 | virtual uint16_t SequenceNumber() const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 198 | |
| 199 | /* |
| 200 | * Set SequenceNumber, default is a random number |
| 201 | * |
| 202 | * return -1 on failure else 0 |
| 203 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 204 | virtual int32_t SetSequenceNumber(const uint16_t seq) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 205 | |
| 206 | /* |
| 207 | * Get SSRC |
| 208 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 209 | virtual uint32_t SSRC() const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 210 | |
| 211 | /* |
| 212 | * configure SSRC, default is a random number |
| 213 | * |
| 214 | * return -1 on failure else 0 |
| 215 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 216 | virtual int32_t SetSSRC(const uint32_t ssrc) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 217 | |
| 218 | /* |
| 219 | * Get CSRC |
| 220 | * |
| 221 | * arrOfCSRC - array of CSRCs |
| 222 | * |
| 223 | * return -1 on failure else number of valid entries in the array |
| 224 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 225 | virtual int32_t CSRCs( |
| 226 | uint32_t arrOfCSRC[kRtpCsrcSize]) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 227 | |
| 228 | /* |
| 229 | * Set CSRC |
| 230 | * |
| 231 | * arrOfCSRC - array of CSRCs |
| 232 | * arrLength - number of valid entries in the array |
| 233 | * |
| 234 | * return -1 on failure else 0 |
| 235 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 236 | virtual int32_t SetCSRCs( |
| 237 | const uint32_t arrOfCSRC[kRtpCsrcSize], |
| 238 | const uint8_t arrLength) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 239 | |
| 240 | /* |
| 241 | * includes CSRCs in RTP header if enabled |
| 242 | * |
| 243 | * include CSRC - on/off |
| 244 | * |
| 245 | * default:on |
| 246 | * |
| 247 | * return -1 on failure else 0 |
| 248 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 249 | virtual int32_t SetCSRCStatus(const bool include) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 250 | |
| 251 | /* |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 252 | * Turn on/off sending RTX (RFC 4588) on a specific SSRC. |
| 253 | */ |
mflodman@webrtc.org | 9f5ebb5 | 2013-04-12 14:55:46 +0000 | [diff] [blame] | 254 | virtual int32_t SetRTXSendStatus(RtxMode mode, bool set_ssrc, |
| 255 | uint32_t ssrc) = 0; |
| 256 | |
| 257 | // Sets the payload type to use when sending RTX packets. Note that this |
| 258 | // doesn't enable RTX, only the payload type is set. |
| 259 | virtual void SetRtxSendPayloadType(int payload_type) = 0; |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 260 | |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 261 | /* |
| 262 | * Get status of sending RTX (RFC 4588) on a specific SSRC. |
| 263 | */ |
mflodman@webrtc.org | 9f5ebb5 | 2013-04-12 14:55:46 +0000 | [diff] [blame] | 264 | virtual int32_t RTXSendStatus(RtxMode* mode, uint32_t* ssrc, |
| 265 | int* payloadType) const = 0; |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 266 | |
| 267 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 268 | * sends kRtcpByeCode when going from true to false |
| 269 | * |
| 270 | * sending - on/off |
| 271 | * |
| 272 | * return -1 on failure else 0 |
| 273 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 274 | virtual int32_t SetSendingStatus(const bool sending) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 275 | |
| 276 | /* |
| 277 | * get send status |
| 278 | */ |
| 279 | virtual bool Sending() const = 0; |
| 280 | |
| 281 | /* |
| 282 | * Starts/Stops media packets, on by default |
| 283 | * |
| 284 | * sending - on/off |
| 285 | * |
| 286 | * return -1 on failure else 0 |
| 287 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 288 | virtual int32_t SetSendingMediaStatus(const bool sending) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 289 | |
| 290 | /* |
| 291 | * get send status |
| 292 | */ |
| 293 | virtual bool SendingMedia() const = 0; |
| 294 | |
| 295 | /* |
| 296 | * get sent bitrate in Kbit/s |
| 297 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 298 | virtual void BitrateSent(uint32_t* totalRate, |
| 299 | uint32_t* videoRate, |
| 300 | uint32_t* fecRate, |
| 301 | uint32_t* nackRate) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 302 | |
| 303 | /* |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 304 | * Used by the codec module to deliver a video or audio frame for |
| 305 | * packetization. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 306 | * |
| 307 | * frameType - type of frame to send |
| 308 | * payloadType - payload type of frame to send |
| 309 | * timestamp - timestamp of frame to send |
| 310 | * payloadData - payload buffer of frame to send |
| 311 | * payloadSize - size of payload buffer to send |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 312 | * fragmentation - fragmentation offset data for fragmented frames such |
| 313 | * as layers or RED |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 314 | * |
| 315 | * return -1 on failure else 0 |
| 316 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 317 | virtual int32_t SendOutgoingData( |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 318 | const FrameType frameType, |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 319 | const int8_t payloadType, |
| 320 | const uint32_t timeStamp, |
stefan@webrtc.org | ddfdfed | 2012-07-03 13:21:22 +0000 | [diff] [blame] | 321 | int64_t capture_time_ms, |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 322 | const uint8_t* payloadData, |
| 323 | const uint32_t payloadSize, |
pwestin@webrtc.org | 8281e7d | 2012-01-10 14:09:18 +0000 | [diff] [blame] | 324 | const RTPFragmentationHeader* fragmentation = NULL, |
| 325 | const RTPVideoHeader* rtpVideoHdr = NULL) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 326 | |
stefan@webrtc.org | 9b82f5a | 2013-11-13 15:29:21 +0000 | [diff] [blame] | 327 | virtual bool TimeToSendPacket(uint32_t ssrc, |
| 328 | uint16_t sequence_number, |
| 329 | int64_t capture_time_ms, |
| 330 | bool retransmission) = 0; |
pwestin@webrtc.org | 571a1c0 | 2012-11-13 21:12:39 +0000 | [diff] [blame] | 331 | |
stefan@webrtc.org | 508a84b | 2013-06-17 12:53:37 +0000 | [diff] [blame] | 332 | virtual int TimeToSendPadding(int bytes) = 0; |
| 333 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 334 | /************************************************************************** |
| 335 | * |
| 336 | * RTCP |
| 337 | * |
| 338 | ***************************************************************************/ |
| 339 | |
| 340 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 341 | * Get RTCP status |
| 342 | */ |
| 343 | virtual RTCPMethod RTCP() const = 0; |
| 344 | |
| 345 | /* |
| 346 | * configure RTCP status i.e on(compound or non- compound)/off |
| 347 | * |
| 348 | * method - RTCP method to use |
| 349 | * |
| 350 | * return -1 on failure else 0 |
| 351 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 352 | virtual int32_t SetRTCPStatus(const RTCPMethod method) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 353 | |
| 354 | /* |
| 355 | * Set RTCP CName (i.e unique identifier) |
| 356 | * |
| 357 | * return -1 on failure else 0 |
| 358 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 359 | virtual int32_t SetCNAME(const char cName[RTCP_CNAME_SIZE]) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 360 | |
| 361 | /* |
| 362 | * Get RTCP CName (i.e unique identifier) |
| 363 | * |
| 364 | * return -1 on failure else 0 |
| 365 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 366 | virtual int32_t CNAME(char cName[RTCP_CNAME_SIZE]) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 367 | |
| 368 | /* |
| 369 | * Get remote CName |
| 370 | * |
| 371 | * return -1 on failure else 0 |
| 372 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 373 | virtual int32_t RemoteCNAME( |
| 374 | const uint32_t remoteSSRC, |
pwestin@webrtc.org | f6bb77a | 2012-01-24 17:16:59 +0000 | [diff] [blame] | 375 | char cName[RTCP_CNAME_SIZE]) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 376 | |
| 377 | /* |
| 378 | * Get remote NTP |
| 379 | * |
| 380 | * return -1 on failure else 0 |
| 381 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 382 | virtual int32_t RemoteNTP( |
| 383 | uint32_t *ReceivedNTPsecs, |
| 384 | uint32_t *ReceivedNTPfrac, |
| 385 | uint32_t *RTCPArrivalTimeSecs, |
| 386 | uint32_t *RTCPArrivalTimeFrac, |
| 387 | uint32_t *rtcp_timestamp) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 388 | |
| 389 | /* |
| 390 | * AddMixedCNAME |
| 391 | * |
| 392 | * return -1 on failure else 0 |
| 393 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 394 | virtual int32_t AddMixedCNAME( |
| 395 | const uint32_t SSRC, |
pwestin@webrtc.org | f6bb77a | 2012-01-24 17:16:59 +0000 | [diff] [blame] | 396 | const char cName[RTCP_CNAME_SIZE]) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 397 | |
| 398 | /* |
| 399 | * RemoveMixedCNAME |
| 400 | * |
| 401 | * return -1 on failure else 0 |
| 402 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 403 | virtual int32_t RemoveMixedCNAME(const uint32_t SSRC) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 404 | |
| 405 | /* |
| 406 | * Get RoundTripTime |
| 407 | * |
| 408 | * return -1 on failure else 0 |
| 409 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 410 | virtual int32_t RTT(const uint32_t remoteSSRC, |
| 411 | uint16_t* RTT, |
| 412 | uint16_t* avgRTT, |
| 413 | uint16_t* minRTT, |
| 414 | uint16_t* maxRTT) const = 0 ; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 415 | |
| 416 | /* |
| 417 | * Reset RoundTripTime statistics |
| 418 | * |
| 419 | * return -1 on failure else 0 |
| 420 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 421 | virtual int32_t ResetRTT(const uint32_t remoteSSRC)= 0 ; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 422 | |
| 423 | /* |
| 424 | * Force a send of a RTCP packet |
| 425 | * normal SR and RR are triggered via the process function |
| 426 | * |
| 427 | * return -1 on failure else 0 |
| 428 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 429 | virtual int32_t SendRTCP( |
| 430 | uint32_t rtcpPacketType = kRtcpReport) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 431 | |
| 432 | /* |
| 433 | * Good state of RTP receiver inform sender |
| 434 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 435 | virtual int32_t SendRTCPReferencePictureSelection( |
| 436 | const uint64_t pictureID) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 437 | |
| 438 | /* |
| 439 | * Send a RTCP Slice Loss Indication (SLI) |
| 440 | * 6 least significant bits of pictureID |
| 441 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 442 | virtual int32_t SendRTCPSliceLossIndication( |
| 443 | const uint8_t pictureID) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 444 | |
| 445 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 446 | * Reset RTP data counters for the sending side |
| 447 | * |
| 448 | * return -1 on failure else 0 |
| 449 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 450 | virtual int32_t ResetSendDataCountersRTP() = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 451 | |
| 452 | /* |
| 453 | * statistics of the amount of data sent and received |
| 454 | * |
| 455 | * return -1 on failure else 0 |
| 456 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 457 | virtual int32_t DataCountersRTP( |
| 458 | uint32_t* bytesSent, |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 459 | uint32_t* packetsSent) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 460 | /* |
| 461 | * Get received RTCP sender info |
| 462 | * |
| 463 | * return -1 on failure else 0 |
| 464 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 465 | virtual int32_t RemoteRTCPStat(RTCPSenderInfo* senderInfo) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 466 | |
| 467 | /* |
| 468 | * Get received RTCP report block |
| 469 | * |
| 470 | * return -1 on failure else 0 |
| 471 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 472 | virtual int32_t RemoteRTCPStat( |
perkj@webrtc.org | ce5990c | 2012-01-11 13:00:08 +0000 | [diff] [blame] | 473 | std::vector<RTCPReportBlock>* receiveBlocks) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 474 | /* |
| 475 | * Set received RTCP report block |
| 476 | * |
| 477 | * return -1 on failure else 0 |
| 478 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 479 | virtual int32_t AddRTCPReportBlock( |
| 480 | const uint32_t SSRC, |
perkj@webrtc.org | ce5990c | 2012-01-11 13:00:08 +0000 | [diff] [blame] | 481 | const RTCPReportBlock* receiveBlock) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 482 | |
| 483 | /* |
| 484 | * RemoveRTCPReportBlock |
| 485 | * |
| 486 | * return -1 on failure else 0 |
| 487 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 488 | virtual int32_t RemoveRTCPReportBlock(const uint32_t SSRC) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 489 | |
| 490 | /* |
| 491 | * (APP) Application specific data |
| 492 | * |
| 493 | * return -1 on failure else 0 |
| 494 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 495 | virtual int32_t SetRTCPApplicationSpecificData( |
| 496 | const uint8_t subType, |
| 497 | const uint32_t name, |
| 498 | const uint8_t* data, |
| 499 | const uint16_t length) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 500 | /* |
| 501 | * (XR) VOIP metric |
| 502 | * |
| 503 | * return -1 on failure else 0 |
| 504 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 505 | virtual int32_t SetRTCPVoIPMetrics( |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 506 | const RTCPVoIPMetric* VoIPMetric) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 507 | |
| 508 | /* |
asapersson@webrtc.org | 7d6bd22 | 2013-10-31 12:14:34 +0000 | [diff] [blame] | 509 | * (XR) Receiver Reference Time Report |
| 510 | */ |
| 511 | virtual void SetRtcpXrRrtrStatus(bool enable) = 0; |
| 512 | |
| 513 | /* |
pwestin@webrtc.org | 741da94 | 2011-09-20 13:52:04 +0000 | [diff] [blame] | 514 | * (REMB) Receiver Estimated Max Bitrate |
| 515 | */ |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 516 | virtual bool REMB() const = 0; |
pwestin@webrtc.org | 741da94 | 2011-09-20 13:52:04 +0000 | [diff] [blame] | 517 | |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 518 | virtual int32_t SetREMBStatus(const bool enable) = 0; |
pwestin@webrtc.org | 741da94 | 2011-09-20 13:52:04 +0000 | [diff] [blame] | 519 | |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 520 | virtual int32_t SetREMBData(const uint32_t bitrate, |
| 521 | const uint8_t numberOfSSRC, |
| 522 | const uint32_t* SSRC) = 0; |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 523 | |
| 524 | /* |
| 525 | * (IJ) Extended jitter report. |
| 526 | */ |
| 527 | virtual bool IJ() const = 0; |
| 528 | |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 529 | virtual int32_t SetIJStatus(const bool enable) = 0; |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 530 | |
pwestin@webrtc.org | 741da94 | 2011-09-20 13:52:04 +0000 | [diff] [blame] | 531 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 532 | * (TMMBR) Temporary Max Media Bit Rate |
| 533 | */ |
asapersson@webrtc.org | 5249cc8 | 2011-12-16 14:31:37 +0000 | [diff] [blame] | 534 | virtual bool TMMBR() const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 535 | |
| 536 | /* |
| 537 | * |
| 538 | * return -1 on failure else 0 |
| 539 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 540 | virtual int32_t SetTMMBRStatus(const bool enable) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 541 | |
| 542 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 543 | * (NACK) |
| 544 | */ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 545 | |
| 546 | /* |
stefan@webrtc.org | 6a4bef4 | 2011-12-22 12:52:41 +0000 | [diff] [blame] | 547 | * TODO(holmer): Propagate this API to VideoEngine. |
| 548 | * Returns the currently configured selective retransmission settings. |
| 549 | */ |
| 550 | virtual int SelectiveRetransmissions() const = 0; |
| 551 | |
| 552 | /* |
| 553 | * TODO(holmer): Propagate this API to VideoEngine. |
| 554 | * Sets the selective retransmission settings, which will decide which |
| 555 | * packets will be retransmitted if NACKed. Settings are constructed by |
| 556 | * combining the constants in enum RetransmissionMode with bitwise OR. |
| 557 | * All packets are retransmitted if kRetransmitAllPackets is set, while no |
| 558 | * packets are retransmitted if kRetransmitOff is set. |
| 559 | * By default all packets except FEC packets are retransmitted. For VP8 |
| 560 | * with temporal scalability only base layer packets are retransmitted. |
| 561 | * |
| 562 | * Returns -1 on failure, otherwise 0. |
| 563 | */ |
| 564 | virtual int SetSelectiveRetransmissions(uint8_t settings) = 0; |
| 565 | |
| 566 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 567 | * Send a Negative acknowledgement packet |
| 568 | * |
| 569 | * return -1 on failure else 0 |
| 570 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 571 | virtual int32_t SendNACK(const uint16_t* nackList, |
| 572 | const uint16_t size) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 573 | |
| 574 | /* |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 575 | * Store the sent packets, needed to answer to a Negative acknowledgement |
| 576 | * requests |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 577 | * |
| 578 | * return -1 on failure else 0 |
| 579 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 580 | virtual int32_t SetStorePacketsStatus( |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 581 | const bool enable, |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 582 | const uint16_t numberToStore) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 583 | |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 584 | // Returns true if the module is configured to store packets. |
| 585 | virtual bool StorePackets() const = 0; |
| 586 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 587 | /************************************************************************** |
| 588 | * |
| 589 | * Audio |
| 590 | * |
| 591 | ***************************************************************************/ |
| 592 | |
| 593 | /* |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 594 | * set audio packet size, used to determine when it's time to send a DTMF |
| 595 | * packet in silence (CNG) |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 596 | * |
| 597 | * return -1 on failure else 0 |
| 598 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 599 | virtual int32_t SetAudioPacketSize( |
| 600 | const uint16_t packetSizeSamples) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 601 | |
| 602 | /* |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 603 | * SendTelephoneEventActive |
| 604 | * |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 605 | * return true if we currently send a telephone event and 100 ms after an |
| 606 | * event is sent used to prevent the telephone event tone to be recorded |
| 607 | * 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] | 608 | */ |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 609 | virtual bool SendTelephoneEventActive( |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 610 | int8_t& telephoneEvent) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 611 | |
| 612 | /* |
| 613 | * Send a TelephoneEvent tone using RFC 2833 (4733) |
| 614 | * |
| 615 | * return -1 on failure else 0 |
| 616 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 617 | virtual int32_t SendTelephoneEventOutband( |
| 618 | const uint8_t key, |
| 619 | const uint16_t time_ms, |
| 620 | const uint8_t level) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 621 | |
| 622 | /* |
| 623 | * Set payload type for Redundant Audio Data RFC 2198 |
| 624 | * |
| 625 | * return -1 on failure else 0 |
| 626 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 627 | virtual int32_t SetSendREDPayloadType( |
| 628 | const int8_t payloadType) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 629 | |
| 630 | /* |
| 631 | * Get payload type for Redundant Audio Data RFC 2198 |
| 632 | * |
| 633 | * return -1 on failure else 0 |
| 634 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 635 | virtual int32_t SendREDPayloadType( |
| 636 | int8_t& payloadType) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 637 | |
| 638 | /* |
| 639 | * Set status and ID for header-extension-for-audio-level-indication. |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 640 | * See http://tools.ietf.org/html/rfc6464 for more details. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 641 | * |
| 642 | * return -1 on failure else 0 |
| 643 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 644 | virtual int32_t SetRTPAudioLevelIndicationStatus( |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 645 | const bool enable, |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 646 | const uint8_t ID) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 647 | |
| 648 | /* |
| 649 | * Get status and ID for header-extension-for-audio-level-indication. |
| 650 | * |
| 651 | * return -1 on failure else 0 |
| 652 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 653 | virtual int32_t GetRTPAudioLevelIndicationStatus( |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 654 | bool& enable, |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 655 | uint8_t& ID) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 656 | |
| 657 | /* |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 658 | * Store the audio level in dBov for header-extension-for-audio-level- |
| 659 | * indication. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 660 | * This API shall be called before transmision of an RTP packet to ensure |
| 661 | * that the |level| part of the extended RTP header is updated. |
| 662 | * |
| 663 | * return -1 on failure else 0. |
| 664 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 665 | virtual int32_t SetAudioLevel(const uint8_t level_dBov) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 666 | |
| 667 | /************************************************************************** |
| 668 | * |
| 669 | * Video |
| 670 | * |
| 671 | ***************************************************************************/ |
| 672 | |
| 673 | /* |
stefan@webrtc.org | 7da3459 | 2013-04-09 14:56:29 +0000 | [diff] [blame] | 674 | * Set the estimated camera delay in MS |
| 675 | * |
| 676 | * return -1 on failure else 0 |
| 677 | */ |
| 678 | virtual int32_t SetCameraDelay(const int32_t delayMS) = 0; |
| 679 | |
| 680 | /* |
pwestin@webrtc.org | 49888ce | 2012-04-27 05:25:53 +0000 | [diff] [blame] | 681 | * Set the target send bitrate |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 682 | */ |
stefan@webrtc.org | b2c8a95 | 2013-09-06 13:58:01 +0000 | [diff] [blame] | 683 | virtual void SetTargetSendBitrate( |
| 684 | const std::vector<uint32_t>& stream_bitrates) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 685 | |
| 686 | /* |
| 687 | * Turn on/off generic FEC |
| 688 | * |
| 689 | * return -1 on failure else 0 |
| 690 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 691 | virtual int32_t SetGenericFECStatus( |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 692 | const bool enable, |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 693 | const uint8_t payloadTypeRED, |
| 694 | const uint8_t payloadTypeFEC) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 695 | |
| 696 | /* |
| 697 | * Get generic FEC setting |
| 698 | * |
| 699 | * return -1 on failure else 0 |
| 700 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 701 | virtual int32_t GenericFECStatus(bool& enable, |
| 702 | uint8_t& payloadTypeRED, |
| 703 | uint8_t& payloadTypeFEC) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 704 | |
marpan@google.com | 80c5d7a | 2011-07-15 21:32:40 +0000 | [diff] [blame] | 705 | |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 706 | virtual int32_t SetFecParameters( |
stefan@webrtc.org | e0d6fa4 | 2012-03-20 22:10:56 +0000 | [diff] [blame] | 707 | const FecProtectionParams* delta_params, |
| 708 | const FecProtectionParams* key_params) = 0; |
marpan@google.com | 80c5d7a | 2011-07-15 21:32:40 +0000 | [diff] [blame] | 709 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 710 | /* |
| 711 | * Set method for requestion a new key frame |
| 712 | * |
| 713 | * return -1 on failure else 0 |
| 714 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 715 | virtual int32_t SetKeyFrameRequestMethod( |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 716 | const KeyFrameRequestMethod method) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 717 | |
| 718 | /* |
| 719 | * send a request for a keyframe |
| 720 | * |
| 721 | * return -1 on failure else 0 |
| 722 | */ |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 723 | virtual int32_t RequestKeyFrame() = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 724 | }; |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 725 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 726 | #endif // WEBRTC_MODULES_RTP_RTCP_INTERFACE_RTP_RTCP_H_ |