- Timestamp:
- Apr 6, 2011 11:30:18 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/qt_dev.m
r3489 r3499 24 24 #if PJMEDIA_VIDEO_DEV_HAS_QT 25 25 26 #include <Foundation/NSAutoreleasePool.h> 26 27 #include <QTKit/QTKit.h> 27 28 … … 42 43 static qt_fmt_info qt_fmts[] = 43 44 { 44 {PJMEDIA_FORMAT_YUY2, kCVPixelFormatType_422YpCbCr8_yuvs} , 45 {PJMEDIA_FORMAT_YUY2, kCVPixelFormatType_422YpCbCr8_yuvs}, 46 {PJMEDIA_FORMAT_UYVY, kCVPixelFormatType_422YpCbCr8}, 45 47 }; 46 48 … … 83 85 void *user_data; /**< Application data. */ 84 86 87 pj_bool_t cap_thread_exited; 88 pj_bool_t cap_thread_initialized; 89 pj_thread_desc cap_thread_desc; 90 pj_thread_t *cap_thread; 91 92 NSAutoreleasePool *apool; 85 93 QTCaptureSession *cap_session; 86 94 QTCaptureDeviceInput *dev_input; … … 171 179 struct qt_dev_info *qdi; 172 180 unsigned i, dev_count = 0; 181 NSAutoreleasePool *apool = [[NSAutoreleasePool alloc]init]; 173 182 NSArray *dev_array; 174 183 … … 245 254 } 246 255 256 [apool release]; 257 247 258 PJ_LOG(4, (THIS_FILE, "qt video initialized with %d devices", 248 259 qf->dev_count)); … … 317 328 pjmedia_frame frame; 318 329 330 if (stream->cap_thread_initialized == 0 || !pj_thread_is_registered()) 331 { 332 pj_thread_register("qt_cap", stream->cap_thread_desc, 333 &stream->cap_thread); 334 stream->cap_thread_initialized = 1; 335 PJ_LOG(5,(THIS_FILE, "Capture thread started")); 336 } 337 319 338 if (!videoFrame) 320 339 return; … … 380 399 pj_memcpy(&strm->vid_cb, cb, sizeof(*cb)); 381 400 strm->user_data = user_data; 401 strm->apool = [[NSAutoreleasePool alloc]init]; 382 402 383 403 /* Create player stream here */ … … 447 467 strm->cap_ts_inc = PJMEDIA_SPF2(strm->param.clock_rate, &vfd->fps, 1); 448 468 449 [strm->video_output setMinimumVideoFrameInterval: 450 (1.0f * vfd->fps.denum / (double)vfd->fps.num)]; 451 452 strm->vout_delegate = [VOutDelegate alloc]; 469 if ([strm->video_output 470 respondsToSelector:@selector(setMinimumVideoFrameInterval)]) 471 { 472 [strm->video_output setMinimumVideoFrameInterval: 473 (1.0f * vfd->fps.denum / 474 (double)vfd->fps.num)]; 475 } 476 477 strm->vout_delegate = [[VOutDelegate alloc]init]; 453 478 strm->vout_delegate->stream = strm; 454 479 [strm->video_output setDelegate:strm->vout_delegate]; … … 547 572 if (![stream->cap_session isRunning]) 548 573 return PJ_EUNKNOWN; 549 } 550 551 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);552 574 575 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false); 576 } 577 553 578 return PJ_SUCCESS; 554 579 } … … 599 624 } 600 625 626 // [stream->apool release]; 601 627 pj_pool_release(stream->pool); 602 628
Note: See TracChangeset
for help on using the changeset viewer.