build: fix MSVS build problems
authorAlexander Alekhin <alexander.alekhin@intel.com>
Tue, 10 Apr 2018 11:42:49 +0000 (14:42 +0300)
committerAlexander Alekhin <alexander.alekhin@intel.com>
Tue, 10 Apr 2018 11:50:56 +0000 (14:50 +0300)
with 'CL=/permissive-'

modules/imgproc/src/color_lab.cpp
modules/videoio/src/cap_msmf.cpp
modules/videoio/src/cap_msmf.hpp

index a61a116..61e30a9 100644 (file)
@@ -700,7 +700,7 @@ struct XYZ2RGB_f<float>
     : dstcn(_dstcn), blueIdx(_blueIdx)
     {
         for(int i = 0; i < 9; i++)
-            coeffs[i] = _coeffs ? _coeffs[i] : XYZ2sRGB_D65[i];
+            coeffs[i] = _coeffs ? _coeffs[i] : (float)XYZ2sRGB_D65[i];
         if(blueIdx == 0)
         {
             std::swap(coeffs[0], coeffs[6]);
index 8533bab..d4582d6 100644 (file)
@@ -543,7 +543,7 @@ public:
     // Getting frame rate, which is getting from videodevice with deviceID
     unsigned int getFrameRate(int deviceID) const;
     // Getting name of videodevice with deviceID
-    wchar_t *getNameVideoDevice(int deviceID);
+    const wchar_t *getNameVideoDevice(int deviceID);
     // Getting interface MediaSource for Media Foundation from videodevice with deviceID
     IMFMediaSource *getMediaSource(int deviceID);
     // Getting format with id, which is supported by videodevice with deviceID
@@ -1371,8 +1371,10 @@ void ImageGrabberCallback::resumeGrabbing()
 
 HRESULT ImageGrabber::CreateTopology(IMFMediaSource *pSource, IMFActivate *pSinkActivate, IMFTopology **ppTopo)
 {
+    HRESULT hr = S_OK;
+    { // "done:" scope
     _ComPtr<IMFPresentationDescriptor> pPD = NULL;
-    HRESULT hr = !pSource ? E_POINTER : S_OK; CHECK_HR(hr);
+    hr = !pSource ? E_POINTER : S_OK; CHECK_HR(hr);
     CHECK_HR(hr = pSource->CreatePresentationDescriptor(pPD.GetAddressOf()));
 
     DWORD cStreams = 0;
@@ -1455,6 +1457,7 @@ HRESULT ImageGrabber::CreateTopology(IMFMediaSource *pSource, IMFActivate *pSink
     else
         hr = E_INVALIDARG;
 
+    } // "done:" scope
 done:
     return hr;
 }
@@ -2613,11 +2616,14 @@ HRESULT videoDevice::enumerateCaptureFormats(MAKE_WRL_REF(_MediaCapture) pSource
 
 HRESULT videoDevice::enumerateCaptureFormats(IMFMediaSource *pSource)
 {
+    HRESULT hr = S_OK;
+    { // "done:" scope
+
     _ComPtr<IMFPresentationDescriptor> pPD = NULL;
     _ComPtr<IMFStreamDescriptor> pSD = NULL;
     _ComPtr<IMFMediaTypeHandler> pHandler = NULL;
     _ComPtr<IMFMediaType> pType = NULL;
-    HRESULT hr = !pSource ? E_POINTER : S_OK;
+    hr = !pSource ? E_POINTER : S_OK;
     if (FAILED(hr))
     {
         goto done;
@@ -2655,6 +2661,7 @@ HRESULT videoDevice::enumerateCaptureFormats(IMFMediaSource *pSource)
         vd_CurrentFormats.push_back(MT);
     }
 
+    } // "done:" scope
 done:
     return hr;
 }
@@ -3234,7 +3241,7 @@ unsigned int videoInput::getFrameRate(int deviceID) const
     return 0;
 }
 
-wchar_t *videoInput::getNameVideoDevice(int deviceID)
+const wchar_t *videoInput::getNameVideoDevice(int deviceID)
 {
     if (deviceID < 0)
     {
index cb0514f..2d48f86 100644 (file)
@@ -2088,7 +2088,7 @@ template <class T, bool NULLABLE = FALSE>
 class ComPtrList : public List<T*>
 {
 public:
-
+    typedef typename List<T*>::Node Node;
     typedef T* Ptr;
 
     void Clear()