Changeset 3399


Ignore:
Timestamp:
Dec 17, 2010 1:17:23 PM (8 years ago)
Author:
ming
Message:

Re #1183:

  • Add PJMEDA_VID_DEV_CAP_OUTPUT_WINDOW capability to ios_dev to allow application to provide their own window for the renderer to display the video.
  • Perform image setting function in the main thread.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/ios_dev.m

    r3395 r3399  
    190190    strcpy(qdi->info.driver, "iOS");         
    191191    qdi->info.dir = PJMEDIA_DIR_RENDER; 
    192     qdi->info.has_callback = PJ_FALSE;    
     192    qdi->info.has_callback = PJ_FALSE; 
     193    qdi->info.caps = PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW; 
    193194     
    194195    if (NSClassFromString(@"AVCaptureSession")) { 
     
    204205        qdi = &qf->dev_info[i]; 
    205206        qdi->info.fmt_cnt = PJ_ARRAY_SIZE(ios_fmts);         
    206         qdi->info.caps = PJMEDIA_VID_DEV_CAP_FORMAT; 
     207        qdi->info.caps |= PJMEDIA_VID_DEV_CAP_FORMAT; 
    207208        qdi->info.fmt = (pjmedia_format*) 
    208209                        pj_pool_calloc(qf->pool, qdi->info.fmt_cnt, 
     
    329330    CGImageRelease(quartzImage); 
    330331     
    331     [stream->imgView setImage:image]; 
     332    [stream->imgView performSelectorOnMainThread:@selector(setImage:) 
     333                     withObject:image waitUntilDone:NO]; 
    332334     
    333335    [pool release]; 
     
    453455        [strm->cap_session addOutput:strm->video_output]; 
    454456         
    455         // Configure your output. 
     457        /* Configure the video output */ 
    456458        strm->vout_delegate = [VOutDelegate alloc]; 
    457459        strm->vout_delegate->stream = strm; 
     
    477479        /* Get the main window */ 
    478480        UIWindow *window = [[UIApplication sharedApplication] keyWindow]; 
     481         
     482        if (param->flags & PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW && param->window) 
     483            window = param->window; 
    479484         
    480485        pj_assert(window); 
Note: See TracChangeset for help on using the changeset viewer.