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:
Markus
2022-03-20 14:42:21 +01:00
committed by GitHub
parent f32db90c12
commit addff6f7ef
16 changed files with 278 additions and 287 deletions

View File

@@ -90,13 +90,6 @@ if (ENABLE_AMLOGIC)
endif(ENABLE_AMLOGIC)
if (ENABLE_DISPMANX)
IF ( "${PLATFORM}" MATCHES rpi)
find_package(BCM REQUIRED)
include_directories(${BCM_INCLUDE_DIRS})
ELSE()
SET(BCM_INCLUDE_DIRS "")
SET(BCM_LIBRARIES "")
ENDIF()
target_link_libraries(${PROJECT_NAME} dispmanx-grabber)
endif (ENABLE_DISPMANX)

View File

@@ -264,7 +264,8 @@ void HyperionDaemon::freeObjects()
#endif
delete _amlGrabber;
delete _dispmanx;
if (_dispmanx != nullptr)
delete _dispmanx;
delete _fbGrabber;
delete _osxGrabber;
delete _qtGrabber;
@@ -522,9 +523,13 @@ void HyperionDaemon::handleSettingsUpdate(settings::type settingsType, const QJs
{
createGrabberDispmanx(grabberConfig);
}
#ifdef ENABLE_DISPMANX
if (_dispmanx != nullptr)
{
_dispmanx->handleSettingsUpdate(settings::SYSTEMCAPTURE, getSetting(settings::SYSTEMCAPTURE));
_dispmanx->tryStart();
}
#endif
}
else if (type == "amlogic")
@@ -644,7 +649,16 @@ void HyperionDaemon::createGrabberDispmanx(const QJsonObject& /*grabberConfig*/)
_dispmanx = new DispmanxWrapper(
_grabber_frequency,
_grabber_pixelDecimation
);
);
if (!_dispmanx->available)
{
delete _dispmanx;
_dispmanx = nullptr;
Debug(_log, "The dispmanx framegrabber is not supported on this platform");
return;
}
_dispmanx->setCropping(_grabber_cropLeft, _grabber_cropRight, _grabber_cropTop, _grabber_cropBottom);
// connect to HyperionDaemon signal