[gst-devel] Converting a gst-launch pipeline to C code

Alan Carvalho de Assis acassis at gmail.com
Tue Sep 30 04:04:57 CEST 2008


Hi,

2008/9/29 Alan Carvalho de Assis <acassis at gmail.com>:
> Hi Thijs,
> I will test it and let you know if it works.
>

I got it working but using an ugly/dirt/newbee/dumb hack:

static GstElement *decoder, *decvd, *decad;
static int i;

static void
on_pad_added (GstElement *element,
              GstPad     *pad,
              gpointer    data)
{
  GstPad *sinkpad;
  //GstElement *decoder = (GstElement *) data;
  if(i==0)
          decoder = decvd;
  else
          decoder = decad;
  i++;

  /* We can now link this pad with the vorbis-decoder sink pad */
  g_print ("Dynamic pad created\n");

  sinkpad = gst_element_get_static_pad (decoder, "sink");

  gst_pad_link (pad, sinkpad);

  gst_object_unref (sinkpad);
}


I can't figure out how can on_pad_added get access to two decoders?
currently I can just pass one:
g_signal_connect (demuxer, "pad-added", G_CALLBACK (on_pad_added), decvd);

Please, let me know the right way to on_pad_added get the decvd in the
first call and get the decad in the second call. I am ashamed because
this code, but anyway I am here to learn.

Thank you,

Alan




More information about the gstreamer-devel mailing list