### Start PC2 Listener Application Source: https://github.com/avnu/openavnu/blob/master/documents/examples/AVB_Talker_Listener_Example_Setup.md Run the simple listener example on the listener PC. ```bash cd "${AVB_PATH}/examples/simple_listener" sudo ./simple_listener -i $AVB_PC2_IF -f out.wav ``` -------------------------------- ### Start PC1 Talker Application Source: https://github.com/avnu/openavnu/blob/master/documents/examples/AVB_Talker_Listener_Example_Setup.md Run the simple talker example on the talker PC. ```bash cd "${AVB_PATH}/examples/simple_talker" sudo ./simple_talker -i $AVB_PC1_IF -t 2 ``` -------------------------------- ### Start PC2 AVB Environment Source: https://github.com/avnu/openavnu/blob/master/documents/examples/AVB_Talker_Listener_Example_Setup.md Launch the gPTP and stream reservation daemons on the listener PC. ```bash # GPTP time synchronization daemon (will synchronize on PC 1) cd "${GPTP_PATH}/linux/build/obj" sudo ./daemon_cl $AVB_PC2_IF # Stream reservation daemon (m: MMRP, v: MVRP, s: MSRP) cd "${AVB_PATH}/daemons/mrpd" sudo ./mrpd -mvs -i $AVB_PC2_IF ``` -------------------------------- ### CMake Build Command Example Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/CMakeLists.txt Example command line usage for configuring the build directory. ```bash cmake -DCMAKE_TOOLCHAIN_FILE=..//platform//.cmake -DCMAKE_BUILD_TYPE=Release ../ cmake -DCMAKE_TOOLCHAIN_FILE=../avbrepo/platform/Linux/x86_i210_linux.cmake -DCMAKE_BUILD_TYPE=Release ../avbrepo ``` -------------------------------- ### Define Installation Rules Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/avb_avdecc/CMakeLists.txt Specifies the destination directory for the installed executable. ```cmake install ( TARGETS openavb_avdecc RUNTIME DESTINATION ${AVB_INSTALL_BIN_DIR} ) ``` -------------------------------- ### Start PC1 AVB Environment Source: https://github.com/avnu/openavnu/blob/master/documents/examples/AVB_Talker_Listener_Example_Setup.md Launch the gPTP and stream reservation daemons on the talker PC. ```bash # GPTP time synchronization daemon cd "${GPTP_PATH}/linux/build/obj" sudo ./daemon_cl $AVB_PC1_IF -R 1 # Stream reservation daemon (m: MMRP, v: MVRP, s: MSRP) cd "${AVB_PATH}/daemons/mrpd" sudo ./mrpd -mvs -i $AVB_PC1_IF ``` -------------------------------- ### Configure Interface Module Settings Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/documents/sdk_avtp_interface_module_dev.md Example configuration snippet showing how to set the initialization function and module-specific parameters like timestamp handling. ```c // pIntfInitFn : Interface module initialization function. // openavb_intf_initialize_fn_t) cfg->osalCfg.pIntfInitFn = openavbIntfJ6Video; /////////////////// // Interface module /////////////////// // intf_nv_blocking_tx_callback : A talker only option. When set packet pacing // is expected to be handled in the interface module. // Commonly the TL configuration option tx_blocking_in_intf needs to be set // to match this. // cfg->libCfgNames[cfgIdx] = "intf_nv_blocking_tx_callback"; // cfg->libCfgValues[cfgIdx++] = "1"; // intf_nv_ignore_timestamp : If set the listener will ignore the timestamp // on media queue items. cfg->libCfgNames[cfgIdx] = "intf_nv_ignore_timestamp"; cfg->libCfgValues[cfgIdx++] = "0"; ``` -------------------------------- ### Build on Debian using Make Source: https://github.com/avnu/openavnu/blob/master/README.rst Install required dependencies and build the project components. ```bash sudo apt install libpci-dev libpcap-dev libsndfile-dev libjack-dev make all make -C lib/igb_avb all ``` -------------------------------- ### Install Additional Configuration Files Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/CMakeLists.txt Installs configuration files and shutdown scripts based on enabled AVB features. ```cmake # Copy additional installation files if (AVB_FEATURE_ENDPOINT) install ( FILES ${AVB_SRC_DIR}/endpoint/endpoint.ini DESTINATION ${AVB_INSTALL_BIN_DIR} ) install ( PROGRAMS ${AVB_SRC_DIR}/endpoint/shutdown_openavb_endpoint.sh DESTINATION ${AVB_INSTALL_BIN_DIR} ) endif () if (AVB_FEATURE_AVDECC) install ( FILES ${AVB_SRC_DIR}/avdecc/avdecc.ini DESTINATION ${AVB_INSTALL_BIN_DIR} ) install ( PROGRAMS ${AVB_SRC_DIR}/avdecc/shutdown_openavb_avdecc.sh DESTINATION ${AVB_INSTALL_BIN_DIR} ) endif () ``` -------------------------------- ### Project Initialization and Path Setup Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/CMakeLists.txt Sets the minimum CMake version, project name, and defines paths for source, HAL, OSAL, and TCAL directories. ```cmake cmake_minimum_required ( VERSION 2.6 ) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") project ( AVB ) # point to AVB SRC directory set ( AVB_SRC_DIR ${CMAKE_SOURCE_DIR} ) # point to HAL directory set ( AVB_HAL_DIR ${AVB_SRC_DIR}/platform/${OPENAVB_HAL} ) # point to OSAL directory set ( AVB_OSAL_DIR ${AVB_SRC_DIR}/platform/${OPENAVB_OSAL} ) # point to TCAL directory set ( AVB_TCAL_DIR ${AVB_SRC_DIR}/platform/platTCAL/${OPENAVB_TCAL} ) # Directory to install binaries to set ( AVB_INSTALL_DIR ${CMAKE_BINARY_DIR}/bin ) ``` -------------------------------- ### Define Installation Directories Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/CMakeLists.txt Sets the base paths for static libraries and various SDK modules within the build directory. ```cmake set ( AVB_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/lib ) # Directory to install AVTP Interface module SDK to set ( SDK_INSTALL_SDK_INTF_MOD_DIR ${CMAKE_BINARY_DIR}/sdk_intf_mod ) # Directory to install AVTP Interface module SDK to set ( SDK_INSTALL_SDK_MAP_MOD_DIR ${CMAKE_BINARY_DIR}/sdk_map_mod ) # Directory to install EAVB SDK to set ( SDK_INSTALL_SDK_EAVB_DIR ${CMAKE_BINARY_DIR}/sdk_eavb ) ``` -------------------------------- ### GStreamer Include and Library Path Setup Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/intf_h264_gst/CMakeLists.txt Configures the include directories and library dependencies required for GStreamer integration. ```cmake SET (INTF_INCLUDE_DIR ${INTF_INCLUDE_DIR} ${GLIB_PKG_INCLUDE_DIRS} ${GST_PKG_INCLUDE_DIRS} ${AVB_OSAL_DIR}/gst_al PARENT_SCOPE ) SET (INTF_LIBRARY_DIR ${INTF_LIBRARY_DIR} PARENT_SCOPE) SET (INTF_LIBRARY ${GLIB_PKG_LIBRARIES} ${GST_PKG_LIBRARIES} ${GSTRTP_PKG_LIBRARIES} PARENT_SCOPE) ``` -------------------------------- ### Start the MRP daemon Source: https://github.com/avnu/openavnu/blob/master/daemons/mrpd/readme.rst Run the mrpd binary with flags for MMRP, MVRP, and MSRP on a specific network interface. ```bash sudo ./mrpd -mvs -i eth2 ``` -------------------------------- ### Define Project Directory Paths Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/CMakeLists.txt Sets variables for source, HAL, OSAL, TCAL, and installation directories. ```cmake # point to AVB SRC directory set ( AVB_SRC_DIR ${CMAKE_SOURCE_DIR} ) # point to HAL directory set ( AVB_HAL_DIR ${AVB_SRC_DIR}/platform/${OPENAVB_HAL} ) # point to OSAL directory set ( AVB_OSAL_DIR ${AVB_SRC_DIR}/platform/${OPENAVB_OSAL} ) # point to TCAL directory set ( AVB_TCAL_DIR ${AVB_SRC_DIR}/platform/platTCAL/${OPENAVB_TCAL} ) # Directory to install binaries to set ( AVB_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/bin ) ``` -------------------------------- ### Initialize H.264 Listener Configuration Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/documents/sdk_avtp_stream_cfg.md Example of initializing the openavb_tl_cfg_t structure for a H.264 listener, including setting the role, multicast address, and latency parameters. ```c void h264_SampleListenerCfg(openavb_tl_cfg_t *cfg) { // Clear our the configuration structure to ensure defaults (0) memset(cfg, 0, sizeof(openavb_tl_cfg_t)); // This must be set to the multicast address that is used U8 multicastStrmAddr[] = { 0x91, 0xE0, 0xF0, 0x00, 0xFE, 0x00 }; /////////////////// // TL (Talker / Listener) Configuration /////////////////// // Identify the role of the stream (talker or listener) // must be set to AVB_ROLE_LISTENER or AVB_ROLE_TALKER cfg->role = AVB_ROLE_LISTENER; memcpy(cfg->stream_addr.buffer.ether_addr_octet, multicastStrmAddr, ETH_ALEN); cfg->stream_addr.mac = &cfg->stream_addr.buffer; // max_interval_frames: The maximum number of packets that will be sent during // an observation interval. This is only used on the talker. // cfg->max_interval_frames = 1; // max_transit_usec: Allows manually specifying a maximum transit time. // On the talker this value is added to the PTP walltime to create the AVTP Timestamp. // On the listener this value is used to validate an expected valid timestamp range. // Note: For the listener the map_nv_item_count value must be set large enough to // allow buffering at least as many AVTP packets that can be transmitted during this // max transit time. cfg->max_transit_usec = 2000; // max_transmit_deficit_usec: Allows setting the maximum packet transmit rate deficit that will // be recovered when a talker falls behind. This is only used on a talker side. When a talker // can not keep up with the specified transmit rate it builds up a deficit and will attempt to // make up for this deficit by sending more packets. There is normally some variability in the // transmit rate because of other demands on the system so this is expected. However, without this // bounding value the deficit could grew too large in cases such where more streams are started // than the system can support and when the number of streams is reduced the remaining streams // will attempt to recover this deficit by sending packets at a higher rate. This can cause a problem // at the listener side and significantly delay the recovery time before media playback will return // to normal. Typically this value can be set to the expected buffer size (in usec) that listeners are // expected to be buffering. For low latency solutions this is normally a small value. For non-live // media playback such as video playback the listener side buffers can often be large enough to held many // seconds of data. // cfg->max_transmit_deficit_usec = 2000; // internal_latency: Allows mannually specifying an internal latency time. This is used // only on the talker. // cfg->internal_latency = 0; // The number of microseconds a media queue items can be passed the presentation time at which // point it will be purged. cfg->max_stale = 500; // number of intervals to handle at once (talker) // cfg->batch_factor = 1; // report_seconds: How often to output stats. Defaults to 10 seconds. 0 turns off the stats. cfg->report_seconds = 0; // sr_class: A talker only setting. Values are either SR_CLASS_A or SR_CLASS_B. // cfg->sr_class = SR_CLASS_A; // raw_tx_buffers: The number of raw socket transmit buffers. // cfg->raw_tx_buffers = 40; // raw_rx_buffers: The number of raw socket receive buffers. cfg->raw_rx_buffers = 40; ``` -------------------------------- ### mrpd Command Line Execution Source: https://github.com/avnu/openavnu/blob/master/daemons/mrpd/readme.rst The mrpd daemon is started via the command line, where you must specify the interface and the protocols to enable. ```APIDOC ## mrpd Command Line ### Description Starts the MRP daemon on a specified network interface with selected protocols enabled. ### Usage `sudo ./mrpd [-m] [-v] [-s] -i ` ### Options - **-m** - Enable MMRP - **-v** - Enable MVRP - **-s** - Enable MSRP - **-i** - Specify the network interface (e.g., eth2) ``` -------------------------------- ### Define Mapping and Interface Macros Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/CMakeLists.txt Defines reusable macros for adding mapping and interface modules, including library creation and installation steps. ```cmake macro (add_map_mod MAP_NAME) SET ( SRC_FILES "" ) add_subdirectory ( ${MAP_NAME} ) add_library ( ${MAP_NAME} ${SRC_FILES} ) install ( TARGETS ${MAP_NAME} ARCHIVE DESTINATION ${AVB_INSTALL_LIB_DIR} ) endmacro() macro (add_intf_mod INTF_NAME) SET ( SRC_FILES "" ) add_subdirectory ( ${INTF_NAME} ) add_library ( ${INTF_NAME} ${SRC_FILES} ) install ( TARGETS ${INTF_NAME} ARCHIVE DESTINATION ${AVB_INSTALL_LIB_DIR} ) install ( DIRECTORY "${AVB_SRC_DIR}/${INTF_NAME}/" DESTINATION ${AVB_INSTALL_BIN_DIR} FILES_MATCHING PATTERN "*.ini" ) endmacro() macro (add_intf_mod_platform INTF_NAME) SET ( SRC_FILES "" ) SET ( INTF_INCLUDE_DIR "") SET ( INTF_LIBRARY_DIR "") SET ( INTF_LIBRARY "") add_subdirectory ( ${AVB_OSAL_DIR}/${INTF_NAME} ) include_directories ( ${INTF_INCLUDE_DIR} ) add_library ( ${INTF_NAME} ${SRC_FILES} ) install ( TARGETS ${INTF_NAME} ARCHIVE DESTINATION ${AVB_INSTALL_LIB_DIR} ) install ( DIRECTORY "${AVB_OSAL_DIR}/${INTF_NAME}/" DESTINATION ${AVB_INSTALL_BIN_DIR} FILES_MATCHING PATTERN "*.ini" ) endmacro() ``` -------------------------------- ### Generate Documentation Source: https://github.com/avnu/openavnu/blob/master/examples/alsa_timed_audio/README.md Builds the project documentation as a PDF file. ```bash make docs ``` -------------------------------- ### Build Documentation with Doxygen Source: https://github.com/avnu/openavnu/blob/master/daemons/maap/README.rst Execute this command from the doc directory to generate HTML documentation when BUILD_DOCUMENTATION is enabled. ```bash $ doxygen Doxyfile.in ``` -------------------------------- ### Initialize Submodules Source: https://github.com/avnu/openavnu/blob/master/examples/alsa_timed_audio/README.md Initializes the Open-AVB submodule required for building the toolkit. ```bash git submodule update --init ``` -------------------------------- ### Configure Linker and Platform Directories Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/CMakeLists.txt Sets up library search paths and linker flags for the platform build environment. ```cmake link_directories( ${SYSROOT}/usr/lib ) link_directories ( ${PLATFORM_SPECIFIC_DIRECTORIES} ) set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_SPECIFIC_LINKER_FLAGS}" ) # Setup platform directories include_directories ( ${PLATFORM_INCLUDE_DIRECTORIES} ) link_directories ( ${PLATFORM_LINK_DIRECTORIES} ) ``` -------------------------------- ### Initialize Project and Testing Source: https://github.com/avnu/openavnu/blob/master/CMakeLists.txt Sets the minimum CMake version, defines the project name, and enables testing support. ```cmake cmake_minimum_required (VERSION 2.8) project (open-avb) enable_testing() ``` -------------------------------- ### Configure AVTP Stream Parameters Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/documents/sdk_avtp_stream_cfg.md Sets up mapping and interface module configuration using name-value pairs and initializes function pointers. ```c int cfgIdx = 0; cfg->libCfgNames[cfgIdx] = "map_nv_item_count"; cfg->libCfgValues[cfgIdx++] = "10"; cfg->libCfgNames[cfgIdx] = "map_nv_max_payload_size"; cfg->libCfgValues[cfgIdx++] = "1412"; cfg->libCfgNames[cfgIdx] = "intf_nv_ignore_timestamp"; cfg->libCfgValues[cfgIdx++] = "0"; cfg->nLibCfgItems = cfgIdx; cfg->osalCfg.pMapInitFn = openavbMapH264Initialize; cfg->osalCfg.pIntfInitFn = openavbIntfJ6Video; ``` -------------------------------- ### Configure GLIB and AVB Core Dependencies Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/CMakeLists.txt Sets up include and link directories for GLIB and initializes the source file list for the AVB core library. ```cmake include_directories(${GLIB_PKG_INCLUDE_DIRS}) link_directories(${GLIB_PKG_LIBRARY_DIRS}) # AVB Core Library SET ( SRC_FILES "" ) ``` -------------------------------- ### Build Support Utilities Source: https://github.com/avnu/openavnu/blob/master/examples/alsa_timed_audio/README.md Compiles the time sync daemon and helper applications within the support directory. ```bash make ``` -------------------------------- ### Display Build Information Source: https://github.com/avnu/openavnu/blob/master/CMakeLists.txt Prints the current compiler settings and feature configurations to the console. ```cmake message(" ------------------------------------------------------- OpenAvnu Build information Current compiler options: CC: ${CMAKE_C_COMPILER} CXX: ${CMAKE_CXX_COMPILER} OpenAvnu CFLAGS: ${CMAKE_C_FLAGS} OpenAvnu CXXFLAGS: ${CMAKE_CXX_FLAGS} OpenAvnu LDFLAGS: ${CMAKE_LD_FLAGS} Features configured in OpenAvnu root CMakeFile.txt: Memory Leak Detection: ${MEMORY_LEAK_DETECTION} Compiling Extensions: ${EXTENSIONS} Support Long Long: ${LONGLONG} Use OpenAvnu flags: ${CMAKE_FLAGS} Using Standard C library: ${STD_C} Using Standard C++ library: ${STD_CPP} Using C++11 library: ${C++11} ------------------------------------------------------- ") ``` -------------------------------- ### Initialize Project and Build Type Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/CMakeLists.txt Sets the minimum CMake version, project name, and enforces a valid build type. ```cmake cmake_minimum_required ( VERSION 2.6 ) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") project ( AVB ) # Some CMake voodoo to set the default build type IF(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) else () IF (NOT (("${CMAKE_BUILD_TYPE}" STREQUAL "Release") OR ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") OR ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") OR ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel"))) MESSAGE ( FATAL_ERROR "Unknown CMAKE_BUILD_TYPE; Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel") ENDIF () ENDIF() MESSAGE ("-- Build type is ${CMAKE_BUILD_TYPE}") ``` -------------------------------- ### Configure MAAP Test Build Source: https://github.com/avnu/openavnu/blob/master/daemons/maap/test/CMakeLists.txt Initializes the project, enables testing, and sets up include directories for common files. ```cmake cmake_minimum_required (VERSION 2.8) project (maap_tests) enable_testing() set (ComDir "../common" ) include_directories( ${ComDir} ) ``` -------------------------------- ### Clone Repositories Source: https://github.com/avnu/openavnu/blob/master/documents/examples/AVB_Talker_Listener_Example_Setup.md Fetch the required Open-AVB and gPTP repositories from GitHub. ```bash git clone https://github.com/Avnu/OpenAvnu.git git clone https://github.com/Avnu/gptp.git ``` -------------------------------- ### Verify Audio Pipeline with gst-launch Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/endpoint/gstreamer.txt Test a local audio loopback pipeline using ALSA source and sink to ensure hardware compatibility and capability negotiation. ```bash gst-launch -v alsasrc device=hw:1 ! audio/x-raw-int,rate=48000 ! audioconvert ! alsasink device=hw:0 ``` -------------------------------- ### Build using CMake Source: https://github.com/avnu/openavnu/blob/master/README.rst Configure and build the project using an out-of-tree directory. ```bash mkdir tmp cd tmp cmake .. -G "Unix Makefiles" make ``` -------------------------------- ### Run Ranging Demo Source: https://github.com/avnu/openavnu/blob/master/examples/alsa_timed_audio/README.md Executes the ranging demo application to measure distance between devices using play or record modes. ```bash ./RangingDemo <-p|-r> -d -i ``` -------------------------------- ### Initialize Git Submodules Source: https://github.com/avnu/openavnu/blob/master/README.rst Commands to initialize and update submodules after cloning the repository. ```bash git submodule init git submodule update ``` -------------------------------- ### Build MAAP with Make Source: https://github.com/avnu/openavnu/blob/master/daemons/maap/README.rst Use the makefile directly from the build directory to compile the MAAP daemon on Linux. ```bash $ cd daemons/maap/linux/build $ make ``` -------------------------------- ### Policy and Include Configuration Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/CMakeLists.txt Initializes source file lists, suppresses policy warnings, and includes the OSAL CMake configuration. ```cmake # Used to hold lists of source files from common code subdirectories SET (SRC_FILES "") # Suppress the policy warning when including a CMakeLists.txt file if(POLICY CMP0011) cmake_policy(SET CMP0011 OLD) endif(POLICY CMP0011) include(${AVB_OSAL_DIR}/CMakeLists.txt) ``` -------------------------------- ### Check Driver Source: https://github.com/avnu/openavnu/blob/master/documents/examples/AVB_Talker_Listener_Example_Setup.md Verify the network interface driver using ethtool. ```bash ethtool -i eth0 ``` -------------------------------- ### Set Environment Variables Source: https://github.com/avnu/openavnu/blob/master/documents/examples/AVB_Talker_Listener_Example_Setup.md Define paths and network interfaces for the AVB environment. ```bash export AVB_PATH=$(pwd) export GPTP_PATH="$AVB_PATH/../gptp" export AVB_PC1_IF="eth0" export AVB_PC2_IF="eth2" ``` -------------------------------- ### Build AVB Host and Harness Executables Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/avb_host/CMakeLists.txt Defines the executable targets and their associated link libraries for the host and harness applications. ```cmake add_executable ( openavb_host openavb_host.c ) target_link_libraries( openavb_host map_ctrl map_mjpeg map_mpeg2ts map_null map_pipe map_aaf_audio map_uncmp_audio map_h264 intf_ctrl intf_echo intf_logger intf_null intf_tonegen intf_viewer intf_alsa intf_mpeg2ts_file intf_wav_file avbTl ${PLATFORM_LINK_LIBRARIES} ${ALSA_LIBRARIES} ${GLIB_PKG_LIBRARIES} pthread rt dl ) ``` ```cmake add_executable ( openavb_harness openavb_harness.c ) target_link_libraries( openavb_harness map_ctrl map_mjpeg map_mpeg2ts map_null map_pipe map_aaf_audio map_uncmp_audio map_h264 intf_ctrl intf_echo intf_logger intf_null intf_tonegen intf_viewer intf_alsa intf_mpeg2ts_file intf_wav_file avbTl ${PLATFORM_LINK_LIBRARIES} ${ALSA_LIBRARIES} ${GLIB_PKG_LIBRARIES} pthread rt dl ) ``` -------------------------------- ### Configure Include Directories Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/avb_host/CMakeLists.txt Sets the search paths for header files required by the AVB components. ```cmake include_directories( ${AVB_OSAL_DIR}/tl ${AVB_OSAL_DIR}/endpoint ${AVB_SRC_DIR}/util ${AVB_SRC_DIR}/tl ${AVB_SRC_DIR}/srp ) ``` -------------------------------- ### Configure CMake for mrpd_simple_test Source: https://github.com/avnu/openavnu/blob/master/daemons/mrpd/tests/simple/CMakeLists.txt Initializes the project, enables testing, and sets up source directories and include paths for CppUTest. ```cmake cmake_minimum_required (VERSION 2.8) project (mrpd_simple_test) enable_testing() set (CPPUTEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../thirdparty/cpputest ) set (SRC_DIR "../.." ) add_definitions(-DMRP_CPPUTEST) include_directories( . "../../../common" ${CPPUTEST_DIR}/include ) file(GLOB CPPUTEST_SRC *.cpp) file(GLOB MRPD_SRC ${SRC_DIR}/mrp.c ${SRC_DIR}/mvrp.c ${SRC_DIR}/mmrp.c ${SRC_DIR}/msrp.c "../../../common/parse.c" "../../../common/eui64set.c" ) # memory leak test add_definitions(-DCPPUTEST_USE_MEM_LEAK_DETECTION) ``` -------------------------------- ### General command string format Source: https://github.com/avnu/openavnu/blob/master/daemons/mrpd/readme.rst The standard syntax for sending commands to the MRP daemon. ```text CCC:X=12233,Y=34567 ``` -------------------------------- ### Load AVB Driver Source: https://github.com/avnu/openavnu/blob/master/documents/examples/AVB_Talker_Listener_Example_Setup.md Load the igb_avb driver if the interface is not already configured. ```bash sudo ./startup.sh eth0 ``` -------------------------------- ### Configure Include Directories Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/avb_avdecc/CMakeLists.txt Sets the search paths for header files required by the AVDECC component. ```cmake include_directories( ${AVB_OSAL_DIR}/avdecc ${AVB_SRC_DIR}/util ) ``` -------------------------------- ### Configure MAAP Test Build Environment Source: https://github.com/avnu/openavnu/blob/master/daemons/maap/tests/CMakeLists.txt Initializes the project, enables testing, and defines source directories and compiler definitions for the MAAP test suite. ```cmake cmake_minimum_required (VERSION 2.8) project (maap_test) enable_testing() set (CPPUTEST_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../thirdparty/cpputest" ) set (SRC_DIR "../common" ) set (TEST_DIR "../test" ) add_definitions(-DMRP_CPPUTEST) include_directories( . "${CMAKE_CURRENT_LIST_DIR}/../common/" ${CPPUTEST_DIR}/include ) file(GLOB CPPUTEST_SRC *.cpp) file(GLOB MAAP_SRC ${SRC_DIR}/intervals.c ${SRC_DIR}/maap.c ${SRC_DIR}/maap_log_queue.c ${SRC_DIR}/maap_net.c ${SRC_DIR}/maap_packet.c ${SRC_DIR}/maap_parse.c) file(GLOB MAAP_TEST_SRC ${TEST_DIR}/maap_log_dummy.c ${TEST_DIR}/maap_timer_dummy.c) if(APPLE) include_directories( include ${SRC_DIR} ${CPPUTEST_DIR}/include/Platforms/Gcc ) link_directories(${CPPUTEST_DIR}/src/CppUTest ${CPPUTEST_DIR}/src/CppUTestExt ) add_executable (maap_test ${MAAP_SRC} ${MAAP_TEST_SRC} ${CPPUTEST_SRC} ) target_link_libraries(maap_test CppUTest CppUTestExt) elseif(UNIX) include_directories( include ${SRC_DIR} ${CPPUTEST_DIR}/include/Platforms/Gcc ) link_directories(${CPPUTEST_DIR}/src/CppUTest ${CPPUTEST_DIR}/src/CppUTestExt ) add_executable (maap_test ${MAAP_SRC} ${MAAP_TEST_SRC} ${CPPUTEST_SRC} ) target_link_libraries(maap_test CppUTest CppUTestExt) elseif(WIN32) if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) link_directories($ENV{WPCAP_DIR}/Lib/x64 ${CPPUTEST_DIR}/src/CppUTest ${CPPUTEST_DIR}/src/CppUTestExt) elseif( CMAKE_SIZEOF_VOID_P EQUAL 4 ) link_directories($ENV{WPCAP_DIR}/Lib ${CPPUTEST_DIR}/src/CppUTest ${CPPUTEST_DIR}/src/CppUTestExt) endif() add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_executable (maap_test ${MAAP_SRC} ${MAAP_TEST_SRC} ${CPPUTEST_SRC} ) target_link_libraries(maap_test CppUTest CppUTestExt Ws2_32 Winmm) endif() add_test( maap_test maap_test ) ``` -------------------------------- ### Configure Source Files and Dependencies Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/intf_mjpeg_gst/CMakeLists.txt Sets source files based on the GStreamer version and defines include directories and libraries required for the build. ```cmake IF (NOT GSTREAMER_1_0) SET (SRC_FILES ${SRC_FILES} ${AVB_OSAL_DIR}/intf_mjpeg_gst/openavb_intf_mjpeg_gst.c ${AVB_OSAL_DIR}/gst_al/gst_al_01.c PARENT_SCOPE ) ELSE () SET (SRC_FILES ${SRC_FILES} ${AVB_OSAL_DIR}/intf_mjpeg_gst/openavb_intf_mjpeg_gst.c ${AVB_OSAL_DIR}/gst_al/gst_al_10.c PARENT_SCOPE ) ENDIF () # Need include and link directories for GST SET (INTF_INCLUDE_DIR ${INTF_INCLUDE_DIR} ${GLIB_PKG_INCLUDE_DIRS} ${GST_PKG_INCLUDE_DIRS} ${AVB_OSAL_DIR}/gst_al PARENT_SCOPE ) SET (INTF_LIBRARY_DIR ${INTF_LIBRARY_DIR} PARENT_SCOPE) SET (INTF_LIBRARY ${GLIB_PKG_LIBRARIES} ${GST_PKG_LIBRARIES} ${GSTRTP_PKG_LIBRARIES} PARENT_SCOPE) ``` -------------------------------- ### Run AVTP pipeline stream configurations Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/README.md Shell commands to execute talker and listener instances for different stream mappings. Ensure AVTP pipeline is compiled without SRP support before running. ```bash IFNAME=eth0 STREAMS=7 CLASS=A RATE=8000 TRANSIT_USEC=2000 REPORT=0 # statistics display interval in seconds (0 turns off statistics) # AAF talker sudo ./openavb_harness -I $IFNAME -s $STREAMS -d 0 -a a0:36:9f:2d:01:ad aaf_file_talker.ini,sr_class=$CLASS,map_nv_tx_rate=$RATE,max_transit_usec=$TRANSIT_USEC,map_nv_sparse_mode=0,intf_nv_file_name=test01.wav,report_seconds=$REPORT # AAF listener sudo ./openavb_harness -I $IFNAME -s $STREAMS -d 0 -a a0:36:9f:2d:01:ad aaf_listener_auto.ini,sr_class=$CLASS,map_nv_tx_rate=$RATE,max_transit_usec=$TRANSIT_USEC,map_nv_sparse_mode=0,intf_nv_audio_endian=big,report_seconds=$REPORT # 61883-6 talker sudo ./openavb_harness -I $IFNAME -s $STREAMS -d 0 -a a0:36:9f:2d:01:ad wav_file_talker.ini,sr_class=$CLASS,map_nv_tx_rate=$RATE,max_transit_usec=$TRANSIT_USEC,intf_nv_file_name=test01.wav,report_seconds=$REPORT # 61883-6 listener sudo ./openavb_harness -I $IFNAME -s $STREAMS -d 0 -a a0:36:9f:2d:01:ad alsa_listener.ini,sr_class=$CLASS,map_nv_tx_rate=$RATE,max_transit_usec=$TRANSIT_USEC,report_seconds=$REPORT # H264 talker sudo ./openavb_harness -I $IFNAME -s $STREAMS -d 0 -a a0:36:9f:2d:01:ad h264_gst_talker.ini,sr_class=$CLASS,map_nv_tx_rate=$RATE,max_transit_usec=$TRANSIT_USEC,report_seconds=$REPORT # H264 listener sudo ./openavb_harness -I $IFNAME -s $STREAMS -d 0 -a a0:36:9f:2d:01:ad h264_gst_listener.ini,sr_class=$CLASS,map_nv_tx_rate=$RATE,max_transit_usec=$TRANSIT_USEC,report_seconds=$REPORT # MJPEG talker sudo ./openavb_harness -I $IFNAME -s $STREAMS -d 0 -a a0:36:9f:2d:01:ad mjpeg_gst_talker.ini,sr_class=$CLASS,map_nv_tx_rate=$RATE,max_transit_usec=$TRANSIT_USEC,report_seconds=$REPORT # MJPEG listener sudo ./openavb_harness -I $IFNAME -s $STREAMS -d 0 -a a0:36:9f:2d:01:ad mjpeg_gst_listener.ini,sr_class=$CLASS,map_nv_tx_rate=$RATE,max_transit_usec=$TRANSIT_USEC,report_seconds=$REPORT # MPEG2TS talker sudo ./openavb_harness -I $IFNAME -s $STREAMS -d 0 -a a0:36:9f:2d:01:ad mpeg2ts_file_talker.ini,sr_class=$CLASS,map_nv_tx_rate=$RATE,max_transit_usec=$TRANSIT_USEC,report_seconds=$REPORT # MPEG2TS listener sudo ./openavb_harness -I $IFNAME -s $STREAMS -d 0 -a a0:36:9f:2d:01:ad mpeg2ts_gst_listener.ini,sr_class=$CLASS,map_nv_tx_rate=$RATE,max_transit_usec=$TRANSIT_USEC,report_seconds=$REPORT ``` -------------------------------- ### Configure Subdirectories and Executables Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/CMakeLists.txt Adds subdirectories and defines build targets for rawsock_rx and rawsock_tx when AVB_FEATURE_AVDECC is disabled. ```cmake add_subdirectory ( documents ) if (NOT AVB_FEATURE_AVDECC) # SDKS add_subdirectory ( sdk ) # rawsock_rx add_executable (rawsock_rx ${AVB_OSAL_DIR}/rawsock/rawsock_rx.c) target_link_libraries (rawsock_rx avbTl ${GLIB_PKG_LIBRARIES} pthread rt ${PLATFORM_LINK_LIBRARIES} ) install ( TARGETS rawsock_rx RUNTIME DESTINATION ${AVB_INSTALL_BIN_DIR} ) # rawsock_tx add_executable (rawsock_tx ${AVB_OSAL_DIR}/rawsock/rawsock_tx.c) target_link_libraries (rawsock_tx avbTl ${GLIB_PKG_LIBRARIES} pthread rt ${PLATFORM_LINK_LIBRARIES} ) install ( TARGETS rawsock_tx RUNTIME DESTINATION ${AVB_INSTALL_BIN_DIR} ) endif () ``` -------------------------------- ### MSRP command reference Source: https://github.com/avnu/openavnu/blob/master/daemons/mrpd/readme.rst List of available MSRP commands for querying, joining, leaving, and reporting stream or listener statuses. ```text S??: query MSRP Registrar database S+?: (re)JOIN a stream S++: NEW a stream S--: LV a stream S+L: Report a listener status S-L: Withdraw a listener status S+D: Report a domain status S-D: Withdraw a domain status ``` -------------------------------- ### Define Project Include Directories Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/CMakeLists.txt Registers various source and OSAL directories for the compiler to locate header files. ```cmake include_directories( ${AVB_TCAL_DIR} ${AVB_HAL_DIR} ${AVB_HAL_DIR}/mcr ${AVB_OSAL_DIR} ${AVB_OSAL_DIR}/include ${AVB_SRC_DIR}/include ${AVB_OSAL_DIR}/avtp ${AVB_OSAL_DIR}/tl ${AVB_SRC_DIR}/avtp ${AVB_SRC_DIR}/avdecc ${AVB_SRC_DIR}/acmp ${AVB_SRC_DIR}/adp ${AVB_SRC_DIR}/aecp ${AVB_SRC_DIR}/aem ${AVB_SRC_DIR}/endpoint ${AVB_SRC_DIR}/srp ${AVB_SRC_DIR}/maap ${AVB_SRC_DIR}/shaper ${AVB_SRC_DIR}/inih ${AVB_SRC_DIR}/map_mjpeg ${AVB_SRC_DIR}/map_mpeg2ts ${AVB_SRC_DIR}/map_null ${AVB_SRC_DIR}/map_pipe ${AVB_SRC_DIR}/map_aaf_audio ${AVB_SRC_DIR}/map_uncmp_audio ${AVB_SRC_DIR}/map_ctrl ${AVB_SRC_DIR}/map_h264 ${AVB_SRC_DIR}/intf_ctrl ${AVB_SRC_DIR}/mcr ${AVB_SRC_DIR}/mediaq ${AVB_SRC_DIR}/rawsock ${AVB_SRC_DIR}/qmgr ${AVB_SRC_DIR}/tl ${AVB_SRC_DIR}/util ${AVB_SRC_DIR}/avdecc_msg ${AVB_OSAL_DIR}/avdecc ${AVB_OSAL_DIR}/endpoint ${AVB_OSAL_DIR}/avdecc_msg ${AVB_SRC_DIR}/../common ${AVB_SRC_DIR}/mcs ) ``` -------------------------------- ### Configure Doxygen Documentation Generation Source: https://github.com/avnu/openavnu/blob/master/daemons/maap/doc/CMakeLists.txt Uses find_package to locate Doxygen and defines a custom target to trigger documentation generation if enabled. ```cmake cmake_minimum_required(VERSION 2.8) # add a target to generate API documentation with Doxygen find_package(Doxygen) option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND}) if(BUILD_DOCUMENTATION) if(NOT DOXYGEN_FOUND) message(FATAL_ERROR "Doxygen is needed to build the documentation.") endif() set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) set(doxyfile ${CMAKE_CURRENT_SOURCE_DIR}/build/Doxyfile) configure_file(${doxyfile_in} ${doxyfile} @ONLY) add_custom_target(doc COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMENT "Generating API documentation with Doxygen" VERBATIM) #install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc) endif() ``` -------------------------------- ### Log Build Configuration Variables Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/CMakeLists.txt Prints the current values of key directory variables to the console during the CMake configuration phase. ```cmake MESSAGE ("-- CMAKE_SOURCE_DIR : ${CMAKE_SOURCE_DIR}") MESSAGE ("-- AVB_SRC_DIR : ${AVB_SRC_DIR}") MESSAGE ("-- AVB_HAL_DIR : ${AVB_HAL_DIR}") MESSAGE ("-- AVB_OSAL_DIR : ${AVB_OSAL_DIR}") MESSAGE ("-- AVB_INSTALL_BIN_DIR : ${AVB_INSTALL_BIN_DIR}") MESSAGE ("-- AVB_INSTALL_LIB_DIR : ${AVB_INSTALL_LIB_DIR}") MESSAGE ("-- SDK_INSTALL_SDK_INTF_MOD_DIR : ${SDK_INSTALL_SDK_INTF_MOD_DIR}") MESSAGE ("-- SDK_INSTALL_SDK_MAP_MOD_DIR : ${SDK_INSTALL_SDK_MAP_MOD_DIR}") MESSAGE ("-- SDK_INSTALL_SDK_EAVB_DIR : ${SDK_INSTALL_SDK_EAVB_DIR}") ``` -------------------------------- ### Platform-Specific Build Configuration Source: https://github.com/avnu/openavnu/blob/master/daemons/mrpd/tests/simple/CMakeLists.txt Configures compiler flags, include directories, and executable targets based on the target operating system (Apple, Unix, or Windows). ```cmake if(APPLE) set(CPPUTEST_C_FLAGS "${CPPUTEST_C_FLAGS} -include ${CPPUTEST_DIR}/include/CppUTest/MemoryLeakDetectorMallocMacros.h") set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -include ${CPPUTEST_DIR}/include/CppUTest/MemoryLeakDetectorNewMacros.h") set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -include ${CPPUTEST_DIR}/include/CppUTest/MemoryLeakDetectorMallocMacros.h") include_directories( include ${CPPUTEST_DIR}/include/Platforms/Gcc ) add_executable (mrpd_simple_test ${MRPD_SRC} ${CPPUTEST_SRC} ) target_link_libraries(mrpd_simple_test CppUTest CppUTestExt) elseif(UNIX) set(CPPUTEST_C_FLAGS "${CPPUTEST_C_FLAGS} -include ${CPPUTEST_DIR}/include/CppUTest/MemoryLeakDetectorMallocMacros.h") set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -include ${CPPUTEST_DIR}/include/CppUTest/MemoryLeakDetectorNewMacros.h") set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -include ${CPPUTEST_DIR}/include/CppUTest/MemoryLeakDetectorMallocMacros.h") include_directories( include ${CPPUTEST_DIR}/include/Platforms/Gcc ) link_directories(mrpd_simple_test ${CPPUTEST_DIR}/src/CppUTest ${CPPUTEST_DIR}/src/CppUTestExt ) add_executable (mrpd_simple_test ${MRPD_SRC} ${CPPUTEST_SRC} mrp_doubles.c) target_link_libraries(mrpd_simple_test CppUTest CppUTestExt) elseif(WIN32) set(CPPUTEST_C_FLAGS "${CPPUTEST_C_FLAGS} /FI${CPPUTEST_DIR}/include/CppUTest/MemoryLeakDetectorMallocMacros.h") set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} /FI${CPPUTEST_DIR}/include/CppUTest/MemoryLeakDetectorMallocMacros.h") if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) link_directories(mrpd_simple_test $ENV{WPCAP_DIR}/Lib/x64 ${CPPUTEST_DIR}/src/CppUTest ${CPPUTEST_DIR}/src/CppUTestExt) elseif( CMAKE_SIZEOF_VOID_P EQUAL 4 ) link_directories(mrpd_simple_test $ENV{WPCAP_DIR}/Lib ${CPPUTEST_DIR}/src/CppUTest ${CPPUTEST_DIR}/src/CppUTestExt) endif() add_definitions(-D_CRT_SECURE_NO_WARNINGS) include_directories( include $ENV{WPCAP_DIR}/Include ) add_executable (mrpd_simple_test ${MRPD_SRC} ${CPPUTEST_SRC} ${SRC_DIR}/que.c mrp_doubles.c) target_link_libraries(mrpd_simple_test wpcap Iphlpapi Ws2_32 CppUTest CppUTestExt) endif() ``` -------------------------------- ### Configure WAV File Interface Build Variables Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/intf_wav_file/CMakeLists.txt Sets the source files and directory variables for the WAV file interface in the parent scope. ```cmake SET (SRC_FILES ${SRC_FILES} ${AVB_OSAL_DIR}/intf_wav_file/openavb_intf_wav_file.c PARENT_SCOPE ) # Need include and link directories SET (INTF_INCLUDE_DIR ${INTF_INCLUDE_DIR} PARENT_SCOPE) SET (INTF_LIBRARY_DIR ${INTF_LIBRARY_DIR} PARENT_SCOPE) SET (INTF_LIBRARY ${INTF_LIBRARY} PARENT_SCOPE) ``` -------------------------------- ### Extended Audio Pipeline with Resampling Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/endpoint/gstreamer.txt A longer pipeline demonstrating the inclusion of audioresample and explicit capability filtering before the sink. ```bash gst-launch -v alsasrc device=hw:1 ! audio/x-raw-int,rate=48000 ! audioresample ! audio/x-raw-int,width=16,depth=16,rate=44100,channels=1,endianness=1234,signed=true ! audioconvert ! alsasink device=hw:0 ``` -------------------------------- ### MAAP Daemon Command Line Usage Source: https://github.com/avnu/openavnu/blob/master/daemons/maap/README.rst Syntax for running the MAAP daemon in either client or server mode. ```bash maap_daemon [ -c | -i interface_name [-d log_file] ] [-p port_num] ``` -------------------------------- ### Configure Doxygen and Custom Build Targets Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/documents/CMakeLists.txt Checks for Doxygen, configures input files, and defines custom targets for generating documentation and PDF output. ```cmake find_package(Doxygen) if(DOXYGEN_FOUND) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DoxygenLayout.xml ${CMAKE_CURRENT_BINARY_DIR}/DoxygenLayout.xml @ONLY) add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation with Doxygen" VERBATIM ) add_custom_target(pdfdoc make 1>/dev/null 2>/dev/null WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/latex DEPENDS doc COMMENT "Generating PDF document" ) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/api_docs DESTINATION ${SDK_INSTALL_SDK_INTF_MOD_DIR} OPTIONAL) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf DESTINATION ${SDK_INSTALL_SDK_INTF_MOD_DIR} RENAME "OPENAVB EAVB SDK.pdf" OPTIONAL) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/api_docs DESTINATION ${SDK_INSTALL_SDK_EAVB_DIR} OPTIONAL) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf DESTINATION ${SDK_INSTALL_SDK_EAVB_DIR} RENAME "OPENAVB EAVB SDK.pdf" OPTIONAL) endif(DOXYGEN_FOUND) ``` -------------------------------- ### Configure Rawsock Source Files Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/rawsock/CMakeLists.txt Conditionally sets source file variables based on enabled features and updates the global SRC_FILES list. ```cmake if (AVB_FEATURE_PCAP) message("-- Rawsock PCAP enabled") SET (PCAP_FILES ${AVB_OSAL_DIR}/rawsock/pcap_rawsock.c ) if (AVB_FEATURE_IGB) message("-- Rawsock IGB enabled") SET (IGB_FILES ${AVB_OSAL_DIR}/rawsock/igb_rawsock.c ${AVB_HAL_DIR}/openavb_igb.c ) endif () if (AVB_FEATURE_ATL) message("-- Rawsock ATL enabled") SET (ATL_FILES ${AVB_OSAL_DIR}/rawsock/atl_rawsock.c ${AVB_HAL_DIR}/openavb_atl.c ) endif () endif () SET (SRC_FILES ${SRC_FILES} ${AVB_SRC_DIR}/rawsock/rawsock_impl.c ${AVB_OSAL_DIR}/rawsock/openavb_rawsock.c ${AVB_OSAL_DIR}/rawsock/simple_rawsock.c ${AVB_OSAL_DIR}/rawsock/ring_rawsock.c ${AVB_OSAL_DIR}/rawsock/sendmmsg_rawsock.c ${PCAP_FILES} ${IGB_FILES} ${ATL_FILES} PARENT_SCOPE ) ``` -------------------------------- ### Define Test Executables Source: https://github.com/avnu/openavnu/blob/master/daemons/maap/test/CMakeLists.txt Creates the test_intervals executable based on the host operating system. ```cmake if(UNIX) add_executable( test_intervals "test_intervals.c" "${ComDir}/intervals.c" ) elseif(WIN32) add_executable( test_intervals "test_intervals.c" "${ComDir}/intervals.c" ) endif() ``` -------------------------------- ### Finalize Build and Register Test Source: https://github.com/avnu/openavnu/blob/master/daemons/mrpd/tests/simple/CMakeLists.txt Applies compiler flags and registers the test executable with CTest. ```cmake set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CPPUTEST_C_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPPUTEST_CXX_FLAGS}") add_test( test_mrpd mrpd_simple_test -v ) ``` -------------------------------- ### Configure Compiler Flags Source: https://github.com/avnu/openavnu/blob/master/lib/avtp_pipeline/platform/Linux/CMakeLists.txt Defines build-specific preprocessor macros based on the selected build type. ```cmake # Set a define to signal build to source files STRING ( TOUPPER "${CMAKE_BUILD_TYPE}_BUILD" BUILD_TYPE_STRING ) SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D${BUILD_TYPE_STRING}" ) ```