<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>hi, <br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>Could you please help me to solve this problem?</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>I tried so many times but still had the same problem.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>The result exited with
</span>code 0 like below.<br>
<style type="text/css">
p, li { white-space: pre-wra</style>
</div><div style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Monospace'; font-size:9pt; font-weight:600; color:#1414be;">/home/iesx/Desktop/imageOnly/imageonly exited with code 0</span></div><div style="margin: 0px; text-indent: 0px; color: rgb(20, 20, 190); font-size: 9pt; font-family: 'Monospace'; background-color: transparent; font-style: normal;"><br><span style=" font-family:'Monospace'; font-size:9pt; font-weight:600; color:#1414be;"></span></div><div style="margin: 0px; text-indent: 0px; color: rgb(20, 20, 190); font-size: 9pt; font-family: 'Monospace'; background-color: transparent; font-style: normal;"><span style=" font-family:'Monospace'; font-size:9pt; font-weight:600; color:#1414be;"><span style="color: rgb(0, 0, 0);">The code is like below.Please somebody help me solve this problem.</span><br></span></div><div style="margin: 0px; text-indent: 0px;
font-size: 9pt; font-family: 'Monospace'; font-style: normal;"><span style="background-color: rgb(255, 255, 255);"><br><span style="font-family: 'Monospace'; font-size: 9pt; font-weight: 600;"></span></span></div><div style="margin: 0px; text-indent: 0px; color: rgb(20, 20, 190); font-size: 9pt; font-family: 'Monospace'; background-color: transparent; font-style: normal;"><span style=" font-family:'Monospace'; font-size:9pt; font-weight:600; color:#1414be;"><span style="background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 0, 0);"><span>imageonly.pro file </span></span></span><br></span></div><div style="margin: 0px; text-indent: 0px; color: rgb(20, 20, 190); font-size: 12px; font-family: 'Monospace'; background-color: transparent; font-style: normal;"><br><span style=" font-family:'Monospace'; font-size:9pt; font-weight:600; color:#1414be;"></span></div><div style="margin: 0px; text-indent: 0px; color: rgb(20, 20, 190); font-size: 9pt;
font-family: 'Monospace'; background-color: transparent; font-style: normal;"><span style=" font-family:'Monospace'; font-size:9pt; font-weight:600; color:#1414be;">QT += core<br>QT -= gui<br><br>TARGET = imageonly<br>CONFIG += console<br>CONFIG -= app_bundle<br><br>TEMPLATE = app<br><br>SOURCES += main.cpp<br><br>unix {<br> CONFIG += link_pkgconfig<br> PKGCONFIG += gstreamer-0.10<br>}<br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new
roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>main.cpp file <br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>#include <QtCore/QCoreApplication><br>#include <pthread.h><br>#include <string.h><br>#include <gst/gst.h><br>#include <glib.h><br><br>int main(int argc , char* argv[])<br>{<br> GMainLoop *loop;<br><br> loop=g_main_loop_new(NULL,FALSE);<br><br> GstElement *pipeline, *source, *jpg_decoder, *freeze, *colorspace, *sink;<br><br> /* Initialisation */<br> gst_init (&argc,
&argv);<br><br> /* Create gstreamer elements */<br> pipeline = gst_pipeline_new ("image-player");<br> if(!pipeline)<br> {<br> g_printerr ("Pipeline could not be created. Exiting.\n");<br> return -1;<br> }<br><br> source = gst_element_factory_make ("filesrc", "file-source");<br> //set the location of the file to the argv[1]<br> //QString url = imagePath;<br> g_object_set (G_OBJECT (source), "location", "capture1.jpeg", NULL);<br> if(!source)<br> {<br> g_printerr ("File could not be created.
Exiting.\n");<br> return -1;<br> }<br><br> jpg_decoder = gst_element_factory_make ("jpegdec", "jpg-decoder");<br> if(!jpg_decoder)<br> {<br> g_printerr ("Jpg Decoder could not be created. Exiting.\n");<br> return -1;<br> }<br><br> freeze = gst_element_factory_make("imagefreeze", "freeze");<br> if(!freeze)<br> {<br> g_printerr ("ImageFreeze could not be created. Exiting.\n");<br> return -1;<br> }<br><br> colorspace = gst_element_factory_make("ffmpegcolorspace", "colorspace");<br> if(!colorspace)<br>
{<br> g_printerr ("Colorspace could not be created. Exiting.\n");<br> return -1;<br> }<br><br> sink = gst_element_factory_make ("xvimagesink", "imagesink");<br> if(!sink)<br> {<br> g_printerr ("Image sink could not be created. Exiting.\n");<br> return -1;<br> }<br><br> /* file-source | jpg-decoder | image-freeze | colorspace | sink */<br> gst_bin_add_many (GST_BIN (pipeline), source, jpg_decoder, freeze, colorspace, sink, NULL);<br> gst_element_link_many (source, jpg_decoder, freeze, colorspace, sink, NULL);<br><br> /* Set the pipeline to "playing" state*/<br> g_print ("Now
playing: \n");<br> gst_element_set_state (pipeline, GST_STATE_PLAYING);<br><br> /* Out of the main loop, clean up nicely */<br> g_print ("Returned, stopping playback\n");<br> gst_element_set_state (pipeline, GST_STATE_NULL);<br><br> g_print ("Deleting pipeline\n");<br> gst_object_unref (GST_OBJECT (pipeline));<br><br> return 0;<br>}<br><br><br></span></div><div> </div><div><span style="font-size:16px;"><br> </span><br><font face="Trebuchet MS,Arial,Helvetica"> <br><br><br></font><br><font face="Trebuchet MS,Arial,Helvetica"><span style="background-color:rgb(255, 255, 0);"><span style="color:rgb(0, 0, 255);"><span style="font-weight:bold;"><span style="font-size:16px;"><span
style="FONT-FAMILY:Batang,;"></span></span></span></span></span><br><br><br>Regards , <br><br>.............................<br>( <span style="font-weight:bold;">ISZAIDY ISMAIL</span> )<br><span style="font-style:italic;">anak_jatiperlis@yahoo.com </span><br></font></div></div></body></html>