Reorder buffers from different src pad

Demeyer Jonathan Jonathan.Demeyer at macq.eu
Mon Aug 26 03:14:13 PDT 2013


The problem seems located in
GSList* orderedList = g_slist_sort_with_data(pads->data, compareOrderedData, pads);

Which call the function :
gint compareOrderedData(gconstpointer a, gconstpointer b, gpointer user_data)
{
        gint res;
        GstCollectData2 * data_a = ((GSList *) &a)->data;
        GstCollectData2 * data_b = ((GSList *) &b)->data;
        GstCollectPads2 *pads = (GstCollectPads2 *) user_data;

        GstBuffer * buf_a = gst_collect_pads2_peek(pads, data_a);
        GstBuffer * buf_b = gst_collect_pads2_peek(pads, data_b);

        g_print("Compare Buffers offseta : %llu, offsetb : %llu", buf_a->offset, buf_b->offset);
        if (buf_b->offset < buf_a->offset)
                res = 1;
        else if (buf_b->offset > buf_a->offset)
                res = -1;
        else
                res = 0;

        gst_buffer_unref (buf_a);
        gst_buffer_unref (buf_b);
        return res;
}

I'm still investigating but when I don't try to reorder the buffer, it goes fine.

Kind regards,

Jonathan
________________________________________
De : gstreamer-devel-bounces+jonathan.demeyer=macq.eu at lists.freedesktop.org [gstreamer-devel-bounces+jonathan.demeyer=macq.eu at lists.freedesktop.org] de la part de Demeyer Jonathan [Jonathan.Demeyer at macq.eu]
Date d'envoi : lundi 26 août 2013 10:37
À : Discussion of the development of and with GStreamer
Objet : RE : Reorder buffers from different src pad

Hello,

Nice, because I already started to implement it myself (without succeeding yet).

I looked to videomixer as inspiration (and so use GstCollectPads2 on Gst0.10) but I didn't extend GstPad (If you can point me to another good example, you are welcome).

As a source, we use a buffer pool and It get stuck because the buffers from one branch are not released.
In the logs, I found something strange :
When first called, the _collected function have the correct number of "g_slist_length(pads->data)" i.e. 2

0:00:00.598074973 31601  0x81300c0 DEBUG           collectpads2 gstcollectpads2.c:1969:gst_collect_pads2_chain:<collectpads20> Pad mix:sink_1 resuming

and then, the function _collected is called while g_slist_length(pads->data) == 1 (altough I can see

What can cause the pad resuming ?

More log in attachment.

FYI : The pipeline to do heavy load processing on several cores (and have modularity).

Thanks,

Jonathan
________________________________________
De : gstreamer-devel-bounces+jonathan.demeyer=macq.eu at lists.freedesktop.org [gstreamer-devel-bounces+jonathan.demeyer=macq.eu at lists.freedesktop.org] de la part de Tim-Philipp Müller [t.i.m at zen.co.uk]
Date d'envoi : lundi 26 août 2013 00:15
À : gstreamer-devel at lists.freedesktop.org
Objet : Re: Reorder buffers from different src pad

On Sun, 2013-08-25 at 20:10 +0000, Demeyer Jonathan wrote:

Hi Jonathan,

> I'm trying to find an element for the following pipeline :
>
>                     / filterA -> processingA \
> src -> tee                                                   reorder
> -> sink
>                     \ filterB -> processingB /
>
> The "reorder" plugin will be there to reorder buffers based on their
> timestamp. It will simply compare buffers on both branches and decide
> which one it has to send first.
> In the example, filterA and filterB drop buffers alternatively.
> ProcessingA and processingB can have different "processing time". A
> buffer arriving first in the tee and taking the A branch may arrive
> after a later one taking the B branch. The element has to wait for the
> buffer coming from A.
>
> Does this plugin already exist ? (the question is for a video flow but
> it can also be signal agnostic)
> I saw "funnel" but this plugin doesn't reorder buffers (AFAIU).

I'm not aware of such an element, but it should be fairly easy to write.
It's basically like a muxer. You can just use GstCollectPads, which take
care of waiting for buffers, and then decide which one you want to pick
and push out.

Out of curiosity - can you tell us a bit more about the underlying
functionality, what this is for?

 Cheers
  -Tim


_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list