[Title] fixed a bug does not open the camera device on Windows XP
authorjinhyung.jo <jinhyung.jo@samsung.com>
Wed, 25 Jul 2012 02:58:30 +0000 (11:58 +0900)
committerjinhyung.jo <jinhyung.jo@samsung.com>
Wed, 25 Jul 2012 02:58:30 +0000 (11:58 +0900)
[Type] Bug Fix
[Module] Emulator / Camera
[Priority] Minor
[CQ#] N_SE-4727
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/hw/maru_camera_win32_pci.c

index 85bcce9d906ce6e280705c799d24810e2ac7a858..d32d3f8116bab5e8a992077947997d390acf0687 100644 (file)
@@ -1455,6 +1455,14 @@ void marucam_device_open(MaruCamState* state)
     MaruCamParam *param = state->param;\r
     param->top = 0;\r
 \r
+    hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);\r
+    if (FAILED(hr)) {\r
+        ERR("CoInitailizeEx\n");\r
+        ERR("camera device open failed!!!, [HRESULT : 0x%x]\n", hr);\r
+        param->errCode = EINVAL;\r
+        return;\r
+    }\r
+\r
     hr = GraphBuilder_Init();\r
     if (FAILED(hr)) {\r
         ERR("GraphBuilder_Init\n");\r
@@ -1496,6 +1504,7 @@ void marucam_device_open(MaruCamState* state)
 \r
 error_failed:\r
     CloseInterfaces();\r
+    CoUninitialize();\r
     param->errCode = EINVAL;\r
     ERR("camera device open failed!!!, [HRESULT : 0x%x]\n", hr);\r
 }\r
@@ -1507,6 +1516,7 @@ void marucam_device_close(MaruCamState* state)
     param->top = 0;\r
 \r
     CloseInterfaces();\r
+    CoUninitialize();\r
     INFO("Close successfully!!!\n");\r
 }\r
 \r