[gst-devel] Init pipeline in the function

Tristan Matthews tristan at sat.qc.ca
Fri Apr 23 17:18:48 CEST 2010


2010/4/23 Tristan Matthews <tristan at sat.qc.ca>

> 2010/4/23 Edward Hervey <bilboed at gmail.com>
>
> The correct answer since nobody was able to come up with it (although
>> one was very close):
>>
>>
> Could you clarify what you considered incorrect in my response?
>

Unless it's a mixed declarations and code issue (C90 and earlier), in which
case you'll have to forgive my c++ contaminated style :)


>
>
>> --------------------------------
>> 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
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>
>
>
> --
> Tristan Matthews
> email: tristan at sat.qc.ca
> web: http://tristanswork.blogspot.com
>



-- 
Tristan Matthews
email: tristan at sat.qc.ca
web: http://tristanswork.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100423/f6c0422a/attachment.htm>


More information about the gstreamer-devel mailing list