From 8522626d02647b2996d7dc62d0486422286a62f6 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Tue, 27 Dec 2011 12:47:52 +0000 Subject: More re #1419: changed field names from video_count to vid_cnt and audio_cnt to aud_cnt for better consistency git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3925 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/include/pjsua-lib/pjsua.h | 8 ++++---- pjsip/src/pjsua-lib/pjsua_call.c | 14 +++++++------- pjsip/src/pjsua-lib/pjsua_media.c | 34 +++++++++++++++++----------------- pjsip/src/pjsua-lib/pjsua_vid.c | 10 +++++----- 4 files changed, 33 insertions(+), 33 deletions(-) (limited to 'pjsip') diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h index f10d7170..c9f4eb6d 100644 --- a/pjsip/include/pjsua-lib/pjsua.h +++ b/pjsip/include/pjsua-lib/pjsua.h @@ -589,7 +589,7 @@ typedef struct pjsua_call_setting * * Default: 1 */ - unsigned audio_cnt; + unsigned aud_cnt; /** * Number of simultaneous active video streams for this call. Setting @@ -597,7 +597,7 @@ typedef struct pjsua_call_setting * * Default: 1 (if video feature is enabled, otherwise it is zero) */ - unsigned video_cnt; + unsigned vid_cnt; } pjsua_call_setting; @@ -3614,10 +3614,10 @@ typedef struct pjsua_call_info pj_bool_t rem_offerer; /** Number of audio streams offered by remote */ - unsigned rem_audio_cnt; + unsigned rem_aud_cnt; /** Number of video streams offered by remote */ - unsigned rem_video_cnt; + unsigned rem_vid_cnt; /** Internal */ struct { diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index c3b459c7..0616754c 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -510,10 +510,10 @@ PJ_DEF(void) pjsua_call_setting_default(pjsua_call_setting *opt) pj_bzero(opt, sizeof(*opt)); opt->flag = PJSUA_CALL_INCLUDE_DISABLED_MEDIA; - opt->audio_cnt = 1; + opt->aud_cnt = 1; #if defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) - opt->video_cnt = 1; + opt->vid_cnt = 1; opt->req_keyframe_method = PJSUA_VID_REQ_KEYFRAME_SIP_INFO | PJSUA_VID_REQ_KEYFRAME_RTCP_PLI; #endif @@ -529,7 +529,7 @@ static pj_status_t apply_call_setting(pjsua_call *call, return PJ_SUCCESS; #if !PJMEDIA_HAS_VIDEO - pj_assert(opt->video_cnt == 0); + pj_assert(opt->vid_cnt == 0); #endif /* If call is established, reinit media channel */ @@ -541,8 +541,8 @@ static pj_status_t apply_call_setting(pjsua_call *call, call->opt = *opt; /* Reinit media channel when media count is changed */ - if (opt->audio_cnt != old_opt.audio_cnt || - opt->video_cnt != old_opt.video_cnt) + if (opt->aud_cnt != old_opt.aud_cnt || + opt->vid_cnt != old_opt.vid_cnt) { pjsip_role_e role = rem_sdp? PJSIP_ROLE_UAS : PJSIP_ROLE_UAC; status = pjsua_media_channel_init(call->index, role, @@ -1598,8 +1598,8 @@ PJ_DEF(pj_status_t) pjsua_call_get_info( pjsua_call_id call_id, /* Audio & video count offered by remote */ info->rem_offerer = call->rem_offerer; if (call->rem_offerer) { - info->rem_audio_cnt = call->rem_aud_cnt; - info->rem_video_cnt = call->rem_vid_cnt; + info->rem_aud_cnt = call->rem_aud_cnt; + info->rem_vid_cnt = call->rem_vid_cnt; } /* Build array of media status and dir */ diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c index 109108cd..571be8ae 100644 --- a/pjsip/src/pjsua-lib/pjsua_media.c +++ b/pjsip/src/pjsua-lib/pjsua_media.c @@ -1734,34 +1734,34 @@ pj_status_t pjsua_media_channel_init(pjsua_call_id call_id, */ /* Check if we need to add new audio */ - if (maudcnt < call->opt.audio_cnt && - mtotaudcnt < call->opt.audio_cnt) + if (maudcnt < call->opt.aud_cnt && + mtotaudcnt < call->opt.aud_cnt) { - for (mi = 0; mi < call->opt.audio_cnt - mtotaudcnt; ++mi) + for (mi = 0; mi < call->opt.aud_cnt - mtotaudcnt; ++mi) maudidx[maudcnt++] = (pj_uint8_t)call->med_cnt++; - mtotaudcnt = call->opt.audio_cnt; + mtotaudcnt = call->opt.aud_cnt; } - maudcnt = call->opt.audio_cnt; + maudcnt = call->opt.aud_cnt; /* Check if we need to add new video */ - if (mvidcnt < call->opt.video_cnt && - mtotvidcnt < call->opt.video_cnt) + if (mvidcnt < call->opt.vid_cnt && + mtotvidcnt < call->opt.vid_cnt) { - for (mi = 0; mi < call->opt.video_cnt - mtotvidcnt; ++mi) + for (mi = 0; mi < call->opt.vid_cnt - mtotvidcnt; ++mi) mvididx[mvidcnt++] = (pj_uint8_t)call->med_cnt++; - mtotvidcnt = call->opt.video_cnt; + mtotvidcnt = call->opt.vid_cnt; } - mvidcnt = call->opt.video_cnt; + mvidcnt = call->opt.vid_cnt; } else { - maudcnt = mtotaudcnt = call->opt.audio_cnt; + maudcnt = mtotaudcnt = call->opt.aud_cnt; for (mi=0; miopt.video_cnt; + mvidcnt = mtotvidcnt = call->opt.vid_cnt; for (mi=0; miopt.audio_cnt && + if (call->opt.aud_cnt && pj_memchr(maudidx, mi, maudcnt * sizeof(maudidx[0]))) { enabled = PJ_TRUE; } } else if (pj_memchr(mvididx, mi, mtotvidcnt * sizeof(mvididx[0]))) { media_type = PJMEDIA_TYPE_VIDEO; - if (call->opt.video_cnt && + if (call->opt.vid_cnt && pj_memchr(mvididx, mi, mvidcnt * sizeof(mvididx[0]))) { enabled = PJ_TRUE; @@ -2596,12 +2596,12 @@ pj_status_t pjsua_media_channel_update(pjsua_call_id call_id, * no media count limitation applied, as we didn't know yet which media * would pass the SDP negotiation. */ - if (maudcnt > call->opt.audio_cnt || mvidcnt > call->opt.video_cnt) + if (maudcnt > call->opt.aud_cnt || mvidcnt > call->opt.vid_cnt) { pjmedia_sdp_session *local_sdp2; - maudcnt = PJ_MIN(maudcnt, call->opt.audio_cnt); - mvidcnt = PJ_MIN(mvidcnt, call->opt.video_cnt); + maudcnt = PJ_MIN(maudcnt, call->opt.aud_cnt); + mvidcnt = PJ_MIN(mvidcnt, call->opt.vid_cnt); local_sdp2 = pjmedia_sdp_session_clone(tmp_pool, local_sdp); for (mi=0; mi < local_sdp2->media_count; ++mi) { diff --git a/pjsip/src/pjsua-lib/pjsua_vid.c b/pjsip/src/pjsua-lib/pjsua_vid.c index 1e87b0a8..bff1fa87 100644 --- a/pjsip/src/pjsua-lib/pjsua_vid.c +++ b/pjsip/src/pjsua-lib/pjsua_vid.c @@ -1630,7 +1630,7 @@ static pj_status_t call_add_video(pjsua_call *call, if (status != PJ_SUCCESS) goto on_error; - call->opt.video_cnt++; + call->opt.vid_cnt++; return PJ_SUCCESS; @@ -1700,7 +1700,7 @@ static pj_status_t call_modify_video(pjsua_call *call, if (call_med->dir == PJMEDIA_DIR_NONE) { unsigned i, vid_cnt = 0; - /* Check if video_cnt in call option needs to be increased */ + /* Check if vid_cnt in call option needs to be increased */ for (i = 0; i < call->med_cnt; ++i) { if (call->media[i].type == PJMEDIA_TYPE_VIDEO && call->media[i].dir != PJMEDIA_DIR_NONE) @@ -1708,8 +1708,8 @@ static pj_status_t call_modify_video(pjsua_call *call, ++vid_cnt; } } - if (call->opt.video_cnt <= vid_cnt) - call->opt.video_cnt++; + if (call->opt.vid_cnt <= vid_cnt) + call->opt.vid_cnt++; } status = pjsua_call_media_init(call_med, PJMEDIA_TYPE_VIDEO, @@ -1789,7 +1789,7 @@ on_error: /* Deactivate the stream */ pjmedia_sdp_media_deactivate(pool, sdp->media[med_idx]); - call->opt.video_cnt--; + call->opt.vid_cnt--; } status = call_reoffer_sdp(call->index, sdp); -- cgit v1.2.3