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

Use mosaic highest framerate #146

Merged
merged 2 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
18 changes: 14 additions & 4 deletions ext/tiovx/gsttiovxmosaic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -347,17 +346,20 @@ 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 * agg);

static void
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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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++;
}

Expand Down Expand Up @@ -1070,3 +1074,9 @@ target_id_to_target_name (gint target_id)

return value_nick;
}

static GstClockTime
gst_tiovx_mosaic_get_next_time (GstAggregator * agg)
{
return gst_aggregator_simple_get_next_time (agg);
}
4 changes: 4 additions & 0 deletions gst-libs/gst/tiovx/gsttiovxmiso.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down