[Title] Fixed some bugs for camera on Windows.
authorjinhyung.jo <jinhyung.jo@samsung.com>
Thu, 12 Jul 2012 11:06:37 +0000 (20:06 +0900)
committerjinhyung.jo <jinhyung.jo@samsung.com>
Thu, 12 Jul 2012 11:06:37 +0000 (20:06 +0900)
[Type] Bug Fix
[Module] Emulatorj / Multimedia / Camera
[Priority] Major
[CQ#] N_SE-3228, N_SE-1664
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/hw/maru_camera_win32_pci.c

index acd1ee73b34be5839cbf1d0c5aaec9daf178f25c..85bcce9d906ce6e280705c799d24810e2ac7a858 100644 (file)
@@ -1343,6 +1343,10 @@ static STDMETHODIMP SetDefaultValues(void)
                 DeleteMediaType(pmtConfig);\r
             }\r
         }\r
+        if (iFormat >= iCount) {\r
+            ERR("Maybe connected webcam does not support %ld x %ld resolution.\n", g_dwWidth, g_dwHeight);\r
+            hr = E_FAIL;\r
+        }\r
     }\r
     pSConfig->lpVtbl->Release(pSConfig);\r
     return hr;\r
@@ -1375,6 +1379,9 @@ static STDMETHODIMP SetResolution(LONG width, LONG height)
             pvi->AvgTimePerFrame = g_dwAvgInterval;\r
             pvi->bmiHeader.biSizeImage = ((width * pvi->bmiHeader.biBitCount) >> 3 ) * height;\r
             hr = vsc->lpVtbl->SetFormat(vsc, pmt);\r
+            if (hr != S_OK) {\r
+                ERR("failed to set the resolution.(w:%ld, h:%ld), Maybe connected webcam does not support the resolution.\n", width, height);\r
+            }\r
         }\r
         DeleteMediaType(pmt);\r
     }\r
@@ -1481,6 +1488,8 @@ void marucam_device_open(MaruCamState* state)
         ERR("SetDefaultValues\n");\r
         goto error_failed;\r
     }\r
+    cur_frame_idx = 0;\r
+    cur_fmt_idx = 0;\r
 \r
     INFO("Open successfully!!!\n");\r
     return;\r