diff options
author | Liong Sauw Ming <ming@teluu.com> | 2015-08-21 06:46:32 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2015-08-21 06:46:32 +0000 |
commit | 97c47c4e1e14582218162e7cb8ed5185bd441357 (patch) | |
tree | fe0484a7af6ae60b4046dace0c395b64c923cc88 /pjsip-apps/src | |
parent | 8c6f78c4426aae98c9d72b14afd010a3458a662d (diff) |
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)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5166 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src')
-rw-r--r-- | pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m b/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m index 18d3557e..d85aba45 100644 --- a/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m +++ b/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m @@ -180,6 +180,7 @@ static void pjsuaOnAppConfigCb(pjsua_app_config *cfg) static pj_thread_t *a_thread; static UIDeviceOrientation prev_ori = 0; UIDeviceOrientation dev_ori = [[UIDevice currentDevice] orientation]; + int i; if (dev_ori == prev_ori) return; @@ -192,9 +193,15 @@ static void pjsuaOnAppConfigCb(pjsua_app_config *cfg) pj_thread_register("ipjsua", a_thread_desc, &a_thread); } - pjsua_vid_dev_set_setting(PJMEDIA_VID_DEFAULT_CAPTURE_DEV, - PJMEDIA_VID_DEV_CAP_ORIENTATION, - &pj_ori[dev_ori-1], PJ_TRUE); + /* Here we set the orientation for all video devices. + * This may return failure for renderer devices or for + * capture devices which do not support orientation setting, + * we can simply ignore them. + */ + for (i = pjsua_vid_dev_count()-1; i >= 0; i--) { + pjsua_vid_dev_set_setting(i, PJMEDIA_VID_DEV_CAP_ORIENTATION, + &pj_ori[dev_ori-1], PJ_TRUE); + } } #endif } |