Changeset 3579


Ignore:
Timestamp:
Jun 9, 2011 4:05:44 AM (9 years ago)
Author:
ming
Message:

Closed #1275: Change pjmedia_vid_subsys_xx() to pjmedia_vid_dev_subsys_xx()

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

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia-videodev/videodev.h

    r3489 r3579  
    358358 
    359359/** 
    360  * Initialize the video subsystem. This will register all supported video 
    361  * device factories to the video subsystem. This function may be called 
    362  * more than once, but each call to this function must have the 
    363  * corresponding #pjmedia_vid_subsys_shutdown() call. 
     360 * Initialize the video device subsystem. This will register all supported 
     361 * video device factories to the video device subsystem. This function may be 
     362 * called more than once, but each call to this function must have the 
     363 * corresponding #pjmedia_vid_dev_subsys_shutdown() call. 
    364364 * 
    365365 * @param pf        The pool factory. 
     
    368368 *                  error code. 
    369369 */ 
    370 PJ_DECL(pj_status_t) pjmedia_vid_subsys_init(pj_pool_factory *pf); 
    371  
    372  
    373 /** 
    374  * Get the pool factory registered to the video subsystem. 
     370PJ_DECL(pj_status_t) pjmedia_vid_dev_subsys_init(pj_pool_factory *pf); 
     371 
     372 
     373/** 
     374 * Get the pool factory registered to the video device subsystem. 
    375375 * 
    376376 * @return          The pool factory. 
    377377 */ 
    378 PJ_DECL(pj_pool_factory*) pjmedia_vid_subsys_get_pool_factory(void); 
    379  
    380  
    381 /** 
    382  * Shutdown the video subsystem. This will destroy all video device factories 
    383  * registered in the video subsystem. Note that currently opened video streams 
    384  * may or may not be closed, depending on the implementation of the video 
    385  * device factories. 
    386  * 
    387  * @return          PJ_SUCCESS on successful operation or the appropriate 
    388  *                  error code. 
    389  */ 
    390 PJ_DECL(pj_status_t) pjmedia_vid_subsys_shutdown(void); 
    391  
    392  
    393 /** 
    394  * Register a supported video device factory to the video subsystem. This 
    395  * function can only be called after calling #pjmedia_vid_subsys_init(). 
     378PJ_DECL(pj_pool_factory*) pjmedia_vid_dev_subsys_get_pool_factory(void); 
     379 
     380 
     381/** 
     382 * Shutdown the video device subsystem. This will destroy all video device 
     383 * factories registered in the video device subsystem. Note that currently 
     384 * opened video streams may or may not be closed, depending on the 
     385 * implementation of the video device factories. 
     386 * 
     387 * @return          PJ_SUCCESS on successful operation or the appropriate 
     388 *                  error code. 
     389 */ 
     390PJ_DECL(pj_status_t) pjmedia_vid_dev_subsys_shutdown(void); 
     391 
     392 
     393/** 
     394 * Register a supported video device factory to the video device subsystem. 
     395 * This function can only be called after calling 
     396 * #pjmedia_vid_dev_subsys_init(). 
    396397 * 
    397398 * @param vdf       The video device factory. 
     
    405406 
    406407/** 
    407  * Unregister an video device factory from the video subsystem. This 
    408  * function can only be called after calling #pjmedia_vid_subsys_init(). 
     408 * Unregister a video device factory from the video device subsystem. This 
     409 * function can only be called after calling #pjmedia_vid_dev_subsys_init(). 
    409410 * Devices from this factory will be unlisted. If a device from this factory 
    410411 * is currently in use, then the behavior is undefined. 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/videodev.c

    r3489 r3579  
    105105}; 
    106106 
    107 /* The video subsystem */ 
     107/* The video device subsystem */ 
    108108static struct vid_subsys 
    109109{ 
     
    309309} 
    310310 
    311 /* API: Initialize the video subsystem. */ 
    312 PJ_DEF(pj_status_t) pjmedia_vid_subsys_init(pj_pool_factory *pf) 
     311/* API: Initialize the video device subsystem. */ 
     312PJ_DEF(pj_status_t) pjmedia_vid_dev_subsys_init(pj_pool_factory *pf) 
    313313{ 
    314314    unsigned i; 
     
    367367} 
    368368 
    369 /* API: register an video device factory to the video subsystem. */ 
     369/* API: register a video device factory to the video device subsystem. */ 
    370370PJ_DEF(pj_status_t) 
    371371pjmedia_vid_register_factory(pjmedia_vid_dev_factory_create_func_ptr adf) 
     
    387387} 
    388388 
    389 /* API: unregister an video device factory from the video subsystem. */ 
     389/* API: unregister a video device factory from the video device subsystem. */ 
    390390PJ_DEF(pj_status_t) 
    391391pjmedia_vid_unregister_factory(pjmedia_vid_dev_factory_create_func_ptr adf) 
     
    414414} 
    415415 
    416 /* API: get the pool factory registered to the video subsystem. */ 
    417 PJ_DEF(pj_pool_factory*) pjmedia_vid_subsys_get_pool_factory(void) 
     416/* API: get the pool factory registered to the video device subsystem. */ 
     417PJ_DEF(pj_pool_factory*) pjmedia_vid_dev_subsys_get_pool_factory(void) 
    418418{ 
    419419    return vid_subsys.pf; 
    420420} 
    421421 
    422 /* API: Shutdown the video subsystem. */ 
    423 PJ_DEF(pj_status_t) pjmedia_vid_subsys_shutdown(void) 
     422/* API: Shutdown the video device subsystem. */ 
     423PJ_DEF(pj_status_t) pjmedia_vid_dev_subsys_shutdown(void) 
    424424{ 
    425425    unsigned i; 
     
    433433    --vid_subsys.init_count; 
    434434 
    435     for (i=0; i<vid_subsys.drv_cnt; ++i) { 
    436         deinit_driver(i); 
    437     } 
    438  
    439     vid_subsys.pf = NULL; 
     435    if (vid_subsys.init_count == 0) { 
     436        for (i=0; i<vid_subsys.drv_cnt; ++i) { 
     437            deinit_driver(i); 
     438        } 
     439 
     440        vid_subsys.pf = NULL; 
     441    } 
    440442    return PJ_SUCCESS; 
    441443} 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/test/vid_codec_test.c

    r3564 r3579  
    418418    pool = pj_pool_create(mem, "Vid codec test", 256, 256, 0); 
    419419 
    420     status = pjmedia_vid_subsys_init(mem); 
     420    status = pjmedia_vid_dev_subsys_init(mem); 
    421421    if (status != PJ_SUCCESS) 
    422422        return -10; 
     
    436436on_return: 
    437437    pjmedia_codec_ffmpeg_deinit(); 
    438     pjmedia_vid_subsys_shutdown(); 
     438    pjmedia_vid_dev_subsys_shutdown(); 
    439439    pj_pool_release(pool); 
    440440    pj_log_set_level(orig_log_level); 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/test/vid_dev_test.c

    r3578 r3579  
    277277    pj_status_t status; 
    278278     
    279     status = pjmedia_vid_subsys_init(mem); 
     279    status = pjmedia_vid_dev_subsys_init(mem); 
    280280    if (status != PJ_SUCCESS) 
    281281        return -10; 
     
    290290 
    291291on_return: 
    292     pjmedia_vid_subsys_shutdown(); 
     292    pjmedia_vid_dev_subsys_shutdown(); 
    293293     
    294294    return rc; 
  • pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/aviplay.c

    r3487 r3579  
    481481    pjmedia_vid_codec_mgr_create(pool, NULL); 
    482482     
    483     status = pjmedia_vid_subsys_init(&cp.factory); 
     483    status = pjmedia_vid_dev_subsys_init(&cp.factory); 
    484484    if (status != PJ_SUCCESS) 
    485485        goto on_return; 
     
    508508    pjmedia_codec_ffmpeg_deinit(); 
    509509    pjmedia_aud_subsys_shutdown(); 
    510     pjmedia_vid_subsys_shutdown(); 
     510    pjmedia_vid_dev_subsys_shutdown(); 
    511511     
    512512    pjmedia_video_format_mgr_destroy(pjmedia_video_format_mgr_instance()); 
  • pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/simpleua.c

    r3460 r3579  
    383383    status = pjmedia_vid_codec_mgr_create(pool, NULL); 
    384384    PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); 
    385     status = pjmedia_vid_subsys_init(&cp.factory); 
     385    status = pjmedia_vid_dev_subsys_init(&cp.factory); 
    386386    PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); 
    387387 
  • pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/vid_streamutil.c

    r3514 r3579  
    566566 
    567567    /* Init video subsystem */ 
    568     pjmedia_vid_subsys_init(&cp.factory); 
     568    pjmedia_vid_dev_subsys_init(&cp.factory); 
    569569 
    570570    /* Register all supported codecs */ 
     
    912912 
    913913    /* Shutdown video subsystem */ 
    914     pjmedia_vid_subsys_shutdown(); 
     914    pjmedia_vid_dev_subsys_shutdown(); 
    915915 
    916916    /* Release application pool */ 
  • pjproject/branches/projects/2.0-dev/pjsip/src/pjsua-lib/pjsua_media.c

    r3560 r3579  
    298298    } 
    299299 
    300     status = pjmedia_vid_subsys_init(&pjsua_var.cp.factory); 
     300    status = pjmedia_vid_dev_subsys_init(&pjsua_var.cp.factory); 
    301301    if (status != PJ_SUCCESS) { 
    302302        pjsua_perror(THIS_FILE, "Error creating PJMEDIA video subsystem", 
     
    541541        /* Videodev */ 
    542542#       if PJMEDIA_HAS_VIDEO 
    543             pjmedia_vid_subsys_shutdown(); 
     543            pjmedia_vid_dev_subsys_shutdown(); 
    544544#       endif 
    545545 
Note: See TracChangeset for help on using the changeset viewer.