even more changes

Signed-off-by: Paulchen-Panther <Paulchen--Panter@gmx.net>
This commit is contained in:
Paulchen-Panther
2018-12-28 18:12:45 +01:00
parent 3700566d10
commit 2a77f6f012
99 changed files with 2610 additions and 673 deletions

View File

@@ -24,12 +24,13 @@ Grabber::~Grabber()
void Grabber::setEnabled(bool enable)
{
Info(_log,"Capture interface is now %s", enable ? "enabled" : "disabled");
_enabled = enable;
}
void Grabber::setVideoMode(VideoMode mode)
{
Debug(_log,"setvideomode %d", mode);
Debug(_log,"Set videomode to %d", mode);
_videoMode = mode;
if ( _useImageResampler )
{
@@ -68,18 +69,20 @@ void Grabber::setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTo
}
}
void Grabber::setWidthHeight(int width, int height)
bool Grabber::setWidthHeight(int width, int height)
{
// eval changes with crop
if (width>0 && height>0)
if ( (width>0 && height>0) && (_width != width || _height != height) )
{
if (_cropLeft + _cropRight >= width || _cropTop + _cropBottom >= height)
{
Error(_log, "Rejecting invalid width/height values as it collides with image cropping: width: %d, height: %d", width, height);
return;
return false;
}
Debug(_log, "Set new width: %d, height: %d for capture", width, height);
_width = width;
_height = height;
return true;
}
return false;
}