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:
redPanther
2017-08-04 23:08:15 +02:00
committed by GitHub
parent 3612ccda75
commit 569e59110e
54 changed files with 375 additions and 659 deletions

View File

@@ -1,9 +1,11 @@
#pragma once
#include <QObject>
// Hyperion-utils includes
#include <utils/Image.h>
#include <utils/ColorRgb.h>
#include <utils/ImageResampler.h>
#include <utils/Logger.h>
#include <hyperion/Grabber.h>
// X11 includes
#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>
@@ -11,7 +13,7 @@
#include <sys/ipc.h>
#include <sys/shm.h>
class X11Grabber
class X11Grabber : public Grabber
{
public:
@@ -19,12 +21,6 @@ public:
virtual ~X11Grabber();
///
/// Set the video mode (2D/3D)
/// @param[in] mode The new video mode
///
void setVideoMode(const VideoMode videoMode);
bool Setup();
Image<ColorRgb> & grab();
@@ -43,21 +39,9 @@ public:
/// update dimension according current screen
int updateScreenDimensions();
/// gets resulting height of image
const unsigned getImageWidth() { return _croppedWidth; };
/// gets resulting width of image
const unsigned getImageHeight() { return _croppedHeight; };
private:
ImageResampler _imageResampler;
bool _useXGetImage, _XShmAvailable, _XShmPixmapAvailable, _XRenderAvailable;
int _cropLeft;
int _cropRight;
int _cropTop;
int _cropBottom;
XImage* _xImage;
XShmSegmentInfo _shminfo;
@@ -79,14 +63,9 @@ private:
unsigned _screenWidth;
unsigned _screenHeight;
unsigned _croppedWidth;
unsigned _croppedHeight;
Image<ColorRgb> _image;
void freeResources();
void setupResources();
Logger * _log;
};