mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 01:53:19 +08:00
Merge pull request #26384 from mshabunin:fix-winrt-warnings-2
WinRT/UWP build: fix more warnings in media part
This commit is contained in:
commit
2756c20e3e
@ -9,6 +9,8 @@
|
|||||||
#error "Build configuration error"
|
#error "Build configuration error"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#pragma warning(disable:4447) // Disable warning 'main' signature found without threading model
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ MediaStreamSink::MediaStreamSink(
|
|||||||
__in MediaSampleHandler^ sampleHandler
|
__in MediaSampleHandler^ sampleHandler
|
||||||
)
|
)
|
||||||
: _shutdown(false)
|
: _shutdown(false)
|
||||||
, _id(-1)
|
, _id((DWORD)-1)
|
||||||
, _width(0)
|
, _width(0)
|
||||||
, _height(0)
|
, _height(0)
|
||||||
{
|
{
|
||||||
@ -207,16 +207,16 @@ HRESULT MediaStreamSink::QueueEvent(
|
|||||||
__in MediaEventType met,
|
__in MediaEventType met,
|
||||||
__in REFGUID extendedType,
|
__in REFGUID extendedType,
|
||||||
__in HRESULT status,
|
__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();
|
auto lock = _lock.LockExclusive();
|
||||||
|
|
||||||
_VerifyNotShutdown();
|
_VerifyNotShutdown();
|
||||||
|
|
||||||
CHK(_eventQueue->QueueEventParamVar(met, extendedType, status, value));
|
CHK(_eventQueue->QueueEventParamVar(met, extendedType, status, value_));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,11 +81,11 @@ void VideoioBridge::allocateOutputBuffers()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// performed on UI thread
|
// 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)
|
// allocate input Mats (bgra8 = CV_8UC4, RGB24 = CV_8UC3)
|
||||||
frontInputMat.create(height, width, CV_8UC3);
|
frontInputMat.create(height_, width_, CV_8UC3);
|
||||||
backInputMat.create(height, width, CV_8UC3);
|
backInputMat.create(height_, width_, CV_8UC3);
|
||||||
|
|
||||||
frontInputPtr = frontInputMat.ptr(0);
|
frontInputPtr = frontInputMat.ptr(0);
|
||||||
backInputPtr = backInputMat.ptr(0);
|
backInputPtr = backInputMat.ptr(0);
|
||||||
|
@ -154,6 +154,7 @@ namespace cv {
|
|||||||
// see VideoCapture::read
|
// see VideoCapture::read
|
||||||
bool VideoCapture_WinRT::retrieveFrame(int channel, cv::OutputArray outArray)
|
bool VideoCapture_WinRT::retrieveFrame(int channel, cv::OutputArray outArray)
|
||||||
{
|
{
|
||||||
|
CV_UNUSED(channel);
|
||||||
if (!started) {
|
if (!started) {
|
||||||
|
|
||||||
int width, height;
|
int width, height;
|
||||||
|
@ -238,9 +238,9 @@ void Video::CopyOutput() {
|
|||||||
auto inAr = VideoioBridge::getInstance().frontInputPtr;
|
auto inAr = VideoioBridge::getInstance().frontInputPtr;
|
||||||
auto outAr = GetData(VideoioBridge::getInstance().frontOutputBuffer->PixelBuffer);
|
auto outAr = GetData(VideoioBridge::getInstance().frontOutputBuffer->PixelBuffer);
|
||||||
|
|
||||||
const unsigned int bytesPerPixel = 3;
|
const unsigned int bytesPerPixel_ = 3;
|
||||||
auto pbScanline = inAr;
|
auto pbScanline = inAr;
|
||||||
auto plPitch = width * bytesPerPixel;
|
auto plPitch = width * bytesPerPixel_;
|
||||||
|
|
||||||
auto buf = outAr;
|
auto buf = outAr;
|
||||||
unsigned int colBytes = width * 4;
|
unsigned int colBytes = width * 4;
|
||||||
@ -254,7 +254,7 @@ void Video::CopyOutput() {
|
|||||||
|
|
||||||
// used for RGB24:
|
// used for RGB24:
|
||||||
// nb. alpha is set to full opaque
|
// 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)
|
// swizzle the R and B values (RGB24 to Bgr8)
|
||||||
buf[j] = pbScanline[i + 2];
|
buf[j] = pbScanline[i + 2];
|
||||||
|
Loading…
Reference in New Issue
Block a user