[gst-devel] Problems when using ghostpad
Edward Hervey
bilboed at gmail.com
Wed Feb 28 10:37:28 CET 2007
No problem :)
Don't forget to put the gstreamer-devel mailing-list on CC next
time, so that other people can benefit from the tips.
Edward
P.S. And share with the mailing list the work you're doing, we're
always looking forward to hear about new apps and new plugins.
On 2/28/07, Diqing Zhong <diqing.zhong at gmail.com> wrote:
> Thanks Edward, I got more clear. :)
>
>
>
> On 2/27/07, Edward Hervey <bilboed at gmail.com> wrote:
> > On 2/27/07, Diqing Zhong <diqing.zhong at gmail.com> wrote:
> > > Hi Edward,
> > >
> > > See my comments below, thanks for your help!! :-)
> > >
> > > - Max
> > >
> > >
> > > On 2/27/07, Edward Hervey <bilboed at gmail.com> wrote:
> > > > On 2/25/07, Diqing Zhong <diqing.zhong at gmail.com> wrote:
> > > > >
> > > > >
> > > > > Hi all,
> > > > >
> > > > > I wrote a video decoder, the src and sink pad is customized, they
> are
> > > the
> > > > > sub-class of GstPad. Can I encapsulate this decoder into a bin, then
> use
> > > > > ghost pad to connect this bin into pipeline?
> > > > >
> > > > > I used following code, but it failed.
> > > > >
> > > > > ----------------------------------
> > > > > In player application:
> > > > > ----------------------------------
> > > > > 1. add video decoder into dec bin.
> > > > > decbin = gst_bin_new("decbin");
> > > > > gst_bin_add(GST_BIN(decbin), video_decoder);
> > > > >
> > > > > 2. add ghost pads to dec bin.
> > > > > gst_element_add_pad (decbin, gst_ghost_pad_new ("sink",
> > > > > video_decoder_sinkpad));
> > > > > gst_element_add_pad (decbin, gst_ghost_pad_new ("src",
> > > > > video_decoder_sinkpad));
> > > >
> > > > This is invalid, you are saying that BOTH the "src" ghostpad AND the
> > > > "sink" ghostpad are ghosting your video decoder sinkpad. Maybe that's
> > > > the source of your problems.
> > >
> > >
> > > [Max]: Sorry, I used "copy&paste" while writing mail, forgot to change
> the
> > > variable name, it should be:
> > > gst_element_add_pad (decbin, gst_ghost_pad_new ("sink",
> > > video_decoder_sinkpad));
> > > gst_element_add_pad (decbin, gst_ghost_pad_new ("src",
> > > video_decoder_srcpad));
> > >
> > > > >
> > > > > 3. link the dec bin into pipeline.
> > > > > gst_element_link(decbin, video_sink);
> > > > > gst_element_link(demux, decbin);
> > > > >
> > > > >
> > > > > -----------------------------------------------
> > > > > In Plugin code of video decoder:
> > > > > -----------------------------------------------
> > > > > After debugging the src_link_function(GstPad *pad, GstPad *peer), I
> > > found
> > > > > the "pad" is the "video decoder src pad", but the "peer" is proxy
> pad,
> > > not
> > > > > the "video_sink sink pad", so I can't connect the pipeline properly.
> > > >
> > > > What do you mean you can't connect the pipeline properly ? Do the
> > > > gst_*_link functions return TRUE or FALSE ? If they returned TRUE,
> > > > then your pipeline IS properly connected.
> > >
> > >
> > > [Max]: My pads are not GstPad, they are derived from the GstPad, also
> have
> > > some own data structures. When connecting, I need to write a
> link_function
> > > in plugin to set these own data properly, otherwise it not work. So I
> need
> > > the "video decoder src pad" and "video_sink sink pad", then find my own
> data
> > > structures in these two pads and set them to the right value.
> >
> > If your pads derive from GstPad (the proper way, using gobject),
> > then they ARE GstPads. OOP 101.
> > Otherwise, fetching data from other elements is really not the
> > proper way to do things in GStreamer. You might want to use caps to
> > get information from downstream/upstream elements, by adding certain
> > fields for example. Your pads set_caps() functions will be called
> > before any data flows through them, so you can safely implement those
> > instead of the link() functions.
> >
> > >
> > >
> > > > >
> > > > >
> > > > > How can I solve this issue?
> > > > > Thanks in advance! :-)
> > > > >
> > > > >
> > > > > - Max
> > > > >
> > >
> -------------------------------------------------------------------------
> > > > > Take Surveys. Earn Cash. Influence the Future of IT
> > > > > Join SourceForge.net's Techsay panel and you'll get the chance to
> share
> > > your
> > > > > opinions on IT & business topics through brief surveys-and earn cash
> > > > >
> > >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > > > > _______________________________________________
> > > > > gstreamer-devel mailing list
> > > > > gstreamer-devel at lists.sourceforge.net
> > > > >
> > >
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Edward Hervey
> > > > Multimedia editing developer / Fluendo S.A.
> > > > http://www.pitivi.org/
> > > >
> > >
> > >
> >
> >
> > --
> > Edward Hervey
> > Multimedia editing developer / Fluendo S.A.
> > http://www.pitivi.org/
> >
>
>
--
Edward Hervey
Multimedia editing developer / Fluendo S.A.
http://www.pitivi.org/
More information about the gstreamer-devel
mailing list