refactor: Address (Windows) compile warnings (#840)

* Windows compile errors and (Qt 5.15 deprecation) warnings

* Usability - Enable/Disable Instance button

Co-authored-by: brindosch <edeltraud70@gmx.de>
This commit is contained in:
LordGrey
2020-06-28 23:05:32 +02:00
committed by GitHub
parent e365a2839d
commit bfb50b8d91
61 changed files with 530 additions and 365 deletions

View File

@@ -159,7 +159,7 @@ int AmlogicGrabber::grabFrame_amvideocap(Image<ColorRgb> & image)
}
_useImageResampler = true;
_imageResampler.processImage((const uint8_t*)_image_ptr, _width, _height, (_width << 1) + _width, PIXELFORMAT_BGR24, image);
_imageResampler.processImage((const uint8_t*)_image_ptr, _width, _height, (_width << 1) + _width, PixelFormat::BGR24, image);
_lastError = 0;
return 0;

View File

@@ -114,15 +114,15 @@ int DispmanxFrameGrabber::grabFrame(Image<ColorRgb> & image)
// calculate final image dimensions and adjust top/left cropping in 3D modes
switch (_videoMode)
{
case VIDEO_3DSBS:
case VideoMode::VIDEO_3DSBS:
imageWidth /= 2;
cropLeft /= 2;
break;
case VIDEO_3DTAB:
case VideoMode::VIDEO_3DTAB:
imageHeight /= 2;
cropTop /= 2;
break;
case VIDEO_2D:
case VideoMode::VIDEO_2D:
default:
break;
}

View File

@@ -44,12 +44,12 @@ int FramebufferFrameGrabber::grabFrame(Image<ColorRgb> & image)
switch (vinfo.bits_per_pixel)
{
case 16: pixelFormat = PIXELFORMAT_BGR16; break;
case 24: pixelFormat = PIXELFORMAT_BGR24; break;
case 16: pixelFormat = PixelFormat::BGR16; break;
case 24: pixelFormat = PixelFormat::BGR24; break;
#ifdef ENABLE_AMLOGIC
case 32: pixelFormat = PIXELFORMAT_RGB32; break;
case 32: pixelFormat = PixelFormat::PIXELFORMAT_RGB32; break;
#else
case 32: pixelFormat = PIXELFORMAT_BGR32; break;
case 32: pixelFormat = PixelFormat::BGR32; break;
#endif
default:
Error(_log, "Unknown pixel format: %d bits per pixel", vinfo.bits_per_pixel);

View File

@@ -50,7 +50,7 @@ int OsxFrameGrabber::grabFrame(Image<ColorRgb> & image)
dspWidth,
dspHeight,
CGImageGetBytesPerRow(dispImage),
PIXELFORMAT_BGR32,
PixelFormat::BGR32,
image);
CFRelease(imgData);

View File

