appsrc performance issue

mksafavi mksafavi at gmail.com
Tue Jan 28 09:05:50 UTC 2020


Hi.

I did notice a high CPU usage of 35% percent, even without the accelerator (
appsink -> appsrc).

for proxying the query allocation:
inside my "take sample then push"(appsink new-sample callback) function, I
added a probe to appsink.
    /sink = gst_bin_get_by_name(GST_BIN(data->sink), "testsink");
    appsink_pad = gst_element_get_static_pad(sink, "sink");
    gst_pad_add_probe(appsink_pad, GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM,
appsink_query_cb, NULL, NULL);/

1- but how can I get the appsink query from the probe to run it on appsrc?
I thought I should use /gst_pad_query (appsrc_pad , appsink_query);/ method.
but chouldn't find a way to get the query from the probe.
/source = gst_bin_get_by_name(GST_BIN(data->source), "testsource");
appsrc_pad = gst_element_get_static_pad(source, "source");/


2- on the probe callback what should I set the Query type? right now It
produces a drain query for each buffer. when I try to set it to
GST_QUERY_ALLOCATION, I get insertion failed error.

/static GstPadProbeReturn appsink_query_cb(GstPad *pad G_GNUC_UNUSED,
GstPadProbeInfo *info, pointer user_data G_GNUC_UNUSED)
{
    GstQuery *query = info->data;
    if (GST_QUERY_TYPE (query) == GST_QUERY_ALLOCATION)
    {
           return GST_PAD_PROBE_OK;
    }
    else 
    { 
        g_print("query is %d\n", GST_QUERY_TYPE (query));
        gst_query_add_allocation_meta(query, GST_QUERY_ALLOCATION, NULL);
        return GST_PAD_PROBE_HANDLED;
    }
}/



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list