Skip to content

Commit

Permalink
Fix, src pad
Browse files Browse the repository at this point in the history
  • Loading branch information
DawidWesierski4 committed Dec 23, 2024
1 parent b8c0adb commit 7786562
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions ecosystem/gstreamer_plugin/gst_mtl_st30p_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ enum {

/* pad template */
static GstStaticPadTemplate gst_mtl_st30p_rx_src_pad_template =
GST_STATIC_PAD_TEMPLATE("src", GST_PAD_SINK, GST_PAD_ALWAYS,
GST_STATIC_PAD_TEMPLATE("src", GST_PAD_SRC, GST_PAD_ALWAYS,
GST_STATIC_CAPS("audio/x-raw, "
"format = (string) {S8, S16LE, S24LE},"
"channels = (int) [1, 2], "
Expand Down Expand Up @@ -311,11 +311,14 @@ static gboolean gst_mtl_st30p_rx_start(GstBaseSrc* basesrc) {

ops_rx->name = "st30src";
ops_rx->channel = src->channel;
ops_rx->sampling = src->sampling;
ops_rx->port.num_port = 1;
ops_rx->ptime = ST30_PTIME_1MS;
ops_rx->flags |= ST30P_RX_FLAG_BLOCK_GET;

if (!gst_mtlst30tx_parse_sampling(src->sampling, &ops_rx->sampling)) {
GST_ERROR("Failed to parse ops_rx sampling %d", src->sampling);
return FALSE;
}

if (!gst_mtl_common_parse_audio_format(src->audio_format, &ops_rx->fmt)) {
GST_ERROR("Failed to parse ops_rx audio format %s", src->audio_format);
Expand All @@ -324,6 +327,18 @@ static gboolean gst_mtl_st30p_rx_start(GstBaseSrc* basesrc) {

ops_rx->framebuff_size = st30_calculate_framebuff_size(
ops_rx->fmt, ops_rx->ptime, ops_rx->sampling, ops_rx->channel, 10 * NS_PER_MS, NULL);

if (!ops_rx->framebuff_size) {
GST_ERROR("Failed to calculate framebuff size");
return FALSE;
}


if (src->framebuffer_num) {
ops_rx->framebuff_cnt = src->framebuffer_num;
} else {
ops_rx->framebuff_cnt = 3;
}

if (inet_pton(AF_INET, src->portArgs.session_ip_string,
ops_rx->port.ip_addr[MTL_PORT_P]) != 1) {
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/gstreamer_plugin/gst_mtl_st30p_rx.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct _Gst_Mtl_St30p_Rx {
mtl_handle mtl_lib_handle;
st30p_rx_handle rx_handle;

/* arguments for incomplete frame buffers */
/* arguments for mtl frame buffers */
guint retry_frame;
guint frame_size;

Expand Down

0 comments on commit 7786562

Please sign in to comment.