Changeset 3579
- Timestamp:
- Jun 9, 2011 4:05:44 AM (13 years ago)
- 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 358 358 359 359 /** 360 * Initialize the video subsystem. This will register all supported video361 * device factories to the video subsystem. This function may be called362 * more than once, but each call to this function must have the363 * 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. 364 364 * 365 365 * @param pf The pool factory. … … 368 368 * error code. 369 369 */ 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.370 PJ_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. 375 375 * 376 376 * @return The pool factory. 377 377 */ 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(). 378 PJ_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 */ 390 PJ_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(). 396 397 * 397 398 * @param vdf The video device factory. … … 405 406 406 407 /** 407 * Unregister a n video device factory from the videosubsystem. This408 * 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(). 409 410 * Devices from this factory will be unlisted. If a device from this factory 410 411 * is currently in use, then the behavior is undefined. -
pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/videodev.c
r3489 r3579 105 105 }; 106 106 107 /* The video subsystem */107 /* The video device subsystem */ 108 108 static struct vid_subsys 109 109 { … … 309 309 } 310 310 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. */ 312 PJ_DEF(pj_status_t) pjmedia_vid_dev_subsys_init(pj_pool_factory *pf) 313 313 { 314 314 unsigned i; … … 367 367 } 368 368 369 /* API: register a n video device factory to the videosubsystem. */369 /* API: register a video device factory to the video device subsystem. */ 370 370 PJ_DEF(pj_status_t) 371 371 pjmedia_vid_register_factory(pjmedia_vid_dev_factory_create_func_ptr adf) … … 387 387 } 388 388 389 /* API: unregister a n video device factory from the videosubsystem. */389 /* API: unregister a video device factory from the video device subsystem. */ 390 390 PJ_DEF(pj_status_t) 391 391 pjmedia_vid_unregister_factory(pjmedia_vid_dev_factory_create_func_ptr adf) … … 414 414 } 415 415 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. */ 417 PJ_DEF(pj_pool_factory*) pjmedia_vid_dev_subsys_get_pool_factory(void) 418 418 { 419 419 return vid_subsys.pf; 420 420 } 421 421 422 /* API: Shutdown the video subsystem. */423 PJ_DEF(pj_status_t) pjmedia_vid_ subsys_shutdown(void)422 /* API: Shutdown the video device subsystem. */ 423 PJ_DEF(pj_status_t) pjmedia_vid_dev_subsys_shutdown(void) 424 424 { 425 425 unsigned i; … … 433 433 --vid_subsys.init_count; 434 434 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 } 440 442 return PJ_SUCCESS; 441 443 } -
pjproject/branches/projects/2.0-dev/pjmedia/src/test/vid_codec_test.c
r3564 r3579 418 418 pool = pj_pool_create(mem, "Vid codec test", 256, 256, 0); 419 419 420 status = pjmedia_vid_ subsys_init(mem);420 status = pjmedia_vid_dev_subsys_init(mem); 421 421 if (status != PJ_SUCCESS) 422 422 return -10; … … 436 436 on_return: 437 437 pjmedia_codec_ffmpeg_deinit(); 438 pjmedia_vid_ subsys_shutdown();438 pjmedia_vid_dev_subsys_shutdown(); 439 439 pj_pool_release(pool); 440 440 pj_log_set_level(orig_log_level); -
pjproject/branches/projects/2.0-dev/pjmedia/src/test/vid_dev_test.c
r3578 r3579 277 277 pj_status_t status; 278 278 279 status = pjmedia_vid_ subsys_init(mem);279 status = pjmedia_vid_dev_subsys_init(mem); 280 280 if (status != PJ_SUCCESS) 281 281 return -10; … … 290 290 291 291 on_return: 292 pjmedia_vid_ subsys_shutdown();292 pjmedia_vid_dev_subsys_shutdown(); 293 293 294 294 return rc; -
pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/aviplay.c
r3487 r3579 481 481 pjmedia_vid_codec_mgr_create(pool, NULL); 482 482 483 status = pjmedia_vid_ subsys_init(&cp.factory);483 status = pjmedia_vid_dev_subsys_init(&cp.factory); 484 484 if (status != PJ_SUCCESS) 485 485 goto on_return; … … 508 508 pjmedia_codec_ffmpeg_deinit(); 509 509 pjmedia_aud_subsys_shutdown(); 510 pjmedia_vid_ subsys_shutdown();510 pjmedia_vid_dev_subsys_shutdown(); 511 511 512 512 pjmedia_video_format_mgr_destroy(pjmedia_video_format_mgr_instance()); -
pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/simpleua.c
r3460 r3579 383 383 status = pjmedia_vid_codec_mgr_create(pool, NULL); 384 384 PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); 385 status = pjmedia_vid_ subsys_init(&cp.factory);385 status = pjmedia_vid_dev_subsys_init(&cp.factory); 386 386 PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); 387 387 -
pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/vid_streamutil.c
r3514 r3579 566 566 567 567 /* Init video subsystem */ 568 pjmedia_vid_ subsys_init(&cp.factory);568 pjmedia_vid_dev_subsys_init(&cp.factory); 569 569 570 570 /* Register all supported codecs */ … … 912 912 913 913 /* Shutdown video subsystem */ 914 pjmedia_vid_ subsys_shutdown();914 pjmedia_vid_dev_subsys_shutdown(); 915 915 916 916 /* Release application pool */ -
pjproject/branches/projects/2.0-dev/pjsip/src/pjsua-lib/pjsua_media.c
r3560 r3579 298 298 } 299 299 300 status = pjmedia_vid_ subsys_init(&pjsua_var.cp.factory);300 status = pjmedia_vid_dev_subsys_init(&pjsua_var.cp.factory); 301 301 if (status != PJ_SUCCESS) { 302 302 pjsua_perror(THIS_FILE, "Error creating PJMEDIA video subsystem", … … 541 541 /* Videodev */ 542 542 # if PJMEDIA_HAS_VIDEO 543 pjmedia_vid_ subsys_shutdown();543 pjmedia_vid_dev_subsys_shutdown(); 544 544 # endif 545 545
Note: See TracChangeset
for help on using the changeset viewer.