Changeset 3487


Ignore:
Timestamp:
Mar 25, 2011 8:13:43 AM (11 years ago)
Author:
bennylp
Message:

libswscale rearrangement (re #1219/ffmpeg codecs): instantiate libswscale converter from the converter manager instead of having to instantiate it manually in all apps

Location:
pjproject/branches/projects/2.0-dev
Files:
4 edited

Legend:

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

    r3392 r3487  
    2121#include <pj/errno.h> 
    2222 
     23#define THIS_FILE       "converter.c" 
    2324 
    2425struct pjmedia_converter_mgr 
     
    2930static pjmedia_converter_mgr *converter_manager_instance; 
    3031 
     32#if PJMEDIA_HAS_LIBSWSCALE && PJMEDIA_HAS_LIBAVUTIL 
     33PJ_DECL(pj_status_t) 
     34pjmedia_libswscale_converter_init(pjmedia_converter_mgr *mgr); 
     35#endif 
     36 
     37 
    3138PJ_DEF(pj_status_t) pjmedia_converter_mgr_create(pj_pool_t *pool, 
    3239                                                 pjmedia_converter_mgr **p_mgr) 
    3340{ 
    3441    pjmedia_converter_mgr *mgr; 
     42    pj_status_t status; 
    3543 
    3644    mgr = PJ_POOL_ALLOC_T(pool, pjmedia_converter_mgr); 
     
    3947    if (!converter_manager_instance) 
    4048        converter_manager_instance = mgr; 
     49 
     50#if PJMEDIA_HAS_LIBSWSCALE && PJMEDIA_HAS_LIBAVUTIL 
     51    status = pjmedia_libswscale_converter_init(mgr); 
     52    if (status != PJ_SUCCESS) { 
     53        PJ_PERROR(4,(THIS_FILE, status, 
     54                     "Error initializing libswscale converter")); 
     55    } 
     56#endif 
    4157 
    4258    if (p_mgr) 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/converter_libswscale.c

    r3392 r3487  
    177177 
    178178PJ_DEF(pj_status_t) 
    179 pjmedia_libswscale_converter_init(pjmedia_converter_mgr *mgr, 
    180                                   pj_pool_t *pool) 
     179pjmedia_libswscale_converter_init(pjmedia_converter_mgr *mgr) 
    181180{ 
    182181    libswscale_factory.op = &libswscale_factory_op; 
    183     PJ_UNUSED_ARG(pool); 
    184182    return pjmedia_converter_mgr_register_factory(mgr, &libswscale_factory); 
    185183} 
  • pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/aviplay.c

    r3483 r3487  
    5858/* For logging purpose. */ 
    5959#define THIS_FILE   "aviplay.c" 
    60  
    61 pj_status_t 
    62 pjmedia_libswscale_converter_init(pjmedia_converter_mgr *mgr, 
    63                                   pj_pool_t *pool); 
    6460 
    6561static const char *desc =  
     
    330326                pjmedia_conversion_param conv_param; 
    331327                 
    332                 status = pjmedia_libswscale_converter_init(NULL, pool); 
    333                  
    334328                pjmedia_format_copy(&conv_param.src, &param.vidparam.fmt); 
    335329                pjmedia_format_copy(&conv_param.dst, &param.vidparam.fmt); 
  • pjproject/branches/projects/2.0-dev/pjsip/src/pjsua-lib/pjsua_media.c

    r3476 r3487  
    6060 
    6161 
    62 PJ_DECL(pj_status_t) 
    63 pjmedia_libswscale_converter_init(pjmedia_converter_mgr *mgr, 
    64                                   pj_pool_t *pool); 
    65  
    6662/** 
    6763 * Init media subsystems. 
     
    315311    if (status != PJ_SUCCESS) { 
    316312        pjsua_perror(THIS_FILE, "Error initializing ffmpeg library", 
    317                      status); 
    318         return status; 
    319     } 
    320 #endif 
    321  
    322 #if PJMEDIA_HAS_VIDEO && PJMEDIA_HAS_LIBSWSCALE && PJMEDIA_HAS_LIBAVUTIL 
    323     status = pjmedia_libswscale_converter_init(NULL, pjsua_var.pool); 
    324     if (status != PJ_SUCCESS) { 
    325         pjsua_perror(THIS_FILE, "Error initializing libswscale converter", 
    326313                     status); 
    327314        return status; 
Note: See TracChangeset for help on using the changeset viewer.