mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Dynamic loading of the Dispmanx Grabber (#1440)
* BCM dynamic loading * cleanup * better handle start of dispmanx * set GrabberWrapper pointer to null on exit * Update DispmanxFrameGrabber.cpp
This commit is contained in:
@@ -3,16 +3,8 @@ project(hyperion-dispmanx)
|
||||
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Network Widgets REQUIRED)
|
||||
|
||||
IF ( "${PLATFORM}" MATCHES rpi)
|
||||
find_package(BCM REQUIRED)
|
||||
ELSE()
|
||||
SET(BCM_INCLUDE_DIRS "")
|
||||
SET(BCM_LIBRARIES "")
|
||||
ENDIF()
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/flatbufserver
|
||||
${BCM_INCLUDE_DIRS}
|
||||
${FLATBUFFERS_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
@@ -30,13 +22,15 @@ add_executable( ${PROJECT_NAME}
|
||||
${Hyperion_Dispmanx_SOURCES}
|
||||
)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-rdynamic")
|
||||
SET(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS} "-rdynamic")
|
||||
|
||||
target_link_libraries( ${PROJECT_NAME}
|
||||
commandline
|
||||
hyperion-utils
|
||||
flatbufconnect
|
||||
flatbuffers
|
||||
dispmanx-grabber
|
||||
${Dispmanx_LIBRARIES}
|
||||
ssdp
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
|
@@ -27,6 +27,11 @@ const Image<ColorRgb> & DispmanxWrapper::getScreenshot()
|
||||
return _screenshot;
|
||||
}
|
||||
|
||||
bool DispmanxWrapper::open()
|
||||
{
|
||||
return _grabber.open();
|
||||
}
|
||||
|
||||
void DispmanxWrapper::start()
|
||||
{
|
||||
_timer.start();
|
||||
@@ -39,13 +44,16 @@ void DispmanxWrapper::stop()
|
||||
|
||||
bool DispmanxWrapper::screenInit()
|
||||
{
|
||||
return _grabber.setupScreen();
|
||||
return (open() && _grabber.setupScreen());
|
||||
}
|
||||
|
||||
void DispmanxWrapper::capture()
|
||||
{
|
||||
_grabber.grabFrame(_screenshot);
|
||||
emit sig_screenshot(_screenshot);
|
||||
if ( open() )
|
||||
{
|
||||
_grabber.grabFrame(_screenshot);
|
||||
emit sig_screenshot(_screenshot);
|
||||
}
|
||||
}
|
||||
|
||||
void DispmanxWrapper::setVideoMode(VideoMode mode)
|
||||
|
@@ -16,6 +16,8 @@ public:
|
||||
);
|
||||
|
||||
const Image<ColorRgb> & getScreenshot();
|
||||
|
||||
bool open();
|
||||
|
||||
///
|
||||
/// Starts the timed capturing of screenshots
|
||||
|
Reference in New Issue
Block a user