Don't rotate camera view during getUserMedia logic when running web app.
authoreojin.ham <eojin.ham@samsung.com>
Thu, 11 Apr 2013 03:00:05 +0000 (12:00 +0900)
committerGerrit Code Review <gerrit2@kim11>
Thu, 11 Apr 2013 11:48:04 +0000 (20:48 +0900)
[Title] Don't rotate camera view during getUserMedia logic when running web app.
[Problem] The direciton of camera view is incorrect when rotate device during running 'Self Camera' app.
          (https://tizendev.org/bugs/browse/N_SE-33737)
[Cause] Even if 'auto-rotate' is turned on 'Self Camera' doesn't rotate window.
[Solution] getUserMedia don't know whether the web app will rotate window.
           So don't rotate camera view when running web app.
           If necessary the web app should implement it.

Change-Id: I4c3db52ab6a3a1ee48d55249da72658e9c5ba887

Source/WebCore/platform/graphics/gstreamer/tizen/WebKitCameraSourceGStreamerTizen.cpp

index c47e6f8..285e9ca 100644 (file)
 #include <sensors.h>
 #include <vconf.h>
 
+#if ENABLE(TIZEN_EXTENSIBLE_API)
+#include "TizenExtensibleAPI.h"
+#endif
+
 #define RADIAN_VALUE (57.2957)
 #define VCAPS "video/x-raw-yuv, format=(fourcc)I420, width=(int)320, height=(int)240, framerate=(fraction)30/1"
 
@@ -466,14 +470,18 @@ static void webKitCameraSrcUriHandlerInit(gpointer gIface, gpointer ifaceData)
     iface->set_uri = webKitCameraSrcSetUri;
 }
 
-RotationManager::RotationManager(WebKitCameraSrc* src) : m_src(src)
+RotationManager::RotationManager(WebKitCameraSrc* src) : m_src(src), m_handle(0)
 {
-    registerRotationCallback();
+#if ENABLE(TIZEN_EXTENSIBLE_API)
+    if (TizenExtensibleAPI::extensibleAPI().rotateCameraView())
+        registerRotationCallback();
+#endif
 }
 
 RotationManager::~RotationManager()
 {
-    unregisterRotationCallback();
+    if (m_handle)
+        unregisterRotationCallback();
 }
 
 void RotationManager::onRotationChanged(unsigned long long timeStamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void* userData)