- Timestamp:
- Mar 19, 2011 5:33:21 AM (14 years ago)
- Location:
- pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/ios_dev.m
r3459 r3467 74 74 struct ios_stream 75 75 { 76 pjmedia_vid_ stream base; /**< Base stream*/77 pjmedia_vid_param param;/**< Settings */78 pj_pool_t *pool; /**< Memory pool.*/79 80 pjmedia_vid_cb vid_cb; /**< Stream callback.*/81 void *user_data; /**< Application data.*/82 83 pjmedia_rect_size size;84 pj_uint8_t bpp;85 unsigned bytes_per_row;86 unsigned frame_size;76 pjmedia_vid_dev_stream base; /**< Base stream */ 77 pjmedia_vid_param param; /**< Settings */ 78 pj_pool_t *pool; /**< Memory pool */ 79 80 pjmedia_vid_cb vid_cb; /**< Stream callback */ 81 void *user_data; /**< Application data */ 82 83 pjmedia_rect_size size; 84 pj_uint8_t bpp; 85 unsigned bytes_per_row; 86 unsigned frame_size; 87 87 88 88 AVCaptureSession *cap_session; … … 110 110 unsigned index, 111 111 pjmedia_vid_param *param); 112 static pj_status_t ios_factory_create_stream(pjmedia_vid_dev_factory *f, 113 const pjmedia_vid_param *param, 114 const pjmedia_vid_cb *cb, 115 void *user_data, 116 pjmedia_vid_stream **p_vid_strm); 117 118 static pj_status_t ios_stream_get_param(pjmedia_vid_stream *strm, 112 static pj_status_t ios_factory_create_stream( 113 pjmedia_vid_dev_factory *f, 114 const pjmedia_vid_param *param, 115 const pjmedia_vid_cb *cb, 116 void *user_data, 117 pjmedia_vid_dev_stream **p_vid_strm); 118 119 static pj_status_t ios_stream_get_param(pjmedia_vid_dev_stream *strm, 119 120 pjmedia_vid_param *param); 120 static pj_status_t ios_stream_get_cap(pjmedia_vid_ stream *strm,121 static pj_status_t ios_stream_get_cap(pjmedia_vid_dev_stream *strm, 121 122 pjmedia_vid_dev_cap cap, 122 123 void *value); 123 static pj_status_t ios_stream_set_cap(pjmedia_vid_ stream *strm,124 static pj_status_t ios_stream_set_cap(pjmedia_vid_dev_stream *strm, 124 125 pjmedia_vid_dev_cap cap, 125 126 const void *value); 126 static pj_status_t ios_stream_start(pjmedia_vid_ stream *strm);127 static pj_status_t ios_stream_put_frame(pjmedia_vid_ stream *strm,127 static pj_status_t ios_stream_start(pjmedia_vid_dev_stream *strm); 128 static pj_status_t ios_stream_put_frame(pjmedia_vid_dev_stream *strm, 128 129 const pjmedia_frame *frame); 129 static pj_status_t ios_stream_stop(pjmedia_vid_ stream *strm);130 static pj_status_t ios_stream_destroy(pjmedia_vid_ stream *strm);130 static pj_status_t ios_stream_stop(pjmedia_vid_dev_stream *strm); 131 static pj_status_t ios_stream_destroy(pjmedia_vid_dev_stream *strm); 131 132 132 133 /* Operations */ … … 141 142 }; 142 143 143 static pjmedia_vid_ stream_op stream_op =144 static pjmedia_vid_dev_stream_op stream_op = 144 145 { 145 146 &ios_stream_get_param, … … 294 295 param->flags = PJMEDIA_VID_DEV_CAP_FORMAT; 295 296 param->clock_rate = DEFAULT_CLOCK_RATE; 296 param->frame_rate.num = DEFAULT_FPS;297 param->frame_rate.denum = 1;298 297 pj_memcpy(¶m->fmt, &di->info.fmt[0], sizeof(param->fmt)); 299 298 … … 384 383 385 384 /* API: create stream */ 386 static pj_status_t ios_factory_create_stream(pjmedia_vid_dev_factory *f, 387 const pjmedia_vid_param *param, 388 const pjmedia_vid_cb *cb, 389 void *user_data, 390 pjmedia_vid_stream **p_vid_strm) 385 static pj_status_t ios_factory_create_stream( 386 pjmedia_vid_dev_factory *f, 387 const pjmedia_vid_param *param, 388 const pjmedia_vid_cb *cb, 389 void *user_data, 390 pjmedia_vid_dev_stream **p_vid_strm) 391 391 { 392 392 struct ios_factory *qf = (struct ios_factory*)f; … … 489 489 490 490 if (param->flags & PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW && param->window) 491 window = param->window;491 window = (UIWindow *)param->window; 492 492 493 493 pj_assert(window); … … 522 522 523 523 on_error: 524 ios_stream_destroy((pjmedia_vid_ stream *)strm);524 ios_stream_destroy((pjmedia_vid_dev_stream *)strm); 525 525 526 526 return status; … … 528 528 529 529 /* API: Get stream info. */ 530 static pj_status_t ios_stream_get_param(pjmedia_vid_ stream *s,530 static pj_status_t ios_stream_get_param(pjmedia_vid_dev_stream *s, 531 531 pjmedia_vid_param *pi) 532 532 { … … 547 547 548 548 /* API: get capability */ 549 static pj_status_t ios_stream_get_cap(pjmedia_vid_ stream *s,549 static pj_status_t ios_stream_get_cap(pjmedia_vid_dev_stream *s, 550 550 pjmedia_vid_dev_cap cap, 551 551 void *pval) … … 567 567 568 568 /* API: set capability */ 569 static pj_status_t ios_stream_set_cap(pjmedia_vid_ stream *s,569 static pj_status_t ios_stream_set_cap(pjmedia_vid_dev_stream *s, 570 570 pjmedia_vid_dev_cap cap, 571 571 const void *pval) … … 586 586 587 587 /* API: Start stream. */ 588 static pj_status_t ios_stream_start(pjmedia_vid_ stream *strm)588 static pj_status_t ios_stream_start(pjmedia_vid_dev_stream *strm) 589 589 { 590 590 struct ios_stream *stream = (struct ios_stream*)strm; … … 606 606 607 607 /* API: Put frame from stream */ 608 static pj_status_t ios_stream_put_frame(pjmedia_vid_ stream *strm,608 static pj_status_t ios_stream_put_frame(pjmedia_vid_dev_stream *strm, 609 609 const pjmedia_frame *frame) 610 610 { … … 625 625 626 626 /* API: Stop stream. */ 627 static pj_status_t ios_stream_stop(pjmedia_vid_ stream *strm)627 static pj_status_t ios_stream_stop(pjmedia_vid_dev_stream *strm) 628 628 { 629 629 struct ios_stream *stream = (struct ios_stream*)strm; … … 641 641 642 642 /* API: Destroy stream. */ 643 static pj_status_t ios_stream_destroy(pjmedia_vid_ stream *strm)643 static pj_status_t ios_stream_destroy(pjmedia_vid_dev_stream *strm) 644 644 { 645 645 struct ios_stream *stream = (struct ios_stream*)strm; -
pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/qt_dev.m
r3459 r3467 73 73 struct qt_stream 74 74 { 75 pjmedia_vid_ stream base;/**< Base stream */76 pjmedia_vid_param param;/**< Settings */77 pj_pool_t *pool;/**< Memory pool. */78 79 pj_timestamp cap_frame_ts;/**< Captured frame tstamp */80 unsigned cap_ts_inc; /**< Increment */81 82 pjmedia_vid_cb vid_cb;/**< Stream callback. */83 void *user_data;/**< Application data. */75 pjmedia_vid_dev_stream base; /**< Base stream */ 76 pjmedia_vid_param param; /**< Settings */ 77 pj_pool_t *pool; /**< Memory pool. */ 78 79 pj_timestamp cap_frame_ts; /**< Captured frame tstamp */ 80 unsigned cap_ts_inc; /**< Increment */ 81 82 pjmedia_vid_cb vid_cb; /**< Stream callback. */ 83 void *user_data; /**< Application data. */ 84 84 85 85 QTCaptureSession *cap_session; … … 101 101 unsigned index, 102 102 pjmedia_vid_param *param); 103 static pj_status_t qt_factory_create_stream(pjmedia_vid_dev_factory *f, 104 const pjmedia_vid_param *param, 105 const pjmedia_vid_cb *cb, 106 void *user_data, 107 pjmedia_vid_stream **p_vid_strm); 108 109 static pj_status_t qt_stream_get_param(pjmedia_vid_stream *strm, 103 static pj_status_t qt_factory_create_stream( 104 pjmedia_vid_dev_factory *f, 105 const pjmedia_vid_param *param, 106 const pjmedia_vid_cb *cb, 107 void *user_data, 108 pjmedia_vid_dev_stream **p_vid_strm); 109 110 static pj_status_t qt_stream_get_param(pjmedia_vid_dev_stream *strm, 110 111 pjmedia_vid_param *param); 111 static pj_status_t qt_stream_get_cap(pjmedia_vid_ stream *strm,112 static pj_status_t qt_stream_get_cap(pjmedia_vid_dev_stream *strm, 112 113 pjmedia_vid_dev_cap cap, 113 114 void *value); 114 static pj_status_t qt_stream_set_cap(pjmedia_vid_ stream *strm,115 static pj_status_t qt_stream_set_cap(pjmedia_vid_dev_stream *strm, 115 116 pjmedia_vid_dev_cap cap, 116 117 const void *value); 117 static pj_status_t qt_stream_start(pjmedia_vid_ stream *strm);118 static pj_status_t qt_stream_stop(pjmedia_vid_ stream *strm);119 static pj_status_t qt_stream_destroy(pjmedia_vid_ stream *strm);118 static pj_status_t qt_stream_start(pjmedia_vid_dev_stream *strm); 119 static pj_status_t qt_stream_stop(pjmedia_vid_dev_stream *strm); 120 static pj_status_t qt_stream_destroy(pjmedia_vid_dev_stream *strm); 120 121 121 122 /* Operations */ … … 130 131 }; 131 132 132 static pjmedia_vid_ stream_op stream_op =133 static pjmedia_vid_dev_stream_op stream_op = 133 134 { 134 135 &qt_stream_get_param, … … 302 303 param->flags = PJMEDIA_VID_DEV_CAP_FORMAT; 303 304 param->clock_rate = DEFAULT_CLOCK_RATE; 304 param->frame_rate.num = DEFAULT_FPS;305 param->frame_rate.denum = 1;306 305 pj_memcpy(¶m->fmt, &di->info.fmt[0], sizeof(param->fmt)); 307 306 … … 348 347 349 348 /* API: create stream */ 350 static pj_status_t qt_factory_create_stream(pjmedia_vid_dev_factory *f, 351 const pjmedia_vid_param *param, 352 const pjmedia_vid_cb *cb, 353 void *user_data, 354 pjmedia_vid_stream **p_vid_strm) 349 static pj_status_t qt_factory_create_stream( 350 pjmedia_vid_dev_factory *f, 351 const pjmedia_vid_param *param, 352 const pjmedia_vid_cb *cb, 353 void *user_data, 354 pjmedia_vid_dev_stream **p_vid_strm) 355 355 { 356 356 struct qt_factory *qf = (struct qt_factory*)f; … … 445 445 446 446 pj_assert(vfd->fps.num); 447 strm->cap_ts_inc = PJMEDIA_SPF2( &strm->param.clock_rate, &vfd->fps, 1);447 strm->cap_ts_inc = PJMEDIA_SPF2(strm->param.clock_rate, &vfd->fps, 1); 448 448 449 449 [strm->video_output setMinimumVideoFrameInterval: … … 470 470 471 471 on_error: 472 qt_stream_destroy((pjmedia_vid_ stream *)strm);472 qt_stream_destroy((pjmedia_vid_dev_stream *)strm); 473 473 474 474 return status; … … 476 476 477 477 /* API: Get stream info. */ 478 static pj_status_t qt_stream_get_param(pjmedia_vid_ stream *s,478 static pj_status_t qt_stream_get_param(pjmedia_vid_dev_stream *s, 479 479 pjmedia_vid_param *pi) 480 480 { … … 495 495 496 496 /* API: get capability */ 497 static pj_status_t qt_stream_get_cap(pjmedia_vid_ stream *s,497 static pj_status_t qt_stream_get_cap(pjmedia_vid_dev_stream *s, 498 498 pjmedia_vid_dev_cap cap, 499 499 void *pval) … … 515 515 516 516 /* API: set capability */ 517 static pj_status_t qt_stream_set_cap(pjmedia_vid_ stream *s,517 static pj_status_t qt_stream_set_cap(pjmedia_vid_dev_stream *s, 518 518 pjmedia_vid_dev_cap cap, 519 519 const void *pval) … … 534 534 535 535 /* API: Start stream. */ 536 static pj_status_t qt_stream_start(pjmedia_vid_ stream *strm)536 static pj_status_t qt_stream_start(pjmedia_vid_dev_stream *strm) 537 537 { 538 538 struct qt_stream *stream = (struct qt_stream*)strm; … … 553 553 554 554 /* API: Stop stream. */ 555 static pj_status_t qt_stream_stop(pjmedia_vid_ stream *strm)555 static pj_status_t qt_stream_stop(pjmedia_vid_dev_stream *strm) 556 556 { 557 557 struct qt_stream *stream = (struct qt_stream*)strm; … … 569 569 570 570 /* API: Destroy stream. */ 571 static pj_status_t qt_stream_destroy(pjmedia_vid_ stream *strm)571 static pj_status_t qt_stream_destroy(pjmedia_vid_dev_stream *strm) 572 572 { 573 573 struct qt_stream *stream = (struct qt_stream*)strm;
Note: See TracChangeset
for help on using the changeset viewer.