<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>gst-launch filesrc location=h264.mp4 ! decodebin2 ! videoscale ! xvimagesink</DIV>
<DIV>&nbsp;</DIV>
<DIV>This command works, but I convert it to C application, it fails. Any suggestion ?</DIV>
<DIV>&nbsp;</DIV>
<DIV>---------------------------------------------------------------------------------------------------------</DIV>
<DIV>&nbsp;&nbsp; gst_init(&amp;argc, &amp;argv);<BR>&nbsp;&nbsp; loop = g_main_loop_new(NULL, FALSE);<BR>&nbsp;&nbsp; pipeline = gst_pipeline_new("my-pipeline");<BR>&nbsp;&nbsp; src = gst_element_factory_make("filesrc", "src");<BR>&nbsp;&nbsp; g_object_set (G_OBJECT (usrc),"location","h264.mp4", NULL);</DIV>
<DIV>&nbsp;&nbsp; decode = gst_element_factory_make("decodebin2", "decode");<BR>&nbsp;&nbsp; scale = gst_element_factory_make("videoscale", "scale");<BR>&nbsp;&nbsp; sink = gst_element_factory_make("xvimagesink", "sink");<BR>&nbsp;&nbsp; gst_bin_add_many(GST_BIN(pipeline), src,&nbsp;decode, scale,&nbsp; sink, NULL);<BR>&nbsp;&nbsp; gst_element_link_many(src,&nbsp;decode, scale, sink, NULL);</DIV>
<DIV>&nbsp;&nbsp; gst_element_set_state(pipeline, GST_STATE_PLAYING);<BR>&nbsp;&nbsp; if (gst_element_get_state(pipeline, NULL, NULL, -1) ==&nbsp; ST_STATE_CHANGE_FAILURE)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_error("Failed to go into PLAYING state");<BR>&nbsp;&nbsp;&nbsp;g_main_loop_run(loop);<BR>&nbsp;&nbsp;&nbsp;gst_element_set_state(pipeline, GST_STATE_NULL);<BR>&nbsp;&nbsp; gst_object_unref(pipeline);</DIV>
<DIV>-----------------------------------------------------------------------------------------------</DIV>
<DIV>Thanks,</DIV></td></tr></table><br>