media/webrtc/signaling/src/sipcc/include/ccsdp.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 /**
michael@0 6 * Skip this file if not doing video on the device.
michael@0 7 *
michael@0 8 * The ccsdp_xxx api's provide a means to query and populate the SDP attributes
michael@0 9 * for video m lines. These Api are not needed if we are not supporting video on
michael@0 10 * the platform. For audio the stack will populate the appropriate attributes
michael@0 11 *
michael@0 12 *
michael@0 13 * These API's can be invoked from the vcmCheckAttrs() and vcmPopulateAttrs()
michael@0 14 * methods to populate or extract the value of specific attributes in the video SDP.
michael@0 15 * These api require an handle to the SDP that is passed in the above methods.
michael@0 16 * <pre>
michael@0 17 * sdp_handle The SDP handle
michael@0 18 * level The level the attribute is defined. Can be either
michael@0 19 * SDP_SESSION_LEVEL or 0-n specifying a media line level.
michael@0 20 * inst_num The instance number of the attribute. Multiple instances
michael@0 21 * of a particular attribute may exist at each level and so
michael@0 22 * the inst_num determines the particular attribute at that
michael@0 23 * level that should be accessed. Note that this is the
michael@0 24 * instance number of the specified type of attribute, not the
michael@0 25 * overall attribute number at the level. Also note that the
michael@0 26 * instance number is 1-based. For example:
michael@0 27 * v=0
michael@0 28 * o=mhandley 2890844526 2890842807 IN IP4 126.16.64.4
michael@0 29 * s=SDP Seminar
michael@0 30 * c=IN IP4 10.1.0.2
michael@0 31 * t=0 0
michael@0 32 * m=audio 1234 RTP/AVP 0 101 102
michael@0 33 * a=foo 1
michael@0 34 * a=foo 2
michael@0 35 * a=bar 1 # This is instance 1 of attribute bar.
michael@0 36 * a=foo 3 # This is instance 3 of attribute foo.
michael@0 37 * cap_num Almost all of the attributes may be defined as X-cpar
michael@0 38 * parameters (with the exception of X-sqn, X-cap, and X-cpar).
michael@0 39 * If the cap_num is set to zero, then the attribute is not
michael@0 40 * an X-cpar parameter attribute. If the cap_num is any other
michael@0 41 * value, it specifies the capability number that the X-cpar
michael@0 42 * attribute is specified for.
michael@0 43 * </pre>
michael@0 44 */
michael@0 45
michael@0 46 #ifndef __CCSDP_H__
michael@0 47 #define __CCSDP_H__
michael@0 48
michael@0 49 #include "cpr_types.h"
michael@0 50 #include "ccsdp_rtcp_fb.h"
michael@0 51
michael@0 52 #define SIPSDP_ILBC_MODE20 20
michael@0 53
michael@0 54 /**
michael@0 55 * Return codes for sdp helper APIs
michael@0 56 */
michael@0 57 typedef enum rtp_ptype_
michael@0 58 {
michael@0 59 RTP_NONE = -1,
michael@0 60 RTP_PCMU = 0,
michael@0 61 RTP_CELP = 1,
michael@0 62 RTP_G726 = 2,
michael@0 63 RTP_GSM = 3,
michael@0 64 RTP_G723 = 4,
michael@0 65 RTP_DVI4 = 5,
michael@0 66 RTP_DVI4_II = 6,
michael@0 67 RTP_LPC = 7,
michael@0 68 RTP_PCMA = 8,
michael@0 69 RTP_G722 = 9,
michael@0 70 RTP_G728 = 15,
michael@0 71 RTP_G729 = 18,
michael@0 72 RTP_JPEG = 26,
michael@0 73 RTP_NV = 28,
michael@0 74 RTP_H261 = 31,
michael@0 75 RTP_H264_P0 = 97,
michael@0 76 RTP_H264_P1 = 126,
michael@0 77 RTP_AVT = 101,
michael@0 78 RTP_L16 = 102,
michael@0 79 RTP_H263 = 103,
michael@0 80 RTP_ILBC = 116, /* used only to make an offer */
michael@0 81 RTP_OPUS = 109,
michael@0 82 RTP_VP8 = 120,
michael@0 83 RTP_I420 = 124,
michael@0 84 RTP_ISAC = 124
michael@0 85 } rtp_ptype;
michael@0 86
michael@0 87 /**
michael@0 88 * IANA-registered static payload types for the RTP/AVP profile.
michael@0 89 * See http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xml
michael@0 90 */
michael@0 91 typedef enum static_rtp_ptype_
michael@0 92 {
michael@0 93 STATIC_RTP_AVP_PCMU_8000_1 = 0,
michael@0 94 STATIC_RTP_AVP_GSM_8000_1 = 3,
michael@0 95 STATIC_RTP_AVP_G723_8000_1 = 4,
michael@0 96 STATIC_RTP_AVP_DVI4_8000_1 = 5,
michael@0 97 STATIC_RTP_AVP_DVI4_16000_1 = 6,
michael@0 98 STATIC_RTP_AVP_LPC_8000_1 = 7,
michael@0 99 STATIC_RTP_AVP_PCMA_8000_1 = 8,
michael@0 100 STATIC_RTP_AVP_G722_8000_1 = 9,
michael@0 101 STATIC_RTP_AVP_L16_44100_2 = 10,
michael@0 102 STATIC_RTP_AVP_L16_44100_1 = 11,
michael@0 103 STATIC_RTP_AVP_QCELP_8000_1 = 12,
michael@0 104 STATIC_RTP_AVP_CN_8000_1 = 13,
michael@0 105 STATIC_RTP_AVP_MPA_90000_1 = 14,
michael@0 106 STATIC_RTP_AVP_G728_8000_1 = 15,
michael@0 107 STATIC_RTP_AVP_DVI4_11025_1 = 16,
michael@0 108 STATIC_RTP_AVP_DVI4_22050_1 = 17,
michael@0 109 STATIC_RTP_AVP_G729_8000_1 = 18,
michael@0 110 STATIC_RTP_AVP_CELB_90000_1 = 25,
michael@0 111 STATIC_RTP_AVP_JPEG_90000_1 = 26,
michael@0 112 STATIC_RTP_AVP_NV_90000_1 = 28,
michael@0 113 STATIC_RTP_AVP_H261_90000_1 = 31,
michael@0 114 STATIC_RTP_AVP_MPV_90000_1 = 32,
michael@0 115 STATIC_RTP_AVP_MP2T_90000_1 = 33,
michael@0 116 STATIC_RTP_AVP_H263_90000_1 = 34
michael@0 117 } static_rtp_ptype;
michael@0 118
michael@0 119 typedef struct {
michael@0 120 const char *name;
michael@0 121 int value;
michael@0 122 } ccsdp_key_table_entry_t;
michael@0 123
michael@0 124 typedef enum max_coded_audio_bandwidth_ {
michael@0 125 opus_nb = 0, /* Narrowband */
michael@0 126 opus_mb = 1, /* Mediumband */
michael@0 127 opus_wb = 2, /* Wideband */
michael@0 128 opus_swb = 3, /* Super-wideband */
michael@0 129 opus_fb = 4 /* Fullband */
michael@0 130 } max_coded_audio_bandwidth;
michael@0 131
michael@0 132 static const ccsdp_key_table_entry_t max_coded_audio_bandwidth_table[] = {
michael@0 133 {"nb", opus_nb},
michael@0 134 {"mb", opus_mb},
michael@0 135 {"wb", opus_wb},
michael@0 136 {"swb", opus_swb},
michael@0 137 {"fb", opus_fb}
michael@0 138 };
michael@0 139
michael@0 140 typedef enum {
michael@0 141 SDP_SUCCESS, /**< Success */
michael@0 142 SDP_FAILURE,
michael@0 143 SDP_INVALID_SDP_PTR,
michael@0 144 SDP_NOT_SDP_DESCRIPTION,
michael@0 145 SDP_INVALID_TOKEN_ORDERING,
michael@0 146 SDP_INVALID_PARAMETER,
michael@0 147 SDP_INVALID_MEDIA_LEVEL,
michael@0 148 SDP_INVALID_CAPABILITY,
michael@0 149 SDP_NO_RESOURCE,
michael@0 150 SDP_UNRECOGNIZED_TOKEN,
michael@0 151 SDP_NULL_BUF_PTR,
michael@0 152 SDP_POTENTIAL_SDP_OVERFLOW,
michael@0 153 SDP_MAX_RC
michael@0 154 } sdp_result_e;
michael@0 155
michael@0 156 /**
michael@0 157 * Indicates invalid bandwidth value
michael@0 158 */
michael@0 159 #define SDP_INVALID_VALUE (-2)
michael@0 160
michael@0 161 /**
michael@0 162 * Bandwidth modifier type for b= SDP line
michael@0 163 */
michael@0 164 typedef enum {
michael@0 165 SDP_BW_MODIFIER_INVALID = -1,
michael@0 166 SDP_BW_MODIFIER_AS, /** < b=AS: */
michael@0 167 SDP_BW_MODIFIER_CT, /** < b=CT: */
michael@0 168 SDP_BW_MODIFIER_TIAS, /** < b=TIAS: */
michael@0 169 SDP_MAX_BW_MODIFIER_VAL,
michael@0 170 SDP_BW_MODIFIER_UNSUPPORTED
michael@0 171 } sdp_bw_modifier_e;
michael@0 172
michael@0 173 /**
michael@0 174 * SDP attribute types
michael@0 175 */
michael@0 176 /* Attribute Types */
michael@0 177 typedef enum {
michael@0 178 SDP_ATTR_BEARER = 0,
michael@0 179 SDP_ATTR_CALLED,
michael@0 180 SDP_ATTR_CONN_TYPE,
michael@0 181 SDP_ATTR_DIALED,
michael@0 182 SDP_ATTR_DIALING,
michael@0 183 SDP_ATTR_DIRECTION,
michael@0 184 SDP_ATTR_EECID,
michael@0 185 SDP_ATTR_FMTP,
michael@0 186 SDP_ATTR_SCTPMAP,
michael@0 187 SDP_ATTR_FRAMING,
michael@0 188 SDP_ATTR_INACTIVE,
michael@0 189 SDP_ATTR_PTIME,
michael@0 190 SDP_ATTR_QOS,
michael@0 191 SDP_ATTR_CURR,
michael@0 192 SDP_ATTR_DES,
michael@0 193 SDP_ATTR_CONF,
michael@0 194 SDP_ATTR_RECVONLY,
michael@0 195 SDP_ATTR_RTPMAP,
michael@0 196 SDP_ATTR_SECURE,
michael@0 197 SDP_ATTR_SENDONLY,
michael@0 198 SDP_ATTR_SENDRECV,
michael@0 199 SDP_ATTR_SUBNET,
michael@0 200 SDP_ATTR_T38_VERSION,
michael@0 201 SDP_ATTR_T38_MAXBITRATE,
michael@0 202 SDP_ATTR_T38_FILLBITREMOVAL,
michael@0 203 SDP_ATTR_T38_TRANSCODINGMMR,
michael@0 204 SDP_ATTR_T38_TRANSCODINGJBIG,
michael@0 205 SDP_ATTR_T38_RATEMGMT,
michael@0 206 SDP_ATTR_T38_MAXBUFFER,
michael@0 207 SDP_ATTR_T38_MAXDGRAM,
michael@0 208 SDP_ATTR_T38_UDPEC,
michael@0 209 SDP_ATTR_X_CAP,
michael@0 210 SDP_ATTR_X_CPAR,
michael@0 211 SDP_ATTR_X_PC_CODEC,
michael@0 212 SDP_ATTR_X_PC_QOS,
michael@0 213 SDP_ATTR_X_QOS,
michael@0 214 SDP_ATTR_X_SQN,
michael@0 215 SDP_ATTR_TMRGWXID,
michael@0 216 SDP_ATTR_TC1_PAYLOAD_BYTES,
michael@0 217 SDP_ATTR_TC1_WINDOW_SIZE,
michael@0 218 SDP_ATTR_TC2_PAYLOAD_BYTES,
michael@0 219 SDP_ATTR_TC2_WINDOW_SIZE,
michael@0 220 SDP_ATTR_RTCP,
michael@0 221 SDP_ATTR_RTR,
michael@0 222 SDP_ATTR_SILENCESUPP,
michael@0 223 SDP_ATTR_SRTP_CONTEXT, /* version 2 sdescriptions */
michael@0 224 SDP_ATTR_MPTIME,
michael@0 225 SDP_ATTR_X_SIDIN,
michael@0 226 SDP_ATTR_X_SIDOUT,
michael@0 227 SDP_ATTR_X_CONFID,
michael@0 228 SDP_ATTR_GROUP,
michael@0 229 SDP_ATTR_MID,
michael@0 230 SDP_ATTR_SOURCE_FILTER,
michael@0 231 SDP_ATTR_RTCP_UNICAST,
michael@0 232 SDP_ATTR_MAXPRATE,
michael@0 233 SDP_ATTR_SQN,
michael@0 234 SDP_ATTR_CDSC,
michael@0 235 SDP_ATTR_CPAR,
michael@0 236 SDP_ATTR_SPRTMAP,
michael@0 237 SDP_ATTR_SDESCRIPTIONS, /* version 9 sdescriptions */
michael@0 238 SDP_ATTR_LABEL,
michael@0 239 SDP_ATTR_FRAMERATE,
michael@0 240 SDP_ATTR_ICE_CANDIDATE,
michael@0 241 SDP_ATTR_ICE_UFRAG,
michael@0 242 SDP_ATTR_ICE_PWD,
michael@0 243 SDP_ATTR_RTCP_MUX,
michael@0 244 SDP_ATTR_DTLS_FINGERPRINT,
michael@0 245 SDP_ATTR_MAXPTIME,
michael@0 246 SDP_ATTR_RTCP_FB, /* RFC 4585 */
michael@0 247 SDP_ATTR_SETUP,
michael@0 248 SDP_ATTR_CONNECTION,
michael@0 249 SDP_ATTR_EXTMAP, /* RFC 5285 */
michael@0 250 SDP_ATTR_IDENTITY,
michael@0 251 SDP_MAX_ATTR_TYPES,
michael@0 252 SDP_ATTR_INVALID
michael@0 253 } sdp_attr_e;
michael@0 254 /* This is here so that it can be used in the VcmSIPCCBinding interface */
michael@0 255 typedef enum {
michael@0 256 SDP_SETUP_NOT_FOUND = -1,
michael@0 257 SDP_SETUP_ACTIVE = 0,
michael@0 258 SDP_SETUP_PASSIVE,
michael@0 259 SDP_SETUP_ACTPASS,
michael@0 260 SDP_SETUP_HOLDCONN,
michael@0 261 SDP_MAX_SETUP,
michael@0 262 SDP_SETUP_UNKNOWN
michael@0 263 } sdp_setup_type_e;
michael@0 264
michael@0 265 /**
michael@0 266 * Gets the value of the fmtp attribute- parameter-sets parameter for H.264 codec
michael@0 267 *
michael@0 268 * @param[in] sdp_handle The SDP handle
michael@0 269 * @param[in] level The level to check for the attribute.
michael@0 270 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 271 * @param[in] inst_num The attribute instance number to check.
michael@0 272 *
michael@0 273 * @return parameter-sets value.
michael@0 274 */
michael@0 275
michael@0 276 const char* ccsdpAttrGetFmtpParamSets(void *sdp_handle, uint16_t level,
michael@0 277 uint8_t cap_num, uint16_t inst_num);
michael@0 278
michael@0 279 /**
michael@0 280 * Gets the value of the fmtp attribute- packetization-mode parameter for H.264 codec
michael@0 281 *
michael@0 282 * @param[in] sdp_handle The SDP handle
michael@0 283 * @param[in] level The level to check for the attribute.
michael@0 284 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 285 * @param[in] inst_num The attribute instance number to check.
michael@0 286 * @param[out] *val packetization-mode value in the range 0 - 2.
michael@0 287 *
michael@0 288 * @return sdp_result_e SDP_SUCCESS = SUCCESS
michael@0 289 */
michael@0 290 sdp_result_e ccsdpAttrGetFmtpPackMode(void *sdp_handle, uint16_t level,
michael@0 291 uint8_t cap_num, uint16_t inst_num, uint16_t *val);
michael@0 292 /**
michael@0 293 * Gets the value of the fmtp attribute- level asymmetry allowed parameter for H.264 codec
michael@0 294 *
michael@0 295 * @param[in] sdp_handle The SDP handle
michael@0 296 * @param[in] level The level to check for the attribute.
michael@0 297 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 298 * @param[in] inst_num The attribute instance number to check.
michael@0 299 * @param[out] *val level-asymmetry-allowed param value in the range 0 - 1.
michael@0 300 *
michael@0 301 * @return sdp_result_e SDP_SUCCESS = SUCCESS
michael@0 302 */
michael@0 303 sdp_result_e ccsdpAttrGetFmtpLevelAsymmetryAllowed(void *sdp_handle, uint16_t level,
michael@0 304 uint8_t cap_num, uint16_t inst_num, uint16_t *val);
michael@0 305
michael@0 306
michael@0 307 /**
michael@0 308 * Gets the value of the fmtp attribute- profile-level-id parameter for H.264 codec
michael@0 309 *
michael@0 310 * @param[in] sdp_handle The SDP handle returned by sdp_init_description.
michael@0 311 * @param[in] level The level to check for the attribute.
michael@0 312 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 313 * @param[in] inst_num The attribute instance number to check.
michael@0 314 *
michael@0 315 * @return char * profile-level-id value.
michael@0 316 */
michael@0 317 const char* ccsdpAttrGetFmtpProfileLevelId (void *sdp_handle, uint16_t level,
michael@0 318 uint8_t cap_num, uint16_t inst_num);
michael@0 319
michael@0 320 /**
michael@0 321 * Gets the value of the fmtp attribute- max-mbps parameter for H.264 codec
michael@0 322 *
michael@0 323 * @param[in] sdp_handle The SDP handle
michael@0 324 * @param[in] level The level to check for the attribute.
michael@0 325 * @param[in] cap_num The capability number associated with the
michael@0 326 * attribute if any. If none, should be zero.
michael@0 327 * @param[in] inst_num The attribute instance number to check.
michael@0 328 * @param[out] *val max-mbps value.
michael@0 329 *
michael@0 330 * @return sdp_result_e SDP_SUCCESS
michael@0 331 */
michael@0 332
michael@0 333 sdp_result_e ccsdpAttrGetFmtpMaxMbps (void *sdp_handle, uint16_t level,
michael@0 334 uint8_t cap_num, uint16_t inst_num, uint32_t *val);
michael@0 335
michael@0 336 /**
michael@0 337 * Gets the value of the fmtp attribute- max-fs parameter for H.264 codec
michael@0 338 *
michael@0 339 * @param[in] sdp_handle The SDP handle
michael@0 340 * @param[in] level The level to check for the attribute.
michael@0 341 * @param[in] cap_num The capability number associated with the
michael@0 342 * attribute if any. If none, should be zero.
michael@0 343 * @param[in] inst_num The attribute instance number to check.
michael@0 344 * @param[out] *val max-fs value.
michael@0 345 *
michael@0 346 * @return sdp_result_e SDP_SUCCESS
michael@0 347 */
michael@0 348 sdp_result_e ccsdpAttrGetFmtpMaxFs (void *sdp_handle, uint16_t level,
michael@0 349 uint8_t cap_num, uint16_t inst_num, uint32_t *val);
michael@0 350
michael@0 351 /**
michael@0 352 * Gets the value of the fmtp attribute- max-cpb parameter for H.264 codec
michael@0 353 * @param[in] sdp_handle The SDP handle
michael@0 354 * @param[in] level The level to check for the attribute.
michael@0 355 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 356 * @param[in] inst_num The attribute instance number to check.
michael@0 357 * @param [out] *val max-cpb value.
michael@0 358 *
michael@0 359 * @return sdp_result_e SDP_SUCCESS
michael@0 360 */
michael@0 361 sdp_result_e ccsdpAttrGetFmtpMaxCpb (void *sdp_handle, uint16_t level,
michael@0 362 uint8_t cap_num, uint16_t inst_num, uint32_t *val);
michael@0 363
michael@0 364 /**
michael@0 365 * Gets the value of the fmtp attribute- max-br parameter for H.264 codec
michael@0 366 *
michael@0 367 * @param[in] sdp_handle The SDP handle
michael@0 368 * @param[in] level The level to check for the attribute.
michael@0 369 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 370 * @param[in] inst_num The attribute instance number to check.
michael@0 371 * @param [out] *val max-br value.
michael@0 372 *
michael@0 373 * @return sdp_result_e SDP_SUCCESS
michael@0 374 */
michael@0 375 sdp_result_e ccsdpAttrGetFmtpMaxBr (void *sdp_handle, uint16_t level,
michael@0 376 uint8_t cap_num, uint16_t inst_num, uint32_t* val);
michael@0 377
michael@0 378 /**
michael@0 379 * Returns the bandwidth value parameter from the b= line.
michael@0 380 *
michael@0 381 * @param[in] sdp_handle The SDP handle
michael@0 382 * @param[in] level The level from which to get the bw value.
michael@0 383 * @param[in] inst_num instance number of bw line at the level. The first
michael@0 384 * instance has a inst_num of 1 and so on.
michael@0 385 *
michael@0 386 * @return A valid numerical bw value or SDP_INVALID_VALUE(-2).
michael@0 387 */
michael@0 388 int ccsdpGetBandwidthValue (void *sdp_handle, uint16_t level, uint16_t inst_num);
michael@0 389
michael@0 390 /**
michael@0 391 * Add a new attribute of the specified type at the given level and capability
michael@0 392 * level or base attribute if cap_num is zero.
michael@0 393 *
michael@0 394 * @param[in] sdp_handle The SDP handle
michael@0 395 * @param[in] level The level to check for the attribute.
michael@0 396 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 397 * @param[in] attr_type The type of attribute to add.
michael@0 398 * @param[in] inst_num Pointer to a uint16_t in which to return the instance number of the newly added attribute.
michael@0 399 *
michael@0 400 * @return sdp_result_e
michael@0 401 * SDP_SUCCESS Attribute was added successfully.
michael@0 402 * SDP_NO_RESOURCE No memory avail for new attribute.
michael@0 403 * SDP_INVALID_PARAMETER Specified media line is not defined.
michael@0 404 */
michael@0 405 sdp_result_e ccsdpAddNewAttr (void *sdp_handle, uint16_t level, uint8_t cap_num,
michael@0 406 sdp_attr_e attr_type, uint16_t *inst_num);
michael@0 407
michael@0 408 /**
michael@0 409 * Gets the value of the fmtp attribute- max-dpb parameter for H.264 codec
michael@0 410 *
michael@0 411 * @param[in] sdp_handle The SDP handle
michael@0 412 * @param[in] level The level to check for the attribute.
michael@0 413 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 414 * @param[in] inst_num The attribute instance number to check.
michael@0 415 * @param[out] *val max-dpb value.
michael@0 416 *
michael@0 417 * @return sdp_result_e
michael@0 418 * SDP_SUCCESS Attribute was added successfully.
michael@0 419 */
michael@0 420
michael@0 421 sdp_result_e ccsdpAttrGetFmtpMaxDpb (void *sdp_handle, uint16_t level,
michael@0 422 uint8_t cap_num, uint16_t inst_num, uint32_t *val);
michael@0 423
michael@0 424
michael@0 425 /**
michael@0 426 * Sets the value of the fmtp attribute payload type parameter for the given attribute.
michael@0 427 *
michael@0 428 * @param[in] sdp_handle The SDP handle
michael@0 429 * @param[in] level The level to check for the attribute.
michael@0 430 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 431 * @param[in] inst_num The attribute instance number to check.
michael@0 432 * @param[in] payload_num New payload type value.
michael@0 433 *
michael@0 434 * @return SDP_SUCCESS Attribute was added successfully.
michael@0 435 * SDP_INVALID_PARAMETER Specified attribute is not defined.
michael@0 436 */
michael@0 437 sdp_result_e ccsdpAttrSetFmtpPayloadType (void *sdp_handle, uint16_t level,
michael@0 438 uint8_t cap_num, uint16_t inst_num, uint16_t payload_num);
michael@0 439
michael@0 440 /**
michael@0 441 * Sets the value of the packetization mode attribute parameter for the given attribute.
michael@0 442 *
michael@0 443 * @param[in] sdp_handle The SDP handle returned by sdp_init_description.
michael@0 444 * @param[in] level The level to check for the attribute.
michael@0 445 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 446 * @param[in] inst_num The attribute instance number to check.
michael@0 447 * @param[in] pack_mode Packetization mode value
michael@0 448 *
michael@0 449 * @return SDP_SUCCESS Attribute was added successfully.
michael@0 450 * SDP_INVALID_PARAMETER Specified attribute is not defined.
michael@0 451 */
michael@0 452
michael@0 453 sdp_result_e ccsdpAttrSetFmtpPackMode (void *sdp_handle, uint16_t level,
michael@0 454 uint8_t cap_num, uint16_t inst_num, uint16_t pack_mode);
michael@0 455 /**
michael@0 456 * Sets the value of the level-asymmetry-allowed attribute parameter for the given attribute.
michael@0 457 *
michael@0 458 * @param[in] sdp_handle The SDP handle returned by sdp_init_description.
michael@0 459 * @param[in] level The level to check for the attribute.
michael@0 460 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 461 * @param[in] inst_num The attribute instance number to check.
michael@0 462 * @param[in] level_asymmetry_allowed level asymmetry allowed value (0 or 1).
michael@0 463 *
michael@0 464 * @return SDP_SUCCESS Attribute was added successfully.
michael@0 465 * SDP_INVALID_PARAMETER Specified attribute is not defined.
michael@0 466 */
michael@0 467
michael@0 468 sdp_result_e ccsdpAttrSetFmtpLevelAsymmetryAllowed (void *sdp_handle, uint16_t level,
michael@0 469 uint8_t cap_num, uint16_t inst_num, uint16_t level_asymmetry_allowed);
michael@0 470
michael@0 471 /**
michael@0 472 * Sets the value of the profile-level-id parameter for the given attribute.
michael@0 473 *
michael@0 474 * @param[in] sdp_handle The SDP handle returned by sdp_init_description.
michael@0 475 * @param[in] level The level to check for the attribute.
michael@0 476 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 477 * @param[in] inst_num The attribute instance number to check.
michael@0 478 * @param[in] profile_level_id profile_level_id to be set
michael@0 479 *
michael@0 480 * @return SDP_SUCCESS Attribute was added successfully.
michael@0 481 * SDP_INVALID_PARAMETER Specified attribute is not defined.
michael@0 482 */
michael@0 483
michael@0 484 sdp_result_e ccsdpAttrSetFmtpProfileLevelId (void *sdp_handle, uint16_t level,
michael@0 485 uint8_t cap_num, uint16_t inst_num, const char *profile_level_id);
michael@0 486
michael@0 487 /**
michael@0 488 * Sets the value of the profile-level-id parameter for the given attribute.
michael@0 489 *
michael@0 490 * @param[in] sdp_handle The SDP handle returned by sdp_init_description.
michael@0 491 * @param[in] level The level to check for the attribute.
michael@0 492 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 493 * @param[in] inst_num The attribute instance number to check.
michael@0 494 * @param[in] parameter_sets parameter_sets to be set
michael@0 495 *
michael@0 496 * @return SDP_SUCCESS Attribute was added successfully.
michael@0 497 * SDP_INVALID_PARAMETER Specified attribute is not defined.
michael@0 498 */
michael@0 499
michael@0 500 sdp_result_e ccsdpAttrSetFmtpParameterSets (void *sdp_handle, uint16_t level,
michael@0 501 uint8_t cap_num, uint16_t inst_num, const char *parameter_sets);
michael@0 502
michael@0 503 /**
michael@0 504 * Sets the value of the max-br parameter for the given attribute.
michael@0 505 *
michael@0 506 * @param[in] sdp_handle The SDP handle returned by sdp_init_description.
michael@0 507 * @param[in] level The level to check for the attribute.
michael@0 508 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 509 * @param[in] inst_num The attribute instance number to check.
michael@0 510 * @param[in] max_br max_br value to be set
michael@0 511 *
michael@0 512 * @return SDP_SUCCESS Attribute was added successfully.
michael@0 513 * SDP_INVALID_PARAMETER Specified attribute is not defined.
michael@0 514 */
michael@0 515
michael@0 516
michael@0 517 sdp_result_e ccsdpAttrSetFmtpMaxBr (void *sdp_handle, uint16_t level,
michael@0 518 uint8_t cap_num, uint16_t inst_num, uint32_t max_br);
michael@0 519
michael@0 520 /**
michael@0 521 * Sets the value of the fmtp attribute- max-mbps parameter for H.264 codec
michael@0 522 *
michael@0 523 * @param[in] sdp_handle The SDP handle returned by sdp_init_description.
michael@0 524 * @param[in] level The level to check for the attribute.
michael@0 525 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 526 * @param[in] inst_num The attribute instance number to check.
michael@0 527 * @param[in] max_mbps value of max_mbps to be set
michael@0 528 *
michael@0 529 * @return SDP_SUCCESS Attribute was added successfully.
michael@0 530 * SDP_INVALID_PARAMETER Specified attribute is not defined.
michael@0 531 */
michael@0 532
michael@0 533 sdp_result_e ccsdpAttrSetFmtpMaxMbps (void *sdp_handle, uint16_t level,
michael@0 534 uint8_t cap_num, uint16_t inst_num, uint32_t max_mbps);
michael@0 535
michael@0 536 /**
michael@0 537 * Sets the value of the fmtp attribute- max-fs parameter for H.264 codec
michael@0 538 * @param[in] sdp_handle The SDP handle returned by sdp_init_description.
michael@0 539 * @param[in] level The level to check for the attribute.
michael@0 540 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 541 * @param[in] inst_num The attribute instance number to check.
michael@0 542 * @param[in] max_fs max_fs value to be set
michael@0 543 *
michael@0 544 * @return SDP_SUCCESS Attribute was added successfully.
michael@0 545 * SDP_INVALID_PARAMETER Specified attribute is not defined.
michael@0 546 */
michael@0 547 sdp_result_e ccsdpAttrSetFmtpMaxFs (void *sdp_handle, uint16_t level,
michael@0 548 uint8_t cap_num, uint16_t inst_num, uint32_t max_fs);
michael@0 549 /**
michael@0 550 * Sets the value of the fmtp attribute- max-cbp parameter for H.264 codec
michael@0 551 * @param[in] sdp_handle The SDP handle returned by sdp_init_description.
michael@0 552 * @param[in] level The level to check for the attribute.
michael@0 553 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 554 * @param[in] inst_num The attribute instance number to check.
michael@0 555 * @param[in] max_cpb max_cbp value to be set
michael@0 556 *
michael@0 557 * @return SDP_SUCCESS Attribute was added successfully.
michael@0 558 * SDP_INVALID_PARAMETER Specified attribute is not defined.
michael@0 559 */
michael@0 560
michael@0 561 sdp_result_e ccsdpAttrSetFmtpMaxCpb (void *sdp_handle, uint16_t level,
michael@0 562 uint8_t cap_num, uint16_t inst_num, uint32_t max_cpb);
michael@0 563 /**
michael@0 564 * Sets the value of the fmtp attribute- max-dbp parameter for H.264 codec
michael@0 565 * @param[in] sdp_handle The SDP handle returned by sdp_init_description.
michael@0 566 * @param[in] level The level to check for the attribute.
michael@0 567 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 568 * @param[in] inst_num The attribute instance number to check.
michael@0 569 * @param[in] max_dpb max_dbp value to be set
michael@0 570 *
michael@0 571 * @return SDP_SUCCESS Attribute was added successfully.
michael@0 572 * SDP_INVALID_PARAMETER Specified attribute is not defined.
michael@0 573 */
michael@0 574
michael@0 575 sdp_result_e ccsdpAttrSetFmtpMaxDbp (void *sdp_handle, uint16_t level,
michael@0 576 uint8_t cap_num, uint16_t inst_num, uint32_t max_dpb);
michael@0 577
michael@0 578
michael@0 579 /**
michael@0 580 * Sets the value of the fmtp attribute qcif parameter for the given attribute.
michael@0 581 * @param[in] sdp_handle The SDP handle returned by sdp_init_description.
michael@0 582 * @param[in] level The level to check for the attribute.
michael@0 583 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 584 * @param[in] inst_num The attribute instance number to check.
michael@0 585 * @param[in] qcif Sets the QCIF value for a video codec
michael@0 586 *
michael@0 587 * @return SDP_SUCCESS Attribute param was set successfully.
michael@0 588 * SDP_INVALID_PARAMETER Specified attribute is not defined.
michael@0 589 */
michael@0 590 sdp_result_e ccsdpAttrSetFmtpQcif (void *sdp_handle, uint16_t level,
michael@0 591 uint8_t cap_num, uint16_t inst_num, uint16_t qcif);
michael@0 592
michael@0 593 /**
michael@0 594 * Sets the value of the fmtp attribute sqcif parameter for the given attribute.
michael@0 595 *
michael@0 596 * @param[in] sdp_handle The SDP handle returned by sdp_init_description.
michael@0 597 * @param[in] level The level to check for the attribute.
michael@0 598 * @param[in] cap_num The capability number associated with the attribute if any. If none, should be zero.
michael@0 599 * @param[in] inst_num The attribute instance number to check.
michael@0 600 * @param[in] sqcif Sets the SQCIF value for a video codec
michael@0 601 *
michael@0 602 * @return SDP_SUCCESS Attribute param was set successfully.
michael@0 603 * SDP_INVALID_PARAMETER Specified attribute is not defined.
michael@0 604 */
michael@0 605 sdp_result_e ccsdpAttrSetFmtpSqcif (void *sdp_handle, uint16_t level,
michael@0 606 uint8_t cap_num, uint16_t inst_num, uint16_t sqcif);
michael@0 607
michael@0 608 /**
michael@0 609 *
michael@0 610 * To specify bandwidth parameters at any level, a bw line must first be
michael@0 611 * added at that level using this function. This function returns the instance
michael@0 612 * number of an existing bw_line that matches bw_modifier type, or of a newly
michael@0 613 * created bw_line of type bw_modifier. After this addition, you can set the
michael@0 614 * properties of the added bw line by using sdp_set_bw().
michael@0 615 *
michael@0 616 * Note carefully though, that since there can be multiple instances of bw
michael@0 617 * lines at any level, you must specify the instance number when setting
michael@0 618 * or getting the properties of a bw line at any level.
michael@0 619 *
michael@0 620 * This function returns the inst_num variable, the instance number
michael@0 621 * of the created bw_line at that level. The instance number is 1 based.
michael@0 622 * <pre>
michael@0 623 * For example:
michael@0 624 * v=0 :Session Level
michael@0 625 * o=mhandley 2890844526 2890842807 IN IP4 126.16.64.4
michael@0 626 * s=SDP Seminar
michael@0 627 * c=IN IP4 10.1.0.2
michael@0 628 * t=0 0
michael@0 629 * b=AS:60 : instance number 1
michael@0 630 * b=TIAS:50780 : instance number 2
michael@0 631 * m=audio 1234 RTP/AVP 0 101 102 : 1st Media level
michael@0 632 * b=AS:12 : instance number 1
michael@0 633 * b=TIAS:8480 : instance number 2
michael@0 634 * m=audio 1234 RTP/AVP 0 101 102 : 2nd Media level
michael@0 635 * b=AS:20 : instance number 1
michael@0 636 * </pre>
michael@0 637 * @param[in] sdp_handle The SDP handle returned by sdp_init_description.
michael@0 638 * @param[in] level The level to create the bw line.
michael@0 639 * @param[in] bw_modifier The Type of bandwidth, CT, AS or TIAS.
michael@0 640 * @param[out] inst_num This memory is set with the instance number of the newly created bw line instance.
michael@0 641 *
michael@0 642 * @return SDP_SUCCESS Attribute param was set successfully.
michael@0 643 * SDP_INVALID_PARAMETER Specified attribute is not defined.
michael@0 644 */
michael@0 645 sdp_result_e ccsdpAddNewBandwidthLine (void *sdp_handle, uint16_t level, sdp_bw_modifier_e bw_modifier, uint16_t *inst_num);
michael@0 646
michael@0 647
michael@0 648 /**
michael@0 649 * Once a bandwidth line is added under a level, this function can be used to
michael@0 650 * set the properties of that bandwidth line.
michael@0 651 *
michael@0 652 * @param[in] sdp_handle The SDP handle returned by sdp_init_description.
michael@0 653 * @param[in] level The level to at which the bw line resides.
michael@0 654 * @param[in] inst_num The instance number of the bw line that is to be set.
michael@0 655 * @param[in] bw_modifier The Type of bandwidth, CT, AS or TIAS.
michael@0 656 * @param[in] bw_val Numerical bandwidth value.
michael@0 657 *
michael@0 658 * @note Before calling this function to set the bw line, the bw line must
michael@0 659 * be added using sdp_add_new_bw_line at the required level.
michael@0 660 *
michael@0 661 * @return SDP_SUCCESS Attribute param was set successfully.
michael@0 662 * SDP_INVALID_PARAMETER Specified attribute is not defined.
michael@0 663 */
michael@0 664 sdp_result_e ccsdpSetBandwidth (void *sdp_handle, uint16_t level, uint16_t inst_num,
michael@0 665 sdp_bw_modifier_e bw_modifier, uint32_t bw_val);
michael@0 666
michael@0 667 /**
michael@0 668 * Returns a string representation of a codec's name.
michael@0 669 *
michael@0 670 * @param[in] rtp_ptype The value taken from the rtp_ptype enumeration
michael@0 671 *
michael@0 672 * @return A string representing the name of the codec
michael@0 673 */
michael@0 674 const char * ccsdpCodecName(rtp_ptype ptype);
michael@0 675
michael@0 676 #endif

mercurial