Skip to content

Commit

Permalink
Fix input parameteres
Browse files Browse the repository at this point in the history
  • Loading branch information
DawidWesierski4 committed Jan 2, 2025
1 parent 6fc360b commit 5f3730c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ecosystem/gstreamer_plugin/gst_mtl_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ gboolean gst_mtl_common_parse_audio_format(const char* format, enum st30_fmt* au
return TRUE;
}

gboolean gst_mtlst30tx_parse_sampling(gint sampling, enum st30_sampling* st_sampling) {
gboolean gst_mtl_common_parse_sampling(gint sampling, enum st30_sampling* st_sampling) {
if (!st_sampling) {
GST_ERROR("Invalid st_sampling pointer");
return FALSE;
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/gstreamer_plugin/gst_mtl_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ gboolean gst_mtl_common_parse_fps_code(gint fps_code, enum st_fps* fps);
gboolean gst_mtl_common_parse_pixel_format(const char* format, enum st_frame_fmt* fmt);

gboolean gst_mtl_common_parse_audio_format(const char* format, enum st30_fmt* audio);
gboolean gst_mtlst30tx_parse_sampling(gint sampling, enum st30_sampling* st_sampling);
gboolean gst_mtl_common_parse_sampling(gint sampling, enum st30_sampling* st_sampling);

#endif /* __GST_MTL_COMMON_H__ */
14 changes: 6 additions & 8 deletions ecosystem/gstreamer_plugin/gst_mtl_st30p_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ static gboolean gst_mtl_st30p_rx_start(GstBaseSrc* basesrc) {
mtl_init_params.rx_queues_cnt[MTL_PORT_P] = src->devArgs.rx_queues_cnt[MTL_PORT_P];
} else {
mtl_init_params.rx_queues_cnt[MTL_PORT_P] = 16;
mtl_init_params.tx_queues_cnt[MTL_PORT_P] = 16;
}
mtl_init_params.tx_queues_cnt[MTL_PORT_P] = 16;

mtl_init_params.num_ports++;
mtl_init_params.num_ports = 1;

mtl_init_params.flags |= MTL_FLAG_BIND_NUMA;
if (src->silent) {
Expand Down Expand Up @@ -315,7 +315,7 @@ static gboolean gst_mtl_st30p_rx_start(GstBaseSrc* basesrc) {
ops_rx->ptime = ST30_PTIME_1MS;
ops_rx->flags |= ST30P_RX_FLAG_BLOCK_GET;

if (!gst_mtlst30tx_parse_sampling(src->sampling, &ops_rx->sampling)) {
if (!gst_mtl_common_parse_sampling(src->sampling, &ops_rx->sampling)) {
GST_ERROR("Failed to parse ops_rx sampling %d", src->sampling);
return FALSE;
}
Expand Down Expand Up @@ -429,11 +429,8 @@ static void gst_mtl_st30p_rx_set_property(GObject* object, guint prop_id,
case PROP_RX_PORT_RX_QUEUES:
self->devArgs.rx_queues_cnt[MTL_PORT_P] = g_value_get_uint(value);
break;
case PROP_RX_FRAMERATE:
self->channel = g_value_get_uint(value);
break;
case PROP_RX_FRAMEBUFF_NUM:
self->sampling = g_value_get_uint(value);
self->framebuffer_num = g_value_get_uint(value);
break;
case PROP_RX_CHANNEL:
self->channel = g_value_get_uint(value);
Expand Down Expand Up @@ -567,7 +564,7 @@ static GstFlowReturn gst_mtl_st30p_rx_create(GstBaseSrc* basesrc, guint64 offset
gint ret;
gsize fill_size;

buf = gst_buffer_new_allocate(NULL, src->frame_size + 1, NULL);
buf = gst_buffer_new_allocate(NULL, src->frame_size, NULL);
if (!buf) {
GST_ERROR("Failed to allocate buffer");
return GST_FLOW_ERROR;
Expand All @@ -592,6 +589,7 @@ static GstFlowReturn gst_mtl_st30p_rx_create(GstBaseSrc* basesrc, guint64 offset

gst_buffer_map(buf, &dest_info, GST_MAP_WRITE);
fill_size = gst_buffer_fill(buf, 0, frame->addr, src->frame_size);
GST_BUFFER_PTS(buf) = frame->timestamp;
gst_buffer_unmap(buf, &dest_info);

if (fill_size != src->frame_size) {
Expand Down

0 comments on commit 5f3730c

Please sign in to comment.