diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt index 864ad0c80..5fc37b2fc 100755 --- a/base/CMakeLists.txt +++ b/base/CMakeLists.txt @@ -92,8 +92,6 @@ IF(ENABLE_CUDA) find_library(NVBUFUTILSLIB nvbuf_utils REQUIRED) find_library(EGLSTREAM_CAMCONSUMER_LIB nveglstream_camconsumer REQUIRED) find_library(NVARGUS_SOCKETCLINET_LIB nvargus_socketclient REQUIRED) - find_library(LIBRE_LIB NAMES libre.so libre.a REQUIRED) - find_library(BARESIP_LIB NAMES libbaresip.so REQUIRED) find_package(Curses REQUIRED) set(VCPKG_GTK_INCLUDE_DIRS @@ -127,8 +125,6 @@ IF(ENABLE_CUDA) ELSEIF(ENABLE_LINUX) find_library(LIBNVCUVID libnvcuvid.so PATHS /usr/lib/x86_64-linux-gnu NO_DEFAULT_PATH) find_library(LIBNVENCODE libnvidia-encode.so PATHS /usr/lib/x86_64-linux-gnu NO_DEFAULT_PATH) - find_library(LIBRE_LIB NAMES libre.so libre.a REQUIRED) - find_library(BARESIP_LIB NAMES libbaresip.so REQUIRED) SET(NVCODEC_LIB ${LIBNVCUVID} ${LIBNVENCODE}) SET(NVCUDAToolkit_LIBS libcuda.so @@ -519,8 +515,6 @@ target_include_directories ( aprapipes PRIVATE ${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${LIBMP4_INC_DIR} - ${BARESIP_INC_DIR} - ${LIBRE_INC_DIR} ${NVCODEC_INCLUDE_DIR} ) diff --git a/base/include/PipeLine.h b/base/include/PipeLine.h index b47b0d035..f15dad608 100755 --- a/base/include/PipeLine.h +++ b/base/include/PipeLine.h @@ -47,7 +47,7 @@ class PipeLine { void stop(); void term(); void wait_for_all(bool ignoreStatus = false); - void interrup_wait_for_all(); + void interrupt_wait_for_all(); void flushAllQueues(); const char* getStatus(); }; diff --git a/base/src/H264EncoderNVCodecHelper.cpp b/base/src/H264EncoderNVCodecHelper.cpp index c1463b240..6f1226258 100644 --- a/base/src/H264EncoderNVCodecHelper.cpp +++ b/base/src/H264EncoderNVCodecHelper.cpp @@ -603,7 +603,7 @@ class H264EncoderNVCodecHelper::Detail LOG_INFO << "Allocated <" << bufferLength << "> outputbitstreams to the encoder buffer."; m_nvcodecResources->m_nFreeOutputBitstreams += bufferLength; } - else + else if(!m_nvcodecResources->m_nFreeOutputBitstreams) { LOG_INFO << "waiting for free outputbitstream<> busy streams<" << m_nvcodecResources->m_nBusyOutputBitstreams << ">"; } @@ -715,4 +715,4 @@ void H264EncoderNVCodecHelper::endEncode() bool H264EncoderNVCodecHelper::getSPSPPS(void*& buffer, size_t& size, int& width, int& height) { return mDetail->getSPSPPS(buffer, size, width, height); -} \ No newline at end of file +} diff --git a/base/src/PipeLine.cpp b/base/src/PipeLine.cpp index 0bc0f9d79..2a5ae6382 100755 --- a/base/src/PipeLine.cpp +++ b/base/src/PipeLine.cpp @@ -232,6 +232,11 @@ void PipeLine::stop() i->get()->stop(); } } + + if ((modules[0]->controlModule) != nullptr) + { + modules[0]->controlModule->stop(); + } } void PipeLine::wait_for_all(bool ignoreStatus) @@ -242,6 +247,12 @@ void PipeLine::wait_for_all(bool ignoreStatus) return; } + if ((modules[0]->controlModule) != nullptr) + { + Module& m = *(modules[0]->controlModule); + m.myThread.join(); + } + for (auto i = modules.begin(); i != modules.end(); i++) { Module& m = *(i->get()); @@ -250,7 +261,7 @@ void PipeLine::wait_for_all(bool ignoreStatus) } -void PipeLine::interrup_wait_for_all() +void PipeLine::interrupt_wait_for_all() { if (myStatus > PL_STOPPING) { @@ -258,17 +269,30 @@ void PipeLine::interrup_wait_for_all() return; } + if ((modules[0]->controlModule) != nullptr) + { + Module& m = *(modules[0]->controlModule); + m.myThread.interrupt(); + } + for (auto i = modules.begin(); i != modules.end(); i++) { Module& m = *(i->get()); m.myThread.interrupt(); } + if ((modules[0]->controlModule) != nullptr) + { + Module& m = *(modules[0]->controlModule); + m.myThread.join(); + } + for (auto i = modules.begin(); i != modules.end(); i++) { Module& m = *(i->get()); m.myThread.join(); } + myStatus = PL_STOPPED; } diff --git a/base/vcpkg.json b/base/vcpkg.json index b030aaefb..86632fbed 100644 --- a/base/vcpkg.json +++ b/base/vcpkg.json @@ -85,14 +85,6 @@ "name": "redis-plus-plus", "platform": "!arm64" }, - { - "name": "re", - "platform": "!windows" - }, - { - "name": "baresip", - "platform": "!windows" - }, { "name": "libmp4" }