<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> </DIV>
<DIV>This command works, but I convert it to C application, it fails. Any suggestion ?</DIV>
<DIV> </DIV>
<DIV>---------------------------------------------------------------------------------------------------------</DIV>
<DIV> gst_init(&argc, &argv);<BR> loop = g_main_loop_new(NULL, FALSE);<BR> pipeline = gst_pipeline_new("my-pipeline");<BR> src = gst_element_factory_make("filesrc", "src");<BR> g_object_set (G_OBJECT (usrc),"location","h264.mp4", NULL);</DIV>
<DIV> decode = gst_element_factory_make("decodebin2", "decode");<BR> scale = gst_element_factory_make("videoscale", "scale");<BR> sink = gst_element_factory_make("xvimagesink", "sink");<BR> gst_bin_add_many(GST_BIN(pipeline), src, decode, scale, sink, NULL);<BR> gst_element_link_many(src, decode, scale, sink, NULL);</DIV>
<DIV> gst_element_set_state(pipeline, GST_STATE_PLAYING);<BR> if (gst_element_get_state(pipeline, NULL, NULL, -1) == ST_STATE_CHANGE_FAILURE)<BR> g_error("Failed to go into PLAYING state");<BR> g_main_loop_run(loop);<BR> gst_element_set_state(pipeline, GST_STATE_NULL);<BR> gst_object_unref(pipeline);</DIV>
<DIV>-----------------------------------------------------------------------------------------------</DIV>
<DIV>Thanks,</DIV></td></tr></table><br>