From 718ffa5a00a5dfee52ed91c7d7d90ca2518a13b2 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Fri, 24 Nov 2023 00:40:28 +0100 Subject: [PATCH] simple packageconfig --- app/util/qopenhd.cpp | 15 +++++---------- app/videostreaming/avcodec/avcodec_video.pri | 3 +++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/util/qopenhd.cpp b/app/util/qopenhd.cpp index c88902391..114dc60c9 100644 --- a/app/util/qopenhd.cpp +++ b/app/util/qopenhd.cpp @@ -306,16 +306,11 @@ bool QOpenHD::is_platform_rpi() bool QOpenHD::is_platform_rock() { -const char* rockPlatformPath = "/usr/local/share/openhd/platform/rock/"; - struct stat info; - if (stat(rockPlatformPath, &info) != 0) { - return false; - } - if (info.st_mode & S_IFDIR) { - return true; - } else { - return false; - } +#ifdef IS_PLATFORM_ROCK + return true; +#else + return false; +#endif } void QOpenHD::keep_screen_on(bool on) diff --git a/app/videostreaming/avcodec/avcodec_video.pri b/app/videostreaming/avcodec/avcodec_video.pri index a29142325..7de028bd7 100644 --- a/app/videostreaming/avcodec/avcodec_video.pri +++ b/app/videostreaming/avcodec/avcodec_video.pri @@ -32,6 +32,9 @@ CONFIG += link_pkgconfig packagesExist(mmal) { DEFINES += IS_PLATFORM_RPI } +packagesExist(mali) { + DEFINES += IS_PLATFORM_ROCK +} # can be used in c++, also set to be exposed in qml DEFINES += QOPENHD_ENABLE_VIDEO_VIA_AVCODEC