[gst-devel] Init pipeline in the function

Igor Mironchick imironchick at gmail.com
Thu Apr 22 09:58:09 CEST 2010


You're passing the pointer by value, you need to pass its address. Also, you
> need to call gst_init beforehand, so your code should look like:
>
> #include <gst/gst.h>
>
> void initPipeline(GstElement **pipeline)
> {
>     *pipeline = gst_pipeline_new("camera");
> }
>
> int main(int argc, char **argv)
> {
>     gst_init(&argc, &argv);
>     GstElement *pipeline;
>     initPipeline(&pipeline);
>     return 0;
> }
>

Thx for your reply. I've already found the solution. But a little bit in
another way:

void initPipeline( GstElement *& pipeline )
{
  pipeline = ...
}

void main()
{
  ...
  GstElement * pipeline;
  initPipeline( pipeline );
  ...
}



-- 
Regards,
Igor Mironchick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100422/302e8d31/attachment.htm>


More information about the gstreamer-devel mailing list