- Timestamp:
- Mar 25, 2011 8:38:26 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/videodev.c
r3420 r3489 610 610 /* API: Open video stream object using the specified parameters. */ 611 611 PJ_DEF(pj_status_t) pjmedia_vid_dev_stream_create( 612 constpjmedia_vid_param *prm,612 pjmedia_vid_param *prm, 613 613 const pjmedia_vid_cb *cb, 614 614 void *user_data, … … 616 616 { 617 617 pjmedia_vid_dev_factory *cap_f=NULL, *rend_f=NULL, *f=NULL; 618 pjmedia_vid_param param;619 618 pj_status_t status; 620 619 … … 626 625 PJ_EINVAL); 627 626 628 /* Must make copy of param because we're changing device ID */629 pj_memcpy(¶m, prm, sizeof(param));630 631 627 /* Normalize cap_id */ 632 if (p aram.dir & PJMEDIA_DIR_CAPTURE) {628 if (prm->dir & PJMEDIA_DIR_CAPTURE) { 633 629 unsigned index; 634 630 635 if (p aram.cap_id < 0)636 p aram.cap_id = PJMEDIA_VID_DEFAULT_CAPTURE_DEV;637 638 status = lookup_dev(p aram.cap_id, &cap_f, &index);631 if (prm->cap_id < 0) 632 prm->cap_id = PJMEDIA_VID_DEFAULT_CAPTURE_DEV; 633 634 status = lookup_dev(prm->cap_id, &cap_f, &index); 639 635 if (status != PJ_SUCCESS) 640 636 return status; 641 637 642 p aram.cap_id = index;638 prm->cap_id = index; 643 639 f = cap_f; 644 640 } 645 641 646 642 /* Normalize rend_id */ 647 if (p aram.dir & PJMEDIA_DIR_RENDER) {643 if (prm->dir & PJMEDIA_DIR_RENDER) { 648 644 unsigned index; 649 645 650 if (p aram.rend_id < 0)651 p aram.rend_id = PJMEDIA_VID_DEFAULT_RENDER_DEV;652 653 status = lookup_dev(p aram.rend_id, &rend_f, &index);646 if (prm->rend_id < 0) 647 prm->rend_id = PJMEDIA_VID_DEFAULT_RENDER_DEV; 648 649 status = lookup_dev(prm->rend_id, &rend_f, &index); 654 650 if (status != PJ_SUCCESS) 655 651 return status; 656 652 657 p aram.rend_id = index;653 prm->rend_id = index; 658 654 f = rend_f; 659 655 } … … 662 658 663 659 /* For now, cap_id and rend_id must belong to the same factory */ 664 PJ_ASSERT_RETURN((p aram.dir != PJMEDIA_DIR_CAPTURE_RENDER) ||660 PJ_ASSERT_RETURN((prm->dir != PJMEDIA_DIR_CAPTURE_RENDER) || 665 661 (cap_f == rend_f), 666 662 PJMEDIA_EVID_INVDEV); 667 663 668 664 /* Create the stream */ 669 status = f->op->create_stream(f, ¶m, cb,665 status = f->op->create_stream(f, prm, cb, 670 666 user_data, p_vid_strm); 671 667 if (status != PJ_SUCCESS)
Note: See TracChangeset
for help on using the changeset viewer.