[gst-devel] Init pipeline in the function

Edward Hervey bilboed at gmail.com
Fri Apr 23 13:14:14 CEST 2010


The correct answer since nobody was able to come up with it (although
one was very close):

--------------------------------
static GstElement * createPipeline (void) {
  GstElement * pipeline;

  pipeline = gst_pipeline_new ("mylittleponypipeline");

  /* Do stuff with the pipeline, fill it in, etc... */

  return pipeline;
}

void main (int argc, gchar **argv) {
  GstElement * pipeline;

  /* Initialize GStreamer, parse arguments, etc.. */

  pipeline = createPipeline ();

  /* Use pipeline */
}
---------------------------------------

  I recommend everybody who replied to the list to read Kernighan &
Ritchie "The C programming language" [1] as well as reading examples and
learning how to use google.

   Edward

[1] http://en.wikipedia.org/wiki/The_C_Programming_Language_%28book%29

On Thu, 2010-04-22 at 10:08 +0300, Igor Mironchick wrote:
> Hi.
> 
> I'm a new with gstreamer and glib.
> 
> Why can't I init pipeline in function and then use it somewhere else.
> 
> Here is the code example:
> 
> void initPipeline( GstElement * pipeline )
> {
>   pipeline = gst_pipeline_new( "camera" )
> }
> 
> void main()
> {
>   GstElement * pipeline;
> 
>   initPipeline( pipeline );
> 
>   // And here pipeline == 0 !!! Why?
> }
> 
> -- 
> Regards,
> Igor Mironchick
> ------------------------------------------------------------------------------
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel






More information about the gstreamer-devel mailing list