From 4e3a98d4f9e7bfd900cb00186574ea3b1062e79e Mon Sep 17 00:00:00 2001 From: "Kasiewicz, Marek" Date: Mon, 20 Jan 2025 09:04:40 +0000 Subject: [PATCH] Fix: Code style Signed-off-by: Kasiewicz, Marek --- ecosystem/gstreamer_plugin/gst_mtl_st40p_tx.c | 25 +++++++------------ ecosystem/gstreamer_plugin/gst_mtl_st40p_tx.h | 3 ++- lib/src/st2110/pipeline/st40_pipeline_tx.c | 1 - lib/src/st2110/pipeline/st40_pipeline_tx.h | 5 +--- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/ecosystem/gstreamer_plugin/gst_mtl_st40p_tx.c b/ecosystem/gstreamer_plugin/gst_mtl_st40p_tx.c index 5db08af23..c6e2d2b30 100644 --- a/ecosystem/gstreamer_plugin/gst_mtl_st40p_tx.c +++ b/ecosystem/gstreamer_plugin/gst_mtl_st40p_tx.c @@ -93,11 +93,7 @@ GST_DEBUG_CATEGORY_STATIC(gst_mtl_st40p_tx_debug); /* Maximum size for single User Data Words defined in st0291-1 */ #define MAX_UDW_SIZE 255 -enum { - PROP_ST40P_TX_RETRY = PROP_GENERAL_MAX, - PROP_ST40P_TX_FRAMEBUFF_CNT, - PROP_MAX -}; +enum { PROP_ST40P_TX_RETRY = PROP_GENERAL_MAX, PROP_ST40P_TX_FRAMEBUFF_CNT, PROP_MAX }; /* pad template */ static GstStaticPadTemplate gst_mtl_st40p_tx_sink_pad_template = @@ -105,8 +101,7 @@ static GstStaticPadTemplate gst_mtl_st40p_tx_sink_pad_template = #define gst_mtl_st40p_tx_parent_class parent_class G_DEFINE_TYPE_WITH_CODE(Gst_Mtl_St40p_Tx, gst_mtl_st40p_tx, GST_TYPE_BASE_SINK, - GST_DEBUG_CATEGORY_INIT(gst_mtl_st40p_tx_debug, - "mtl_st40p_tx", 0, + GST_DEBUG_CATEGORY_INIT(gst_mtl_st40p_tx_debug, "mtl_st40p_tx", 0, "MTL St2110 st40 transmission sink")); GST_ELEMENT_REGISTER_DEFINE(mtl_st40p_tx, "mtl_st40p_tx", GST_RANK_NONE, @@ -126,7 +121,6 @@ static GstFlowReturn gst_mtl_st40p_tx_chain(GstPad* pad, GstObject* parent, static gboolean gst_mtl_st40p_tx_start(GstBaseSink* bsink); static gboolean gst_mtl_st40p_tx_session_create(Gst_Mtl_St40p_Tx* sink); - static void gst_mtl_st40p_tx_class_init(Gst_Mtl_St40p_TxClass* klass) { GObjectClass* gobject_class; GstElementClass* gstelement_class; @@ -150,7 +144,6 @@ static void gst_mtl_st40p_tx_class_init(Gst_Mtl_St40p_TxClass* klass) { gstbasesink_class->start = GST_DEBUG_FUNCPTR(gst_mtl_st40p_tx_start); gst_mtl_common_init_general_argumetns(gobject_class); - } static gboolean gst_mtl_st40p_tx_start(GstBaseSink* bsink) { @@ -289,9 +282,9 @@ static gboolean gst_mtl_st40p_tx_session_create(Gst_Mtl_St40p_Tx* sink) { return FALSE; } ops_tx.port.payload_type = sink->portArgs.payload_type; - ops_tx.fps = ST_FPS_P59_94; // TODO: parameterize + ops_tx.fps = ST_FPS_P59_94; // TODO: parameterize ops_tx.interlaced = false; - sink->frame_size = MAX_UDW_SIZE; // Allow only single ANC data packet. ANC_Count = 1 + sink->frame_size = MAX_UDW_SIZE; /* Allow only single ANC data packet. ANC_Count = 1 */ ops_tx.max_udw_buff_size = MAX_UDW_SIZE; ret = mtl_start(sink->mtl_lib_handle); @@ -341,14 +334,14 @@ static gboolean gst_mtl_st40p_tx_sink_event(GstPad* pad, GstObject* parent, return ret; } -static void fill_st40_meta(struct st40_frame* frame, void *data, guint32 data_size) { +static void fill_st40_meta(struct st40_frame* frame, void* data, guint32 data_size) { frame->meta[0].c = 0; frame->meta[0].line_number = 10; frame->meta[0].hori_offset = 0; frame->meta[0].s = 0; frame->meta[0].stream_num = 0; - frame->meta[0].did = 0x43; // TODO: parametrize - frame->meta[0].sdid = 0x02; // TODO: parametrize + frame->meta[0].did = 0x43; // TODO: parametrize + frame->meta[0].sdid = 0x02; // TODO: parametrize frame->meta[0].udw_size = data_size; frame->meta[0].udw_offset = 0; frame->data = data; @@ -391,7 +384,8 @@ static GstFlowReturn gst_mtl_st40p_tx_chain(GstPad* pad, GstObject* parent, return GST_FLOW_ERROR; } cur_addr_buf = map_info.data + gst_buffer_get_size(buf) - bytes_to_write; - bytes_to_write_cur = bytes_to_write > sink->frame_size ? sink->frame_size : bytes_to_write; + bytes_to_write_cur = + bytes_to_write > sink->frame_size ? sink->frame_size : bytes_to_write; mtl_memcpy(frame->udw_buff_addr, cur_addr_buf, bytes_to_write_cur); fill_st40_meta(frame->anc_frame, frame->udw_buff_addr, bytes_to_write_cur); st40p_tx_put_frame(sink->tx_handle, frame); @@ -403,7 +397,6 @@ static GstFlowReturn gst_mtl_st40p_tx_chain(GstPad* pad, GstObject* parent, return GST_FLOW_OK; } - static void gst_mtl_st40p_tx_finalize(GObject* object) { Gst_Mtl_St40p_Tx* sink = GST_MTL_ST40P_TX(object); diff --git a/ecosystem/gstreamer_plugin/gst_mtl_st40p_tx.h b/ecosystem/gstreamer_plugin/gst_mtl_st40p_tx.h index 9912241c3..803d7b826 100644 --- a/ecosystem/gstreamer_plugin/gst_mtl_st40p_tx.h +++ b/ecosystem/gstreamer_plugin/gst_mtl_st40p_tx.h @@ -47,9 +47,10 @@ #ifndef __GST_MTL_ST40P_TX_H__ #define __GST_MTL_ST40P_TX_H__ -#include "gst_mtl_common.h" #include +#include "gst_mtl_common.h" + G_BEGIN_DECLS #define GST_TYPE_MTL_ST40P_TX (gst_mtl_st40p_tx_get_type()) diff --git a/lib/src/st2110/pipeline/st40_pipeline_tx.c b/lib/src/st2110/pipeline/st40_pipeline_tx.c index 9f92ec14a..14f762817 100644 --- a/lib/src/st2110/pipeline/st40_pipeline_tx.c +++ b/lib/src/st2110/pipeline/st40_pipeline_tx.c @@ -385,7 +385,6 @@ int st40p_tx_free(st40p_tx_handle handle) { } tx_st40p_uinit_fbs(ctx); - mt_pthread_mutex_destroy(&ctx->lock); mt_pthread_mutex_destroy(&ctx->block_wake_mutex); mt_pthread_cond_destroy(&ctx->block_wake_cond); diff --git a/lib/src/st2110/pipeline/st40_pipeline_tx.h b/lib/src/st2110/pipeline/st40_pipeline_tx.h index 87817502f..d5d90c5fb 100644 --- a/lib/src/st2110/pipeline/st40_pipeline_tx.h +++ b/lib/src/st2110/pipeline/st40_pipeline_tx.h @@ -2,6 +2,7 @@ #define __ST40_PIPELINE_TX_H__ #include + #include "../st_main.h" #if defined(__cplusplus) @@ -24,8 +25,6 @@ struct st40_frame_info { void* udw_buff_addr; /** user data words buffer size */ size_t udw_buffer_size; - /** frame valid data size, may <= buffer_size */ -// size_t data_size; !!!!! TODO remove!! /** frame timestamp format */ enum st10_timestamp_fmt tfmt; /** frame timestamp value */ @@ -205,5 +204,3 @@ void* st40p_tx_get_fb_addr(st40p_tx_handle handle, uint16_t idx); #endif #endif /* __ST40_PIPELINE_TX_H__ */ - -