Thanks Junping Mao.
1. cpu utilization remains high through out.
Please see the code and suggest if something is incorrect.
GstBin *Bin;
GstBus *bus;
GMainLoop *Mainloop;
gst_init (&argc,&argv);
Mainloop = g_main_loop_new(NULL,FALSE);//NULL to use the current context and False to tell its not in running state
GstElement *pipeline = gst_pipeline_new("PIPELINE");
Bin = GST_BIN(pipeline);
bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
source = gst_element_factory_make("filesrc","file-source");
g_object_set(G_OBJECT(source),"location",argv[1],NULL);
imagedecoder = gst_element_factory_make("jpegdec","decoder");
imagefreeze = gst_element_factory_make("imagefreeze","imagefreeze");//"Vorbis audio decoder","vorbis");
video_sink = gst_element_factory_make("mfw_isink","XV video sink ");
int axis_top=0;
int axis_left=0;
int disp_width=1920;
int disp_height=1080;
g_object_set(G_OBJECT(video_sink),"axis-top",axis_top,"axis-left",axis_left,"disp-width",disp_width,"disp-height",disp_height,NULL);
gst_bin_add(Bin,source);
gst_bin_add_many(Bin,imagedecoder,imagefreeze,video_sink,NULL);
gst_element_link(source,imagedecoder);
gst_element_link(imagedecoder,imagefreeze);
gst_element_link(imagefreeze,video_sink);
gst_bus_add_watch(bus,process_message,Mainloop); //Mainloop is passed as user data as in the process_message actions are taken on the loop
g_object_unref(bus);
g_print("In playing state\n");
gst_element_set_state(pipeline,GST_STATE_PLAYING);//Pipeline is also a bin and bin is also an element at abstract level and hence gst_element_set_state call is used to set state of pipeline.
g_main_loop_run(Mainloop);
g_print("In playing state2\n");
gst_element_set_state(pipeline,GST_STATE_NULL);
g_object_unref(G_OBJECT(pipeline));
}
2. This problem was solved after making sure files are 8*8 pixel format.
3. I thing there is some issue with playing files bigger than 1080P.
Thanks
Alok