prepare standalone amlogic grabber

activate internal amlogic grabber forwarding


Former-commit-id: 21dabf759935836eef556baeb8a27e362e95ae96
This commit is contained in:
redpanther
2016-02-24 14:42:25 +01:00
parent 6bef43887b
commit 8fdf97e693
6 changed files with 8 additions and 4 deletions

View File

@@ -13,7 +13,7 @@
#include <sys/types.h>
// Local includes
#include "AmlogicGrabber.h"
#include <grabber/AmlogicGrabber.h>
// Flags copied from 'include/linux/amlogic/amports/amvideocap.h' at https://github.com/codesnake/linux-amlogic
#define AMVIDEOCAP_IOC_MAGIC 'V'

View File

@@ -1,58 +0,0 @@
#pragma once
// STL includes
#include <cstdint>
// Utils includes
#include <utils/Image.h>
#include <utils/ColorBgr.h>
#include <utils/VideoMode.h>
///
/// The DispmanxFrameGrabber is used for creating snapshots of the display (screenshots) with a
/// downsized and scaled resolution.
///
class AmlogicGrabber
{
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();
///
/// 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)
/// @return Zero on success else negative
///
int grabFrame(Image<ColorBgr> & image);
/**
* Returns true if video is playing over the amlogic chip
* @return True if video is playing else false
*/
bool isVideoPlaying();
private:
/// With of the captured snapshot [pixels]
const unsigned _width;
/// Height of the captured snapshot [pixels]
const unsigned _height;
/** The snapshot/capture device of the amlogic video chip */
int _amlogicCaptureDev;
};

View File

@@ -9,7 +9,7 @@
// Amlogic grabber includes
#include <grabber/AmlogicWrapper.h>
#include "AmlogicGrabber.h"
#include <grabber/AmlogicGrabber.h>
AmlogicWrapper::AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, Hyperion * hyperion) :

View File

@@ -7,7 +7,7 @@ SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic)
SET(AmlogicQT_HEADERS ${CURRENT_HEADER_DIR}/AmlogicWrapper.h)
SET(AmlogicHEADERS
${CURRENT_SOURCE_DIR}/AmlogicGrabber.h
${CURRENT_HEADER_DIR}/AmlogicGrabber.h
)
SET(AmlogicSOURCES