WinRT/UWP build: fix more warnings in media part

pull/26384/head
Maksim Shabunin 2 weeks ago
parent 41489f983d
commit 7654d06b83
  1. 2
      cmake/templates/dllmain.cpp.in
  2. 10
      modules/videoio/src/cap_winrt/MediaStreamSink.cpp
  3. 8
      modules/videoio/src/cap_winrt_bridge.cpp
  4. 1
      modules/videoio/src/cap_winrt_capture.cpp
  5. 8
      modules/videoio/src/cap_winrt_video.cpp

@ -9,6 +9,8 @@
#error "Build configuration error"
#endif
#pragma warning(disable:4447) // Disable warning 'main' signature found without threading model
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

@ -35,7 +35,7 @@ MediaStreamSink::MediaStreamSink(
__in MediaSampleHandler^ sampleHandler
)
: _shutdown(false)
, _id(-1)
, _id((DWORD)-1)
, _width(0)
, _height(0)
{
@ -207,16 +207,16 @@ HRESULT MediaStreamSink::QueueEvent(
__in MediaEventType met,
__in REFGUID extendedType,
__in HRESULT status,
__in_opt const PROPVARIANT *value
__in_opt const PROPVARIANT *value_
)
{
return ExceptionBoundary([this, met, extendedType, status, value]()
return ExceptionBoundary([this, met, extendedType, status, value_]()
{
auto lock = _lock.LockExclusive();
_VerifyNotShutdown();
CHK(_eventQueue->QueueEventParamVar(met, extendedType, status, value));
CHK(_eventQueue->QueueEventParamVar(met, extendedType, status, value_));
});
}
@ -381,4 +381,4 @@ void MediaStreamSink::_UpdateMediaType(__in const ComPtr<IMFMediaType>& mt)
}
CHK(mt->CopyAllItems(_curMT.Get()));
}
}

@ -81,11 +81,11 @@ void VideoioBridge::allocateOutputBuffers()
}
// performed on UI thread
void VideoioBridge::allocateBuffers(int width, int height)
void VideoioBridge::allocateBuffers(int width_, int height_)
{
// allocate input Mats (bgra8 = CV_8UC4, RGB24 = CV_8UC3)
frontInputMat.create(height, width, CV_8UC3);
backInputMat.create(height, width, CV_8UC3);
frontInputMat.create(height_, width_, CV_8UC3);
backInputMat.create(height_, width_, CV_8UC3);
frontInputPtr = frontInputMat.ptr(0);
backInputPtr = backInputMat.ptr(0);
@ -155,4 +155,4 @@ void VideoioBridge::setHeight(int _height)
height = _height;
}
// end
// end

@ -154,6 +154,7 @@ namespace cv {
// see VideoCapture::read
bool VideoCapture_WinRT::retrieveFrame(int channel, cv::OutputArray outArray)
{
CV_UNUSED(channel);
if (!started) {
int width, height;

@ -238,9 +238,9 @@ void Video::CopyOutput() {
auto inAr = VideoioBridge::getInstance().frontInputPtr;
auto outAr = GetData(VideoioBridge::getInstance().frontOutputBuffer->PixelBuffer);
const unsigned int bytesPerPixel = 3;
const unsigned int bytesPerPixel_ = 3;
auto pbScanline = inAr;
auto plPitch = width * bytesPerPixel;
auto plPitch = width * bytesPerPixel_;
auto buf = outAr;
unsigned int colBytes = width * 4;
@ -254,7 +254,7 @@ void Video::CopyOutput() {
// used for RGB24:
// nb. alpha is set to full opaque
for (unsigned int i = 0, j = 0; i < plPitch; i += bytesPerPixel, j += 4)
for (unsigned int i = 0, j = 0; i < plPitch; i += bytesPerPixel_, j += 4)
{
// swizzle the R and B values (RGB24 to Bgr8)
buf[j] = pbScanline[i + 2];
@ -317,4 +317,4 @@ bool Video::listDevices() {
return result.get();
}
// end
// end

Loading…
Cancel
Save