From 63c60f299ce0be0d553cffbf8fa316fef6f10eb8 Mon Sep 17 00:00:00 2001 From: Marco Herrera Date: Wed, 17 Nov 2021 11:40:01 -0600 Subject: [PATCH 1/2] Add mosaic max framerate as aggregation deadline --- ext/tiovx/gsttiovxmosaic.c | 18 ++++++++++++++---- gst-libs/gst/tiovx/gsttiovxmiso.c | 4 ++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ext/tiovx/gsttiovxmosaic.c b/ext/tiovx/gsttiovxmosaic.c index 4f6188b03..0fc8c4aec 100644 --- a/ext/tiovx/gsttiovxmosaic.c +++ b/ext/tiovx/gsttiovxmosaic.c @@ -152,8 +152,7 @@ gst_tiovx_mosaic_pad_class_init (GstTIOVXMosaicPadClass * klass) g_param_spec_uint ("height", "Height", "Height of the image.\n" "Cannot be smaller than 1/4 of the input hieght or larger than the input height.\n" "Set to 0 to default to the input height.", - min_dim_value, max_dim_value, default_dim_value, - G_PARAM_READWRITE)); + min_dim_value, max_dim_value, default_dim_value, G_PARAM_READWRITE)); } static void @@ -347,6 +346,7 @@ static gboolean gst_tiovx_mosaic_release_buffer (GstTIOVXMiso * agg); static gboolean gst_tiovx_mosaic_deinit_module (GstTIOVXMiso * agg); static GstCaps *gst_tiovx_mosaic_fixate_caps (GstTIOVXMiso * self, GList * sink_caps_list, GstCaps * src_caps); +static GstClockTime gst_tiovx_mosaic_get_next_time (GstAggregator * self); static void gst_tiovx_mosaic_class_init (GstTIOVXMosaicClass * klass) @@ -354,10 +354,12 @@ gst_tiovx_mosaic_class_init (GstTIOVXMosaicClass * klass) GObjectClass *gobject_class = NULL; GstElementClass *gstelement_class = NULL; GstTIOVXMisoClass *gsttiovxmiso_class = NULL; + GstAggregatorClass *aggregator_class = NULL; gobject_class = G_OBJECT_CLASS (klass); gstelement_class = GST_ELEMENT_CLASS (klass); gsttiovxmiso_class = GST_TIOVX_MISO_CLASS (klass); + aggregator_class = GST_AGGREGATOR_CLASS (klass); gst_element_class_set_details_simple (gstelement_class, "TIOVX Mosaic", @@ -403,6 +405,9 @@ gst_tiovx_mosaic_class_init (GstTIOVXMosaicClass * klass) gsttiovxmiso_class->deinit_module = GST_DEBUG_FUNCPTR (gst_tiovx_mosaic_deinit_module); + + aggregator_class->get_next_time = + GST_DEBUG_FUNCPTR (gst_tiovx_mosaic_get_next_time); } static void @@ -715,8 +720,7 @@ gst_tiovx_mosaic_get_node_info (GstTIOVXMiso * agg, gst_tiovx_miso_pad_set_params (pad, (vx_reference *) & mosaic->obj.inputs[i].image_handle[0], - mosaic->obj.inputs[i].graph_parameter_index, - input_param_id_start + i); + mosaic->obj.inputs[i].graph_parameter_index, input_param_id_start + i); i++; } @@ -1070,3 +1074,9 @@ target_id_to_target_name (gint target_id) return value_nick; } + +static GstClockTime +gst_tiovx_mosaic_get_next_time (GstAggregator * self) +{ + return gst_aggregator_simple_get_next_time (self); +} diff --git a/gst-libs/gst/tiovx/gsttiovxmiso.c b/gst-libs/gst/tiovx/gsttiovxmiso.c index 2bc1d685c..e9254a209 100644 --- a/gst-libs/gst/tiovx/gsttiovxmiso.c +++ b/gst-libs/gst/tiovx/gsttiovxmiso.c @@ -618,6 +618,10 @@ gst_tiovx_miso_aggregate (GstAggregator * agg, gboolean timeout) GST_BUFFER_OFFSET_END (outbuf) = GST_BUFFER_OFFSET_END_FIXED_VALUE; finish_buffer: + if (GST_BUFFER_PTS_IS_VALID (outbuf)) { + GST_AGGREGATOR_PAD (agg->srcpad)->segment.position = + GST_BUFFER_PTS (outbuf); + } gst_aggregator_finish_buffer (agg, outbuf); /* Mark all input buffers as read */ From 5b6f3197b017736749aaa65f29630dce495981e0 Mon Sep 17 00:00:00 2001 From: Marco Herrera Date: Wed, 17 Nov 2021 11:49:41 -0600 Subject: [PATCH 2/2] Rename aggregator parameter --- ext/tiovx/gsttiovxmosaic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/tiovx/gsttiovxmosaic.c b/ext/tiovx/gsttiovxmosaic.c index 0fc8c4aec..12de34583 100644 --- a/ext/tiovx/gsttiovxmosaic.c +++ b/ext/tiovx/gsttiovxmosaic.c @@ -346,7 +346,7 @@ static gboolean gst_tiovx_mosaic_release_buffer (GstTIOVXMiso * agg); static gboolean gst_tiovx_mosaic_deinit_module (GstTIOVXMiso * agg); static GstCaps *gst_tiovx_mosaic_fixate_caps (GstTIOVXMiso * self, GList * sink_caps_list, GstCaps * src_caps); -static GstClockTime gst_tiovx_mosaic_get_next_time (GstAggregator * self); +static GstClockTime gst_tiovx_mosaic_get_next_time (GstAggregator * agg); static void gst_tiovx_mosaic_class_init (GstTIOVXMosaicClass * klass) @@ -1076,7 +1076,7 @@ target_id_to_target_name (gint target_id) } static GstClockTime -gst_tiovx_mosaic_get_next_time (GstAggregator * self) +gst_tiovx_mosaic_get_next_time (GstAggregator * agg) { - return gst_aggregator_simple_get_next_time (self); + return gst_aggregator_simple_get_next_time (agg); }