From f2738da8d9e4b0e34ca07dae482a0fa5dcf10c9a Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 6 Jun 2013 15:26:21 +0200 Subject: [PATCH] Add linphone_core_get_camera_sensor_rotation(). --- coreapi/linphonecore.c | 10 ++++++++++ coreapi/linphonecore.h | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index f0963f90..202519d7 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -4744,6 +4744,16 @@ void linphone_core_set_device_rotation(LinphoneCore *lc, int rotation) { #endif } +int linphone_core_get_camera_sensor_rotation(LinphoneCore *lc) { +#ifdef VIDEO_ENABLED + LinphoneCall *call = linphone_core_get_current_call(lc); + if ((call != NULL) && (call->videostream != NULL)) { + return video_stream_get_camera_sensor_rotation(call->videostream); + } +#endif + return -1; +} + static MSVideoSizeDef supported_resolutions[]={ #ifdef ENABLE_HD { {MS_VIDEO_SIZE_1080P_W,MS_VIDEO_SIZE_1080P_H} , "1080p" }, diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 67d4fb25..50686a2c 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -1354,6 +1354,17 @@ void linphone_core_use_preview_window(LinphoneCore *lc, bool_t yesno); int linphone_core_get_device_rotation(LinphoneCore *lc ); void linphone_core_set_device_rotation(LinphoneCore *lc, int rotation); +/** + * @brief Get the camera sensor rotation. + * + * This is needed on some mobile platforms to get the number of degrees the camera sensor + * is rotated relative to the screen. + * + * @param lc The linphone core related to the operation + * @return The camera sensor rotation in degrees (0 to 360) or -1 if it could not be retrieved + */ +int linphone_core_get_camera_sensor_rotation(LinphoneCore *lc); + /* start or stop streaming video in case of embedded window */ void linphone_core_show_video(LinphoneCore *lc, bool_t show); -- 2.39.2