mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Added image flipping ability to MF Grabber
This commit is contained in:
@@ -56,7 +56,7 @@ public:
|
||||
QList<DevicePropertiesItem> valid = QList<DevicePropertiesItem>();
|
||||
};
|
||||
|
||||
MFGrabber(const QString & device, const unsigned width, const unsigned height, const unsigned fps, const unsigned input, int pixelDecimation);
|
||||
MFGrabber(const QString & device, const unsigned width, const unsigned height, const unsigned fps, const unsigned input, int pixelDecimation, QString flipMode);
|
||||
~MFGrabber() override;
|
||||
|
||||
void receive_image(const void *frameImageBuffer, int size);
|
||||
@@ -80,6 +80,7 @@ public:
|
||||
bool setFramerate(int fps) override;
|
||||
void setFpsSoftwareDecimation(int decimation);
|
||||
void setEncoding(QString enc);
|
||||
void setFlipMode(QString flipMode);
|
||||
void setBrightnessContrastSaturationHue(int brightness, int contrast, int saturation, int hue);
|
||||
|
||||
public slots:
|
||||
|
@@ -32,7 +32,7 @@ public:
|
||||
unsigned int threadIndex, PixelFormat pixelFormat, uint8_t* sharedData,
|
||||
int size, int width, int height, int lineLength,
|
||||
int subsamp, unsigned cropLeft, unsigned cropTop, unsigned cropBottom, unsigned cropRight,
|
||||
VideoMode videoMode, int currentFrame, int pixelDecimation);
|
||||
VideoMode videoMode, FlipMode flipMode, int currentFrame, int pixelDecimation);
|
||||
void run();
|
||||
|
||||
bool isBusy();
|
||||
@@ -45,30 +45,33 @@ private:
|
||||
void processImageMjpeg();
|
||||
|
||||
#ifdef HAVE_TURBO_JPEG
|
||||
tjhandle _decompress;
|
||||
tjscalingfactor* _scalingFactors;
|
||||
tjhandle _transform,
|
||||
_decompress;
|
||||
tjscalingfactor* _scalingFactors;
|
||||
tjtransform* _xform;
|
||||
#endif
|
||||
|
||||
static volatile bool _isActive;
|
||||
volatile bool _isBusy;
|
||||
QSemaphore _semaphore;
|
||||
unsigned int _workerIndex;
|
||||
PixelFormat _pixelFormat;
|
||||
uint8_t* _localData;
|
||||
int _localDataSize;
|
||||
int _scalingFactorsCount;
|
||||
int _size;
|
||||
int _width;
|
||||
int _height;
|
||||
int _lineLength;
|
||||
int _subsamp;
|
||||
unsigned _cropLeft;
|
||||
unsigned _cropTop;
|
||||
unsigned _cropBottom;
|
||||
unsigned _cropRight;
|
||||
int _currentFrame;
|
||||
int _pixelDecimation;
|
||||
ImageResampler _imageResampler;
|
||||
volatile bool _isBusy;
|
||||
QSemaphore _semaphore;
|
||||
unsigned int _threadIndex;
|
||||
PixelFormat _pixelFormat;
|
||||
uint8_t* _localData;
|
||||
int _localDataSize,
|
||||
_scalingFactorsCount,
|
||||
_size,
|
||||
_width,
|
||||
_height,
|
||||
_lineLength,
|
||||
_subsamp,
|
||||
_currentFrame,
|
||||
_pixelDecimation;
|
||||
unsigned _cropLeft,
|
||||
_cropTop,
|
||||
_cropBottom,
|
||||
_cropRight;
|
||||
FlipMode _flipMode;
|
||||
ImageResampler _imageResampler;
|
||||
};
|
||||
|
||||
class MFThreadManager : public QObject
|
||||
@@ -116,7 +119,7 @@ public:
|
||||
|
||||
if (_threads != nullptr)
|
||||
{
|
||||
for(unsigned i=0; i < _maxThreads; i++)
|
||||
for(unsigned i = 0; i < _maxThreads; i++)
|
||||
if (_threads[i] != nullptr)
|
||||
{
|
||||
_threads[i]->quit();
|
||||
@@ -125,6 +128,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int _maxThreads;
|
||||
MFThread** _threads;
|
||||
unsigned int _maxThreads;
|
||||
MFThread** _threads;
|
||||
};
|
||||
|
@@ -8,7 +8,7 @@ class MFWrapper : public GrabberWrapper
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MFWrapper(const QString & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned fps, const unsigned input, int pixelDecimation);
|
||||
MFWrapper(const QString & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned fps, const unsigned input, int pixelDecimation, QString flipMode);
|
||||
~MFWrapper() override;
|
||||
|
||||
bool getSignalDetectionEnable() const;
|
||||
|
@@ -86,8 +86,8 @@ private:
|
||||
|
||||
unsigned _display;
|
||||
int _pixelDecimation;
|
||||
unsigned _screenWidth;
|
||||
unsigned _screenHeight;
|
||||
unsigned _calculatedWidth;
|
||||
unsigned _calculatedHeight;
|
||||
unsigned _src_x;
|
||||
unsigned _src_y;
|
||||
unsigned _src_x_max;
|
||||
|
Reference in New Issue
Block a user