- Timestamp:
- Dec 28, 2007 8:51:58 AM (17 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/errno.h
r1417 r1639 149 149 */ 150 150 #define PJMEDIA_SDP_EINRTCP (PJMEDIA_ERRNO_START+35) /* 220035 */ 151 /** 152 * @hideinitializer 153 * Invalid SDP media transport protocol. 154 */ 155 #define PJMEDIA_SDP_EINPROTO (PJMEDIA_ERRNO_START+36) /* 220036 */ 151 156 152 157 -
pjproject/trunk/pjmedia/include/pjmedia/stream.h
r1615 r1639 90 90 { 91 91 pjmedia_type type; /**< Media type (audio, video) */ 92 pjmedia_tp_proto proto; /**< Transport protocol (RTP/AVP, etc.) */ 92 93 pjmedia_dir dir; /**< Media direction. */ 93 94 pj_sockaddr rem_addr; /**< Remote RTP address */ -
pjproject/trunk/pjmedia/include/pjmedia/types.h
r1615 r1639 68 68 } pjmedia_type; 69 69 70 71 /** 72 * Media transport protocol. 73 */ 74 typedef enum pjmedia_tp_proto 75 { 76 /** No transport type */ 77 PJMEDIA_TP_PROTO_NONE = 0, 78 79 /** RTP using A/V profile */ 80 PJMEDIA_TP_PROTO_RTP_AVP, 81 82 /** Secure RTP */ 83 PJMEDIA_TP_PROTO_RTP_SAVP, 84 85 /** Unknown */ 86 PJMEDIA_TP_PROTO_UNKNOWN 87 88 } pjmedia_tp_proto; 70 89 71 90 -
pjproject/trunk/pjmedia/src/pjmedia/errno.c
r1202 r1639 59 59 PJ_BUILD_ERR( PJMEDIA_SDP_EINFMTP, "Invalid SDP fmtp attribute" ), 60 60 PJ_BUILD_ERR( PJMEDIA_SDP_EINRTCP, "Invalid SDP rtcp attribyte" ), 61 PJ_BUILD_ERR( PJMEDIA_SDP_EINPROTO, "Invalid SDP media transport protocol" ), 61 62 62 63 /* SDP negotiator errors. */ -
pjproject/trunk/pjmedia/src/pjmedia/session.c
r1615 r1639 54 54 static const pj_str_t ID_IP4 = { "IP4", 3}; 55 55 static const pj_str_t ID_IP6 = { "IP6", 3}; 56 /*static const pj_str_t ID_RTP_AVP = { "RTP/AVP", 7 };*/ 57 /*static const pj_str_t ID_SDP_NAME = { "pjmedia", 7 };*/ 56 static const pj_str_t ID_RTP_AVP = { "RTP/AVP", 7 }; 57 static const pj_str_t ID_RTP_SAVP = { "RTP/SAVP", 8 }; 58 //static const pj_str_t ID_SDP_NAME = { "pjmedia", 7 }; 58 59 static const pj_str_t ID_RTPMAP = { "rtpmap", 6 }; 59 60 static const pj_str_t ID_TELEPHONE_EVENT = { "telephone-event", 15 }; … … 181 182 } 182 183 184 /* Transport protocol */ 185 183 186 /* Transport type must be equal */ 184 187 if (pj_stricmp(&rem_m->desc.transport, … … 188 191 return PJMEDIA_SDPNEG_EINVANSTP; 189 192 } 193 194 if (pj_stricmp(&local_m->desc.transport, &ID_RTP_AVP) == 0) { 195 196 si->proto = PJMEDIA_TP_PROTO_RTP_AVP; 197 198 } else if (pj_stricmp(&local_m->desc.transport, &ID_RTP_SAVP) == 0) { 199 200 si->proto = PJMEDIA_TP_PROTO_RTP_SAVP; 201 202 } else { 203 204 si->proto = PJMEDIA_TP_PROTO_UNKNOWN; 205 return PJMEDIA_SDP_EINPROTO; 206 } 207 190 208 191 209 /* Check address family in remote SDP */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r1636 r1639 885 885 const pjmedia_sdp_session *remote_sdp) 886 886 { 887 unsigned i; 887 888 int prev_media_st = 0; 888 889 pjsua_call *call = &pjsua_var.calls[call_id]; 889 890 pjmedia_session_info sess_info; 891 pjmedia_stream_info *si = NULL; 890 892 pjmedia_port *media_port; 891 893 pj_str_t port_name; … … 898 900 899 901 /* Create media session info based on SDP parameters. 900 * We only support one stream per session at the moment901 902 */ 902 903 status = pjmedia_session_info_from_sdp( call->inv->dlg->pool, 903 904 pjsua_var.med_endpt, 904 1,&sess_info,905 PJMEDIA_MAX_SDP_MEDIA, &sess_info, 905 906 local_sdp, remote_sdp); 906 907 if (status != PJ_SUCCESS) 907 908 return status; 908 909 910 /* Find which session is audio (we only support audio for now) */ 911 for (i=0; i < sess_info.stream_cnt; ++i) { 912 if (sess_info.stream_info[i].type == PJMEDIA_TYPE_AUDIO && 913 sess_info.stream_info[i].proto == PJMEDIA_TP_PROTO_RTP_AVP) 914 { 915 si = &sess_info.stream_info[i]; 916 break; 917 } 918 } 919 920 if (si == NULL) { 921 /* Not found */ 922 return PJMEDIA_EINVALIMEDIATYPE; 923 } 924 925 926 /* Reset session info with only one media stream */ 927 sess_info.stream_cnt = 1; 928 if (si != &sess_info.stream_info[0]) 929 pj_memcpy(&sess_info.stream_info[0], si, sizeof(pjmedia_stream_info)); 909 930 910 931 /* Check if media is put on-hold */ 911 if (sess_info.stream_cnt == 0 || 912 sess_info.stream_info[0].dir == PJMEDIA_DIR_NONE) 932 if (sess_info.stream_cnt == 0 || si->dir == PJMEDIA_DIR_NONE) 913 933 { 914 934 … … 944 964 /* Override ptime, if this option is specified. */ 945 965 if (pjsua_var.media_cfg.ptime != 0) { 946 s ess_info.stream_info[0].param->setting.frm_per_pkt = (pj_uint8_t)947 (pjsua_var.media_cfg.ptime / s ess_info.stream_info[0].param->info.frm_ptime);948 if (s ess_info.stream_info[0].param->setting.frm_per_pkt == 0)949 s ess_info.stream_info[0].param->setting.frm_per_pkt = 1;966 si->param->setting.frm_per_pkt = (pj_uint8_t) 967 (pjsua_var.media_cfg.ptime / si->param->info.frm_ptime); 968 if (si->param->setting.frm_per_pkt == 0) 969 si->param->setting.frm_per_pkt = 1; 950 970 } 951 971 952 972 /* Disable VAD, if this option is specified. */ 953 973 if (pjsua_var.media_cfg.no_vad) { 954 s ess_info.stream_info[0].param->setting.vad = 0;974 si->param->setting.vad = 0; 955 975 } 956 976 … … 959 979 * (such as jitter buffer parameters, codec ptime, etc.) 960 980 */ 961 s ess_info.stream_info[0].jb_init = pjsua_var.media_cfg.jb_init;962 s ess_info.stream_info[0].jb_min_pre = pjsua_var.media_cfg.jb_min_pre;963 s ess_info.stream_info[0].jb_max_pre = pjsua_var.media_cfg.jb_max_pre;964 s ess_info.stream_info[0].jb_max = pjsua_var.media_cfg.jb_max;981 si->jb_init = pjsua_var.media_cfg.jb_init; 982 si->jb_min_pre = pjsua_var.media_cfg.jb_min_pre; 983 si->jb_max_pre = pjsua_var.media_cfg.jb_max_pre; 984 si->jb_max = pjsua_var.media_cfg.jb_max; 965 985 966 986 /* Set SSRC */ 967 s ess_info.stream_info[0].ssrc = call->ssrc;987 si->ssrc = call->ssrc; 968 988 969 989 /* Create session based on session info. */ … … 1010 1030 /* Call's media state is active */ 1011 1031 call->media_st = PJSUA_CALL_MEDIA_ACTIVE; 1012 call->media_dir = s ess_info.stream_info[0].dir;1032 call->media_dir = si->dir; 1013 1033 } 1014 1034
Note: See TracChangeset
for help on using the changeset viewer.