Changeset 3360 for pjproject/trunk
- Timestamp:
- Nov 3, 2010 6:46:27 AM (14 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/endpoint.h
r2506 r3360 43 43 44 44 PJ_BEGIN_DECL 45 46 /** 47 * This enumeration describes various flags that can be set or retrieved in 48 * the media endpoint, by using pjmedia_endpt_set_flag() and 49 * pjmedia_endpt_get_flag() respectively. 50 */ 51 typedef enum pjmedia_endpt_flag 52 { 53 /** 54 * This flag controls whether telephony-event should be offered in SDP. 55 * Value is boolean. 56 */ 57 PJMEDIA_ENDPT_HAS_TELEPHONE_EVENT_FLAG 58 59 } pjmedia_endpt_flag; 45 60 46 61 … … 74 89 PJ_DECL(pj_status_t) pjmedia_endpt_destroy(pjmedia_endpt *endpt); 75 90 76 91 /** 92 * Change the value of a flag. 93 * 94 * @param endpt Media endpoint. 95 * @param flag The flag. 96 * @param value Pointer to the value to be set. 97 * 98 * @reurn PJ_SUCCESS on success. 99 */ 100 PJ_DECL(pj_status_t) pjmedia_endpt_set_flag(pjmedia_endpt *endpt, 101 pjmedia_endpt_flag flag, 102 const void *value); 103 104 /** 105 * Retrieve the value of a flag. 106 * 107 * @param endpt Media endpoint. 108 * @param flag The flag. 109 * @param value Pointer to store the result. 110 * 111 * @return PJ_SUCCESS on success. 112 */ 113 PJ_DECL(pj_status_t) pjmedia_endpt_get_flag(pjmedia_endpt *endpt, 114 pjmedia_endpt_flag flag, 115 void *value); 77 116 78 117 /** -
pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
r3204 r3360 88 88 /** To signal polling thread to quit. */ 89 89 pj_bool_t quit_flag; 90 91 /** Is telephone-event enable */ 92 pj_bool_t has_telephone_event; 90 93 }; 91 94 … … 121 124 endpt->ioqueue = ioqueue; 122 125 endpt->thread_cnt = worker_cnt; 126 endpt->has_telephone_event = PJ_TRUE; 123 127 124 128 /* Sound */ … … 222 226 } 223 227 228 PJ_DEF(pj_status_t) pjmedia_endpt_set_flag( pjmedia_endpt *endpt, 229 pjmedia_endpt_flag flag, 230 const void *value) 231 { 232 PJ_ASSERT_RETURN(endpt, PJ_EINVAL); 233 234 switch (flag) { 235 case PJMEDIA_ENDPT_HAS_TELEPHONE_EVENT_FLAG: 236 endpt->has_telephone_event = *(pj_bool_t*)value; 237 break; 238 default: 239 return PJ_EINVAL; 240 } 241 242 return PJ_SUCCESS; 243 } 244 245 PJ_DEF(pj_status_t) pjmedia_endpt_get_flag( pjmedia_endpt *endpt, 246 pjmedia_endpt_flag flag, 247 void *value) 248 { 249 PJ_ASSERT_RETURN(endpt, PJ_EINVAL); 250 251 switch (flag) { 252 case PJMEDIA_ENDPT_HAS_TELEPHONE_EVENT_FLAG: 253 *(pj_bool_t*)value = endpt->has_telephone_event; 254 break; 255 default: 256 return PJ_EINVAL; 257 } 258 259 return PJ_SUCCESS; 260 } 224 261 225 262 /** … … 490 527 #if defined(PJMEDIA_RTP_PT_TELEPHONE_EVENTS) && \ 491 528 PJMEDIA_RTP_PT_TELEPHONE_EVENTS != 0 492 493 529 /* 494 530 * Add support telephony event 495 531 */ 496 m->desc.fmt[m->desc.fmt_count++] = 497 pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR); 498 499 /* Add rtpmap. */ 500 attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); 501 attr->name = pj_str("rtpmap"); 502 attr->value = pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR 503 " telephone-event/8000"); 504 m->attr[m->attr_count++] = attr; 505 506 /* Add fmtp */ 507 attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); 508 attr->name = pj_str("fmtp"); 509 attr->value = pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR " 0-15"); 510 m->attr[m->attr_count++] = attr; 532 if (endpt->has_telephone_event) { 533 m->desc.fmt[m->desc.fmt_count++] = 534 pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR); 535 536 /* Add rtpmap. */ 537 attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); 538 attr->name = pj_str("rtpmap"); 539 attr->value = pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR 540 " telephone-event/8000"); 541 m->attr[m->attr_count++] = attr; 542 543 /* Add fmtp */ 544 attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); 545 attr->name = pj_str("fmtp"); 546 attr->value = pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR " 0-15"); 547 m->attr[m->attr_count++] = attr; 548 } 511 549 #endif 512 550
Note: See TracChangeset
for help on using the changeset viewer.