hyperion.ng/include/grabber/AmlogicGrabber.h
redPanther 2aa4df92a9 amlogic refactoring (#464)
* - grabber auto off when not set as active prio
- join aml and fb - on aml platform both grabbers are needed, so they joind in one module and share one prio. user don't the the nasty magic behind
- aml: preparation for direct ge2d access

* just save it, in the middle of ge2d impl

* fix compile issues

* now grabbing works basicly

* add 3d support for ge2d

* next step, we got some video from aml

* switch back to rgba

* remove unfinished ge2d stuff

* commit missing changes

* some urgent fixes, needs some beautifying, but it works now

* fixes and refctoring
2017-09-01 08:50:37 +02:00

55 lines
1.4 KiB
C++
Executable File

#pragma once
// Utils includes
#include <utils/ColorBgr.h>
#include <hyperion/Grabber.h>
#include <grabber/FramebufferFrameGrabber.h>
///
///
class AmlogicGrabber : public Grabber
{
public:
///
/// Construct a AmlogicGrabber that will capture snapshots with specified dimensions.
///
/// @param[in] width The width of the captured screenshot
/// @param[in] height The heigth of the captured screenshot
///
AmlogicGrabber(const unsigned width, const unsigned height);
~AmlogicGrabber();
///
/// 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)
/// @return Zero on success else negative
///
int grabFrame(Image<ColorRgb> & image);
private:
/**
* Returns true if video is playing over the amlogic chip
* @return True if video is playing else false
*/
bool isVideoPlaying();
int grabFrame_amvideocap(Image<ColorRgb> & image);
void closeDev(int &fd);
bool openDev(int &fd, const char* dev, int flags);
/** The snapshot/capture device of the amlogic video chip */
int _captureDev;
int _videoDev;
Image<ColorBgr> _image_bgr;
int _lastError;
bool _videoPlaying;
FramebufferFrameGrabber _fbGrabber;
int _grabbingModeNotification;
};