Skip to content

Commit 7654d06

Browse files
committed
WinRT/UWP build: fix more warnings in media part
1 parent 41489f9 commit 7654d06

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

cmake/templates/dllmain.cpp.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#error "Build configuration error"
1010
#endif
1111

12+
#pragma warning(disable:4447) // Disable warning 'main' signature found without threading model
13+
1214
#define WIN32_LEAN_AND_MEAN
1315
#include <windows.h>
1416

modules/videoio/src/cap_winrt/MediaStreamSink.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ MediaStreamSink::MediaStreamSink(
3535
__in MediaSampleHandler^ sampleHandler
3636
)
3737
: _shutdown(false)
38-
, _id(-1)
38+
, _id((DWORD)-1)
3939
, _width(0)
4040
, _height(0)
4141
{
@@ -207,16 +207,16 @@ HRESULT MediaStreamSink::QueueEvent(
207207
__in MediaEventType met,
208208
__in REFGUID extendedType,
209209
__in HRESULT status,
210-
__in_opt const PROPVARIANT *value
210+
__in_opt const PROPVARIANT *value_
211211
)
212212
{
213-
return ExceptionBoundary([this, met, extendedType, status, value]()
213+
return ExceptionBoundary([this, met, extendedType, status, value_]()
214214
{
215215
auto lock = _lock.LockExclusive();
216216

217217
_VerifyNotShutdown();
218218

219-
CHK(_eventQueue->QueueEventParamVar(met, extendedType, status, value));
219+
CHK(_eventQueue->QueueEventParamVar(met, extendedType, status, value_));
220220
});
221221
}
222222

@@ -381,4 +381,4 @@ void MediaStreamSink::_UpdateMediaType(__in const ComPtr<IMFMediaType>& mt)
381381
}
382382

383383
CHK(mt->CopyAllItems(_curMT.Get()));
384-
}
384+
}

modules/videoio/src/cap_winrt_bridge.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ void VideoioBridge::allocateOutputBuffers()
8181
}
8282

8383
// performed on UI thread
84-
void VideoioBridge::allocateBuffers(int width, int height)
84+
void VideoioBridge::allocateBuffers(int width_, int height_)
8585
{
8686
// allocate input Mats (bgra8 = CV_8UC4, RGB24 = CV_8UC3)
87-
frontInputMat.create(height, width, CV_8UC3);
88-
backInputMat.create(height, width, CV_8UC3);
87+
frontInputMat.create(height_, width_, CV_8UC3);
88+
backInputMat.create(height_, width_, CV_8UC3);
8989

9090
frontInputPtr = frontInputMat.ptr(0);
9191
backInputPtr = backInputMat.ptr(0);
@@ -155,4 +155,4 @@ void VideoioBridge::setHeight(int _height)
155155
height = _height;
156156
}
157157

158-
// end
158+
// end

modules/videoio/src/cap_winrt_capture.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ namespace cv {
154154
// see VideoCapture::read
155155
bool VideoCapture_WinRT::retrieveFrame(int channel, cv::OutputArray outArray)
156156
{
157+
CV_UNUSED(channel);
157158
if (!started) {
158159

159160
int width, height;

modules/videoio/src/cap_winrt_video.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ void Video::CopyOutput() {
238238
auto inAr = VideoioBridge::getInstance().frontInputPtr;
239239
auto outAr = GetData(VideoioBridge::getInstance().frontOutputBuffer->PixelBuffer);
240240

241-
const unsigned int bytesPerPixel = 3;
241+
const unsigned int bytesPerPixel_ = 3;
242242
auto pbScanline = inAr;
243-
auto plPitch = width * bytesPerPixel;
243+
auto plPitch = width * bytesPerPixel_;
244244

245245
auto buf = outAr;
246246
unsigned int colBytes = width * 4;
@@ -254,7 +254,7 @@ void Video::CopyOutput() {
254254

255255
// used for RGB24:
256256
// nb. alpha is set to full opaque
257-
for (unsigned int i = 0, j = 0; i < plPitch; i += bytesPerPixel, j += 4)
257+
for (unsigned int i = 0, j = 0; i < plPitch; i += bytesPerPixel_, j += 4)
258258
{
259259
// swizzle the R and B values (RGB24 to Bgr8)
260260
buf[j] = pbScanline[i + 2];
@@ -317,4 +317,4 @@ bool Video::listDevices() {
317317
return result.get();
318318
}
319319

320-
// end
320+
// end

0 commit comments

Comments
 (0)