[gst-devel] Confusion over ghost pads

David Schleef ds at schleef.org
Wed Jan 14 18:18:01 CET 2004


On Thu, Jan 15, 2004 at 02:06:59AM +0000, William R Sowerbutts wrote:
> I'm using GStreamer 0.7.3 to develop a simple application for blending two 
> video streams together.
> 
> I've read the relevant documentation about ghost pads, and my understanding is
> that attaching a ghost pad to a GstBin simply exposes that pad to the outside
> of the bin, and allows you to use the ghost pad and the real pad
> interchangeably.
> 
> However, this doesn't work for me.
> 
> My app creates a GstThread with a filesrc, dvdec and queue object suitably 
> interconnected. It then creates a ghost pad for the queue's "src" pad as a 
> "src" pad on the GstThread.


>   g_assert(GST_RPAD_DIRECTION(gst_element_get_pad(filesource, "src")) == GST_PAD_SRC);
> 
>   // connect the filesrc's output to the bin's "src" ghost pad
>   g_assert(gst_element_add_ghost_pad(thread, gst_element_get_pad(filesource, "src"), "src") != 0);
> 
>   // All OK up to this point, but this assertion fails!!

Before the next statement, you might want to try:

    g_assert (GST_IS_RPAD (gst_element_get_pad (thread, "src));

This will fail (because it's a ghost pad, not a real pad).  Which means
that using the RPAD macro in the next line will not work correctly.

>   g_assert(GST_RPAD_DIRECTION(gst_element_get_pad(thread, "src")) == GST_PAD_SRC);

It's a bit annoying that these macros don't do typechecking, but that's
something we'd like to fix in 0.9.



dave...





More information about the gstreamer-devel mailing list