Changeset 1998


Ignore:
Timestamp:
Jun 9, 2008 9:35:59 AM (11 years ago)
Author:
nanang
Message:

Added more validations & a new API (thanks Florian Bomers):

  • added more validation on pjmedia transport get info.
  • added more validation on stop_media_session() of pjsua_media, useful when conference is not used.
  • added new API for retrieving user_data of pjmedia session.
Location:
pjproject/trunk
Files:
4 edited

Legend:

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

    r974 r1998  
    173173                                               pjmedia_session_info *info ); 
    174174 
     175/** 
     176 * Get user data of the session. 
     177 * 
     178 * @param session       The session being queried. 
     179 * 
     180 * @return              User data of the session. 
     181 */ 
     182PJ_DECL(void*) pjmedia_session_get_user_data( pjmedia_session *session); 
     183 
    175184 
    176185/** 
  • pjproject/trunk/pjmedia/include/pjmedia/transport.h

    r1944 r1998  
    497497                                                  pjmedia_transport_info *info) 
    498498{ 
    499     if (tp->op->get_info) 
     499    if (tp && tp->op && tp->op->get_info) 
    500500        return (*tp->op->get_info)(tp, info); 
    501501    else 
  • pjproject/trunk/pjmedia/src/pjmedia/session.c

    r1943 r1998  
    686686} 
    687687 
     688/* 
     689 * Get user data. 
     690 */ 
     691PJ_DEF(void*) pjmedia_session_get_user_data( pjmedia_session *session) 
     692{ 
     693    return (session? session->user_data : NULL); 
     694} 
    688695 
    689696/** 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r1990 r1998  
    954954 
    955955    if (call->conf_slot != PJSUA_INVALID_ID) { 
    956         pjmedia_conf_remove_port(pjsua_var.mconf, call->conf_slot); 
     956        if (pjsua_var.mconf) { 
     957            pjmedia_conf_remove_port(pjsua_var.mconf, call->conf_slot); 
     958        } 
    957959        call->conf_slot = PJSUA_INVALID_ID; 
    958960    } 
Note: See TracChangeset for help on using the changeset viewer.