Ignore:
Timestamp:
Jan 27, 2010 11:48:31 AM (14 years ago)
Author:
nanang
Message:

Ticket #1028: Recommit r3074 with updated codec.h.

File:
1 edited

Legend:

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

    r2875 r3078  
    2929#include <pjmedia/port.h> 
    3030#include <pj/list.h> 
     31#include <pj/pool.h> 
    3132 
    3233PJ_BEGIN_DECL 
     
    245246 * Structure of codec specific parameters which contains name=value pairs. 
    246247 * The codec specific parameters are to be used with SDP according to  
    247  * the standards (e.g: RFC 3555). 
     248 * the standards (e.g: RFC 3555) in SDP 'a=fmtp' attribute. 
    248249 */ 
    249250typedef struct pjmedia_codec_fmtp 
    250251{ 
    251     pj_uint8_t      cnt; 
     252    pj_uint8_t      cnt;            /**< Number of parameters.          */ 
    252253    struct param { 
    253         pj_str_t    name; 
    254         pj_str_t    val; 
    255     } param [PJMEDIA_CODEC_MAX_FMTP_CNT]; 
     254        pj_str_t    name;           /**< Parameter name.                */ 
     255        pj_str_t    val;            /**< Parameter value.               */ 
     256    } param [PJMEDIA_CODEC_MAX_FMTP_CNT]; /**< The parameters.          */ 
    256257} pjmedia_codec_fmtp; 
    257258 
    258259/**  
    259  * Detailed codec attributes used both to configure a codec and to query 
    260  * the capability of codec factories. 
     260 * Detailed codec attributes used in configuring a codec and in querying 
     261 * the capability of codec factories. Default attributes of any codecs could 
     262 * be queried using #pjmedia_codec_mgr_get_default_param() and modified 
     263 * using #pjmedia_codec_mgr_set_default_param(). 
     264 * 
     265 * Please note that codec parameter also contains SDP specific setting,  
     266 * #dec_fmtp and #enc_fmtp, which may need to be set appropriately based on 
     267 * the effective setting. See each codec documentation for more detail. 
    261268 */ 
    262269typedef struct pjmedia_codec_param 
     
    629636 
    630637 
     638/** 
     639 * Opaque declaration of default codecs parameters. 
     640 */ 
     641typedef struct pjmedia_codec_default_param pjmedia_codec_default_param; 
     642 
    631643/**  
    632644 * Codec manager maintains array of these structs for each supported 
     
    639651    pjmedia_codec_priority  prio;       /**< Priority.              */ 
    640652    pjmedia_codec_factory  *factory;    /**< The factory.           */ 
     653    pjmedia_codec_default_param *param; /**< Default codecs  
     654                                             parameters.            */ 
    641655}; 
    642656 
     
    649663typedef struct pjmedia_codec_mgr 
    650664{ 
     665    /** Media endpoint instance. */ 
     666    pj_pool_factory             *pf; 
     667 
     668    /** Codec manager pool. */ 
     669    pj_pool_t                   *pool; 
     670 
     671    /** Codec manager mutex. */ 
     672    pj_mutex_t                  *mutex; 
     673 
    651674    /** List of codec factories registered to codec manager. */ 
    652     pjmedia_codec_factory       factory_list; 
    653  
    654     /** Number of supported codesc. */ 
    655     unsigned                    codec_cnt; 
     675    pjmedia_codec_factory        factory_list; 
     676 
     677    /** Number of supported codecs. */ 
     678    unsigned                     codec_cnt; 
    656679 
    657680    /** Array of codec descriptor. */ 
    658     struct pjmedia_codec_desc   codec_desc[PJMEDIA_CODEC_MGR_MAX_CODECS]; 
     681    struct pjmedia_codec_desc    codec_desc[PJMEDIA_CODEC_MGR_MAX_CODECS]; 
    659682 
    660683} pjmedia_codec_mgr; 
     
    667690 * 
    668691 * @param mgr       Codec manager instance. 
     692 * @param pf        Pool factory instance. 
    669693 * 
    670694 * @return          PJ_SUCCESS on success. 
    671695 */ 
    672 PJ_DECL(pj_status_t) pjmedia_codec_mgr_init(pjmedia_codec_mgr *mgr); 
     696PJ_DECL(pj_status_t) pjmedia_codec_mgr_init(pjmedia_codec_mgr *mgr,  
     697                                            pj_pool_factory *pf); 
     698 
     699 
     700/** 
     701 * Destroy codec manager. Normally this function is called by pjmedia 
     702 * endpoint's deinitialization code. 
     703 * 
     704 * @param mgr       Codec manager instance. 
     705 * 
     706 * @return          PJ_SUCCESS on success. 
     707 */ 
     708PJ_DECL(pj_status_t) pjmedia_codec_mgr_destroy(pjmedia_codec_mgr *mgr); 
    673709 
    674710 
     
    822858                                     pjmedia_codec_param *param ); 
    823859 
     860 
     861/** 
     862 * Set default codec param for the specified codec info. 
     863 * 
     864 * @param mgr       The codec manager instance. Application can get the 
     865 *                  instance by calling #pjmedia_endpt_get_codec_mgr(). 
     866 * @param info      The codec info, which default parameter's is being 
     867 *                  updated. 
     868 * @param param     The new default codec parameter. Set to NULL to reset 
     869 *                  codec parameter to library default settings. 
     870 * 
     871 * @return          PJ_SUCCESS on success. 
     872 */ 
     873PJ_DECL(pj_status_t)  
     874pjmedia_codec_mgr_set_default_param( pjmedia_codec_mgr *mgr, 
     875                                     const pjmedia_codec_info *info, 
     876                                     const pjmedia_codec_param *param ); 
     877 
     878 
    824879/** 
    825880 * Request the codec manager to allocate one instance of codec with the 
Note: See TracChangeset for help on using the changeset viewer.