From 08f53cf939a40c1100338224704a6e6526d38c59 Mon Sep 17 00:00:00 2001 From: "Byron Campen [:bwc]" Date: Tue, 17 Mar 2015 16:28:06 -0700 Subject: [PATCH] Bug 1144962 - Part 1: Delete most setters in sipcc. r=mt --- media/webrtc/signaling/src/sdp/sipcc/sdp.h | 406 -- .../signaling/src/sdp/sipcc/sdp_access.c | 318 -- .../signaling/src/sdp/sipcc/sdp_attr_access.c | 3744 ----------------- 3 files changed, 4468 deletions(-) diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp.h b/media/webrtc/signaling/src/sdp/sipcc/sdp.h index 98af54f9b95..6a0ff1ac5bb 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp.h +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp.h @@ -1190,10 +1190,6 @@ sdp_result_e sdp_set_time_stop(sdp_t *sdp_p, const char *stop_time); extern tinybool sdp_encryption_valid(sdp_t *sdp_p, uint16_t level); extern sdp_encrypt_type_e sdp_get_encryption_method(sdp_t *sdp_p, uint16_t level); extern const char *sdp_get_encryption_key(sdp_t *sdp_p, uint16_t level); -extern sdp_result_e sdp_set_encryption_method(sdp_t *sdp_p, uint16_t level, - sdp_encrypt_type_e method); -extern sdp_result_e sdp_set_encryption_key(sdp_t *sdp_p, uint16_t level, - const char *key); extern tinybool sdp_connection_valid(sdp_t *sdp_p, uint16_t level); extern tinybool sdp_bw_line_exists(sdp_t *sdp_p, uint16_t level, uint16_t inst_num); @@ -1212,8 +1208,6 @@ extern sdp_result_e sdp_set_conn_addrtype(sdp_t *sdp_p, uint16_t level, sdp_addrtype_e addrtype); extern sdp_result_e sdp_set_conn_address(sdp_t *sdp_p, uint16_t level, const char *address); -extern sdp_result_e sdp_set_mcast_addr_fields(sdp_t *sdp_p, uint16_t level, - uint16_t ttl, uint16_t num_addr); extern tinybool sdp_media_line_valid(sdp_t *sdp_p, uint16_t level); extern uint16_t sdp_get_num_media_lines(sdp_t *sdp_ptr); @@ -1244,17 +1238,9 @@ extern sdp_result_e sdp_insert_media_line(sdp_t *sdp_p, uint16_t level); extern void sdp_delete_media_line(sdp_t *sdp_p, uint16_t level); extern sdp_result_e sdp_set_media_type(sdp_t *sdp_p, uint16_t level, sdp_media_e media); -extern sdp_result_e sdp_set_media_port_format(sdp_t *sdp_p, uint16_t level, - sdp_port_format_e port_format); extern sdp_result_e sdp_set_media_portnum(sdp_t *sdp_p, uint16_t level, int32_t portnum, int32_t sctpport); extern int32_t sdp_get_media_sctp_port(sdp_t *sdp_p, uint16_t level); -extern sdp_result_e sdp_set_media_portcount(sdp_t *sdp_p, uint16_t level, - int32_t num_ports); -extern sdp_result_e sdp_set_media_vpi(sdp_t *sdp_p, uint16_t level, int32_t vpi); -extern sdp_result_e sdp_set_media_vci(sdp_t *sdp_p, uint16_t level, uint32_t vci); -extern sdp_result_e sdp_set_media_vcci(sdp_t *sdp_p, uint16_t level, int32_t vcci); -extern sdp_result_e sdp_set_media_cid(sdp_t *sdp_p, uint16_t level, int32_t cid); extern sdp_result_e sdp_set_media_transport(sdp_t *sdp_p, uint16_t level, sdp_transport_e transport); extern sdp_result_e sdp_add_media_profile(sdp_t *sdp_p, uint16_t level, @@ -1280,35 +1266,18 @@ extern uint32_t sdp_attr_line_number(sdp_t *sdp_p, sdp_attr_e attr_type, uint16_t level, uint8_t cap_num, uint16_t inst_num); extern const char *sdp_attr_get_simple_string(sdp_t *sdp_p, sdp_attr_e attr_type, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_simple_string(sdp_t *sdp_p, - sdp_attr_e attr_type, uint16_t level, - uint8_t cap_num, uint16_t inst_num, const char *string_parm); extern uint32_t sdp_attr_get_simple_u32(sdp_t *sdp_p, sdp_attr_e attr_type, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_simple_u32(sdp_t *sdp_p, - sdp_attr_e attr_type, uint16_t level, - uint8_t cap_num, uint16_t inst_num, uint32_t num_parm); extern tinybool sdp_attr_get_simple_boolean(sdp_t *sdp_p, sdp_attr_e attr_type, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_simple_boolean(sdp_t *sdp_p, - sdp_attr_e attr_type, uint16_t level, uint8_t cap_num, - uint16_t inst_num, uint32_t bool_parm); extern tinybool sdp_attr_is_present (sdp_t *sdp_p, sdp_attr_e attr_type, uint16_t level, uint8_t cap_num); extern const char* sdp_attr_get_maxprate(sdp_t *sdp_p, uint16_t level, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_maxprate(sdp_t *sdp_p, uint16_t level, - uint16_t inst_num, const char *string_parm); extern sdp_t38_ratemgmt_e sdp_attr_get_t38ratemgmt(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_t38ratemgmt(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_t38_ratemgmt_e t38ratemgmt); extern sdp_t38_udpec_e sdp_attr_get_t38udpec(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_t38udpec(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_t38_udpec_e t38udpec); extern sdp_direction_e sdp_get_media_direction(sdp_t *sdp_p, uint16_t level, uint8_t cap_num); extern sdp_qos_strength_e sdp_attr_get_qos_strength(sdp_t *sdp_p, uint16_t level, @@ -1325,27 +1294,6 @@ extern sdp_des_type_e sdp_attr_get_des_type (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, sdp_attr_e qos_attr, uint16_t inst_num); extern sdp_conf_type_e sdp_attr_get_conf_type (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, sdp_attr_e qos_attr, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_conf_type (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e qos_attr, uint16_t inst_num, - sdp_conf_type_e conf_type); -extern sdp_result_e sdp_attr_set_des_type (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e qos_attr, uint16_t inst_num, - sdp_des_type_e des_type); -extern sdp_result_e sdp_attr_set_curr_type (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e qos_attr, uint16_t inst_num, - sdp_curr_type_e curr_type); -extern sdp_result_e sdp_attr_set_qos_strength(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e qos_attr, uint16_t inst_num, - sdp_qos_strength_e strength); -extern sdp_result_e sdp_attr_set_qos_direction(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e qos_attr, uint16_t inst_num, - sdp_qos_dir_e direction); -extern sdp_result_e sdp_attr_set_qos_status_type(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e qos_attr, uint16_t inst_num, - sdp_qos_status_types_e status_type); -extern sdp_result_e sdp_attr_set_qos_confirm(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e qos_attr, uint16_t inst_num, - tinybool confirm); extern sdp_nettype_e sdp_attr_get_subnet_nettype(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); extern sdp_addrtype_e sdp_attr_get_subnet_addrtype(sdp_t *sdp_p, uint16_t level, @@ -1354,18 +1302,6 @@ extern const char *sdp_attr_get_subnet_addr(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); extern int32_t sdp_attr_get_subnet_prefix(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_subnet_nettype(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_nettype_e nettype); -extern sdp_result_e sdp_attr_set_subnet_addrtype(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_addrtype_e addrtype); -extern sdp_result_e sdp_attr_set_subnet_addr(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - const char *addr); -extern sdp_result_e sdp_attr_set_subnet_prefix(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - int32_t prefix); extern rtp_ptype sdp_attr_get_rtpmap_known_codec(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); extern tinybool sdp_attr_rtpmap_payload_valid(sdp_t *sdp_p, uint16_t level, @@ -1378,16 +1314,6 @@ extern uint32_t sdp_attr_get_rtpmap_clockrate(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); extern uint16_t sdp_attr_get_rtpmap_num_chan(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_rtpmap_payload_type(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t payload_num); -extern sdp_result_e sdp_attr_set_rtpmap_encname(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, const char *encname); -extern sdp_result_e sdp_attr_set_rtpmap_clockrate(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t clockrate); -extern sdp_result_e sdp_attr_set_rtpmap_num_chan(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, uint16_t num_chan); extern tinybool sdp_attr_sprtmap_payload_valid(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t *inst_num, uint16_t payload_type); extern uint16_t sdp_attr_get_sprtmap_payload_type(sdp_t *sdp_p, uint16_t level, @@ -1398,16 +1324,6 @@ extern uint32_t sdp_attr_get_sprtmap_clockrate(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); extern uint16_t sdp_attr_get_sprtmap_num_chan(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_sprtmap_payload_type(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t payload_num); -extern sdp_result_e sdp_attr_set_sprtmap_encname(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, const char *encname); -extern sdp_result_e sdp_attr_set_sprtmap_clockrate(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t clockrate); -extern sdp_result_e sdp_attr_set_sprtmap_num_chan(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, uint16_t num_chan); extern tinybool sdp_attr_fmtp_payload_valid(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t *inst_num, uint16_t payload_type); extern uint16_t sdp_attr_get_fmtp_payload_type(sdp_t *sdp_p, uint16_t level, @@ -1421,10 +1337,6 @@ extern sdp_result_e sdp_attr_set_fmtp_payload_type(sdp_t *sdp_p, uint16_t level, uint16_t payload_num); extern sdp_result_e sdp_attr_get_fmtp_range(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num, uint32_t *bmap); -extern sdp_result_e sdp_attr_set_fmtp_range(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, uint8_t low_val, uint8_t high_val); -extern sdp_result_e sdp_attr_set_fmtp_bitmap(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, uint32_t *bmap, uint32_t maxval); extern sdp_result_e sdp_attr_clear_fmtp_range(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num, uint8_t low_val, uint8_t high_val); extern sdp_ne_res_e sdp_attr_compare_fmtp_ranges(sdp_t *src_sdp_ptr, @@ -1435,132 +1347,9 @@ extern sdp_result_e sdp_attr_copy_fmtp_ranges(sdp_t *src_sdp_ptr, sdp_t *dst_sdp_ptr, uint16_t src_level, uint16_t dst_level, uint8_t src_cap_num, uint8_t dst_cap_num, uint16_t src_inst_num, uint16_t dst_inst_num); -extern sdp_result_e sdp_attr_set_fmtp_annexa (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool annexa); -extern sdp_result_e sdp_attr_set_fmtp_mode(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t mode); extern uint32_t sdp_attr_get_fmtp_mode_for_payload_type (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint32_t payload_type); -extern sdp_result_e sdp_attr_set_fmtp_annexb (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool annexb); - -extern sdp_result_e sdp_attr_set_fmtp_bitrate_type (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t bitrate); -extern sdp_result_e sdp_attr_set_fmtp_cif (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t cif); -extern sdp_result_e sdp_attr_set_fmtp_qcif (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t qcif); -extern sdp_result_e sdp_attr_set_fmtp_sqcif (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t sqcif); -extern sdp_result_e sdp_attr_set_fmtp_cif4 (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t cif4); -extern sdp_result_e sdp_attr_set_fmtp_cif16 (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t cif16); -extern sdp_result_e sdp_attr_set_fmtp_maxbr (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t maxbr); -extern sdp_result_e sdp_attr_set_fmtp_max_average_bitrate (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t maxaveragebitrate); -extern sdp_result_e sdp_attr_set_fmtp_usedtx (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool usedtx); -extern sdp_result_e sdp_attr_set_fmtp_stereo (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool stereo); -extern sdp_result_e sdp_attr_set_fmtp_useinbandfec (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool useinbandfec); -extern sdp_result_e sdp_attr_set_fmtp_maxcodedaudiobandwidth (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - const char *maxcodedaudiobandwidth); -extern sdp_result_e sdp_attr_set_fmtp_cbr (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool cbr); -extern sdp_result_e sdp_attr_set_fmtp_custom (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t custom_x, uint16_t custom_y, - uint16_t custom_mpi); -extern sdp_result_e sdp_attr_set_fmtp_par (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t par_width, uint16_t par_height); -extern sdp_result_e sdp_attr_set_fmtp_bpp (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t bpp); -extern sdp_result_e sdp_attr_set_fmtp_hrd (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t hrd); - -extern sdp_result_e sdp_attr_set_fmtp_h263_num_params (sdp_t *sdp_p, - int16_t level, - uint8_t cap_num, - uint16_t inst_num, - int16_t profile, - uint16_t h263_level, - tinybool interlace); - -extern sdp_result_e sdp_attr_set_fmtp_profile_level_id (sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - const char *prof_id); - -extern sdp_result_e sdp_attr_set_fmtp_parameter_sets (sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - const char *parameter_sets); - -extern sdp_result_e sdp_attr_set_fmtp_deint_buf_req (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t deint_buf_req); - -extern sdp_result_e sdp_attr_set_fmtp_init_buf_time (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t init_buf_time); - -extern sdp_result_e sdp_attr_set_fmtp_max_don_diff (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t max_don_diff); - -extern sdp_result_e sdp_attr_set_fmtp_interleaving_depth (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t interleaving_depth); - -extern sdp_result_e sdp_attr_set_fmtp_pack_mode (sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - uint16_t pack_mode); - -extern sdp_result_e sdp_attr_set_fmtp_level_asymmetry_allowed (sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - uint16_t level_asymmetry_allowed); - -extern sdp_result_e sdp_attr_set_fmtp_redundant_pic_cap (sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - tinybool redundant_pic_cap); - -extern sdp_result_e sdp_attr_set_fmtp_max_mbps (sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - uint32_t max_mbps); - extern sdp_result_e sdp_attr_set_fmtp_max_fs (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, @@ -1573,58 +1362,6 @@ extern sdp_result_e sdp_attr_set_fmtp_max_fr (sdp_t *sdp_p, uint16_t inst_num, uint32_t max_fr); -extern sdp_result_e sdp_attr_set_fmtp_max_cpb (sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - uint32_t max_cpb); - -extern sdp_result_e sdp_attr_set_fmtp_max_dpb (sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - uint32_t max_dpb); - -extern sdp_result_e sdp_attr_set_fmtp_max_br (sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - uint32_t max_br); - -extern sdp_result_e sdp_attr_set_fmtp_max_rcmd_nalu_size (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t max_rcmd_nalu_size); - -extern sdp_result_e sdp_attr_set_fmtp_deint_buf_cap (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t deint_buf_cap); - -extern sdp_result_e sdp_attr_set_fmtp_h264_parameter_add (sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - uint16_t parameter_add); - -extern sdp_result_e sdp_attr_set_fmtp_h261_annex_params (sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - tinybool annex_d); - -extern sdp_result_e sdp_attr_set_fmtp_h263_annex_params (sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - tinybool annex_f, - tinybool annex_i, - tinybool annex_j, - tinybool annex_t, - uint16_t annex_k_val, - uint16_t annex_n_val, - uint16_t annex_p_val_picture_resize, - uint16_t annex_p_val_warp); - - /* get routines */ extern int32_t sdp_attr_get_fmtp_bitrate_type (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); @@ -1696,16 +1433,8 @@ extern int32_t sdp_attr_get_fmtp_annex_p_warp (sdp_t *sdp_p, uint16_t level, /* sctpmap params */ extern uint16_t sdp_attr_get_sctpmap_port(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_sctpmap_port(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t port); extern sdp_result_e sdp_attr_get_sctpmap_protocol (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num, char* protocol); -extern sdp_result_e sdp_attr_set_sctpmap_protocol (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - const char *protocol); -extern sdp_result_e sdp_attr_set_sctpmap_streams (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, uint32_t streams); extern sdp_result_e sdp_attr_get_sctpmap_streams (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num, uint32_t* val); @@ -1797,10 +1526,6 @@ extern uint16_t sdp_attr_get_xcap_num_payload_types(sdp_t *sdp_p, uint16_t level extern uint16_t sdp_attr_get_xcap_payload_type(sdp_t *sdp_p, uint16_t level, uint16_t inst_num, uint16_t payload_num, sdp_payload_ind_e *indicator); -extern sdp_result_e sdp_attr_set_xcap_media_type(sdp_t *sdp_p, uint16_t level, - uint16_t inst_num, sdp_media_e media); -extern sdp_result_e sdp_attr_set_xcap_transport_type(sdp_t *sdp_p, uint16_t level, - uint16_t inst_num, sdp_transport_e transport); extern sdp_result_e sdp_attr_add_xcap_payload_type(sdp_t *sdp_p, uint16_t level, uint16_t inst_num, uint16_t payload_type, sdp_payload_ind_e indicator); @@ -1815,18 +1540,12 @@ extern uint16_t sdp_attr_get_cdsc_num_payload_types(sdp_t *sdp_p, uint16_t level extern uint16_t sdp_attr_get_cdsc_payload_type(sdp_t *sdp_p, uint16_t level, uint16_t inst_num, uint16_t payload_num, sdp_payload_ind_e *indicator); -extern sdp_result_e sdp_attr_set_cdsc_media_type(sdp_t *sdp_p, uint16_t level, - uint16_t inst_num, sdp_media_e media); -extern sdp_result_e sdp_attr_set_cdsc_transport_type(sdp_t *sdp_p, uint16_t level, - uint16_t inst_num, sdp_transport_e transport); extern sdp_result_e sdp_attr_add_cdsc_payload_type(sdp_t *sdp_p, uint16_t level, uint16_t inst_num, uint16_t payload_type, sdp_payload_ind_e indicator); extern tinybool sdp_media_dynamic_payload_valid (sdp_t *sdp_p, uint16_t payload_type, uint16_t m_line); -extern sdp_result_e sdp_attr_set_rtr_confirm (sdp_t *, uint16_t , \ - uint8_t ,uint16_t ,tinybool ); extern tinybool sdp_attr_get_rtr_confirm (sdp_t *, uint16_t, uint8_t, uint16_t); extern tinybool sdp_attr_get_silencesupp_enabled(sdp_t *sdp_p, uint16_t level, @@ -1845,32 +1564,9 @@ extern sdp_silencesupp_siduse_e sdp_attr_get_silencesupp_siduse(sdp_t *sdp_p, extern uint8_t sdp_attr_get_silencesupp_fxnslevel(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num, tinybool *null_ind); -extern sdp_result_e sdp_attr_set_silencesupp_enabled(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool enable); -extern sdp_result_e sdp_attr_set_silencesupp_timer(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t value, - tinybool null_ind); -extern sdp_result_e sdp_attr_set_silencesupp_pref(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_silencesupp_pref_e pref); -extern sdp_result_e sdp_attr_set_silencesupp_siduse(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_silencesupp_siduse_e siduse); -extern sdp_result_e sdp_attr_set_silencesupp_fxnslevel(sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - uint16_t value, - tinybool null_ind); - extern sdp_mediadir_role_e sdp_attr_get_comediadir_role(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_comediadir_role(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_mediadir_role_e role); extern sdp_result_e sdp_delete_all_media_direction_attrs (sdp_t *sdp_p, uint16_t level); @@ -1894,61 +1590,27 @@ extern int32_t sdp_get_num_bw_lines (sdp_t *sdp_p, uint16_t level); extern sdp_result_e sdp_add_new_bw_line(sdp_t *sdp_p, uint16_t level, sdp_bw_modifier_e bw_modifier, uint16_t *inst_num); -extern sdp_result_e sdp_set_bw(sdp_t *sdp_p, uint16_t level, uint16_t inst_num, - sdp_bw_modifier_e value, uint32_t bw_val); extern sdp_group_attr_e sdp_get_group_attr(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_set_group_attr(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_group_attr_e value); extern const char* sdp_attr_get_x_sidout (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_x_sidout (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - const char *sidout); extern const char* sdp_attr_get_x_sidin (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_x_sidin (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - const char *sidin); - extern const char* sdp_attr_get_x_confid (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_attr_set_x_confid (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - const char *confid); - -extern sdp_result_e sdp_attr_set_ice_candidate(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, const char *ice_candidate); - extern uint16_t sdp_get_group_num_id(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e sdp_set_group_num_id(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t group_num_id); extern const char* sdp_get_group_id(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num, uint16_t id_num); -extern sdp_result_e sdp_set_group_id (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, char* group_id); - extern int32_t sdp_get_mid_value(sdp_t *sdp_p, uint16_t level); -extern sdp_result_e sdp_set_mid_value(sdp_t *sdp_p, uint16_t level, uint32_t mid_val); - -extern sdp_result_e sdp_set_source_filter(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_src_filter_mode_e mode, - sdp_nettype_e nettype, - sdp_addrtype_e addrtype, - const char *dest_addr, - const char *src_addr); extern sdp_result_e sdp_include_new_filter_src_addr(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num, const char *src_addr); @@ -1968,9 +1630,6 @@ extern sdp_result_e sdp_get_filter_source_address (sdp_t *sdp_p, uint16_t level, uint16_t src_addr_id, char *src_addr); -extern sdp_result_e sdp_set_rtcp_unicast_mode(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_rtcp_unicast_mode_e mode); extern sdp_rtcp_unicast_mode_e sdp_get_rtcp_unicast_mode(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num); @@ -2040,94 +1699,29 @@ sdp_attr_get_srtp_crypto_selection_flags(sdp_t *sdp_p, uint8_t cap_num, uint16_t inst_num); -extern sdp_result_e -sdp_attr_set_sdescriptions_tag(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - int32_t tag_num); - -extern sdp_result_e -sdp_attr_set_sdescriptions_crypto_suite(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_srtp_crypto_suite_t crypto_suite); - -extern sdp_result_e -sdp_attr_set_sdescriptions_key(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - char *key); - -extern sdp_result_e -sdp_attr_set_sdescriptions_salt(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - char *salt); - -extern sdp_result_e -sdp_attr_set_sdescriptions_lifetime(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - char *lifetime); - -extern sdp_result_e -sdp_attr_set_sdescriptions_mki(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - char *mki_value, - uint16_t mki_length); - -extern sdp_result_e -sdp_attr_set_sdescriptions_key_size(sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - unsigned char key_size); - -extern sdp_result_e -sdp_attr_set_sdescriptions_salt_size(sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - unsigned char salt_size); - sdp_result_e sdp_attr_get_ice_attribute (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, sdp_attr_e sdp_attr, uint16_t inst_num, char **out); -sdp_result_e -sdp_attr_set_ice_attribute(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e sdp_attr, uint16_t inst_num, const char *ice_attrib); sdp_result_e sdp_attr_get_rtcp_mux_attribute (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, sdp_attr_e sdp_attr, uint16_t inst_num, tinybool *rtcp_mux); -sdp_result_e -sdp_attr_set_rtcp_mux_attribute(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e sdp_attr, uint16_t inst_num, const tinybool rtcp_mux); - - sdp_result_e sdp_attr_get_setup_attribute (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num, sdp_setup_type_e *setup_type); -sdp_result_e -sdp_attr_set_setup_attribute(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, sdp_setup_type_e setup_type); - sdp_result_e sdp_attr_get_connection_attribute (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num, sdp_connection_type_e *connection_type); -sdp_result_e -sdp_attr_set_connection_attribute(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, sdp_connection_type_e connection_type); - sdp_result_e sdp_attr_get_dtls_fingerprint_attribute (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, sdp_attr_e sdp_attr, uint16_t inst_num, char **out); -sdp_result_e -sdp_attr_set_dtls_fingerprint_attribute(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e sdp_attr, uint16_t inst_num, const char *dtls_fingerprint); - sdp_rtcp_fb_ack_type_e sdp_attr_get_rtcp_fb_ack(sdp_t *sdp_p, uint16_t level, uint16_t payload_type, uint16_t inst); diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_access.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_access.c index d8be91292d2..85a2c3943e8 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_access.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_access.c @@ -508,69 +508,6 @@ const char *sdp_get_encryption_key (sdp_t *sdp_p, uint16_t level) return (encrypt_p->encrypt_key); } -/* Function: sdp_set_encryption_method - * Description: Sets the value of the encryption method param for the k= - * encryption token line. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the k= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a - * media line level. - * type The encryption type. - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER - */ -sdp_result_e sdp_set_encryption_method (sdp_t *sdp_p, uint16_t level, - sdp_encrypt_type_e type) -{ - sdp_encryptspec_t *encrypt_p; - sdp_mca_t *mca_p; - - if (level == SDP_SESSION_LEVEL) { - encrypt_p = &(sdp_p->encrypt); - } else { - mca_p = sdp_find_media_level(sdp_p, level); - if (mca_p == NULL) { - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - encrypt_p = &(mca_p->encrypt); - } - - encrypt_p->encrypt_type = type; - return (SDP_SUCCESS); -} - -/* Function: sdp_set_encryption_key - * Description: Sets the value of the encryption key parameter for the k= - * encryption token line. The string is copied into the - * SDP structure so application memory will not be - * referenced by the SDP lib. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the k= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a - * media line level. - * key Ptr to the encryption key string. - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER - */ -sdp_result_e sdp_set_encryption_key (sdp_t *sdp_p, uint16_t level, const char *key) -{ - sdp_encryptspec_t *encrypt_p; - sdp_mca_t *mca_p; - - if (level == SDP_SESSION_LEVEL) { - encrypt_p = &(sdp_p->encrypt); - } else { - mca_p = sdp_find_media_level(sdp_p, level); - if (mca_p == NULL) { - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - encrypt_p = &(mca_p->encrypt); - } - - sstrncpy(encrypt_p->encrypt_key, key, sizeof(encrypt_p->encrypt_key)); - return (SDP_SUCCESS); -} - /* Function: sdp_connection_valid * Description: Returns true or false depending on whether the connection c= * token line has been defined for this SDP at the given level. @@ -942,48 +879,6 @@ sdp_result_e sdp_set_conn_address (sdp_t *sdp_p, uint16_t level, return (SDP_SUCCESS); } -/* Function: sdp_set_mcast_addr_fields - * Description: Sets the value of the ttl and num of addresses for - * a multicast address. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the c= line. Will be - * either SDP_SESSION_LEVEL or 1-n specifying a - * media line level. - * ttl Time to live (ttl) value. - * num_of_addresses number of addresses - . - * Returns: SDP_SUCCESS - */ -sdp_result_e sdp_set_mcast_addr_fields(sdp_t *sdp_p, uint16_t level, - uint16_t ttl, uint16_t num_of_addresses) -{ - sdp_conn_t *conn_p; - sdp_mca_t *mca_p; - - if (level == SDP_SESSION_LEVEL) { - conn_p = &(sdp_p->default_conn); - } else { - mca_p = sdp_find_media_level(sdp_p, level); - if (mca_p == NULL) { - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - conn_p = &(mca_p->conn); - } - - if (conn_p) { - conn_p->is_multicast = TRUE; - if ((conn_p->ttl >0) && (conn_p->ttl <= SDP_MAX_TTL_VALUE)) { - conn_p->ttl = ttl; - } - conn_p->num_of_addresses = num_of_addresses; - } else { - return (SDP_FAILURE); - } - return (SDP_SUCCESS); -} - - /* Function: sdp_media_line_valid * Description: Returns true or false depending on whether the specified * media line m= has been defined for this SDP. The @@ -1705,32 +1600,6 @@ sdp_result_e sdp_set_media_type (sdp_t *sdp_p, uint16_t level, sdp_media_e media return (SDP_SUCCESS); } -/* Function: sdp_set_media_port_format - * Description: Sets the value of the port format parameter for the m= - * media token line. Note that this parameter must be set - * before any of the port type specific parameters. If a - * parameter is not valid according to the port format - * specified, an attempt to set the parameter will fail. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The media level to set the param. Will be 1-n. - * port_format Media type for the media line. - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER - */ -sdp_result_e sdp_set_media_port_format (sdp_t *sdp_p, uint16_t level, - sdp_port_format_e port_format) -{ - sdp_mca_t *mca_p; - - mca_p = sdp_find_media_level(sdp_p, level); - if (mca_p == NULL) { - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - mca_p->port_format = port_format; - return (SDP_SUCCESS); -} - /* Function: sdp_set_media_portnum * Description: Sets the value of the port number parameter for the m= * media token line. If the port number is not valid with the @@ -1777,127 +1646,6 @@ int32_t sdp_get_media_sctp_port(sdp_t *sdp_p, uint16_t level) return mca_p->sctpport; } -/* Function: sdp_set_media_portcount - * Description: Sets the value of the port count parameter for the m= - * media token line. If the port count is not valid with the - * port format specified for the media line, this call will - * fail. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The media level to set the param. Will be 1-n. - * num_ports Port count to set. - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER - */ -sdp_result_e sdp_set_media_portcount (sdp_t *sdp_p, uint16_t level, - int32_t num_ports) -{ - sdp_mca_t *mca_p; - - mca_p = sdp_find_media_level(sdp_p, level); - if (mca_p == NULL) { - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - mca_p->num_ports = num_ports; - return (SDP_SUCCESS); -} - -/* Function: sdp_set_media_vpi - * Description: Sets the value of the VPI parameter for the m= - * media token line. If the VPI is not valid with the - * port format specified for the media line, this call will - * fail. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The media level to set the param. Will be 1-n. - * vpi The VPI value to set. - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER - */ -sdp_result_e sdp_set_media_vpi (sdp_t *sdp_p, uint16_t level, int32_t vpi) -{ - sdp_mca_t *mca_p; - - mca_p = sdp_find_media_level(sdp_p, level); - if (mca_p == NULL) { - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - mca_p->vpi = vpi; - return (SDP_SUCCESS); -} - -/* Function: sdp_set_media_vci - * Description: Sets the value of the VCI parameter for the m= - * media token line. If the VCI is not valid with the - * port format specified for the media line, this call will - * fail. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The media level to set the param. Will be 1-n. - * vci The VCI value to set. - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER - */ -sdp_result_e sdp_set_media_vci (sdp_t *sdp_p, uint16_t level, uint32_t vci) -{ - sdp_mca_t *mca_p; - - mca_p = sdp_find_media_level(sdp_p, level); - if (mca_p == NULL) { - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - mca_p->vci = vci; - return (SDP_SUCCESS); -} - -/* Function: sdp_set_media_vcci - * Description: Sets the value of the VCCI parameter for the m= - * media token line. If the VCCI is not valid with the - * port format specified for the media line, this call will - * fail. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The media level to set the param. Will be 1-n. - * vcci The VCCI value to set. - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER - */ -sdp_result_e sdp_set_media_vcci (sdp_t *sdp_p, uint16_t level, int32_t vcci) -{ - sdp_mca_t *mca_p; - - mca_p = sdp_find_media_level(sdp_p, level); - if (mca_p == NULL) { - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - mca_p->vcci = vcci; - return (SDP_SUCCESS); -} - -/* Function: sdp_set_media_cid - * Description: Sets the value of the CID parameter for the m= - * media token line. If the CID is not valid with the - * port format specified for the media line, this call will - * fail. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The media level to set the param. Will be 1-n. - * cid The CID value to set. - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER - */ -sdp_result_e sdp_set_media_cid (sdp_t *sdp_p, uint16_t level, int32_t cid) -{ - sdp_mca_t *mca_p; - - mca_p = sdp_find_media_level(sdp_p, level); - if (mca_p == NULL) { - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - mca_p->cid = cid; - return (SDP_SUCCESS); -} - /* Function: sdp_set_media_transport * Description: Sets the value of the transport type parameter for the m= * media token line. @@ -2422,52 +2170,6 @@ sdp_result_e sdp_delete_bw_line (sdp_t *sdp_p, uint16_t level, uint16_t inst_num return (SDP_SUCCESS); } -/* - * sdp_set_bw - * - * Once a bandwidth line is added under a level, this function can be used to - * set the properties of that bandwidth line. - * - * Parameters: - * sdp_p The SDP handle returned by sdp_init_description. - * level The level to at which the bw line resides. - * inst_num The instance number of the bw line that is to be set. - * bw_modifier The Type of bandwidth, CT, AS or TIAS. - * bw_val Numerical bandwidth value. - * - * NOTE: Before calling this function to set the bw line, the bw line must - * be added using sdp_add_new_bw_line at the required level. - */ -sdp_result_e sdp_set_bw (sdp_t *sdp_p, uint16_t level, uint16_t inst_num, - sdp_bw_modifier_e bw_modifier, uint32_t bw_val) -{ - sdp_bw_data_t *bw_data_p; - - if ((bw_modifier < SDP_BW_MODIFIER_AS) || - (bw_modifier >= SDP_MAX_BW_MODIFIER_VAL)) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Invalid bw modifier type: %d.", - sdp_p->debug_str, bw_modifier); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - bw_data_p = sdp_find_bw_line(sdp_p, level, inst_num); - if (bw_data_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s The %u instance of a b= line was not found at level %u.", - sdp_p->debug_str, (unsigned)inst_num, (unsigned)level); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - bw_data_p->bw_modifier = bw_modifier; - bw_data_p->bw_val = bw_val; - - return (SDP_SUCCESS); -} - /* Function: sdp_get_mid_value * Description: Returns the mid value parameter from the a= mid: line. * Parameters: sdp_p The SDP handle returned by sdp_init_description. @@ -2486,23 +2188,3 @@ int32_t sdp_get_mid_value (sdp_t *sdp_p, uint16_t level) return (mca_p->mid); } -/* Function: sdp_set_mid_value - * Description: Sets the value of the mid value for the - * a= mid: line. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level SDP_MEDIA_LEVEL - * mid_val mid value . - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER -*/ -sdp_result_e sdp_set_mid_value (sdp_t *sdp_p, uint16_t level, uint32_t mid_val) -{ - sdp_mca_t *mca_p; - - mca_p = sdp_find_media_level(sdp_p, level); - if (mca_p == NULL) { - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - mca_p->mid = mid_val; - return (SDP_SUCCESS); -} diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_attr_access.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_attr_access.c index a0c265802f0..1d76e3d35f6 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_attr_access.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_attr_access.c @@ -733,56 +733,6 @@ const char *sdp_attr_get_simple_string (sdp_t *sdp_p, sdp_attr_e attr_type, } } -/* Function: sdp_attr_set_simple_string - * Description: Sets the value of a string attribute parameter. This - * routine can only be called for attributes that have just - * one string parameter. The string is copied into the SDP - * structure so application memory will not be referenced by - * the SDP library. - * Attributes with a simple string parameter currently include: - * bearer, called, connection_type, dialed, dialing, and - * framing. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * attr_type The simple string attribute type. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * string_parm Ptr to new string value. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_simple_string (sdp_t *sdp_p, sdp_attr_e attr_type, - uint16_t level, uint8_t cap_num, - uint16_t inst_num, const char *string_parm) -{ - sdp_attr_t *attr_p; - - if (!sdp_attr_is_simple_string(attr_type)) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Attribute type is not a simple string (%s)", - sdp_p->debug_str, sdp_get_attr_name(attr_type)); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, attr_type, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Attribute %s, level %u instance %u not found.", - sdp_p->debug_str, sdp_get_attr_name(attr_type), - (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - sstrncpy(attr_p->attr.string_val, string_parm, - sizeof(attr_p->attr.string_val)); - return (SDP_SUCCESS); - } -} - static boolean sdp_attr_is_simple_u32(sdp_attr_e attr_type) { if ((attr_type != SDP_ATTR_EECID) && (attr_type != SDP_ATTR_PTIME) && @@ -852,54 +802,6 @@ uint32_t sdp_attr_get_simple_u32 (sdp_t *sdp_p, sdp_attr_e attr_type, uint16_t l } } -/* Function: sdp_attr_set_simple_u32 - * Description: Sets the value of an unsigned 32-bit attribute parameter. - * This routine can only be called for attributes that have just - * one uint32_t parameter. - * Attributes with a simple uint32_t parameter currently include: - * eecid, ptime, T38FaxVersion, T38maxBitRate, T38FaxMaxBuffer, - * T38FaxMaxDatagram, X-sqn, TC1PayloadBytes, TC1WindowSize, - * TC2PayloadBytes, TC2WindowSize, rtcp. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * attr_type The simple uint32_t attribute type. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * num_parm New uint32_t parameter. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_simple_u32 (sdp_t *sdp_p, sdp_attr_e attr_type, - uint16_t level, uint8_t cap_num, uint16_t inst_num, uint32_t num_parm) -{ - sdp_attr_t *attr_p; - - if (!sdp_attr_is_simple_u32(attr_type)) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Attribute type is not a simple uint32_t (%s)", - sdp_p->debug_str, sdp_get_attr_name(attr_type)); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, attr_type, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Attribute %s, level %u instance %u not found.", - sdp_p->debug_str, sdp_get_attr_name(attr_type), - (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.u32_val = num_parm; - return (SDP_SUCCESS); - } -} - - /* Function: sdp_attr_get_simple_boolean * Description: Returns a boolean attribute parameter. This * routine can only be called for attributes that have just @@ -950,56 +852,6 @@ tinybool sdp_attr_get_simple_boolean (sdp_t *sdp_p, sdp_attr_e attr_type, } } -/* Function: sdp_attr_set_simple_boolean - * Description: Sets the value of a boolean attribute parameter. - * This routine can only be called for attributes that have just - * one boolean parameter. - * Attributes with a simple boolean parameter currently include: - * T38FaxFillBitRemoval, T38FaxTranscodingMMR, - * T38FaxTranscodingJBIG, and TMRGwXid. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * attr_type The simple boolean attribute type. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * bool_parm New boolean parameter. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_simple_boolean (sdp_t *sdp_p, sdp_attr_e attr_type, - uint16_t level, uint8_t cap_num, - uint16_t inst_num, uint32_t bool_parm) -{ - sdp_attr_t *attr_p; - - if ((attr_type != SDP_ATTR_T38_FILLBITREMOVAL) && - (attr_type != SDP_ATTR_T38_TRANSCODINGMMR) && - (attr_type != SDP_ATTR_T38_TRANSCODINGJBIG) && - (attr_type != SDP_ATTR_TMRGWXID)) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Attribute type is not a simple boolean (%s)", - sdp_p->debug_str, sdp_get_attr_name(attr_type)); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, attr_type, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Attribute %s, level %u instance %u not found.", - sdp_p->debug_str, sdp_get_attr_name(attr_type), - (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.boolean_val = (tinybool)bool_parm; - return (SDP_SUCCESS); - } -} - /* * sdp_attr_get_maxprate * @@ -1032,68 +884,6 @@ sdp_attr_get_maxprate (sdp_t *sdp_p, uint16_t level, uint16_t inst_num) } } -/* - * sdp_attr_set_maxprate - * - * This function is used by the application layer to set the packet rate of - * the maxprate attribute line appropriately. The maxprate attribute is - * defined as follows: - * - * max-p-rate-def = "a" "=" "maxprate" ":" packet-rate CRLF - * packet-rate = 1*DIGIT ["." 1*DIGIT] - * - * - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * inst_num The attribute instance number to set. - * string_parm A string that contains the value of packet-rate - * that needs to be advertised. - * - * Note that we use a string to set the packet-rate, so the application layer - * must format a string, as per the packet-rate format and pass it to this - * function. - * - * The decision to use a string to communicate the packet-rate was - * made because some operating systems do not support floating point - * operations. - * - * Returns: - * SDP_INVALID_SDP_PTR - If an invalid sdp handle is passed in. - * SDP_INVALID_PARAMETER - If the maxprate attribute is not defined at the - * specified level OR if the packet-rate is not - * formatted correctly in string_parm. - * SDP_SUCCESS - If we are successfully able to set the maxprate attribute. - */ -sdp_result_e -sdp_attr_set_maxprate (sdp_t *sdp_p, uint16_t level, uint16_t inst_num, - const char *string_parm) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, 0, SDP_ATTR_MAXPRATE, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Attribute %s, level %u instance %u not found.", - sdp_p->debug_str, sdp_get_attr_name(SDP_ATTR_MAXPRATE), - (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - if (!sdp_validate_maxprate(string_parm)) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s is not a valid maxprate value.", string_parm); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - sstrncpy(attr_p->attr.string_val, string_parm, - sizeof(attr_p->attr.string_val)); - return (SDP_SUCCESS); - } -} - /* Function: sdp_attr_get_t38ratemgmt * Description: Returns the value of the t38ratemgmt attribute * parameter specified for the given attribute. If the given @@ -1124,40 +914,6 @@ sdp_t38_ratemgmt_e sdp_attr_get_t38ratemgmt (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_attr_set_t38ratemgmt - * Description: Sets the value of the t38ratemgmt attribute parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * t38ratemgmt New t38ratemgmt parameter. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_t38ratemgmt (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_t38_ratemgmt_e t38ratemgmt) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_T38_RATEMGMT, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s t38ratemgmt attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.t38ratemgmt = t38ratemgmt; - return (SDP_SUCCESS); - } -} - - /* Function: sdp_attr_get_t38udpec * Description: Returns the value of the t38udpec attribute * parameter specified for the given attribute. If the given @@ -1188,40 +944,6 @@ sdp_t38_udpec_e sdp_attr_get_t38udpec (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_attr_set_t38udpec - * Description: Sets the value of the t38ratemgmt attribute parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * t38udpec New t38udpec parameter. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_t38udpec (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_t38_udpec_e t38udpec) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_T38_UDPEC, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s t38udpec attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.t38udpec = t38udpec; - return (SDP_SUCCESS); - } -} - - /* Function: sdp_get_media_direction * Description: Determines the direction defined for a given level. The * direction will be inactive, sendonly, recvonly, or sendrecv @@ -1564,56 +1286,6 @@ tinybool sdp_attr_get_qos_confirm (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_attr_set_qos_strength - * Description: Sets the qos strength value for the specified qos attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * qos_attr The specific type of qos attribute. May be - * qos, secure, X-pc-qos, or X-qos. - * inst_num The attribute instance number to check. - * strength New qos strength parameter. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_qos_strength (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, - sdp_attr_e qos_attr, uint16_t inst_num, - sdp_qos_strength_e strength) -{ - sdp_attr_t *attr_p; - - if (sdp_validate_qos_attr(qos_attr) == FALSE) { - if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - CSFLogDebug(logTag, "%s Warning: Invalid QOS attribute specified " - "for set qos strength.", sdp_p->debug_str); - } - return (SDP_FAILURE); - } - attr_p = sdp_find_attr(sdp_p, level, cap_num, qos_attr, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - switch (qos_attr) { - case SDP_ATTR_QOS: - attr_p->attr.qos.strength = strength; - return (SDP_SUCCESS); - case SDP_ATTR_DES: - attr_p->attr.des.strength = strength; - return (SDP_SUCCESS); - default: - return (SDP_FAILURE); - - } - } -} - /* Function: sdp_attr_get_curr_type * Description: Returns the value of the curr attribute status_type * parameter specified for the given attribute. If the given @@ -1713,290 +1385,6 @@ sdp_conf_type_e sdp_attr_get_conf_type (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_attr_set_curr_type - * Description: Returns the value of the curr attribute status_type - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_CURR_UNKNOWN_TYPE is - * returned. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * qos_attr The specific type of qos attribute. May be - * qos, secure, X-pc-qos, or X-qos. - * inst_num The attribute instance number to check. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_curr_type (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e qos_attr, uint16_t inst_num, - sdp_curr_type_e curr_type) -{ - sdp_attr_t *attr_p; - - if (sdp_validate_qos_attr(qos_attr) == FALSE) { - if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - CSFLogDebug(logTag, "%s Warning: Invalid curr attribute specified " - "for set curr type.", sdp_p->debug_str); - } - return (SDP_FAILURE); - } - attr_p = sdp_find_attr(sdp_p, level, cap_num, qos_attr, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.curr.type = curr_type; - return (SDP_SUCCESS); - } -} - -/* Function: sdp_attr_set_des_type - * Description: Sets the value of the des attribute type - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_DES_UNKNOWN_TYPE is - * returned. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * qos_attr The specific type of qos attribute. May be - * qos, secure, X-pc-qos, or X-qos. - * inst_num The attribute instance number to check. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_des_type (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e qos_attr, uint16_t inst_num, - sdp_des_type_e des_type) -{ - sdp_attr_t *attr_p; - - if (sdp_validate_qos_attr(qos_attr) == FALSE) { - if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - CSFLogDebug(logTag, "%s Warning: Invalid des attribute specified " - "for set des type.", sdp_p->debug_str); - } - return (SDP_FAILURE); - } - attr_p = sdp_find_attr(sdp_p, level, cap_num, qos_attr, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.des.type = des_type; - return (SDP_SUCCESS); - } -} - - -/* Function: sdp_attr_set_conf_type - * Description: Sets the value of the conf attribute type - * parameter specified for the given attribute. If the given - * attribute is not defined, SDP_CONF_UNKNOWN_TYPE is - * returned. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * qos_attr The specific type of qos attribute. May be - * qos, secure, X-pc-qos, or X-qos. - * inst_num The attribute instance number to check. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_conf_type (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e qos_attr, uint16_t inst_num, - sdp_conf_type_e conf_type) -{ - sdp_attr_t *attr_p; - - if (sdp_validate_qos_attr(qos_attr) == FALSE) { - if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - CSFLogDebug(logTag, "%s Warning: Invalid conf attribute specified " - "for set conf type.", sdp_p->debug_str); - } - return (SDP_FAILURE); - } - attr_p = sdp_find_attr(sdp_p, level, cap_num, qos_attr, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.conf.type = conf_type; - return (SDP_SUCCESS); - } -} - -/* Function: sdp_attr_set_qos_direction - * Description: Sets the qos direction value for the specified qos attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * qos_attr The specific type of qos attribute. May be - * qos, secure, X-pc-qos, or X-qos. - * inst_num The attribute instance number to check. - * direction New qos direction parameter. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_qos_direction (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, - sdp_attr_e qos_attr, uint16_t inst_num, - sdp_qos_dir_e direction) -{ - sdp_attr_t *attr_p; - - if (sdp_validate_qos_attr(qos_attr) == FALSE) { - if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - CSFLogDebug(logTag, "%s Warning: Invalid QOS attribute specified " - "for set qos direction.", sdp_p->debug_str); - } - return (SDP_FAILURE); - } - attr_p = sdp_find_attr(sdp_p, level, cap_num, qos_attr, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - switch (qos_attr) { - case SDP_ATTR_QOS: - attr_p->attr.qos.direction = direction; - return (SDP_SUCCESS); - case SDP_ATTR_CURR: - attr_p->attr.curr.direction = direction; - return (SDP_SUCCESS); - case SDP_ATTR_DES: - attr_p->attr.des.direction = direction; - return (SDP_SUCCESS); - case SDP_ATTR_CONF: - attr_p->attr.conf.direction = direction; - return (SDP_SUCCESS); - default: - return (SDP_FAILURE); - - } - } -} - -/* Function: sdp_attr_set_qos_status_type - * Description: Sets the qos status_type value for the specified qos attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * qos_attr The specific type of qos attribute. May be - * qos, secure, X-pc-qos, or X-qos. - * inst_num The attribute instance number to check. - * direction New qos direction parameter. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_qos_status_type (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, - sdp_attr_e qos_attr, uint16_t inst_num, - sdp_qos_status_types_e status_type) -{ - sdp_attr_t *attr_p; - - if (sdp_validate_qos_attr(qos_attr) == FALSE) { - if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - CSFLogDebug(logTag, "%s Warning: Invalid QOS attribute specified " - "for set qos status_type.", sdp_p->debug_str); - } - return (SDP_FAILURE); - } - attr_p = sdp_find_attr(sdp_p, level, cap_num, qos_attr, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - switch (qos_attr) { - case SDP_ATTR_CURR: - attr_p->attr.curr.status_type = status_type; - return (SDP_SUCCESS); - case SDP_ATTR_DES: - attr_p->attr.des.status_type = status_type; - return (SDP_SUCCESS); - case SDP_ATTR_CONF: - attr_p->attr.conf.status_type = status_type; - return (SDP_SUCCESS); - default: - return (SDP_FAILURE); - - } - } -} - -/* Function: sdp_attr_set_qos_confirm - * Description: Sets the qos confirm value for the specified qos attribute. - * If this parameter is TRUE, the confirm parameter will be - * specified when the SDP description is built. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * qos_attr The specific type of qos attribute. May be - * qos, secure, X-pc-qos, or X-qos. - * inst_num The attribute instance number to check. - * confirm New qos confirm parameter. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_qos_confirm (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, - sdp_attr_e qos_attr, uint16_t inst_num, - tinybool qos_confirm) -{ - sdp_attr_t *attr_p; - - if (sdp_validate_qos_attr(qos_attr) == FALSE) { - if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { - CSFLogDebug(logTag, "%s Warning: Invalid QOS attribute specified " - "for set qos confirm.", sdp_p->debug_str); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - attr_p = sdp_find_attr(sdp_p, level, cap_num, qos_attr, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.qos.confirm = qos_confirm; - return (SDP_SUCCESS); - } -} - - /* Function: sdp_attr_get_subnet_nettype * Description: Returns the value of the subnet attribute network type * parameter specified for the given attribute. If the given @@ -2121,142 +1509,6 @@ int32_t sdp_attr_get_subnet_prefix (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_attr_set_subnet_nettype - * Description: Sets the value of the subnet attribute nettype parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * nettype The network type for the attribute. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_subnet_nettype (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_nettype_e nettype) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SUBNET, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Subnet attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.subnet.nettype = nettype; - return (SDP_SUCCESS); - } -} - -/* Function: sdp_attr_set_subnet_addrtype - * Description: Sets the value of the subnet attribute addrtype parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * addrtype The address type for the attribute. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_subnet_addrtype (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_addrtype_e sdp_addrtype) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SUBNET, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Subnet attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.subnet.addrtype = sdp_addrtype; - return (SDP_SUCCESS); - } -} - -/* Function: sdp_attr_set_subnet_addr - * Description: Sets the value of the subnet attribute addr parameter - * for the given attribute. The address is copied into the - * SDP structure so application memory will not be - * referenced by the SDP lib. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * addr Ptr to the address string for the attribute. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_subnet_addr (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - const char *addr) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SUBNET, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Subnet attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - sstrncpy(attr_p->attr.subnet.addr, addr, - sizeof(attr_p->attr.subnet.addr)) ; - return (SDP_SUCCESS); - } -} - -/* Function: sdp_attr_set_subnet_prefix - * Description: Sets the value of the subnet attribute prefix parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * prefix Prefix value for the attribute. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_subnet_prefix (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - int32_t prefix) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SUBNET, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Subnet attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.subnet.prefix = prefix; - return (SDP_SUCCESS); - } -} - - /* Function: sdp_attr_rtpmap_payload_valid * Description: Returns true or false depending on whether an rtpmap * attribute was specified with the given payload value @@ -2420,72 +1672,6 @@ uint16_t sdp_attr_get_rtpmap_num_chan (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_attr_set_rtpmap_payload_type - * Description: Sets the value of the rtpmap attribute payload type parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * payload_num New payload type value. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_rtpmap_payload_type (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t payload_num) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_RTPMAP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s rtpmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.transport_map.payload_num = payload_num; - return (SDP_SUCCESS); - } -} - -/* Function: sdp_attr_set_rtpmap_encname - * Description: Sets the value of the rtpmap attribute encname parameter - * for the given attribute. String is copied into SDP memory. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * encname Ptr to string encoding name. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_rtpmap_encname (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, - uint16_t inst_num, const char *encname) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_RTPMAP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s rtpmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - if (encname) { - sstrncpy(attr_p->attr.transport_map.encname, encname, - sizeof(attr_p->attr.transport_map.encname)); - } - return (SDP_SUCCESS); - } -} - /* Function: sdp_attr_get_ice_attribute * Description: Returns the value of an ice attribute at a given level * @@ -2523,41 +1709,6 @@ sdp_result_e sdp_attr_get_ice_attribute (sdp_t *sdp_p, uint16_t level, return (SDP_FAILURE); } -/* Function: sdp_attr_set_ice_attribute - * Description: Sets the value of an ice attribute parameter - * String is copied into SDP memory. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to set the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * ice_attrib ice attribute string to set - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_ice_attribute(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e sdp_attr, uint16_t inst_num, const char *ice_attrib) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, sdp_attr, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s ice attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - if (!ice_attrib) { - return (SDP_INVALID_PARAMETER); - } - - sstrncpy(attr_p->attr.ice_attr, ice_attrib, sizeof(attr_p->attr.ice_attr)); - return (SDP_SUCCESS); -} - /* Function: sdp_attr_is_present * Description: Returns a boolean value based on attribute being present or * not @@ -2626,38 +1777,6 @@ sdp_result_e sdp_attr_get_rtcp_mux_attribute (sdp_t *sdp_p, uint16_t level, return (SDP_FAILURE); } -/* Function: sdp_attr_set_rtcp_mux_attribute - * Description: Sets the value of an rtcp_mux attribute parameter - * String is copied into SDP memory. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to set the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * rtcp_mux rtcp-mux attribute bool to set - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_rtcp_mux_attribute(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e sdp_attr, uint16_t inst_num, const tinybool rtcp_mux) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, sdp_attr, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s rtcp-mux attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - attr_p->attr.boolean_val = rtcp_mux; - return (SDP_SUCCESS); -} - - /* Function: sdp_attr_get_setup_attribute * Description: Returns the value of a setup attribute at a given level * @@ -2692,39 +1811,6 @@ sdp_result_e sdp_attr_get_setup_attribute (sdp_t *sdp_p, uint16_t level, return SDP_SUCCESS; } -/* Function: sdp_attr_set_setup_attribute - * Description: Sets the value of a setup attribute parameter - * - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to set the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * setup_type setup attribute value to set - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_SDP_PTR SDP ptr invalid - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e -sdp_attr_set_setup_attribute(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, sdp_setup_type_e setup_type) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SETUP, inst_num); - if (!attr_p) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s setup attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return SDP_INVALID_PARAMETER; - } - - attr_p->attr.setup = setup_type; - return SDP_SUCCESS; -} - /* Function: sdp_attr_get_connection_attribute * Description: Returns the value of a connection attribute at a given level * @@ -2760,40 +1846,6 @@ sdp_result_e sdp_attr_get_connection_attribute (sdp_t *sdp_p, uint16_t level, return SDP_SUCCESS; } -/* Function: sdp_attr_set_connection_attribute - * Description: Sets the value of a connection attribute parameter - * - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to set the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * connection_type connection attribute value to set - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_SDP_PTR SDP ptr invalid - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e -sdp_attr_set_connection_attribute(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, sdp_connection_type_e connection_type) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_CONNECTION, - inst_num); - if (!attr_p) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s connection attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return SDP_INVALID_PARAMETER; - } - - attr_p->attr.connection = connection_type; - return SDP_SUCCESS; -} - /* Function: sdp_attr_get_dtls_fingerprint_attribute * Description: Returns the value of dtls fingerprint attribute at a given level * @@ -2830,106 +1882,6 @@ sdp_result_e sdp_attr_get_dtls_fingerprint_attribute (sdp_t *sdp_p, uint16_t lev return (SDP_FAILURE); } -/* Function: sdp_attr_set_dtls_fingerprint_attribute - * Description: Sets the value of a dtls fingerprint attribute parameter - * String is copied into SDP memory. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to set the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * dtls_fingerprint fingerprint attribute string to set - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_dtls_fingerprint_attribute(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, sdp_attr_e sdp_attr, uint16_t inst_num, const char *dtls_fingerprint) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, sdp_attr, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s dtls fingerprint attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - if (!dtls_fingerprint) { - return (SDP_INVALID_PARAMETER); - } - - sstrncpy(attr_p->attr.string_val, dtls_fingerprint, sizeof(attr_p->attr.string_val)); - return (SDP_SUCCESS); -} - -/* Function: sdp_attr_set_rtpmap_clockrate - * Description: Sets the value of the rtpmap attribute clockrate parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * clockrate New clockrate value. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_rtpmap_clockrate (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t clockrate) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_RTPMAP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s rtpmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.transport_map.clockrate = clockrate; - return (SDP_SUCCESS); - } -} - -/* Function: sdp_attr_set_rtpmap_num_chan - * Description: Sets the value of the rtpmap attribute num_chan parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * num_chan New number of channels value. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_rtpmap_num_chan (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t num_chan) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_RTPMAP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s rtpmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.transport_map.num_chan = num_chan; - return (SDP_SUCCESS); - } -} - - /* Function: sdp_attr_sprtmap_payload_valid * Description: Returns true or false depending on whether an sprtmap * attribute was specified with the given payload value @@ -3087,134 +2039,6 @@ uint16_t sdp_attr_get_sprtmap_num_chan (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_attr_set_sprtmap_payload_type - * Description: Sets the value of the sprtmap attribute payload type parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * payload_num New payload type value. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_sprtmap_payload_type (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t payload_num) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SPRTMAP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s sprtmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.transport_map.payload_num = payload_num; - return (SDP_SUCCESS); - } -} - -/* Function: sdp_attr_set_sprtmap_encname - * Description: Sets the value of the sprtmap attribute encname parameter - * for the given attribute. String is copied into SDP memory. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * encname Ptr to string encoding name. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_sprtmap_encname (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, - uint16_t inst_num, const char *encname) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SPRTMAP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s sprtmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - sstrncpy(attr_p->attr.transport_map.encname, encname, - sizeof(attr_p->attr.transport_map.encname)); - return (SDP_SUCCESS); - } -} - -/* Function: sdp_attr_set_sprtmap_clockrate - * Description: Sets the value of the sprtmap attribute clockrate parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * clockrate New clockrate value. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_sprtmap_clockrate (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t clockrate) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SPRTMAP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s sprtmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.transport_map.clockrate = clockrate; - return (SDP_SUCCESS); - } -} - -/* Function: sdp_attr_set_sprtmap_num_chan - * Description: Sets the value of the sprtmap attribute num_chan parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * num_chan New number of channels value. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_sprtmap_num_chan (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t num_chan) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SPRTMAP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s sprtmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.transport_map.num_chan = num_chan; - return (SDP_SUCCESS); - } -} - /* Note: The fmtp attribute formats currently handled are: * fmtp: ,... * fmtp: [annexa=yes/no] [annexb=yes/no] [bitrate=] @@ -3435,39 +2259,6 @@ sdp_result_e sdp_attr_set_fmtp_payload_type (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_attr_set_fmtp_bitmap - * Description: Set a range of named events for an fmtp attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * bmap The 8 word data array holding the bitmap - * Returns: SDP_SUCCESS - */ -sdp_result_e sdp_attr_set_fmtp_bitmap(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, uint32_t *bmap, uint32_t maxval) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->maxval = maxval; - memcpy(fmtp_p->bmap, bmap, SDP_NE_NUM_BMAP_WORDS * sizeof(uint32_t) ); - - return (SDP_SUCCESS); -} - /* Function: sdp_attr_get_fmtp_range * Description: Get a range of named events for an fmtp attribute. * Parameters: sdp_p The SDP handle returned by sdp_init_description. @@ -3500,50 +2291,6 @@ sdp_result_e sdp_attr_get_fmtp_range (sdp_t *sdp_p, uint16_t level, uint8_t cap_ return (SDP_SUCCESS); } -/* Function: sdp_attr_set_fmtp_range - * Description: Set a range of named events for an fmtp attribute. The low - * value specified must be <= the high value. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * low_val The low value of the range. Range is 0-255. - * high_val The high value of the range. May be == low. - * Returns: SDP_SUCCESS - */ -sdp_result_e sdp_attr_set_fmtp_range (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, - uint16_t inst_num, uint8_t low_val, uint8_t high_val) -{ - uint16_t i; - uint32_t mapword; - uint32_t bmap; - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - for (i = low_val; i <= high_val; i++) { - mapword = i/SDP_NE_BITS_PER_WORD; - bmap = SDP_NE_BIT_0 << (i%32); - fmtp_p->bmap[ mapword ] |= bmap; - } - if (high_val > fmtp_p->maxval) { - fmtp_p->maxval = high_val; - } - fmtp_p->fmtp_format = SDP_FMTP_NTE; - return (SDP_SUCCESS); -} - /* Function: sdp_attr_clear_fmtp_range * Description: Clear a range of named events for an fmtp attribute. The low * value specified must be <= the high value. @@ -3701,80 +2448,6 @@ sdp_result_e sdp_attr_copy_fmtp_ranges (sdp_t *src_sdp_p, sdp_t *dst_sdp_p, return (SDP_SUCCESS); } -/* Function: sdp_attr_set_fmtp_annexa - * Description: Sets the value of the fmtp attribute annexa type parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * annexa It is either yes or no. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_fmtp_annexa (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool annexa) -{ - - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->annexa_required = TRUE; - fmtp_p->annexa = annexa; - - return (SDP_SUCCESS); -} - -/* Function: sdp_attr_set_fmtp_annexb - * Description: Sets the value of the fmtp attribute annexb type parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * annexb It is either yes or no. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_fmtp_annexb (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool annexb) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->annexb_required = TRUE; - fmtp_p->annexb = annexb; - return (SDP_SUCCESS); -} - /* Function: sdp_attr_get_fmtp_mode * Description: Gets the value of the fmtp attribute mode parameter * for the given attribute. @@ -3809,824 +2482,6 @@ uint32_t sdp_attr_get_fmtp_mode_for_payload_type (sdp_t *sdp_p, uint16_t level, return 0; } -/* Function: sdp_attr_set_fmtp_mode - * Description: Sets the value of the fmtp attribute mode type parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * mode in milli seconds - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_fmtp_mode (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t mode) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_MODE; - fmtp_p->mode = mode; - return (SDP_SUCCESS); -} - -/* Function: sdp_attr_set_fmtp_bitrate_type - * Description: Sets the value of the fmtp attribute bitrate type parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * bitrate Sets the bitrate value. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_fmtp_bitrate_type (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t bitrate) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - if (bitrate <= 0) { - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->bitrate = bitrate; - return (SDP_SUCCESS); -} - -/* Function: sdp_attr_set_fmtp_cif - * Description: Sets the value of the fmtp attribute cif parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * cif Sets the CIF value for a video codec - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_fmtp_cif (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t cif) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - if ((cif < SDP_MIN_CIF_VALUE) || ( cif > SDP_MAX_CIF_VALUE)) { - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->cif = cif; - return (SDP_SUCCESS); -} - -/* Function: sdp_attr_set_fmtp_qcif - * Description: Sets the value of the fmtp attribute qcif parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * qcif Sets the QCIF value for a video codec - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_fmtp_qcif (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t qcif) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - if ((qcif < SDP_MIN_CIF_VALUE) || ( qcif > SDP_MAX_CIF_VALUE)) { - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->qcif = qcif; - return (SDP_SUCCESS); -} -/* Function: sdp_attr_set_fmtp_sqcif - * Description: Sets the value of the fmtp attribute sqcif parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * sqcif Sets the SQCIF value for a video codec - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_fmtp_sqcif (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t sqcif) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - if ((sqcif < SDP_MIN_CIF_VALUE) || (sqcif > SDP_MAX_CIF_VALUE)) { - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->sqcif = sqcif; - return (SDP_SUCCESS); -} - - -/* Function: sdp_attr_set_fmtp_cif4 - * Description: Sets the value of the fmtp attribute cif4 parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * sqcif Sets the cif4 value for a video codec - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_fmtp_cif4 (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t cif4) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - if ((cif4 < SDP_MIN_CIF_VALUE) || (cif4 > SDP_MAX_CIF_VALUE)) { - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->cif4 = cif4; - return (SDP_SUCCESS); -} - -/* Function: sdp_attr_set_fmtp_cif16 - * Description: Sets the value of the fmtp attribute cif16 parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * cif16 Sets the cif16 value for a video codec - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_fmtp_cif16 (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t cif16) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - if ((cif16 < SDP_MIN_CIF_VALUE) || (cif16 > SDP_MAX_CIF_VALUE)) { - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->cif16 = cif16; - return (SDP_SUCCESS); -} - - -/* Function: sdp_attr_set_fmtp_maxbr - * Description: Sets the value of the fmtp attribute maxbr parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * MAXBR Sets the MAXBR value for a video codec - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. -*/ - -sdp_result_e sdp_attr_set_fmtp_maxbr (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t maxbr) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - if (maxbr <= 0) { - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->maxbr = maxbr; - return (SDP_SUCCESS); -} - -/* Function: sdp_attr_set_fmtp_custom - * Description: Sets the value of the fmtp attribute custom parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * CUSTOM Sets the CUSTOM value for a video codec - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. -*/ - -sdp_result_e sdp_attr_set_fmtp_custom (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t custom_x, uint16_t custom_y, uint16_t custom_mpi) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - if ((custom_x <= 0) || (custom_y <= 0) || (custom_mpi <= 0)) { - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->custom_x = custom_x; - fmtp_p->custom_y = custom_y; - fmtp_p->custom_mpi = custom_mpi; - return (SDP_SUCCESS); -} - -/* Function: sdp_attr_set_fmtp_par - * Description: Sets the value of the fmtp attribute PAR parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * PAR Sets the PAR width/height value - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. -*/ - -sdp_result_e sdp_attr_set_fmtp_par (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t par_width, uint16_t par_height) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - if ((par_width <= 0) || (par_height <= 0)) { - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->par_width = par_width; - fmtp_p->par_height = par_height; - return (SDP_SUCCESS); -} - -/* Function: sdp_attr_set_fmtp_cpcf - * Description: Sets the value of the fmtp attribute CPCF parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * CPCF Sets the CPCF value - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. -*/ - -sdp_result_e sdp_attr_set_fmtp_cpcf (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t cpcf) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - if (cpcf <= 0) { - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->cpcf = cpcf; - return (SDP_SUCCESS); -} - -/* Function: sdp_attr_set_fmtp_bpp - * Description: Sets the value of the fmtp attribute BPP parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * BPP Sets the BPP value - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. -*/ - -sdp_result_e sdp_attr_set_fmtp_bpp (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t bpp) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - if (bpp <= 0) { - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->bpp = bpp; - return (SDP_SUCCESS); -} - -/* Function: sdp_attr_set_fmtp_hrd - * Description: Sets the value of the fmtp attribute HRD parameter - * for the given attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * HRD Sets the HRD value - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ - -sdp_result_e sdp_attr_set_fmtp_hrd (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, uint16_t hrd) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - if (hrd <= 0) { - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->hrd = hrd; - return (SDP_SUCCESS); -} - -sdp_result_e sdp_attr_set_fmtp_h263_num_params (sdp_t *sdp_p, int16_t level, - uint8_t cap_num, uint16_t inst_num, - int16_t profile, - uint16_t h263_level, - tinybool interlace) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - - if ((profile >= SDP_MIN_PROFILE_LEVEL_VALUE) && - (profile <= SDP_MAX_PROFILE_VALUE)) { - fmtp_p->profile = profile; - } - - if ((level >= SDP_MIN_PROFILE_LEVEL_VALUE) && - (level <= SDP_MAX_LEVEL_VALUE)) { - fmtp_p->level = h263_level; - } - - if (interlace) { - fmtp_p->is_interlace = TRUE; - } else { - fmtp_p->is_interlace = FALSE; - } - - return (SDP_SUCCESS); -} - -sdp_result_e sdp_attr_set_fmtp_profile_level_id (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - const char *profile_level_id) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - if (profile_level_id) { - sstrncpy(fmtp_p->profile_level_id, profile_level_id, - SDP_MAX_STRING_LEN+1); - } - - return (SDP_SUCCESS); -} - -sdp_result_e sdp_attr_set_fmtp_parameter_sets (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - const char *parameter_sets) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - if (parameter_sets) { - sstrncpy(fmtp_p->parameter_sets, parameter_sets, SDP_MAX_STRING_LEN+1); - } - - return (SDP_SUCCESS); -} - -sdp_result_e sdp_attr_set_fmtp_pack_mode (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t pack_mode) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - if (pack_mode > SDP_MAX_PACKETIZATION_MODE_VALUE) { - return (SDP_INVALID_PARAMETER); - } - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->packetization_mode = pack_mode; - - return (SDP_SUCCESS); -} - -sdp_result_e sdp_attr_set_fmtp_level_asymmetry_allowed (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t asym_allowed) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->level_asymmetry_allowed = asym_allowed; - - return (SDP_SUCCESS); -} - -sdp_result_e sdp_attr_set_fmtp_deint_buf_req (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t deint_buf_req) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->deint_buf_req = deint_buf_req; - fmtp_p->flag |= SDP_DEINT_BUF_REQ_FLAG; - - return (SDP_SUCCESS); -} - -sdp_result_e sdp_attr_set_fmtp_init_buf_time (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t init_buf_time) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->init_buf_time = init_buf_time; - fmtp_p->flag |= SDP_INIT_BUF_TIME_FLAG; - - return (SDP_SUCCESS); -} - -sdp_result_e sdp_attr_set_fmtp_max_don_diff (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t max_don_diff) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->max_don_diff = max_don_diff; - - return (SDP_SUCCESS); -} - -sdp_result_e sdp_attr_set_fmtp_interleaving_depth (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t interleaving_depth) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->interleaving_depth = interleaving_depth; - - return (SDP_SUCCESS); -} - -sdp_result_e sdp_attr_set_fmtp_redundant_pic_cap (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool redundant_pic_cap) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - - if (redundant_pic_cap > 1) { - return (SDP_FAILURE); - } else { - fmtp_p->redundant_pic_cap = redundant_pic_cap; - return (SDP_SUCCESS); - } -} - -sdp_result_e sdp_attr_set_fmtp_max_mbps (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t max_mbps) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - - if (max_mbps > 0) { - fmtp_p->max_mbps = max_mbps; - return (SDP_SUCCESS); - } else { - return (SDP_FAILURE); - } -} - sdp_result_e sdp_attr_set_fmtp_max_fs (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num, uint32_t max_fs) @@ -4683,62 +2538,6 @@ sdp_result_e sdp_attr_set_fmtp_max_fr (sdp_t *sdp_p, uint16_t level, } } -sdp_result_e sdp_attr_set_fmtp_max_br (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t max_br) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - - if (max_br > 0) { - fmtp_p->max_br = max_br; - return (SDP_SUCCESS); - } else { - return (SDP_FAILURE); - } -} - -sdp_result_e sdp_attr_set_fmtp_max_average_bitrate (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t maxaveragebitrate) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - - if (maxaveragebitrate > 0) { - fmtp_p->maxaveragebitrate = maxaveragebitrate; - return (SDP_SUCCESS); - } else { - return (SDP_FAILURE); - } -} - /* Function: sdp_attr_get_fmtp_max_average_bitrate * Description: Gets the value of the fmtp attribute- maxaveragebitrate parameter for the OPUS codec * Parameters: sdp_p The SDP handle returned by sdp_init_description. @@ -4769,35 +2568,6 @@ sdp_result_e sdp_attr_get_fmtp_max_average_bitrate (sdp_t *sdp_p, uint16_t level } -sdp_result_e sdp_attr_set_fmtp_usedtx (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool usedtx) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - - if (usedtx == TRUE) { - fmtp_p->usedtx = 1; - } else { - fmtp_p->usedtx = 0; - } - - return (SDP_SUCCESS); -} - /* Function: sdp_attr_get_fmtp_usedtx * Description: Gets the value of the fmtp attribute- usedtx parameter for the OPUS codec * Parameters: sdp_p The SDP handle returned by sdp_init_description. @@ -4828,35 +2598,6 @@ sdp_result_e sdp_attr_get_fmtp_usedtx (sdp_t *sdp_p, uint16_t level, } } -sdp_result_e sdp_attr_set_fmtp_stereo (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool stereo) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - - if (stereo == TRUE) { - fmtp_p->stereo = 1; - } else { - fmtp_p->stereo = 0; - } - - return (SDP_SUCCESS); -} - /* Function: sdp_attr_get_fmtp_usedtx * Description: Gets the value of the fmtp attribute- usedtx parameter for the OPUS codec * Parameters: sdp_p The SDP handle returned by sdp_init_description. @@ -4887,35 +2628,6 @@ sdp_result_e sdp_attr_get_fmtp_stereo (sdp_t *sdp_p, uint16_t level, } } -sdp_result_e sdp_attr_set_fmtp_useinbandfec (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool useinbandfec) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - - if (useinbandfec == TRUE) { - fmtp_p->useinbandfec = 1; - } else { - fmtp_p->useinbandfec = 0; - } - - return (SDP_SUCCESS); -} - /* Function: sdp_attr_get_fmtp_useinbandfec * Description: Gets the value of the fmtp attribute useinbandfec parameter for the OPUS codec * Parameters: sdp_p The SDP handle returned by sdp_init_description. @@ -4946,33 +2658,6 @@ sdp_result_e sdp_attr_get_fmtp_useinbandfec (sdp_t *sdp_p, uint16_t level, } } -sdp_result_e sdp_attr_set_fmtp_maxcodedaudiobandwidth (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - const char *maxcodedaudiobandwidth) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - if (maxcodedaudiobandwidth) { - sstrncpy(fmtp_p->maxcodedaudiobandwidth, maxcodedaudiobandwidth, - SDP_MAX_STRING_LEN+1); - } - - return (SDP_SUCCESS); -} - /* Function: sdp_attr_get_fmtp_maxcodedaudiobandwidth * Description: Gets the value of the fmtp attribute maxcodedaudiobandwidth parameter for OPUS codec * Parameters: sdp_p The SDP handle returned by sdp_init_description. @@ -5002,35 +2687,6 @@ char* sdp_attr_get_fmtp_maxcodedaudiobandwidth (sdp_t *sdp_p, uint16_t level, } } -sdp_result_e sdp_attr_set_fmtp_cbr (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool cbr) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - - if (cbr == TRUE) { - fmtp_p->cbr = 1; - } else { - fmtp_p->cbr = 0; - } - - return (SDP_SUCCESS); -} - /* Function: sdp_attr_get_fmtp_cbr * Description: Gets the value of the fmtp attribute cbr parameter for the OPUS codec * Parameters: sdp_p The SDP handle returned by sdp_init_description. @@ -5079,26 +2735,6 @@ uint16_t sdp_attr_get_sctpmap_port(sdp_t *sdp_p, uint16_t level, } } -sdp_result_e sdp_attr_set_sctpmap_port(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t port) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SCTPMAP, inst_num); - if (!attr_p) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s sctpmap port, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return SDP_INVALID_PARAMETER; - } else { - attr_p->attr.sctpmap.port = port; - return SDP_SUCCESS; - } -} - sdp_result_e sdp_attr_get_sctpmap_streams (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num, uint32_t* val) { @@ -5118,61 +2754,6 @@ sdp_result_e sdp_attr_get_sctpmap_streams (sdp_t *sdp_p, uint16_t level, } } -sdp_result_e sdp_attr_set_sctpmap_streams (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t streams) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SCTPMAP, inst_num); - if (!attr_p) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s sctpmap streams, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_DATACHANNEL; - - if (streams > 0) { - attr_p->attr.sctpmap.streams = streams; - return (SDP_SUCCESS); - } else { - return (SDP_FAILURE); - } -} - -sdp_result_e sdp_attr_set_sctpmap_protocol(sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - const char *protocol) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_SCTPMAP, inst_num); - if (!attr_p) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s sctpmap streams, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_DATACHANNEL; - if (protocol) { - sstrncpy(attr_p->attr.sctpmap.protocol, protocol, - sizeof(attr_p->attr.sctpmap.protocol)); - } - - return (SDP_SUCCESS); -} - sdp_result_e sdp_attr_get_sctpmap_protocol (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num, char* protocol) @@ -5195,207 +2776,6 @@ sdp_result_e sdp_attr_get_sctpmap_protocol (sdp_t *sdp_p, uint16_t level, return (SDP_SUCCESS); } -sdp_result_e sdp_attr_set_fmtp_max_cpb (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t max_cpb) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s sctpmap, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - - if (max_cpb > 0) { - fmtp_p->max_cpb = max_cpb; - return (SDP_SUCCESS); - } else { - return (SDP_FAILURE); - } -} - -sdp_result_e sdp_attr_set_fmtp_max_dpb (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t max_dpb) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - - if (max_dpb > 0) { - fmtp_p->max_dpb = max_dpb; - return (SDP_SUCCESS); - } else { - return (SDP_FAILURE); - } -} - -sdp_result_e sdp_attr_set_fmtp_max_rcmd_nalu_size (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t max_rcmd_nalu_size) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->max_rcmd_nalu_size = max_rcmd_nalu_size; - fmtp_p->flag |= SDP_MAX_RCMD_NALU_SIZE_FLAG; - - return (SDP_SUCCESS); -} - -sdp_result_e sdp_attr_set_fmtp_deint_buf_cap (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint32_t deint_buf_cap) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->deint_buf_cap = deint_buf_cap; - fmtp_p->flag |= SDP_DEINT_BUF_CAP_FLAG; - - return (SDP_SUCCESS); -} - -sdp_result_e sdp_attr_set_fmtp_h264_parameter_add (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t parameter_add) -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->parameter_add = parameter_add; - - return (SDP_SUCCESS); -} - -sdp_result_e sdp_attr_set_fmtp_h261_annex_params (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool annex_d) { - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - - fmtp_p->annex_d = annex_d; - return (SDP_SUCCESS); -} - -sdp_result_e sdp_attr_set_fmtp_h263_annex_params (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool annex_f, - tinybool annex_i, - tinybool annex_j, - tinybool annex_t, - uint16_t annex_k_val, - uint16_t annex_n_val, - uint16_t annex_p_val_picture_resize, - uint16_t annex_p_val_warp) - -{ - sdp_attr_t *attr_p; - sdp_fmtp_t *fmtp_p; - - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_FMTP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - fmtp_p = &(attr_p->attr.fmtp); - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - - fmtp_p->annex_f = annex_f; - fmtp_p->annex_i = annex_i; - fmtp_p->annex_j = annex_j; - fmtp_p->annex_t = annex_t; - - fmtp_p->annex_k_val = annex_k_val; - fmtp_p->annex_n_val = annex_n_val; - - fmtp_p->annex_p_val_picture_resize = annex_p_val_picture_resize; - fmtp_p->annex_p_val_warp = annex_p_val_warp; - - return (SDP_SUCCESS); -} - - - /* Function: sdp_attr_fmtp_is_annexb_set * Description: Gives the value of the fmtp attribute annexb type parameter * for the given attribute. @@ -7096,69 +4476,6 @@ uint16_t sdp_attr_get_xcap_payload_type (sdp_t *sdp_p, uint16_t level, } -/* Function: sdp_attr_set_xcap_media_type - * Description: Sets the value of the media type parameter for the X-cap - * attribute line. - * Note: cap_num is not specified. It must be zero. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * inst_num The attribute instance number to check. - * media Media type for the X-cap attribute. - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER - */ -sdp_result_e sdp_attr_set_xcap_media_type (sdp_t *sdp_p, uint16_t level, - uint16_t inst_num, sdp_media_e media) -{ - sdp_attr_t *attr_p; - sdp_mca_t *cap_p; - - attr_p = sdp_find_attr(sdp_p, level, 0, SDP_ATTR_X_CAP, inst_num); - if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s X-cap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - cap_p = attr_p->attr.cap_p; - cap_p->media = media; - return (SDP_SUCCESS); -} - -/* Function: sdp_attr_set_xcap_transport_type - * Description: Sets the value of the transport type parameter for the X-cap - * attribute line. - * Note: cap_num is not specified. It must be zero. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * inst_num The attribute instance number to check. - * transport Transport type for the X-cap attribute. - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER - */ -sdp_result_e sdp_attr_set_xcap_transport_type(sdp_t *sdp_p, uint16_t level, - uint16_t inst_num, - sdp_transport_e transport) -{ - sdp_attr_t *attr_p; - sdp_mca_t *cap_p; - - attr_p = sdp_find_attr(sdp_p, level, 0, SDP_ATTR_X_CAP, inst_num); - if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s X-cap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - cap_p = attr_p->attr.cap_p; - cap_p->transport = transport; - return (SDP_SUCCESS); -} - /* Function: sdp_attr_add_xcap_payload_type * Description: Add a new payload type for the X-cap attribute line * specified. The new payload type will be added at the end @@ -7389,68 +4706,6 @@ uint16_t sdp_attr_get_cdsc_payload_type (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_attr_set_cdsc_media_type - * Description: Sets the value of the media type parameter for the CDSC - * attribute line. - * Note: cap_num is not specified. It must be zero. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * inst_num The attribute instance number to check. - * media Media type for the CDSC attribute. - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER - */ -sdp_result_e sdp_attr_set_cdsc_media_type (sdp_t *sdp_p, uint16_t level, - uint16_t inst_num, sdp_media_e media) -{ - sdp_attr_t *attr_p; - sdp_mca_t *cdsc_p; - - attr_p = sdp_find_attr(sdp_p, level, 0, SDP_ATTR_CDSC, inst_num); - if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s CDSC attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - cdsc_p = attr_p->attr.cap_p; - cdsc_p->media = media; - return (SDP_SUCCESS); -} - -/* Function: sdp_attr_set_cdsc_transport_type - * Description: Sets the value of the transport type parameter for the CDSC - * attribute line. - * Note: cap_num is not specified. It must be zero. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * inst_num The attribute instance number to check. - * transport Transport type for the CDSC attribute. - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER - */ -sdp_result_e sdp_attr_set_cdsc_transport_type (sdp_t *sdp_p, uint16_t level, - uint16_t inst_num, sdp_transport_e transport) -{ - sdp_attr_t *attr_p; - sdp_mca_t *cdsc_p; - - attr_p = sdp_find_attr(sdp_p, level, 0, SDP_ATTR_CDSC, inst_num); - if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s CDSC attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - cdsc_p = attr_p->attr.cap_p; - cdsc_p->transport = transport; - return (SDP_SUCCESS); -} - /* Function: sdp_attr_add_cdsc_payload_type * Description: Add a new payload type for the CDSC attribute line * specified. The new payload type will be added at the end @@ -7531,42 +4786,6 @@ tinybool sdp_media_dynamic_payload_valid (sdp_t *sdp_p, uint16_t payload_type, } -/* Function: sdp_attr_set_rtr_confirm - * Description: Sets the rtr confirm value a= rtr:confirm. - * If this parameter is TRUE, the confirm parameter will be - * specified when the SDP description is built. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * qos_attr The specific type of qos attribute. May be - * qos, secure, X-pc-qos, or X-qos. - * inst_num The attribute instance number to check. - * confirm New qos confirm parameter. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_rtr_confirm (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, - uint16_t inst_num, - tinybool confirm) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, SDP_ATTR_RTR, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s %s attribute, level %u instance %u " - "not found.", sdp_p->debug_str, - sdp_get_attr_name(SDP_ATTR_RTR), (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.rtr.confirm = confirm; - return (SDP_SUCCESS); - } -} - /* Function: sdp_attr_get_rtr_confirm * Description: Returns the value of the rtr attribute confirm * parameter specified for the given attribute. Returns TRUE if @@ -7618,39 +4837,6 @@ sdp_mediadir_role_e sdp_attr_get_comediadir_role (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_attr_set_comediadir_role - * Description: Sets the value of the comediadir role parameter - * for the direction attribute. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * comediadir_role The role of the comedia direction attribute - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_comediadir_role (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_mediadir_role_e comediadir_role) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_DIRECTION, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Comediadir role attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.comediadir.role = comediadir_role; - return (SDP_SUCCESS); - } -} - /* Function: sdp_attr_get_silencesupp_enabled * Description: Returns the value of the silencesupp attribute enable * parameter specified for the given attribute. Returns TRUE if @@ -7815,173 +5001,6 @@ uint8_t sdp_attr_get_silencesupp_fxnslevel (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_attr_set_silencesupp_enabled - * Description: Sets the silencesupp enable value - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * confirm New silencesupp enable parameter. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_silencesupp_enabled (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - tinybool enable) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SILENCESUPP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s silenceSuppEnable attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.silencesupp.enabled = enable; - return (SDP_SUCCESS); - } -} - -/* Function: sdp_attr_set_silencesupp_timer - * Description: Sets the silencesupp timer value - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * value New silencesupp timer parameter. - * null_ind if TRUE, timer value is set to "-" instead of - * the 16 bit numeric value - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_silencesupp_timer (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t value, tinybool null_ind) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SILENCESUPP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s silenceTimer attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.silencesupp.timer = value; - attr_p->attr.silencesupp.timer_null = null_ind; - return (SDP_SUCCESS); - } -} - -/* Function: sdp_attr_set_silencesupp_pref - * Description: Sets the silencesupp supppref value - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * pref New silencesupp supppref parameter. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_silencesupp_pref (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_silencesupp_pref_e pref) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SILENCESUPP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s silence SuppPref attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.silencesupp.pref = pref; - return (SDP_SUCCESS); - } -} - -/* Function: sdp_attr_set_silencesupp_siduse - * Description: Sets the silencesupp supppref value - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * siduse New silencesupp siduse parameter. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_silencesupp_siduse (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_silencesupp_siduse_e siduse) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SILENCESUPP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s silence sidUse attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.silencesupp.siduse = siduse; - return (SDP_SUCCESS); - } -} - -/* Function: sdp_attr_set_silencesupp_fxnslevel - * Description: Sets the silencesupp timer value - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * value New silencesupp timer parameter. - * null_ind if TRUE, timer value is set to "-" instead of - * the 16 bit numeric value - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_silencesupp_fxnslevel (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t value, tinybool null_ind) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SILENCESUPP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s silenceTimer attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.silencesupp.fxnslevel = (uint8_t)value; - attr_p->attr.silencesupp.fxnslevel_null = null_ind; - return (SDP_SUCCESS); - } -} - - /* Function: sdp_attr_get_mptime_num_intervals * Description: Returns the number of intervals specified for the * given mptime attribute. If the given attribute is not @@ -8144,36 +5163,6 @@ sdp_group_attr_e sdp_get_group_attr (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_set_group_attr - * Description: Sets the value of the group attribute for the - * a=group: line. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level SDP_SESSION_LEVEL - * group_attr group attribute value ( LS/FID ). - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER/SDP_INVALID_SDP_PTR -*/ - -sdp_result_e sdp_set_group_attr (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_group_attr_e group_attr) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_GROUP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Group attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.stream_data.group_attr = group_attr; - return (SDP_SUCCESS); - } -} - /* Function: sdp_get_group_num_id * Description: Returns the number of ids from the a=group:<> line. * Parameters: sdp_p The SDP handle returned by sdp_init_description. @@ -8204,45 +5193,6 @@ uint16_t sdp_get_group_num_id (sdp_t *sdp_p, uint16_t level, return (attr_p->attr.stream_data.num_group_id); } -/* Function: sdp_set_group_num_id - * Description: Sets the number og group ids that would be added on - * a=group: ...line. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level SDP_SESSION_LEVEL - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER/SDP_INVALID_SDP_PTR - * Note: The application must call this API to set the number of group - * ids to be provided before actually setting the group ids on - * the a=group line. -*/ - -sdp_result_e sdp_set_group_num_id (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - uint16_t group_num_id) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_GROUP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Group attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else if ((group_num_id == 0) || (group_num_id > SDP_MAX_MEDIA_STREAMS)){ - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Number of group id value provided - %u is invalid", - sdp_p->debug_str, (unsigned)group_num_id); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.stream_data.num_group_id = group_num_id; - return (SDP_SUCCESS); - } -} - /* Function: sdp_get_group_id * Description: Returns the group id from the a=group:<> line. * Parameters: sdp_p The SDP handle returned by sdp_init_description. @@ -8279,45 +5229,6 @@ const char* sdp_get_group_id (sdp_t *sdp_p, uint16_t level, return (attr_p->attr.stream_data.group_ids[id_num-1]); } -/* Function: sdp_set_group_id - * Description: Adds a group ID to the a=group: ...line. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level SDP_SESSION_LEVEL - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER/SDP_INVALID_SDP_PTR -*/ - -sdp_result_e sdp_set_group_id (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - char* group_id) -{ - sdp_attr_t *attr_p; - uint16_t num_group_id; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_GROUP, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Group attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - num_group_id = attr_p->attr.stream_data.num_group_id; - if (num_group_id == SDP_MAX_MEDIA_STREAMS) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Max number of Group Ids already defined " - "for this group line %u", sdp_p->debug_str, (unsigned)level); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - attr_p->attr.stream_data.group_ids[num_group_id] = cpr_strdup(group_id); - attr_p->attr.stream_data.num_group_id++; - return (SDP_SUCCESS); - } -} - /* Function: sdp_attr_get_x_sidin * Description: Returns the attribute parameter from the a=X-sidin:<> * line. If no attrib has been set NULL will be returned. @@ -8352,42 +5263,6 @@ const char* sdp_attr_get_x_sidin (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_attr_set_x_sidin - * Description: Sets the value of the X-sidin parameter - * for the given attribute. The address is copied into the - * SDP structure so application memory will not be - * referenced by the SDP lib. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * sidin Ptr to the sidin string - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_x_sidin (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - const char *sidin) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_X_SIDIN, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s X-sidin attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - sstrncpy(attr_p->attr.stream_data.x_sidin, sidin, - sizeof(attr_p->attr.stream_data.x_sidin)) ; - return (SDP_SUCCESS); - } -} - /* Function: sdp_attr_get_x_sidout * Description: Returns the attribute parameter from the a=X-sidout:<> * line. If no attrib has been set NULL will be returned. @@ -8422,42 +5297,6 @@ const char* sdp_attr_get_x_sidout (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_attr_set_x_sidout - * Description: Sets the value of the x-sidout parameter - * for the given attribute. The address is copied into the - * SDP structure so application memory will not be - * referenced by the SDP lib. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * sidout Ptr to the sidout string. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_x_sidout (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - const char *sidout) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_X_SIDOUT, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s X-sidout attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - sstrncpy(attr_p->attr.stream_data.x_sidout, sidout, - sizeof(attr_p->attr.stream_data.x_sidout)) ; - return (SDP_SUCCESS); - } -} - /* Function: sdp_attr_get_x_confid * Description: Returns the attribute parameter from the a=X-confid:<> * line. If no attrib has been set NULL will be returned. @@ -8492,144 +5331,6 @@ const char* sdp_attr_get_x_confid (sdp_t *sdp_p, uint16_t level, } } -/* Function: sdp_attr_set_x_confid - * Description: Sets the value of the X-confid parameter - * for the given attribute. The address is copied into the - * SDP structure so application memory will not be - * referenced by the SDP lib. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * confid Ptr to the confid string. - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ -sdp_result_e sdp_attr_set_x_confid (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - const char *confid) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_X_CONFID, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s X-confid attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - sstrncpy(attr_p->attr.stream_data.x_confid, confid, - sizeof(attr_p->attr.stream_data.x_confid)) ; - return (SDP_SUCCESS); - } -} - -/* Function: sdp_set_source_filter - * Description: Sets the value of the source filter attribute for the - * a=source-filter: line. - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level SDP_SESSION_LEVEL/Media level - * mode Filter-mode (incl/excl) - * nettype Network type - * addrtype Address type of the destination - * dest_addr Destination unicast/multicast address - * (ip-addr/ fqdn/ *) - * src_addr One of the source address to which the filter - * applies, i.e. process/drop the packets. - * (More source addresses are added using - * sdp_include_new_filter_src_addr) - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER/SDP_INVALID_SDP_PTR - */ -sdp_result_e -sdp_set_source_filter (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, - uint16_t inst_num, sdp_src_filter_mode_e mode, - sdp_nettype_e nettype, sdp_addrtype_e addrtype, - const char *dest_addr, const char *src_addr) -{ - sdp_attr_t *attr_p; - uint16_t index; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SOURCE_FILTER, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Source filter attribute, level %u instance %u " - "not found", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - attr_p->attr.source_filter.mode = mode; - attr_p->attr.source_filter.nettype = nettype; - attr_p->attr.source_filter.addrtype = addrtype; - sstrncpy(attr_p->attr.source_filter.dest_addr, dest_addr, - SDP_MAX_STRING_LEN+1); - if (src_addr) { - index = attr_p->attr.source_filter.num_src_addr; - sstrncpy(attr_p->attr.source_filter.src_list[index], - src_addr,SDP_MAX_STRING_LEN+1); - /* Increment source list count if the api was invoked for - * first time or else we're basically replacing the index 0 - * element in src-list. - */ - ++attr_p->attr.source_filter.num_src_addr; - SDP_PRINT("%s Source address (%s) number %d added to source filter", - sdp_p->debug_str,src_addr, - attr_p->attr.source_filter.num_src_addr); - - } - - return (SDP_SUCCESS); -} - -/* Function: sdp_include_new_filter_src_addr - * Description: Adds source addresses to the list to which the filter applies - * This is to be invoked only as follow-up to - * sdp_set_source_filter() to include more source addresses - * Parameters: sdp_p The SDP handle to which the filter attributes - * were added using sdp_set_source_filter - * level SDP_SESSION_LEVEL/Media level - * src_addr Source address to be added to the list - * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER/SDP_INVALID_SDP_PTR - */ - -sdp_result_e -sdp_include_new_filter_src_addr (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, - uint16_t inst_num, const char *src_addr) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SOURCE_FILTER, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Source filter attribute, level %u instance %u " - "not found", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - if (attr_p->attr.source_filter.num_src_addr >= SDP_MAX_SRC_ADDR_LIST) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Max number of source addresses included for " - "filter for the instance %u", sdp_p->debug_str, - (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_FAILURE); - } - sstrncpy(attr_p->attr.source_filter.src_list[ - attr_p->attr.source_filter.num_src_addr], - src_addr, SDP_MAX_STRING_LEN+1); - ++attr_p->attr.source_filter.num_src_addr; - - return (SDP_SUCCESS); -} - /* Function: sdp_get_source_filter_mode * Description: Gets the filter mode in internal representation * Parameters: sdp_p The SDP handle which contains the attributes @@ -8763,31 +5464,6 @@ sdp_get_filter_source_address (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, return (SDP_SUCCESS); } -sdp_result_e -sdp_set_rtcp_unicast_mode (sdp_t *sdp_p, uint16_t level, uint8_t cap_num, - uint16_t inst_num, sdp_rtcp_unicast_mode_e mode) -{ - sdp_attr_t *attr_p; - - if (mode >= SDP_RTCP_MAX_UNICAST_MODE) { - return (SDP_INVALID_PARAMETER); - } - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_RTCP_UNICAST, inst_num); - - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s RTCP Unicast attribute, level %u instance %u " - "not found", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - attr_p->attr.u32_val = mode; - - return (SDP_SUCCESS); -} - sdp_rtcp_unicast_mode_e sdp_get_rtcp_unicast_mode(sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num) @@ -9292,426 +5968,6 @@ sdp_attr_get_srtp_crypto_selection_flags (sdp_t *sdp_p, -/* Function: sdp_attr_set_sdescriptions_tag - * Description: Sets the sdescriptions tag parameter - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * tag_num tag - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ - -sdp_result_e -sdp_attr_set_sdescriptions_tag (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - int32_t tag_num) -{ - sdp_attr_t *attr_p; - - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SDESCRIPTIONS, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s srtp attribute tag, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } else { - attr_p->attr.srtp_context.tag = tag_num; - return (SDP_SUCCESS); - } -} - - -/* Function: sdp_attr_set_sdescriptions_crypto_suite - * Description: Sets the sdescriptions crypto suite parameter. Note that - * this is a common api for both version 2 and version 9 - * sdescriptions. It has no knowledge which version is being - * used so it will first try to find if a version 2 sdescriptions - * attribute is present. If it is, it will set the crypto suite - * for version 2. If it's not, try to find version 9. This assumes - * you cannot have both versions in the same SDP. - * - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * crypto_suite crypto suite - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ - -sdp_result_e -sdp_attr_set_sdescriptions_crypto_suite (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - sdp_srtp_crypto_suite_t crypto_suite) -{ - sdp_attr_t *attr_p; - int i; - - /* Try to find version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SRTP_CONTEXT, inst_num); - if (attr_p == NULL) { - - /* Version 2 not found, try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SDESCRIPTIONS, inst_num); - if (attr_p == NULL) { - - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s srtp attribute suite, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return SDP_INVALID_PARAMETER; - } - } - - attr_p->attr.srtp_context.suite = crypto_suite; - for (i=0; i < SDP_SRTP_MAX_NUM_CRYPTO_SUITES; i++) { - /* For the specified crypto suite, get the size of the - * key and salt. - */ - if (sdp_srtp_crypto_suite_array[i].crypto_suite_val == - crypto_suite) { - - attr_p->attr.srtp_context.master_key_size_bytes = - sdp_srtp_crypto_suite_array[i].key_size_bytes; - - attr_p->attr.srtp_context.master_salt_size_bytes = - sdp_srtp_crypto_suite_array[i].salt_size_bytes; - - } - } - - return SDP_SUCCESS; - -} - - -/* Function: sdp_attr_set_sdescriptions_key - * Description: Sets the sdescriptions key parameter. Note that - * this is a common api for both version 2 and version 9 - * sdescriptions. It has no knowledge which version is being - * used so it will first try to find if a version 2 sdescriptions - * attribute is present. If it is, it will set the key for - * version 2. If it's not, try to find version 9. This assumes - * you cannot have both versions in the same SDP. - * - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * key buffer containing the key assumes null terminated - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ - -sdp_result_e -sdp_attr_set_sdescriptions_key (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - char *key) -{ - sdp_attr_t *attr_p; - - - /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SRTP_CONTEXT, inst_num); - if (attr_p == NULL) { - /* Couldn't find version 2 try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SDESCRIPTIONS, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s srtp attribute key, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return SDP_INVALID_PARAMETER; - } - - } - - memcpy(attr_p->attr.srtp_context.master_key, - key, - SDP_SRTP_MAX_KEY_SIZE_BYTES); - - return SDP_SUCCESS; - -} - - -/* Function: sdp_attr_set_sdescriptions_salt - * Description: Sets the sdescriptions salt parameter. Note that - * this is a common api for both version 2 and version 9 - * sdescriptions. It has no knowledge which version is being - * used so it will first try to find if a version 2 sdescriptions - * attribute is present. If it is, it will set the salt for - * version 2. If it's not, try to find version 9. This assumes - * you cannot have both versions in the same SDP. - * - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * salt buffer containing the salt assumes null terminated - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ - -sdp_result_e -sdp_attr_set_sdescriptions_salt (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - char *salt) -{ - sdp_attr_t *attr_p; - - - /* Try to find version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SRTP_CONTEXT, inst_num); - if (attr_p == NULL) { - /* Couldn't find version 2, try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SDESCRIPTIONS, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s srtp attribute salt, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - } - - memcpy(attr_p->attr.srtp_context.master_salt, - salt, - SDP_SRTP_MAX_SALT_SIZE_BYTES); - - return SDP_SUCCESS; -} - - -/* Function: sdp_attr_set_sdescriptions_lifetime - * Description: Sets the sdescriptions lifetime parameter. Note that - * this is a common api for both version 2 and version 9 - * sdescriptions. It has no knowledge which version is being - * used so it will first try to find if a version 2 sdescriptions - * attribute is present. If it is, it will set the lifetime for - * version 2. If it's not, try to find version 9. This assumes - * you cannot have both versions in the same SDP. - * - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * lifetime buffer containing the lifetime assumes null terminated - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ - -sdp_result_e -sdp_attr_set_sdescriptions_lifetime (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - char *lifetime) -{ - sdp_attr_t *attr_p; - - /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SRTP_CONTEXT, inst_num); - if (attr_p == NULL) { - /* Couldn't find version 2, try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SDESCRIPTIONS, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s srtp lifetime attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return SDP_INVALID_PARAMETER; - } - - } - - sstrncpy((char*)attr_p->attr.srtp_context.master_key_lifetime, lifetime, - SDP_SRTP_MAX_LIFETIME_BYTES); - return SDP_SUCCESS; - -} - - -/* Function: sdp_attr_set_sdescriptions_mki - * Description: Sets the sdescriptions mki parameter compose of the MKI - * value and length. Note that this is a common api for both - * version 2 and version 9 sdescriptions. It has no knowledge - * which version is being used so it will first try to find if - * a version 2 sdescriptions attribute is present. If it is, it will - * set the lifetime for version 2. If it's not, try to find version 9. - * This assumes you cannot have both versions in the same SDP. - * - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * mki_value buffer containing the mki value. Assumes null - * terminated buffer. - * mki_length length of the MKI - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ - -sdp_result_e -sdp_attr_set_sdescriptions_mki (sdp_t *sdp_p, uint16_t level, - uint8_t cap_num, uint16_t inst_num, - char *mki_value, - uint16_t mki_length) -{ - sdp_attr_t *attr_p; - - /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SRTP_CONTEXT, inst_num); - if (attr_p == NULL) { - /* Couldn't find version 2, try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SDESCRIPTIONS, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s srtp MKI attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return SDP_INVALID_PARAMETER; - } - } - - sstrncpy((char*)attr_p->attr.srtp_context.mki, mki_value, - SDP_SRTP_MAX_MKI_SIZE_BYTES); - attr_p->attr.srtp_context.mki_size_bytes = mki_length; - return SDP_SUCCESS; - -} - - -/* Function: sdp_attr_set_sdescriptions_key_size - * Description: Sets the sdescriptions key size parameter. Note that - * this is a common api for both version 2 and version 9 - * sdescriptions. It has no knowledge which version is being - * used so it will first try to find if a version 2 sdescriptions - * attribute is present. If it is, it will set the key for - * version 2. If it's not, try to find version 9. This assumes - * you cannot have both versions in the same SDP. - * - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * key_size key size - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ - -sdp_result_e -sdp_attr_set_sdescriptions_key_size (sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - unsigned char key_size) - -{ - - sdp_attr_t *attr_p; - - /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SRTP_CONTEXT, inst_num); - if (attr_p == NULL) { - /* Couldn't find version 2, try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SDESCRIPTIONS, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s srtp MKI attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return SDP_INVALID_PARAMETER; - } - } - - attr_p->attr.srtp_context.master_key_size_bytes = key_size; - return SDP_SUCCESS; - -} - - -/* Function: sdp_attr_set_sdescriptions_key_size - * Description: Sets the sdescriptions salt size parameter. Note that - * this is a common api for both version 2 and version 9 - * sdescriptions. It has no knowledge which version is being - * used so it will first try to find if a version 2 sdescriptions - * attribute is present. If it is, it will set the salt for - * version 2. If it's not, try to find version 9. This assumes - * you cannot have both versions in the same SDP. - * - * Parameters: sdp_p The SDP handle returned by sdp_init_description. - * level The level to check for the attribute. - * cap_num The capability number associated with the - * attribute if any. If none, should be zero. - * inst_num The attribute instance number to check. - * salt_size salt size - * Returns: SDP_SUCCESS Attribute param was set successfully. - * SDP_INVALID_PARAMETER Specified attribute is not defined. - */ - -sdp_result_e -sdp_attr_set_sdescriptions_salt_size (sdp_t *sdp_p, - uint16_t level, - uint8_t cap_num, - uint16_t inst_num, - unsigned char salt_size) -{ - - sdp_attr_t *attr_p; - - /* Try version 2 first */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SRTP_CONTEXT, inst_num); - if (attr_p == NULL) { - /* Couldn't find version 2, try version 9 */ - attr_p = sdp_find_attr(sdp_p, level, cap_num, - SDP_ATTR_SDESCRIPTIONS, inst_num); - if (attr_p == NULL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s srtp MKI attribute, level %u instance %u " - "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); - } - sdp_p->conf_p->num_invalid_param++; - return SDP_INVALID_PARAMETER; - } - } - - attr_p->attr.srtp_context.master_salt_size_bytes = salt_size; - return SDP_SUCCESS; - -} - - /* Function: sdp_find_rtcp_fb_attr * Description: Helper to find the nth instance of a rtcp-fb attribute of * the specified feedback type.