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

Add: gsteamer plugin for sending ancillary data #1044

Merged
merged 7 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
6 changes: 3 additions & 3 deletions ecosystem/gstreamer_plugin/gst_mtl_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ gboolean gst_mtl_common_parse_sampling(gint sampling, enum st30_sampling* st_sam
}
}

void gst_mtl_common_init_general_argumetns(GObjectClass* gobject_class) {
void gst_mtl_common_init_general_arguments(GObjectClass* gobject_class) {
g_object_class_install_property(
gobject_class, PROP_GENERAL_LOG_LEVEL,
g_param_spec_uint("log-level", "Log Level", "Set the log level (INFO 1 to CRIT 5).",
Expand Down Expand Up @@ -269,7 +269,7 @@ void gst_mtl_common_init_general_argumetns(GObjectClass* gobject_class) {
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}

void gst_mtl_common_set_general_argumetns(GObject* object, guint prop_id,
void gst_mtl_common_set_general_arguments(GObject* object, guint prop_id,
const GValue* value, GParamSpec* pspec,
StDevArgs* devArgs, SessionPortArgs* portArgs,
guint* log_level) {
Expand Down Expand Up @@ -310,7 +310,7 @@ void gst_mtl_common_set_general_argumetns(GObject* object, guint prop_id,
}
}

void gst_mtl_common_get_general_argumetns(GObject* object, guint prop_id,
void gst_mtl_common_get_general_arguments(GObject* object, guint prop_id,
const GValue* value, GParamSpec* pspec,
StDevArgs* devArgs, SessionPortArgs* portArgs,
guint* log_level) {
Expand Down
6 changes: 3 additions & 3 deletions ecosystem/gstreamer_plugin/gst_mtl_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ gboolean gst_mtl_common_parse_sampling(gint sampling, enum st30_sampling* st_sam
gboolean gst_mtl_common_parse_dev_arguments(struct mtl_init_params* mtl_init_params,
StDevArgs* devArgs);

void gst_mtl_common_init_general_argumetns(GObjectClass* gobject_class);
void gst_mtl_common_init_general_arguments(GObjectClass* gobject_class);

void gst_mtl_common_set_general_argumetns(GObject* object, guint prop_id,
void gst_mtl_common_set_general_arguments(GObject* object, guint prop_id,
const GValue* value, GParamSpec* pspec,
StDevArgs* devArgs, SessionPortArgs* portArgs,
guint* log_level);

void gst_mtl_common_get_general_argumetns(GObject* object, guint prop_id,
void gst_mtl_common_get_general_arguments(GObject* object, guint prop_id,
const GValue* value, GParamSpec* pspec,
StDevArgs* devArgs, SessionPortArgs* portArgs,
guint* log_level);
Expand Down
6 changes: 3 additions & 3 deletions ecosystem/gstreamer_plugin/gst_mtl_st20p_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static void gst_mtl_st20p_rx_class_init(Gst_Mtl_St20p_RxClass* klass) {
gstbasesrc_class->negotiate = GST_DEBUG_FUNCPTR(gst_mtl_st20p_rx_negotiate);
gstbasesrc_class->create = GST_DEBUG_FUNCPTR(gst_mtl_st20p_rx_create);

gst_mtl_common_init_general_argumetns(gobject_class);
gst_mtl_common_init_general_arguments(gobject_class);

g_object_class_install_property(
gobject_class, PROP_ST20P_RX_RETRY,
Expand Down Expand Up @@ -313,7 +313,7 @@ static void gst_mtl_st20p_rx_set_property(GObject* object, guint prop_id,
Gst_Mtl_St20p_Rx* self = GST_MTL_ST20P_RX(object);

if (prop_id < PROP_GENERAL_MAX) {
gst_mtl_common_set_general_argumetns(object, prop_id, value, pspec, &(self->devArgs),
gst_mtl_common_set_general_arguments(object, prop_id, value, pspec, &(self->devArgs),
&(self->portArgs), &self->log_level);
return;
}
Expand Down Expand Up @@ -351,7 +351,7 @@ static void gst_mtl_st20p_rx_get_property(GObject* object, guint prop_id, GValue
Gst_Mtl_St20p_Rx* src = GST_MTL_ST20P_RX(object);

if (prop_id < PROP_GENERAL_MAX) {
gst_mtl_common_get_general_argumetns(object, prop_id, value, pspec, &(src->devArgs),
gst_mtl_common_get_general_arguments(object, prop_id, value, pspec, &(src->devArgs),
&(src->portArgs), &src->log_level);
return;
}
Expand Down
6 changes: 3 additions & 3 deletions ecosystem/gstreamer_plugin/gst_mtl_st20p_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static void gst_mtl_st20p_tx_class_init(Gst_Mtl_St20p_TxClass* klass) {
gstvideosinkelement_class->parent_class.start =
GST_DEBUG_FUNCPTR(gst_mtl_st20p_tx_start);

gst_mtl_common_init_general_argumetns(gobject_class);
gst_mtl_common_init_general_arguments(gobject_class);

g_object_class_install_property(
gobject_class, PROP_ST20P_TX_RETRY,
Expand Down Expand Up @@ -218,7 +218,7 @@ static void gst_mtl_st20p_tx_set_property(GObject* object, guint prop_id,
Gst_Mtl_St20p_Tx* self = GST_MTL_ST20P_TX(object);

if (prop_id < PROP_GENERAL_MAX) {
gst_mtl_common_set_general_argumetns(object, prop_id, value, pspec, &(self->devArgs),
gst_mtl_common_set_general_arguments(object, prop_id, value, pspec, &(self->devArgs),
&(self->portArgs), &self->log_level);
return;
}
Expand All @@ -244,7 +244,7 @@ static void gst_mtl_st20p_tx_get_property(GObject* object, guint prop_id, GValue
Gst_Mtl_St20p_Tx* sink = GST_MTL_ST20P_TX(object);

if (prop_id < PROP_GENERAL_MAX) {
gst_mtl_common_get_general_argumetns(object, prop_id, value, pspec, &(sink->devArgs),
gst_mtl_common_get_general_arguments(object, prop_id, value, pspec, &(sink->devArgs),
&(sink->portArgs), &sink->log_level);
return;
}
Expand Down
6 changes: 3 additions & 3 deletions ecosystem/gstreamer_plugin/gst_mtl_st30p_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static void gst_mtl_st30p_rx_class_init(Gst_Mtl_St30p_RxClass* klass) {
gstbasesrc_class->negotiate = GST_DEBUG_FUNCPTR(gst_mtl_st30p_rx_negotiate);
gstbasesrc_class->create = GST_DEBUG_FUNCPTR(gst_mtl_st30p_rx_create);

gst_mtl_common_init_general_argumetns(gobject_class);
gst_mtl_common_init_general_arguments(gobject_class);

g_object_class_install_property(
gobject_class, PROP_ST30P_RX_FRAMERATE,
Expand Down Expand Up @@ -295,7 +295,7 @@ static void gst_mtl_st30p_rx_set_property(GObject* object, guint prop_id,
Gst_Mtl_St30p_Rx* self = GST_MTL_ST30P_RX(object);

if (prop_id < PROP_GENERAL_MAX) {
gst_mtl_common_set_general_argumetns(object, prop_id, value, pspec, &(self->devArgs),
gst_mtl_common_set_general_arguments(object, prop_id, value, pspec, &(self->devArgs),
&(self->portArgs), &self->log_level);
return;
}
Expand Down Expand Up @@ -324,7 +324,7 @@ static void gst_mtl_st30p_rx_get_property(GObject* object, guint prop_id, GValue
Gst_Mtl_St30p_Rx* src = GST_MTL_ST30P_RX(object);

if (prop_id < PROP_GENERAL_MAX) {
gst_mtl_common_get_general_argumetns(object, prop_id, value, pspec, &(src->devArgs),
gst_mtl_common_get_general_arguments(object, prop_id, value, pspec, &(src->devArgs),
&(src->portArgs), &src->log_level);
return;
}
Expand Down
8 changes: 4 additions & 4 deletions ecosystem/gstreamer_plugin/gst_mtl_st30p_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static void gst_mtl_st30p_tx_class_init(Gst_Mtl_St30p_TxClass* klass) {
gstbasesink_class = GST_BASE_SINK_CLASS(klass);

gst_element_class_set_metadata(
gstelement_class, "MtlTxSt30Sink", "Sink/Video",
gstelement_class, "MtlTxSt30Sink", "Sink/Audio",
"MTL transmission plugin for SMPTE ST 2110-30 standard (audio)",
"Marek Kasiewicz <[email protected]>");

Expand All @@ -171,7 +171,7 @@ static void gst_mtl_st30p_tx_class_init(Gst_Mtl_St30p_TxClass* klass) {
gobject_class->finalize = GST_DEBUG_FUNCPTR(gst_mtl_st30p_tx_finalize);
gstbasesink_class->start = GST_DEBUG_FUNCPTR(gst_mtl_st30p_tx_start);

gst_mtl_common_init_general_argumetns(gobject_class);
gst_mtl_common_init_general_arguments(gobject_class);

g_object_class_install_property(
gobject_class, PROP_ST30P_TX_FRAMEBUFF_NUM,
Expand Down Expand Up @@ -223,7 +223,7 @@ static void gst_mtl_st30p_tx_set_property(GObject* object, guint prop_id,
Gst_Mtl_St30p_Tx* self = GST_MTL_ST30P_TX(object);

if (prop_id < PROP_GENERAL_MAX) {
gst_mtl_common_set_general_argumetns(object, prop_id, value, pspec, &(self->devArgs),
gst_mtl_common_set_general_arguments(object, prop_id, value, pspec, &(self->devArgs),
&(self->portArgs), &self->log_level);
return;
}
Expand All @@ -249,7 +249,7 @@ static void gst_mtl_st30p_tx_get_property(GObject* object, guint prop_id, GValue
Gst_Mtl_St30p_Tx* sink = GST_MTL_ST30P_TX(object);

if (prop_id < PROP_GENERAL_MAX) {
gst_mtl_common_get_general_argumetns(object, prop_id, value, pspec, &(sink->devArgs),
gst_mtl_common_get_general_arguments(object, prop_id, value, pspec, &(sink->devArgs),
&(sink->portArgs), &sink->log_level);
return;
}
Expand Down
12 changes: 7 additions & 5 deletions ecosystem/gstreamer_plugin/gst_mtl_st40_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static void gst_mtl_st40_rx_class_init(Gst_Mtl_St40_RxClass* klass) {
gstbasesrc_class = GST_BASE_SRC_CLASS(klass);

gst_element_class_set_metadata(
gstelement_class, "MtlRxSt40Src", "Src/Audio",
gstelement_class, "MtlRxSt40Src", "Src/Metadata",
"MTL transmission plugin for SMPTE ST 2110-40 standard (ancillary data))",
"Dawid Wesierski <[email protected]>");

Expand All @@ -166,7 +166,7 @@ static void gst_mtl_st40_rx_class_init(Gst_Mtl_St40_RxClass* klass) {
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR(gst_mtl_st40_rx_stop);
gstbasesrc_class->create = GST_DEBUG_FUNCPTR(gst_mtl_st40_rx_create);

gst_mtl_common_init_general_argumetns(gobject_class);
gst_mtl_common_init_general_arguments(gobject_class);

g_object_class_install_property(
gobject_class, PROP_ST40_RX_BUFFER_SIZE,
Expand Down Expand Up @@ -286,7 +286,7 @@ static void gst_mtl_st40_rx_set_property(GObject* object, guint prop_id,
Gst_Mtl_St40_Rx* self = GST_MTL_ST40_RX(object);

if (prop_id < PROP_GENERAL_MAX) {
gst_mtl_common_set_general_argumetns(object, prop_id, value, pspec, &(self->devArgs),
gst_mtl_common_set_general_arguments(object, prop_id, value, pspec, &(self->devArgs),
&(self->portArgs), &self->log_level);
return;
}
Expand All @@ -309,7 +309,7 @@ static void gst_mtl_st40_rx_get_property(GObject* object, guint prop_id, GValue*
Gst_Mtl_St40_Rx* src = GST_MTL_ST40_RX(object);

if (prop_id < PROP_GENERAL_MAX) {
gst_mtl_common_get_general_argumetns(object, prop_id, value, pspec, &(src->devArgs),
gst_mtl_common_get_general_arguments(object, prop_id, value, pspec, &(src->devArgs),
&(src->portArgs), &src->log_level);
return;
}
Expand Down Expand Up @@ -361,7 +361,9 @@ static GstFlowReturn gst_mtl_st40_rx_fill_buffer(Gst_Mtl_St40_Rx* src, GstBuffer

hdr = (struct st40_rfc8331_rtp_hdr*)usrptr;
payload_hdr = (struct st40_rfc8331_payload_hdr*)(&hdr[1]);
payload_hdr->swaped_second_hdr_chunk = ntohl(payload_hdr->swaped_second_hdr_chunk);
DawidWesierski4 marked this conversation as resolved.
Show resolved Hide resolved
udw_size = payload_hdr->second_hdr_chunk.data_count & 0xff;
payload_hdr->swaped_second_hdr_chunk = htonl(payload_hdr->swaped_second_hdr_chunk);

if (udw_size == 0) {
GST_ERROR("Ancillary data size is 0");
Expand All @@ -370,7 +372,7 @@ static GstFlowReturn gst_mtl_st40_rx_fill_buffer(Gst_Mtl_St40_Rx* src, GstBuffer
src->udw_size = udw_size;
src->anc_data = (char*)malloc(udw_size);
} else if (src->udw_size != udw_size) {
GST_WARNING("Size of recieved ancillary data has changed");
GST_INFO("Size of recieved ancillary data has changed");
if (src->anc_data) {
free(src->anc_data);
src->anc_data = NULL;
Expand Down
Loading
Loading