Changeset 2597 for pjproject


Ignore:
Timestamp:
Apr 14, 2009 3:18:30 PM (16 years ago)
Author:
nanang
Message:

Ticket #788: Updated pjsua_media_subsys_init() to perform SRTP library initialization.

Location:
pjproject/trunk
Files:
3 edited

Legend:

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

    r2394 r2597  
    196196 
    197197/** 
     198 * Initialize SRTP library. This function should be called before 
     199 * any SRTP functions, however calling #pjmedia_transport_srtp_create()  
     200 * will also invoke this function. This function will also register SRTP 
     201 * library deinitialization to #pj_atexit(), so the deinitialization 
     202 * of SRTP library will be performed automatically by PJLIB destructor. 
     203 */ 
     204PJ_DECL(pj_status_t) pjmedia_srtp_init_lib(void); 
     205 
     206 
     207/** 
    198208 * Initialize SRTP setting with its default values. 
    199209 * 
  • pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c

    r2424 r2597  
    264264static void pjmedia_srtp_deinit_lib(void); 
    265265 
    266 static pj_status_t pjmedia_srtp_init_lib(void) 
     266PJ_DEF(pj_status_t) pjmedia_srtp_init_lib(void) 
    267267{ 
    268268    static pj_bool_t initialized = PJ_FALSE; 
     
    270270    if (initialized == PJ_FALSE) { 
    271271        err_status_t err; 
     272 
    272273        err = srtp_init(); 
    273274        if (err != err_status_ok) {  
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r2563 r2597  
    279279                                      &pjsua_var.null_port); 
    280280    PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 
     281 
     282#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 
     283    /* Initialize SRTP library. */ 
     284    status = pjmedia_srtp_init_lib(); 
     285    if (status != PJ_SUCCESS) { 
     286        pjsua_perror(THIS_FILE, "Error initializing SRTP library",  
     287                     status); 
     288        return status; 
     289    } 
     290#endif 
    281291 
    282292    /* Perform NAT detection */ 
Note: See TracChangeset for help on using the changeset viewer.