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:
@@ -31,10 +31,8 @@
|
||||
#endif
|
||||
|
||||
AmlogicGrabber::AmlogicGrabber(const unsigned width, const unsigned height)
|
||||
: _width(qMax(160u, width)) // Minimum required width or height is 160
|
||||
, _height(qMax(160u, height))
|
||||
: Grabber("AMLOGICGRABBER", qMax(160u, width), qMax(160u, height)) // Minimum required width or height is 160
|
||||
, _amlogicCaptureDev(-1)
|
||||
, _log(Logger::getInstance("AMLOGICGRABBER"))
|
||||
{
|
||||
Debug(_log, "constructed(%d x %d)",_width,_height);
|
||||
}
|
||||
@@ -51,24 +49,13 @@ AmlogicGrabber::~AmlogicGrabber()
|
||||
}
|
||||
}
|
||||
|
||||
void AmlogicGrabber::setVideoMode(const VideoMode videoMode)
|
||||
{
|
||||
switch (videoMode) {
|
||||
case VIDEO_3DSBS:
|
||||
//vc_dispmanx_rect_set(&_rectangle, 0, 0, _width/2, _height);
|
||||
break;
|
||||
case VIDEO_3DTAB:
|
||||
//vc_dispmanx_rect_set(&_rectangle, 0, 0, _width, _height/2);
|
||||
break;
|
||||
case VIDEO_2D:
|
||||
default:
|
||||
//vc_dispmanx_rect_set(&_rectangle, 0, 0, _width, _height);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool AmlogicGrabber::isVideoPlaying()
|
||||
{
|
||||
|
||||
// TODO crop resulting image accroding member _videoMode
|
||||
// TODO add croping
|
||||
|
||||
const QString videoDevice = "/dev/amvideo";
|
||||
|
||||
// Open the video device
|
||||
@@ -97,7 +84,7 @@ bool AmlogicGrabber::isVideoPlaying()
|
||||
int AmlogicGrabber::grabFrame(Image<ColorBgr> & image)
|
||||
{
|
||||
// resize the given image if needed
|
||||
if (image.width() != _width || image.height() != _height)
|
||||
if (image.width() != (unsigned)_width || image.height() != (unsigned)_height)
|
||||
{
|
||||
image.resize(_width, _height);
|
||||
}
|
||||
|
Reference in New Issue
Block a user