mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Details coming soon.
This commit is contained in:
@@ -18,9 +18,8 @@ public:
|
||||
/// @param[in] grabWidth The width of the grabbed image [pixels]
|
||||
/// @param[in] grabHeight The height of the grabbed images [pixels]
|
||||
/// @param[in] updateRate_Hz The image grab rate [Hz]
|
||||
/// @param[in] hyperion The instance of Hyperion used to write the led values
|
||||
///
|
||||
AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority);
|
||||
AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz);
|
||||
|
||||
///
|
||||
/// Destructor of this dispmanx frame grabber. Releases any claimed resources.
|
||||
|
@@ -40,14 +40,23 @@ public:
|
||||
///
|
||||
int grabFrame(Image<ColorRgb> & image);
|
||||
|
||||
///
|
||||
///@brief Set new width and height for dispmanx, overwrite Grabber.h impl
|
||||
virtual void setWidthHeight(int width, int height);
|
||||
|
||||
private:
|
||||
///
|
||||
///
|
||||
/// Updates the frame-grab flags as used by the VC library for frame grabbing
|
||||
///
|
||||
/// @param vc_flags The snapshot grabbing mask
|
||||
///
|
||||
void setFlags(const int vc_flags);
|
||||
|
||||
|
||||
///
|
||||
/// @brief free _vc_resource and captureBuffer
|
||||
///
|
||||
void freeResources();
|
||||
|
||||
/// Handle to the display that is being captured
|
||||
DISPMANX_DISPLAY_HANDLE_T _vc_display;
|
||||
|
||||
|
@@ -7,8 +7,7 @@
|
||||
|
||||
///
|
||||
/// The DispmanxWrapper uses an instance of the DispmanxFrameGrabber to obtain ImageRgb's from the
|
||||
/// displayed content. This ImageRgb is processed to a ColorRgb for each led and commmited to the
|
||||
/// attached Hyperion.
|
||||
/// displayed content. This ImageRgb is forwarded to all Hyperion instances via HyperionDaemon
|
||||
///
|
||||
class DispmanxWrapper: public GrabberWrapper
|
||||
{
|
||||
@@ -20,9 +19,8 @@ public:
|
||||
/// @param[in] grabWidth The width of the grabbed image [pixels]
|
||||
/// @param[in] grabHeight The height of the grabbed images [pixels]
|
||||
/// @param[in] updateRate_Hz The image grab rate [Hz]
|
||||
/// @param[in] hyperion The instance of Hyperion used to write the led values
|
||||
///
|
||||
DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority);
|
||||
DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz);
|
||||
|
||||
///
|
||||
/// Destructor of this dispmanx frame grabber. Releases any claimed resources.
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#include <hyperion/Grabber.h>
|
||||
|
||||
///
|
||||
/// The FramebufferFrameGrabber is used for creating snapshots of the display (screenshots)
|
||||
/// The FramebufferFrameGrabber is used for creating snapshots of the display (screenshots)
|
||||
///
|
||||
class FramebufferFrameGrabber : public Grabber
|
||||
{
|
||||
@@ -30,13 +30,18 @@ public:
|
||||
///
|
||||
int grabFrame(Image<ColorRgb> & image);
|
||||
|
||||
///
|
||||
/// @brief Overwrite Grabber.h implememtation
|
||||
///
|
||||
virtual void setDevicePath(const QString& path);
|
||||
|
||||
private:
|
||||
/// Framebuffer file descriptor
|
||||
int _fbfd;
|
||||
|
||||
/// Pointer to framebuffer
|
||||
unsigned char * _fbp;
|
||||
|
||||
|
||||
/// Framebuffer device e.g. /dev/fb0
|
||||
const QString _fbDevice;
|
||||
QString _fbDevice;
|
||||
};
|
||||
|
@@ -20,7 +20,7 @@ public:
|
||||
/// @param[in] grabHeight The height of the grabbed images [pixels]
|
||||
/// @param[in] updateRate_Hz The image grab rate [Hz]
|
||||
///
|
||||
FramebufferWrapper(const QString & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority);
|
||||
FramebufferWrapper(const QString & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz);
|
||||
|
||||
///
|
||||
/// Destructor of this framebuffer frame grabber. Releases any claimed resources.
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include <hyperion/Grabber.h>
|
||||
|
||||
///
|
||||
/// The OsxFrameGrabber is used for creating snapshots of the display (screenshots)
|
||||
/// The OsxFrameGrabber is used for creating snapshots of the display (screenshots)
|
||||
///
|
||||
class OsxFrameGrabber : public Grabber
|
||||
{
|
||||
@@ -37,10 +37,15 @@ public:
|
||||
///
|
||||
int grabFrame(Image<ColorRgb> & image);
|
||||
|
||||
private:
|
||||
///
|
||||
/// @brief Overwrite Grabber.h implementation
|
||||
///
|
||||
virtual void setDisplayIndex(int index);
|
||||
|
||||
private:
|
||||
/// display
|
||||
const unsigned _screenIndex;
|
||||
|
||||
unsigned _screenIndex;
|
||||
|
||||
/// Reference to the captured diaplay
|
||||
CGDirectDisplayID _display;
|
||||
};
|
||||
|
@@ -19,9 +19,8 @@ public:
|
||||
/// @param[in] grabWidth The width of the grabbed image [pixels]
|
||||
/// @param[in] grabHeight The height of the grabbed images [pixels]
|
||||
/// @param[in] updateRate_Hz The image grab rate [Hz]
|
||||
/// @param[in] hyperion The instance of Hyperion used to write the led values
|
||||
///
|
||||
OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority);
|
||||
OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz);
|
||||
|
||||
///
|
||||
/// Destructor of this osx frame grabber. Releases any claimed resources.
|
||||
|
@@ -24,12 +24,9 @@ class V4L2Grabber : public Grabber
|
||||
public:
|
||||
V4L2Grabber(const QString & device,
|
||||
int input,
|
||||
VideoStandard videoStandard, PixelFormat pixelFormat,
|
||||
unsigned width,
|
||||
unsigned height,
|
||||
int frameDecimation,
|
||||
int horizontalPixelDecimation,
|
||||
int verticalPixelDecimation
|
||||
VideoStandard videoStandard,
|
||||
PixelFormat pixelFormat,
|
||||
int pixelDecimation
|
||||
);
|
||||
virtual ~V4L2Grabber();
|
||||
|
||||
@@ -37,21 +34,46 @@ public:
|
||||
bool getSignalDetectionEnabled();
|
||||
|
||||
int grabFrame(Image<ColorRgb> &);
|
||||
|
||||
public slots:
|
||||
void setSignalThreshold(
|
||||
|
||||
///
|
||||
/// @brief overwrite Grabber.h implementation, as v4l doesn't use width/height
|
||||
///
|
||||
virtual void setWidthHeight(){};
|
||||
|
||||
///
|
||||
/// @brief set new PixelDecimation value to ImageResampler
|
||||
/// @param pixelDecimation The new pixelDecimation value
|
||||
///
|
||||
virtual void setPixelDecimation(int pixelDecimation);
|
||||
|
||||
///
|
||||
/// @brief overwrite Grabber.h implementation
|
||||
///
|
||||
virtual void setSignalThreshold(
|
||||
double redSignalThreshold,
|
||||
double greenSignalThreshold,
|
||||
double blueSignalThreshold,
|
||||
int noSignalCounterThreshold);
|
||||
int noSignalCounterThreshold = 50);
|
||||
|
||||
void setSignalDetectionOffset(
|
||||
///
|
||||
/// @brief overwrite Grabber.h implementation
|
||||
///
|
||||
virtual void setSignalDetectionOffset(
|
||||
double verticalMin,
|
||||
double horizontalMin,
|
||||
double verticalMax,
|
||||
double horizontalMax);
|
||||
///
|
||||
/// @brief overwrite Grabber.h implementation
|
||||
///
|
||||
virtual void setSignalDetectionEnable(bool enable);
|
||||
|
||||
void setSignalDetectionEnable(bool enable);
|
||||
///
|
||||
/// @brief overwrite Grabber.h implementation
|
||||
///
|
||||
virtual void setInputVideoStandard(int input, VideoStandard videoStandard);
|
||||
|
||||
public slots:
|
||||
|
||||
bool start();
|
||||
|
||||
@@ -66,7 +88,7 @@ private slots:
|
||||
|
||||
private:
|
||||
void getV4Ldevices();
|
||||
|
||||
|
||||
bool init();
|
||||
void uninit();
|
||||
|
||||
@@ -120,9 +142,9 @@ private:
|
||||
std::vector<buffer> _buffers;
|
||||
|
||||
PixelFormat _pixelFormat;
|
||||
int _pixelDecimation;
|
||||
int _lineLength;
|
||||
int _frameByteSize;
|
||||
int _frameDecimation;
|
||||
|
||||
// signal detection
|
||||
int _noSignalCounterThreshold;
|
||||
@@ -134,7 +156,6 @@ private:
|
||||
double _y_frac_min;
|
||||
double _x_frac_max;
|
||||
double _y_frac_max;
|
||||
int _currentFrame;
|
||||
|
||||
QSocketNotifier * _streamNotifier;
|
||||
|
||||
|
@@ -12,14 +12,7 @@ public:
|
||||
int input,
|
||||
VideoStandard videoStandard,
|
||||
PixelFormat pixelFormat,
|
||||
unsigned width,
|
||||
unsigned height,
|
||||
int frameDecimation,
|
||||
int pixelDecimation,
|
||||
double redSignalThreshold,
|
||||
double greenSignalThreshold,
|
||||
double blueSignalThreshold,
|
||||
const int priority);
|
||||
int pixelDecimation );
|
||||
virtual ~V4L2Wrapper() {};
|
||||
|
||||
bool getSignalDetectionEnable();
|
||||
@@ -28,19 +21,16 @@ public slots:
|
||||
bool start();
|
||||
void stop();
|
||||
|
||||
void setSignalThreshold(double redSignalThreshold, double greenSignalThreshold, double blueSignalThreshold);
|
||||
void setCropping(int cropLeft, int cropRight, int cropTop, int cropBottom);
|
||||
void setSignalDetectionOffset(double verticalMin, double horizontalMin, double verticalMax, double horizontalMax);
|
||||
void setSignalDetectionEnable(bool enable);
|
||||
|
||||
// signals:
|
||||
// void emitColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms);
|
||||
|
||||
private slots:
|
||||
void newFrame(const Image<ColorRgb> & image);
|
||||
void readError(const char* err);
|
||||
|
||||
virtual void action();
|
||||
void checkSources();
|
||||
|
||||
private:
|
||||
/// The V4L2 grabber
|
||||
|
@@ -17,12 +17,12 @@ class X11Grabber : public Grabber
|
||||
{
|
||||
public:
|
||||
|
||||
X11Grabber(bool useXGetImage, int cropLeft, int cropRight, int cropTop, int cropBottom, int horizontalPixelDecimation, int verticalPixelDecimation);
|
||||
X11Grabber(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation);
|
||||
|
||||
virtual ~X11Grabber();
|
||||
|
||||
bool Setup();
|
||||
|
||||
|
||||
///
|
||||
/// Captures a single snapshot of the display and writes the data to the given image. The
|
||||
/// provided image should have the same dimensions as the configured values (_width and
|
||||
@@ -32,15 +32,34 @@ public:
|
||||
/// height)
|
||||
///
|
||||
virtual int grabFrame(Image<ColorRgb> & image, bool forceUpdate=false);
|
||||
|
||||
|
||||
///
|
||||
/// update dimension according current screen
|
||||
int updateScreenDimensions(bool force=false);
|
||||
|
||||
virtual void setVideoMode(VideoMode mode);
|
||||
|
||||
///
|
||||
/// @brief Apply new width/height values, overwrite Grabber.h implementation as X11 doesn't use width/height, just pixelDecimation to calc dimensions
|
||||
///
|
||||
virtual void setWidthHeight(int width, int height);
|
||||
|
||||
///
|
||||
/// @brief Apply new pixelDecimation
|
||||
///
|
||||
virtual void setPixelDecimation(int pixelDecimation);
|
||||
|
||||
///
|
||||
/// Set the crop values
|
||||
/// @param cropLeft Left pixel crop
|
||||
/// @param cropRight Right pixel crop
|
||||
/// @param cropTop Top pixel crop
|
||||
/// @param cropBottom Bottom pixel crop
|
||||
///
|
||||
virtual void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom);
|
||||
|
||||
private:
|
||||
bool _useXGetImage, _XShmAvailable, _XShmPixmapAvailable, _XRenderAvailable;
|
||||
bool _XShmAvailable, _XShmPixmapAvailable, _XRenderAvailable;
|
||||
|
||||
XImage* _xImage;
|
||||
XShmSegmentInfo _shminfo;
|
||||
@@ -49,17 +68,16 @@ private:
|
||||
Display* _x11Display;
|
||||
Window _window;
|
||||
XWindowAttributes _windowAttr;
|
||||
|
||||
|
||||
Pixmap _pixmap;
|
||||
XRenderPictFormat* _srcFormat;
|
||||
XRenderPictFormat* _dstFormat;
|
||||
XRenderPictureAttributes _pictAttr;
|
||||
Picture _srcPicture;
|
||||
Picture _dstPicture;
|
||||
|
||||
|
||||
XTransform _transform;
|
||||
int _horizontalDecimation;
|
||||
int _verticalDecimation;
|
||||
int _pixelDecimation;
|
||||
|
||||
unsigned _screenWidth;
|
||||
unsigned _screenHeight;
|
||||
@@ -67,7 +85,7 @@ private:
|
||||
unsigned _src_y;
|
||||
|
||||
Image<ColorRgb> _image;
|
||||
|
||||
|
||||
void freeResources();
|
||||
void setupResources();
|
||||
};
|
||||
|
@@ -24,7 +24,7 @@ public:
|
||||
/// @param[in] grabHeight The height of the grabbed images [pixels]
|
||||
/// @param[in] updateRate_Hz The image grab rate [Hz]
|
||||
///
|
||||
X11Wrapper(bool useXGetImage, int cropLeft, int cropRight, int cropTop, int cropBottom, int horizontalPixelDecimation, int verticalPixelDecimation, const unsigned updateRate_Hz, const int priority);
|
||||
X11Wrapper(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, const unsigned updateRate_Hz);
|
||||
|
||||
///
|
||||
/// Destructor of this framebuffer frame grabber. Releases any claimed resources.
|
||||
@@ -43,4 +43,3 @@ private:
|
||||
|
||||
bool _init;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user