Changeset 501 for pjproject/trunk


Ignore:
Timestamp:
Jun 13, 2006 10:22:54 PM (18 years ago)
Author:
bennylp
Message:

Added pjmedia_sdp_neg_was_aswer_remote()

Location:
pjproject/trunk/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/sdp_neg.h

    r411 r501  
    393393                                   const pjmedia_sdp_session **remote); 
    394394 
     395 
     396/** 
     397 * Determine whether remote sent answer (as opposed to offer) on the 
     398 * last negotiation. This function can only be called in state 
     399 * PJMEDIA_SDP_NEG_STATE_DONE. 
     400 * 
     401 * @param neg           The SDP negotiator instance. 
     402 * 
     403 * @return              Non-zero if it was remote who sent answer, 
     404 *                      otherwise zero if it was local who supplied 
     405 *                      answer. 
     406 */ 
     407PJ_DECL(pj_bool_t) 
     408pjmedia_sdp_neg_was_answer_remote(pjmedia_sdp_neg *neg); 
     409 
     410 
    395411/** 
    396412 * Get the current remote SDP offer or answer. Application can only  
  • pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c

    r280 r501  
    3333    pjmedia_sdp_neg_state state;            /**< Negotiator state.           */ 
    3434    pj_bool_t             has_remote_answer; 
     35    pj_bool_t             answer_was_remote; 
    3536 
    3637    pjmedia_sdp_session *initial_sdp,       /**< Initial local SDP           */ 
     
    175176} 
    176177 
     178 
     179PJ_DEF(pj_bool_t) 
     180pjmedia_sdp_neg_was_answer_remote(pjmedia_sdp_neg *neg) 
     181{ 
     182    PJ_ASSERT_RETURN(neg, PJ_FALSE); 
     183 
     184    return neg->answer_was_remote; 
     185} 
     186 
     187 
    177188PJ_DEF(pj_status_t) 
    178189pjmedia_sdp_neg_get_neg_remote( pjmedia_sdp_neg *neg, 
     
    275286    /* We're ready to negotiate. */ 
    276287    neg->state = PJMEDIA_SDP_NEG_STATE_WAIT_NEGO; 
    277     neg->has_remote_answer = 1; 
     288    neg->has_remote_answer = PJ_TRUE; 
    278289    neg->neg_remote_sdp = pjmedia_sdp_session_clone(pool, remote); 
    279290  
     
    918929    neg->state = PJMEDIA_SDP_NEG_STATE_DONE; 
    919930 
     931    /* Save state */ 
     932    neg->answer_was_remote = neg->has_remote_answer; 
     933 
    920934    /* Clear temporary SDP */ 
    921935    neg->neg_local_sdp = neg->neg_remote_sdp = NULL; 
    922     neg->has_remote_answer = 0; 
     936    neg->has_remote_answer = PJ_FALSE; 
    923937 
    924938    return status; 
Note: See TracChangeset for help on using the changeset viewer.