@@ -146,7 +146,7 @@ int QtGrabber::updateScreenDimensions(const bool& force)
// calculate final image dimensions and adjust top/left cropping in 3D modes
switch (_videoMode)
{
case VIDEO_3DSBS:
case VideoMode::VIDEO_3DSBS:
_width = width /2;
_height = height;
_src_x = _cropLeft / 2;
@@ -154,7 +154,7 @@ int QtGrabber::updateScreenDimensions(const bool& force)
_src_x_max = (_screenWidth / 2) - _cropRight;
_src_y_max = _screenHeight - _cropBottom;
break;
case VIDEO_3DTAB:
case VideoMode::VIDEO_3DTAB:
_width = width;
_height = height / 2;
_src_x = _cropLeft;
@@ -162,7 +162,7 @@ int QtGrabber::updateScreenDimensions(const bool& force)
_src_x_max = _screenWidth - _cropRight;
_src_y_max = (_screenHeight / 2) - _cropBottom;
break;
case VIDEO_2D:
case VideoMode::VIDEO_2D:
default:
_width = width;
_height = height;

View File

@@ -591,7 +591,7 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
{
switch (videoStandard)
{
case VIDEOSTANDARD_PAL:
case VideoStandard::PAL:
{
standard.id = V4L2_STD_PAL;
if (-1 == xioctl(VIDIOC_S_STD, &standard.id))
@@ -603,7 +603,7 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
}
break;
case VIDEOSTANDARD_NTSC:
case VideoStandard::NTSC:
{
standard.id = V4L2_STD_NTSC;
if (-1 == xioctl(VIDIOC_S_STD, &standard.id))
@@ -615,7 +615,7 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
}
break;
case VIDEOSTANDARD_SECAM:
case VideoStandard::SECAM:
{
standard.id = V4L2_STD_SECAM;
if (-1 == xioctl(VIDIOC_S_STD, &standard.id))
@@ -627,7 +627,7 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
}
break;
case VIDEOSTANDARD_NO_CHANGE:
case VideoStandard::NO_CHANGE:
default:
// No change to device settings
break;
@@ -648,20 +648,20 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
// set the requested pixel format
switch (_pixelFormat)
{
case PIXELFORMAT_UYVY:
case PixelFormat::UYVY:
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_UYVY;
break;
case PIXELFORMAT_YUYV:
case PixelFormat::YUYV:
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
break;
case PIXELFORMAT_RGB32:
case PixelFormat::RGB32:
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB32;
break;
#ifdef HAVE_JPEG_DECODER
case PIXELFORMAT_MJPEG:
case PixelFormat::MJPEG:
{
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_MJPEG;
fmt.fmt.pix.field = V4L2_FIELD_ANY;
@@ -669,7 +669,7 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
break;
#endif
case PIXELFORMAT_NO_CHANGE:
case PixelFormat::NO_CHANGE:
default:
// No change to device settings
break;
@@ -723,7 +723,7 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
{
case V4L2_PIX_FMT_UYVY:
{
_pixelFormat = PIXELFORMAT_UYVY;
_pixelFormat = PixelFormat::UYVY;
_frameByteSize = _width * _height * 2;
Debug(_log, "Pixel format=UYVY");
}
@@ -731,7 +731,7 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
case V4L2_PIX_FMT_YUYV:
{
_pixelFormat = PIXELFORMAT_YUYV;
_pixelFormat = PixelFormat::YUYV;
_frameByteSize = _width * _height * 2;
Debug(_log, "Pixel format=YUYV");
}
@@ -739,7 +739,7 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
case V4L2_PIX_FMT_RGB32:
{
_pixelFormat = PIXELFORMAT_RGB32;
_pixelFormat = PixelFormat::RGB32;
_frameByteSize = _width * _height * 4;
Debug(_log, "Pixel format=RGB32");
}
@@ -748,7 +748,7 @@ void V4L2Grabber::init_device(VideoStandard videoStandard)
#ifdef HAVE_JPEG_DECODER
case V4L2_PIX_FMT_MJPEG:
{
_pixelFormat = PIXELFORMAT_MJPEG;
_pixelFormat = PixelFormat::MJPEG;
Debug(_log, "Pixel format=MJPEG");
}
break;
@@ -1016,7 +1016,7 @@ bool V4L2Grabber::process_image(const void *p, int size)
{
// We do want a new frame...
#ifdef HAVE_JPEG_DECODER
if (size < _frameByteSize && _pixelFormat != PIXELFORMAT_MJPEG)
if (size < _frameByteSize && _pixelFormat != PixelFormat::MJPEG)
#else
if (size < _frameByteSize)
#endif
@@ -1041,7 +1041,7 @@ void V4L2Grabber::process_image(const uint8_t * data, int size)
* --------------------------------------------------------*/
#ifdef HAVE_JPEG_DECODER
if (_pixelFormat == PIXELFORMAT_MJPEG)
if (_pixelFormat == PixelFormat::MJPEG)
{
#endif
#ifdef HAVE_JPEG

View File

@@ -184,7 +184,7 @@ int X11Grabber::grabFrame(Image<ColorRgb> & image, bool forceUpdate)
return -1;
}
_imageResampler.processImage(reinterpret_cast<const uint8_t *>(_xImage->data), _xImage->width, _xImage->height, _xImage->bytes_per_line, PIXELFORMAT_BGR32, image);
_imageResampler.processImage(reinterpret_cast<const uint8_t *>(_xImage->data), _xImage->width, _xImage->height, _xImage->bytes_per_line, PixelFormat::BGR32, image);
return 0;
}
@@ -244,19 +244,19 @@ int X11Grabber::updateScreenDimensions(bool force)
// calculate final image dimensions and adjust top/left cropping in 3D modes
switch (_videoMode)
{
case VIDEO_3DSBS:
case VideoMode::VIDEO_3DSBS:
_width = width /2;
_height = height;
_src_x = _cropLeft / 2;
_src_y = _cropTop;
break;
case VIDEO_3DTAB:
case VideoMode::VIDEO_3DTAB:
_width = width;
_height = height / 2;
_src_x = _cropLeft;
_src_y = _cropTop / 2;
break;
case VIDEO_2D:
case VideoMode::VIDEO_2D:
default:
_width = width;
_height = height;