mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Merge remote-tracking branch 'refs/remotes/tvdzwan/master'
Former-commit-id: 59c1c363863c950e91ac57cc2ff39a722359634b
This commit is contained in:
@@ -25,7 +25,7 @@ public:
|
||||
/// @param hyperion Hyperion instance
|
||||
/// @param port port number on which to start listening for connections
|
||||
///
|
||||
BoblightServer(Hyperion * hyperion, uint16_t port = 19333);
|
||||
BoblightServer(Hyperion * hyperion, const int priority, uint16_t port = 19333);
|
||||
~BoblightServer();
|
||||
|
||||
///
|
||||
@@ -54,4 +54,7 @@ private:
|
||||
|
||||
/// List with open connections
|
||||
QSet<BoblightClientConnection *> _openConnections;
|
||||
|
||||
/// hyperion priority
|
||||
const int _priority;
|
||||
};
|
||||
|
@@ -33,7 +33,7 @@ public:
|
||||
/// @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, Hyperion * hyperion);
|
||||
AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion);
|
||||
|
||||
///
|
||||
/// Destructor of this dispmanx frame grabber. Releases any claimed resources.
|
||||
|
@@ -33,7 +33,7 @@ public:
|
||||
/// @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, Hyperion * hyperion);
|
||||
DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion);
|
||||
|
||||
///
|
||||
/// Destructor of this dispmanx frame grabber. Releases any claimed resources.
|
||||
|
59
include/grabber/FramebufferFrameGrabber.h
Normal file
59
include/grabber/FramebufferFrameGrabber.h
Normal file
@@ -0,0 +1,59 @@
|
||||
#pragma once
|
||||
|
||||
// Utils includes
|
||||
#include <utils/Image.h>
|
||||
#include <utils/ColorRgb.h>
|
||||
#include <utils/VideoMode.h>
|
||||
#include <utils/ImageResampler.h>
|
||||
|
||||
///
|
||||
/// The FramebufferFrameGrabber is used for creating snapshots of the display (screenshots)
|
||||
///
|
||||
class FramebufferFrameGrabber
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Construct a FramebufferFrameGrabber that will capture snapshots with specified dimensions.
|
||||
///
|
||||
/// @param[in] device The framebuffer device name/path
|
||||
/// @param[in] width The width of the captured screenshot
|
||||
/// @param[in] height The heigth of the captured screenshot
|
||||
///
|
||||
FramebufferFrameGrabber(const std::string & device, const unsigned width, const unsigned height);
|
||||
~FramebufferFrameGrabber();
|
||||
|
||||
///
|
||||
/// Set the video mode (2D/3D)
|
||||
/// @param[in] mode The new video mode
|
||||
///
|
||||
void setVideoMode(const VideoMode videoMode);
|
||||
|
||||
///
|
||||
/// 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
|
||||
/// _height)
|
||||
///
|
||||
/// @param[out] image The snapped screenshot (should be initialized with correct width and
|
||||
/// height)
|
||||
///
|
||||
void grabFrame(Image<ColorRgb> & image);
|
||||
|
||||
private:
|
||||
/// Framebuffer file descriptor
|
||||
int _fbfd;
|
||||
|
||||
/// Pointer to framebuffer
|
||||
unsigned char * _fbp;
|
||||
|
||||
/// Framebuffer device e.g. /dev/fb0
|
||||
const std::string _fbDevice;
|
||||
|
||||
/// With of the captured snapshot [pixels]
|
||||
const unsigned _width;
|
||||
|
||||
/// Height of the captured snapshot [pixels]
|
||||
const unsigned _height;
|
||||
|
||||
/// Image resampler for downscaling the image
|
||||
ImageResampler * _imgResampler;
|
||||
};
|
@@ -33,7 +33,7 @@ public:
|
||||
/// @param[in] updateRate_Hz The image grab rate [Hz]
|
||||
/// @param[in] hyperion The instance of Hyperion used to write the led values
|
||||
///
|
||||
FramebufferWrapper(const std::string & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, Hyperion * hyperion);
|
||||
FramebufferWrapper(const std::string & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion);
|
||||
|
||||
///
|
||||
/// Destructor of this framebuffer frame grabber. Releases any claimed resources.
|
||||
|
59
include/grabber/OsxFrameGrabber.h
Normal file
59
include/grabber/OsxFrameGrabber.h
Normal file
@@ -0,0 +1,59 @@
|
||||
#pragma once
|
||||
|
||||
// OSX includes
|
||||
#include <CoreGraphics/CoreGraphics.h>
|
||||
|
||||
// Utils includes
|
||||
#include <utils/Image.h>
|
||||
#include <utils/ColorRgb.h>
|
||||
#include <utils/VideoMode.h>
|
||||
#include <utils/ImageResampler.h>
|
||||
|
||||
///
|
||||
/// The OsxFrameGrabber is used for creating snapshots of the display (screenshots)
|
||||
///
|
||||
class OsxFrameGrabber
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Construct a OsxFrameGrabber that will capture snapshots with specified dimensions.
|
||||
///
|
||||
/// @param[in] display The index of the display to capture
|
||||
/// @param[in] width The width of the captured screenshot
|
||||
/// @param[in] height The heigth of the captured screenshot
|
||||
///
|
||||
OsxFrameGrabber(const unsigned display, const unsigned width, const unsigned height);
|
||||
~OsxFrameGrabber();
|
||||
|
||||
///
|
||||
/// Set the video mode (2D/3D)
|
||||
/// @param[in] mode The new video mode
|
||||
///
|
||||
void setVideoMode(const VideoMode videoMode);
|
||||
|
||||
///
|
||||
/// 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
|
||||
/// _height)
|
||||
///
|
||||
/// @param[out] image The snapped screenshot (should be initialized with correct width and
|
||||
/// height)
|
||||
///
|
||||
void grabFrame(Image<ColorRgb> & image);
|
||||
|
||||
private:
|
||||
/// display
|
||||
const unsigned _screenIndex;
|
||||
|
||||
/// With of the captured snapshot [pixels]
|
||||
const unsigned _width;
|
||||
|
||||
/// Height of the captured snapshot [pixels]
|
||||
const unsigned _height;
|
||||
|
||||
/// Reference to the captured diaplay
|
||||
CGDirectDisplayID _display;
|
||||
|
||||
/// Image resampler for downscaling the image
|
||||
ImageResampler * _imgResampler;
|
||||
};
|
@@ -34,7 +34,7 @@ public:
|
||||
/// @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, Hyperion * hyperion);
|
||||
OsxWrapper(const unsigned display, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority, Hyperion * hyperion);
|
||||
|
||||
///
|
||||
/// Destructor of this osx frame grabber. Releases any claimed resources.
|
||||
|
Reference in New Issue
Block a user