Changeset 4891


Ignore:
Timestamp:
Aug 19, 2014 1:37:12 AM (10 years ago)
Author:
ming
Message:

Re #1762: Related to r4838, check whether the device supports the capture size before deciding to use it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-videodev/ios_dev.m

    r4853 r4891  
    568568        } 
    569569         
     570        AVCaptureDevice *dev = qf->dev_info[param->cap_id].dev; 
     571         
    570572        /* Find the closest supported size */ 
    571         for(i = 0; i < PJ_ARRAY_SIZE(supported_size)-1; ++i) { 
    572             if (supported_size[i] >= requested_size) 
     573        for(i = PJ_ARRAY_SIZE(supported_size)-1; i > 0; --i) { 
     574            if (![dev supportsAVCaptureSessionPreset: size_preset_str[i]]) 
     575                continue; 
     576            if (supported_size[i-1] < requested_size) 
    573577                break; 
    574578        } 
     
    584588 
    585589        /* Set frame rate, this may only work on iOS 7 or later */ 
    586         AVCaptureDevice *dev = qf->dev_info[param->cap_id].dev; 
    587590        if ([dev respondsToSelector:@selector(activeVideoMinFrameDuration)] && 
    588591            [dev lockForConfiguration:NULL]) 
Note: See TracChangeset for help on using the changeset viewer.