code with optional plugins

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

code with optional plugins

Alexey Fisher
Hallo all,

i have this kind peas of code:
=======================================================================
  GstElement *maxrate, *scale, *colorspace, *noisefilter, *capsfilter;
  GstPad *ghost, *src;
  GstCaps *caps;

  maxrate = gst_element_factory_make ("videomaxrate", NULL);
  scale = gst_element_factory_make ("videoscale", NULL);
  colorspace = gst_element_factory_make ("ffmpegcolorspace", NULL);
  noisefilter = gst_element_factory_make ("postproc_tmpnoise", NULL);


  gst_bin_add_many (GST_BIN (obj), priv->src, maxrate, scale,
colorspace,
    noisefilter, capsfilter, NULL);
  gst_element_link_many (priv->src, maxrate, scale, colorspace,
    noisefilter, capsfilter, NULL);
========================================================================

i wont to make videomaxrate and postproc_tmpnoise optional. If these are
not installed i will pipeline should work.
Are there any easy option to do this? Or i need to create different
gst_bin_add_many and gst_element_link_many for different situations?

Regards,
        Alexey


------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: code with optional plugins

Tim-Philipp Müller-2
On Sun, 2010-09-05 at 10:28 +0200, Alexey Fisher wrote:

> i wont to make videomaxrate and postproc_tmpnoise optional. If these are
> not installed i will pipeline should work.
> Are there any easy option to do this? Or i need to create different
> gst_bin_add_many and gst_element_link_many for different situations?

You don't have to gst_bin_add* all elements to the pipeline in one go,
so just keep your gst_bin_add_many() and then gst_bin_add() the optional
elements one-by-one if they exist.

Alternatively, just create "identity" elements if those optional
elements don't exist, then you can gst_bin_add*() and _link*()
unconditionally.

Cheers
 -Tim


------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel