From 4d22858d0f127fb3980897a07b2cb271adc5454b Mon Sep 17 00:00:00 2001 From: sladro Date: Mon, 12 Jan 2026 22:06:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=A7=E8=83=BD=E4=BC=98=E5=8C=966?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/media_server_app.h | 25 ------------------------- src/utils/dma_alloc.cpp | 6 +++--- 2 files changed, 3 insertions(+), 28 deletions(-) delete mode 100644 src/media_server_app.h diff --git a/src/media_server_app.h b/src/media_server_app.h deleted file mode 100644 index d94f9d5..0000000 --- a/src/media_server_app.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include -#include -#include - -#include "graph_manager.h" - -namespace rk3588 { - -class MediaServerApp { -public: - explicit MediaServerApp(std::string config_path); - - int Start(); - -private: - std::string config_path_; - GraphManager graph_manager_{}; - - std::atomic stop_signal_thread_{false}; - std::thread signal_thread_; -}; - -} // namespace rk3588 diff --git a/src/utils/dma_alloc.cpp b/src/utils/dma_alloc.cpp index d2185b1..e16880c 100644 --- a/src/utils/dma_alloc.cpp +++ b/src/utils/dma_alloc.cpp @@ -1,5 +1,6 @@ #include "utils/dma_alloc.h" +#include #include #include #include @@ -189,7 +190,7 @@ DmaBufferPtr DmaAlloc(size_t alloc_size) { nullptr }; - static bool first_success = true; + static std::atomic first_success{true}; int dma_fd = -1; const char* used_heap = nullptr; @@ -229,9 +230,8 @@ DmaBufferPtr DmaAlloc(size_t alloc_size) { return nullptr; } - if (first_success) { + if (first_success.exchange(false)) { LogInfo(std::string("[DmaAlloc] using heap: ") + (used_heap ? used_heap : "(unknown)")); - first_success = false; } void* ptr = mmap(nullptr, alloc_size, PROT_READ | PROT_WRITE, MAP_SHARED, dma_fd, 0);