feat(downstream): add cvmmap downstream runtime implementation
This commit introduces the full downstream runtime implementation needed to ingest, transform, and publish streams. It preserves the original upstream request boundary by packaging the entire cvmmap-streamer module (build config, public API, protocol and IPC glue, and simulator/tester entrypoints) in one coherent core unit. Keeping this group isolated enables reviewers to validate runtime behavior and correctness without mixing test evidence or process documentation changes. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
+110
@@ -0,0 +1,110 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
project(cvmmap-streamer LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
find_package(cppzmq QUIET)
|
||||
find_package(ZeroMQ QUIET)
|
||||
find_package(spdlog QUIET)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
pkg_check_modules(GSTREAMER
|
||||
IMPORTED_TARGET
|
||||
gstreamer-1.0>=1.14
|
||||
gstreamer-video-1.0>=1.14
|
||||
gstreamer-app-1.0>=1.14)
|
||||
|
||||
if (NOT GSTREAMER_FOUND)
|
||||
message(FATAL_ERROR
|
||||
"GStreamer development packages are required for cvmmap-streamer. "
|
||||
"Install pkg-config modules: gstreamer-1.0>=1.14, gstreamer-video-1.0>=1.14, "
|
||||
"and gstreamer-app-1.0>=1.14.")
|
||||
endif()
|
||||
|
||||
if (NOT TARGET spdlog::spdlog AND NOT TARGET spdlog)
|
||||
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/../app/lib/spdlog/CMakeLists.txt")
|
||||
set(SPDLOG_BUILD_EXAMPLE OFF)
|
||||
set(SPDLOG_BUILD_TESTS OFF)
|
||||
set(SPDLOG_INSTALL OFF)
|
||||
add_subdirectory(
|
||||
"${CMAKE_CURRENT_LIST_DIR}/../app/lib/spdlog"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/vendor/spdlog")
|
||||
endif()
|
||||
endif()
|
||||
add_library(cvmmap_streamer_common STATIC
|
||||
src/ipc/help.cpp
|
||||
src/config/runtime_config.cpp
|
||||
src/core/ingest_runtime.cpp
|
||||
src/ipc/contracts.cpp
|
||||
src/ipc/ipc_stub.cpp
|
||||
src/metrics/latency_tracker.cpp
|
||||
src/pipeline/pipeline_stub.cpp
|
||||
src/protocol/rtmp_publisher.cpp
|
||||
src/protocol/rtp_publisher.cpp)
|
||||
|
||||
target_include_directories(cvmmap_streamer_common
|
||||
PUBLIC
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include")
|
||||
set(CVMAP_STREAMER_LINK_DEPS Threads::Threads)
|
||||
|
||||
if (TARGET cppzmq::cppzmq)
|
||||
list(APPEND CVMAP_STREAMER_LINK_DEPS cppzmq::cppzmq)
|
||||
elseif (TARGET cppzmq)
|
||||
list(APPEND CVMAP_STREAMER_LINK_DEPS cppzmq)
|
||||
endif()
|
||||
|
||||
if (TARGET ZeroMQ::libzmq)
|
||||
list(APPEND CVMAP_STREAMER_LINK_DEPS ZeroMQ::libzmq)
|
||||
elseif (TARGET ZeroMQ::ZeroMQ)
|
||||
list(APPEND CVMAP_STREAMER_LINK_DEPS ZeroMQ::ZeroMQ)
|
||||
endif()
|
||||
|
||||
if (TARGET ZeroMQ::cppzmq)
|
||||
list(APPEND CVMAP_STREAMER_LINK_DEPS ZeroMQ::cppzmq)
|
||||
elseif (TARGET cppzmq::cppzmq)
|
||||
list(APPEND CVMAP_STREAMER_LINK_DEPS cppzmq::cppzmq)
|
||||
endif()
|
||||
|
||||
|
||||
if (NOT TARGET PkgConfig::GSTREAMER)
|
||||
message(FATAL_ERROR
|
||||
"GStreamer packages were detected but PkgConfig::GSTREAMER target is unavailable. "
|
||||
"Please ensure GStreamer development toolchain is correctly installed.")
|
||||
endif()
|
||||
|
||||
list(APPEND CVMAP_STREAMER_LINK_DEPS PkgConfig::GSTREAMER)
|
||||
|
||||
|
||||
if (TARGET spdlog::spdlog)
|
||||
list(APPEND CVMAP_STREAMER_LINK_DEPS spdlog::spdlog)
|
||||
elseif (TARGET spdlog)
|
||||
list(APPEND CVMAP_STREAMER_LINK_DEPS spdlog)
|
||||
endif()
|
||||
|
||||
target_link_libraries(cvmmap_streamer_common PUBLIC ${CVMAP_STREAMER_LINK_DEPS})
|
||||
|
||||
function(add_cvmmap_binary target source)
|
||||
add_executable(${target} ${source} ${ARGN})
|
||||
target_include_directories(${target}
|
||||
PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include")
|
||||
target_link_libraries(${target}
|
||||
PRIVATE
|
||||
cvmmap_streamer_common)
|
||||
set_target_properties(${target} PROPERTIES OUTPUT_NAME "${target}")
|
||||
endfunction()
|
||||
|
||||
add_cvmmap_binary(cvmmap_streamer src/main_streamer.cpp)
|
||||
add_cvmmap_binary(
|
||||
cvmmap_sim
|
||||
src/main_sim.cpp
|
||||
src/sim/options.cpp
|
||||
src/sim/wire.cpp)
|
||||
add_cvmmap_binary(rtp_receiver_tester src/testers/rtp_receiver_tester.cpp)
|
||||
add_cvmmap_binary(rtmp_stub_tester src/testers/rtmp_stub_tester.cpp)
|
||||
add_cvmmap_binary(ipc_snapshot_tester src/testers/ipc_snapshot_tester.cpp)
|
||||
Reference in New Issue
Block a user