diff options
author | Benny Prijono <bennylp@teluu.com> | 2012-03-22 09:56:52 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2012-03-22 09:56:52 +0000 |
commit | ed4644930dd8a74bcf4d4a89298a907643bd5d30 (patch) | |
tree | d2244ba52cc6fe2eb3dff9732a39b9b11eea825f /pjsip/src/pjsua-lib/pjsua_call.c | |
parent | 5bef8e17b3b0ffcfa59ad195787c956903b81978 (diff) |
Re: #1463 (Third party media support). Tnitial work and it works, tested on Linux. Details:
* add PJSUA_MEDIA_HAS_PJMEDIA macro
* move pjmedia specific implementation in pjsua_media.c and pjsua_call.c into pjsua_aud.c
* add pjsip-apps/src/third_party_media sample containing:
- alt_pjsua_aud.c
- alt_pjsua_vid.c
* moved pjmedia_vid_stream_info_from_sdp() into pjmedia/vid_stream_info.c
* moved pjmedia_stream_info_from_sdp() into pjmedia/stream_info.c
* misc: fixed mips_test.c if codecs are disabled
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3982 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib/pjsua_call.c')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_call.c | 178 |
1 files changed, 0 insertions, 178 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index a1f2a3a1..38ef3b9d 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -1389,18 +1389,6 @@ PJ_DEF(pj_bool_t) pjsua_call_is_active(pjsua_call_id call_id) } -/* - * Check if call has an active media session. - */ -PJ_DEF(pj_bool_t) pjsua_call_has_media(pjsua_call_id call_id) -{ - pjsua_call *call = &pjsua_var.calls[call_id]; - PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls, - PJ_EINVAL); - return call->audio_idx >= 0 && call->media[call->audio_idx].strm.a.stream; -} - - /* Acquire lock to the specified call_id */ pj_status_t acquire_call(const char *title, pjsua_call_id call_id, @@ -1478,36 +1466,6 @@ pj_status_t acquire_call(const char *title, /* - * Get the conference port identification associated with the call. - */ -PJ_DEF(pjsua_conf_port_id) pjsua_call_get_conf_port(pjsua_call_id call_id) -{ - pjsua_call *call; - pjsua_conf_port_id port_id = PJSUA_INVALID_ID; - - PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls, - PJ_EINVAL); - - /* Use PJSUA_LOCK() instead of acquire_call(): - * https://trac.pjsip.org/repos/ticket/1371 - */ - PJSUA_LOCK(); - - if (!pjsua_call_is_active(call_id)) - goto on_return; - - call = &pjsua_var.calls[call_id]; - port_id = call->media[call->audio_idx].strm.a.conf_slot; - -on_return: - PJSUA_UNLOCK(); - - return port_id; -} - - - -/* * Obtain detail information about the specified call. */ PJ_DEF(pj_status_t) pjsua_call_get_info( pjsua_call_id call_id, @@ -1739,105 +1697,6 @@ PJ_DEF(pj_status_t) pjsua_call_get_rem_nat_type(pjsua_call_id call_id, /* - * Get media stream info for the specified media index. - */ -PJ_DEF(pj_status_t) pjsua_call_get_stream_info( pjsua_call_id call_id, - unsigned med_idx, - pjsua_stream_info *psi) -{ - pjsua_call *call; - pjsua_call_media *call_med; - pj_status_t status; - - PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls, - PJ_EINVAL); - PJ_ASSERT_RETURN(psi, PJ_EINVAL); - - PJSUA_LOCK(); - - call = &pjsua_var.calls[call_id]; - - if (med_idx >= call->med_cnt) { - PJSUA_UNLOCK(); - return PJ_EINVAL; - } - - call_med = &call->media[med_idx]; - psi->type = call_med->type; - switch (call_med->type) { - case PJMEDIA_TYPE_AUDIO: - status = pjmedia_stream_get_info(call_med->strm.a.stream, - &psi->info.aud); - break; -#if defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) - case PJMEDIA_TYPE_VIDEO: - status = pjmedia_vid_stream_get_info(call_med->strm.v.stream, - &psi->info.vid); - break; -#endif - default: - status = PJMEDIA_EINVALIMEDIATYPE; - break; - } - - PJSUA_UNLOCK(); - return status; -} - - -/* - * Get media stream statistic for the specified media index. - */ -PJ_DEF(pj_status_t) pjsua_call_get_stream_stat( pjsua_call_id call_id, - unsigned med_idx, - pjsua_stream_stat *stat) -{ - pjsua_call *call; - pjsua_call_media *call_med; - pj_status_t status; - - PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls, - PJ_EINVAL); - PJ_ASSERT_RETURN(stat, PJ_EINVAL); - - PJSUA_LOCK(); - - call = &pjsua_var.calls[call_id]; - - if (med_idx >= call->med_cnt) { - PJSUA_UNLOCK(); - return PJ_EINVAL; - } - - call_med = &call->media[med_idx]; - switch (call_med->type) { - case PJMEDIA_TYPE_AUDIO: - status = pjmedia_stream_get_stat(call_med->strm.a.stream, - &stat->rtcp); - if (status == PJ_SUCCESS) - status = pjmedia_stream_get_stat_jbuf(call_med->strm.a.stream, - &stat->jbuf); - break; -#if defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) - case PJMEDIA_TYPE_VIDEO: - status = pjmedia_vid_stream_get_stat(call_med->strm.v.stream, - &stat->rtcp); - if (status == PJ_SUCCESS) - status = pjmedia_vid_stream_get_stat_jbuf(call_med->strm.v.stream, - &stat->jbuf); - break; -#endif - default: - status = PJMEDIA_EINVALIMEDIATYPE; - break; - } - - PJSUA_UNLOCK(); - return status; -} - - -/* * Get media transport info for the specified media index. */ PJ_DEF(pj_status_t) @@ -2530,43 +2389,6 @@ on_error: } -/* - * Send DTMF digits to remote using RFC 2833 payload formats. - */ -PJ_DEF(pj_status_t) pjsua_call_dial_dtmf( pjsua_call_id call_id, - const pj_str_t *digits) -{ - pjsua_call *call; - pjsip_dialog *dlg = NULL; - pj_status_t status; - - PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls, - PJ_EINVAL); - - PJ_LOG(4,(THIS_FILE, "Call %d dialing DTMF %.*s", - call_id, (int)digits->slen, digits->ptr)); - pj_log_push_indent(); - - status = acquire_call("pjsua_call_dial_dtmf()", call_id, &call, &dlg); - if (status != PJ_SUCCESS) - goto on_return; - - if (!pjsua_call_has_media(call_id)) { - PJ_LOG(3,(THIS_FILE, "Media is not established yet!")); - status = PJ_EINVALIDOP; - goto on_return; - } - - status = pjmedia_stream_dial_dtmf( - call->media[call->audio_idx].strm.a.stream, digits); - -on_return: - if (dlg) pjsip_dlg_dec_lock(dlg); - pj_log_pop_indent(); - return status; -} - - /** * Send instant messaging inside INVITE session. */ |