diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ac3be4f3..2685054ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -462,6 +462,7 @@ include_directories(${CMAKE_SOURCE_DIR}/include) # enable C++11; MSVC doesn't have c++11 feature switch if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") include(CheckCXXCompilerFlag) + CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) @@ -470,7 +471,10 @@ if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-psabi") endif() - if(COMPILER_SUPPORTS_CXX11) + if(COMPILER_SUPPORTS_CXX17 AND Qt_VERSION EQUAL 6) + message(STATUS "Enabling support for C++17 for QT6") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") + elseif(COMPILER_SUPPORTS_CXX11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") elseif(COMPILER_SUPPORTS_CXX0X) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") diff --git a/sources/grabber/pipewire/PipewireHandler.cpp b/sources/grabber/pipewire/PipewireHandler.cpp index 86092a811..c428fc8fa 100644 --- a/sources/grabber/pipewire/PipewireHandler.cpp +++ b/sources/grabber/pipewire/PipewireHandler.cpp @@ -689,6 +689,12 @@ void PipewireHandler::onProcessFrame() void PipewireHandler::getImage(PipewireImage& retVal) { + if (_framePaused) + { + _image.isError = hasError(); + _image.data = nullptr; + } + retVal = _image; } @@ -699,7 +705,7 @@ void PipewireHandler::captureFrame() uint8_t* mappedMemory = nullptr; uint8_t* frameBuffer = nullptr; - if (_pwStream == nullptr) + if (_pwStream == nullptr || _framePaused) return; _hasFrame = false; @@ -713,7 +719,7 @@ void PipewireHandler::captureFrame() while ((dequeueFrame = pw_stream_dequeue_buffer(_pwStream)) != nullptr) { - if (newFrame != nullptr) + if (newFrame != nullptr && pw_stream_get_state(_pwStream, NULL) == PW_STREAM_STATE_STREAMING) pw_stream_queue_buffer(_pwStream, newFrame); newFrame = dequeueFrame; } @@ -880,7 +886,7 @@ void PipewireHandler::captureFrame() if (mappedMemory != nullptr) munmap(mappedMemory, newFrame->buffer->datas->maxsize + newFrame->buffer->datas->mapoffset); - if (newFrame != nullptr) + if (newFrame != nullptr && pw_stream_get_state(_pwStream, NULL) == PW_STREAM_STATE_STREAMING) pw_stream_queue_buffer(_pwStream, newFrame); // goodbye diff --git a/sources/grabber/pipewire/smartPipewire.cpp b/sources/grabber/pipewire/smartPipewire.cpp index 6a757f202..d8b764788 100644 --- a/sources/grabber/pipewire/smartPipewire.cpp +++ b/sources/grabber/pipewire/smartPipewire.cpp @@ -76,8 +76,10 @@ const char* getPipewireToken() const char* getPipewireError() { + static QByteArray errorData; QString err = pipewireHandler.getError(); - return err.toLatin1().constData(); + errorData = err.toLatin1(); + return errorData.constData(); } void uninitPipewireDisplay() diff --git a/version b/version index a0f034fd0..6e668dafb 100644 --- a/version +++ b/version @@ -1 +1 @@ -20.0.0.0beta2 +20.0.0.0