Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NMOS GStreamer sender plugin #17

Open
wants to merge 6 commits into
base: feature-gstreamer-plugins
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ Open `cpp/demos/ossrf-nmos-api/config/nmos_config.json` and adjust the following
## Build Container and Code simultaneously

./scripts/build-inside-container.sh

## Notes
At the moment, the gstreamer plugins with NMOS (nmossender and nmosreceiver) aren't 100% functional, being more of a proof of concept that will be refined in the near future.
39 changes: 39 additions & 0 deletions cpp/demos/config/nmos_plugin_node_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"node": {
"id": "d5504cd1-fe68-489d-99d4-20d3f075f062",
"configuration": {
"label": "BISECT OSSRF Node2",
"description": "BISECT OSSRF node2",
"host_addresses": [
"192.168.1.120"
],
"interfaces": [
{
"chassis_id": "c8-94-02-f7-3e-eb",
"name": "wlp1s0",
"port_id": "00-e0-4c-68-01-8d"
}
],
"clocks": [
{
"name": "clk0",
"ref_type": "ptp",
"traceable": false,
"version": "IEEE1588-2008",
"gmid": "00-20-fc-ff-fe-35-9c-25",
"locked": true
}
],
"registry_address": "192.168.1.120",
"registry_version": "v1.3",
"registration_port": 8010,
"system_address": "192.168.1.120",
"system_version": "v1.0",
"system_port": 8010,
"http_port": 5113
}
},
"device": {},
"receivers": [],
"senders": []
}
1 change: 1 addition & 0 deletions cpp/libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ add_subdirectory(bisect_expected)
add_subdirectory(bisect_nmoscpp)
add_subdirectory(bisect_sdp)
add_subdirectory(bisect_gst)
add_subdirectory(gst_nmos_sender_plugin)
add_subdirectory(ossrf_nmos_api)
add_subdirectory(ossrf_gstreamer_api)
add_subdirectory(bisect_json)
67 changes: 67 additions & 0 deletions cpp/libs/gst_nmos_sender_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
cmake_minimum_required(VERSION 3.16)
project(gst_nmos_sender_plugin LANGUAGES CXX)

find_package(nlohmann_json REQUIRED)
find_package(PkgConfig REQUIRED)

# Locate GLib package
pkg_check_modules(GLIB REQUIRED glib-2.0)

# Locate GStreamer packages
pkg_search_module(GSTREAMER REQUIRED gstreamer-1.0>=1.4)
pkg_search_module(GSTREAMER_APP REQUIRED gstreamer-app-1.0>=1.4)
pkg_search_module(GSTREAMER_AUDIO REQUIRED gstreamer-audio-1.0>=1.4)
pkg_search_module(GSTREAMER_VIDEO REQUIRED gstreamer-video-1.0>=1.4)

# Include GLib directories and link libraries
include_directories(${GLIB_INCLUDE_DIRS})
link_directories(${GLIB_LIBRARY_DIRS})
add_definitions(${GLIB_CFLAGS_OTHER})

# Include source files for gst_nmos_sender_plugin
file(GLOB_RECURSE PLUGIN_SOURCE_FILES *.cpp *.h)

# Include source files for utils
file(GLOB_RECURSE UTILS_SOURCE_FILES utils/*.cpp utils/*.h)

# Combine utils and plugin sources
set(SOURCE_FILES ${PLUGIN_SOURCE_FILES} ${UTILS_SOURCE_FILES})

# Define the plugin as a shared library
add_library(${PROJECT_NAME} MODULE ${SOURCE_FILES})

# Include directories
target_include_directories(${PROJECT_NAME}
PRIVATE ${GSTREAMER_INCLUDE_DIRS}
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/utils/include
)

# Link GStreamer libraries
target_compile_options(${PROJECT_NAME} PRIVATE ${GSTREAMER_CFLAGS_OTHER})
target_link_libraries(${PROJECT_NAME}
PRIVATE
${GSTREAMER_LIBRARIES}
${GSTREAMER_APP_LIBRARIES}
${GSTREAMER_AUDIO_LIBRARIES}
${GSTREAMER_VIDEO_LIBRARIES}
PUBLIC
bisect::project_warnings
bisect::expected
bisect::bisect_nmoscpp
bisect::bisect_json
nlohmann_json::nlohmann_json
ossrf::ossrf_nmos_api
${GLIB_LIBRARIES}
)

# Specify the output directory and the library name
set_target_properties(${PROJECT_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins
OUTPUT_NAME "gstnmossender" # Custom .so name
)

add_library(ossrf::${PROJECT_NAME} ALIAS ${PROJECT_NAME})

# Install the plugin to the system's GStreamer plugin directory
install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ~/.local/lib/gstreamer-1.0)
Loading
Loading