Ignore:
Timestamp:
Jul 15, 2011 9:51:46 AM (13 years ago)
Author:
bennylp
Message:

Fixed #1294: New pjmedia_codec_register_audio_codecs() API to register all known codecs, and also added implementation to deregister all codecs when the media endpoint is destroyed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/codec.c

    r3380 r3661  
    7373PJ_DEF(pj_status_t) pjmedia_codec_mgr_destroy (pjmedia_codec_mgr *mgr) 
    7474{ 
     75    pjmedia_codec_factory *factory; 
    7576    unsigned i; 
    7677 
    7778    PJ_ASSERT_RETURN(mgr, PJ_EINVAL); 
     79 
     80    /* Destroy all factories in the list */ 
     81    factory = mgr->factory_list.next; 
     82    while (factory != &mgr->factory_list) { 
     83        pjmedia_codec_factory *next = factory->next; 
     84        (*factory->op->destroy)(); 
     85        factory = next; 
     86    } 
    7887 
    7988    /* Cleanup all pools of all codec default params */ 
     
    111120 
    112121    PJ_ASSERT_RETURN(mgr && factory, PJ_EINVAL); 
     122 
     123    /* Since 2.0 we require codec factory to implement "destroy" op. Please 
     124     * see: https://trac.pjsip.org/repos/ticket/1294 
     125     * 
     126     * Really! Please do see it. 
     127     */ 
     128    PJ_ASSERT_RETURN(factory->op->destroy != NULL, PJ_ENOTSUP); 
    113129 
    114130    /* Enum codecs */ 
Note: See TracChangeset for help on using the changeset viewer.