build: fix MSVS build problems

with 'CL=/permissive-'
This commit is contained in:
Alexander Alekhin 2018-04-10 14:42:49 +03:00
parent a68ffc81da
commit d2d9fd6945
3 changed files with 13 additions and 6 deletions

View 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]);

View 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)
{

View 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()