mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
implement set videomode via json api (#457)
* implement set videomode via json api * refactor grabbers: - new base class - move shared code to base class * fix osx * rework all cmakelist files with auto file collection. except leddevices (need further restructuring) * store current video and grabbing mode * add json stuff * remove grabbingmode - we do not want to expose it
This commit is contained in:
@@ -6,20 +6,13 @@
|
||||
// Local includes
|
||||
#include "grabber/DispmanxFrameGrabber.h"
|
||||
|
||||
DispmanxFrameGrabber::DispmanxFrameGrabber(const unsigned width, const unsigned height) :
|
||||
_vc_display(0),
|
||||
_vc_resource(0),
|
||||
_vc_flags(0),
|
||||
_width(width),
|
||||
_height(height),
|
||||
_videoMode(VIDEO_2D),
|
||||
_cropLeft(0),
|
||||
_cropRight(0),
|
||||
_cropTop(0),
|
||||
_cropBottom(0),
|
||||
_captureBuffer(new ColorRgba[0]),
|
||||
_captureBufferSize(0),
|
||||
_log(Logger::getInstance("DISPMANXGRABBER"))
|
||||
DispmanxFrameGrabber::DispmanxFrameGrabber(const unsigned width, const unsigned height)
|
||||
: Grabber("DISPMANXGRABBER", width, height)
|
||||
, _vc_display(0)
|
||||
, _vc_resource(0)
|
||||
, _vc_flags(0)
|
||||
, _captureBuffer(new ColorRgba[0])
|
||||
, _captureBufferSize(0)
|
||||
{
|
||||
// Initiase BCM
|
||||
bcm_host_init();
|
||||
@@ -71,14 +64,9 @@ void DispmanxFrameGrabber::setFlags(const int vc_flags)
|
||||
_vc_flags = vc_flags;
|
||||
}
|
||||
|
||||
void DispmanxFrameGrabber::setVideoMode(const VideoMode videoMode)
|
||||
{
|
||||
_videoMode = videoMode;
|
||||
}
|
||||
|
||||
void DispmanxFrameGrabber::setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom)
|
||||
{
|
||||
if (cropLeft + cropRight >= _width || cropTop + cropBottom >= _height)
|
||||
if (cropLeft + cropRight >= (unsigned)_width || cropTop + cropBottom >= (unsigned)_height)
|
||||
{
|
||||
Error(_log, "Rejecting invalid crop values: left: %d, right: %d, top: %d, bottom: %d", cropLeft, cropRight, cropTop, cropBottom);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user