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:<br><br>#include <gst/gst.h><br><br>void initPipeline(GstElement **pipeline)<br>
{<br> *pipeline = gst_pipeline_new("camera");<br>}<br><br>int main(int argc, char **argv)<br>{<br> gst_init(&argc, &argv);<br> GstElement *pipeline;<br> initPipeline(&pipeline);<br> return 0;<br>
}<br><br><div class="gmail_quote">2010/4/22 Igor Mironchick <span dir="ltr"><<a href="mailto:imironchick@gmail.com">imironchick@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi.<br><br>I'm a new with gstreamer and glib.<br><br>Why can't I init pipeline in function and then use it somewhere else.<br><br>Here is the code example:<br><br>void initPipeline( GstElement * pipeline )<br>{<br>
pipeline = gst_pipeline_new( "camera" )<br>}<br><br>void main()<br>{<br> GstElement * pipeline;<br><br> initPipeline( pipeline );<br><br> // And here pipeline == 0 !!! Why?<br>}<br clear="all"><br>-- <br>Regards,<br>
<font color="#888888">
Igor Mironchick<br>
</font><br>------------------------------------------------------------------------------<br>
<br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Tristan Matthews<br>email: <a href="mailto:tristan@sat.qc.ca">tristan@sat.qc.ca</a><br>web: <a href="http://tristanswork.blogspot.com">http://tristanswork.blogspot.com</a><br>