Ignore:
Timestamp:
Aug 21, 2015 6:46:32 AM (9 years ago)
Author:
ming
Message:

Fixed #1880: Incorrect orientation after switching video capture or when using back camera

Included in this fix:

  • Change the spec & doc of pjmedia_orient enumeration
  • Change iOS sample app to rotate all video devices upon orientation change event.
  • Set orientation as well when fast switching cameras (for iOS and Android)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m

    r5125 r5166  
    181181    static UIDeviceOrientation prev_ori = 0; 
    182182    UIDeviceOrientation dev_ori = [[UIDevice currentDevice] orientation]; 
     183    int i; 
    183184     
    184185    if (dev_ori == prev_ori) return; 
     
    193194        } 
    194195         
    195         pjsua_vid_dev_set_setting(PJMEDIA_VID_DEFAULT_CAPTURE_DEV, 
    196                                   PJMEDIA_VID_DEV_CAP_ORIENTATION, 
    197                                   &pj_ori[dev_ori-1], PJ_TRUE); 
     196        /* Here we set the orientation for all video devices. 
     197         * This may return failure for renderer devices or for 
     198         * capture devices which do not support orientation setting, 
     199         * we can simply ignore them. 
     200         */ 
     201        for (i = pjsua_vid_dev_count()-1; i >= 0; i--) { 
     202            pjsua_vid_dev_set_setting(i, PJMEDIA_VID_DEV_CAP_ORIENTATION, 
     203                                      &pj_ori[dev_ori-1], PJ_TRUE); 
     204        } 
    198205    } 
    199206#endif 
Note: See TracChangeset for help on using the changeset viewer.