Documentation/Maemo 5 Developer Guide/Using Multimedia Components/Camera API Usage

= Camera API Usage = This section explains how to use the Camera API to access the camera hardware that is present in some models of Nokia Internet Tablets.

Camera Hardware and Linux
The Linux operating system supports live video and audio hardware, such as webcams, TV tuners, video capture cards, FM radio tuners, video output devices etc. The primary API for the applications to access those devices is Video4Linux2.

Video4Linux2 is a kernel API, so there must be kernel drivers for each supported device. At the user level, device access is standardized via device files. In the case of video capture devices like cameras, which are the focus of this material, the files would be /dev/video0, /dev/video1, etc., as many as there are connected devices.

Data exchanged between the device file and user-level application has a standardized format for each device class. This allows the application to be instantly compatible with every video capture device that has a driver for Linux.

The built-in cameras present in Maemo devices are compatible with Video-4-Linux version 2 API. In principle, any application compatible with this API is easily portable to the maemo platform.

Since the maemo platform delegates all multimedia handling to the GStreamer framework, applications that need access to the built-in camera should employ GStreamer for this, instead of directly accessing Video4Linux devices, via the v4l2src GStreamer module.

Thanks to the flexibility of GStreamer, a developer can fully test any given application in a regular desktop PC with a connected webcam, and then perform the final test in the Internet Tablet itself, without a single change in the source code, since GStreamer refers to modules as text names.

One important note about the camera in the maemo device: only one application can use it at any given time. So, while using the camera in an application, other tasks that could possibly make use of it (e.g. a video call) will be blocked.

To ease developing an application that does video recording and still image capture, a high level gstreamer element has been developed. CameraBin follows the idea behind other high level elements like playbin2. One can add capture support to an application without the need to deal with the lowlevel media-processing graph.

To demonstrate how the camera manipulation is performed, a low-level example application is provided and discussed.

Camera Manipulation in C Language
This C application allows to use the maemo device as a "mirror" (i.e. showing the camera input in the screen), as well as allows to take pictures to be saved as JPEG files (which illustrates the video frame buffer manipulation).

In this example, the function initialize_pipeline is most interesting, since it is responsible for creating the GStreamer pipeline, sourcing data from Video4Linux and sinking it to a xvimagesink (which is an optimized X framebuffer). The pipeline scheme is as follows: example_camera.c

 '' /* Initialize the the Gstreamer pipeline. Below is a diagram ''   * of the pipeline that will be created:    *    *                            |Screen|  |Screen|    *                          -&gt;|queue |-&gt;|sink  |-&gt; Display    * |Camera| |CSP   |  |Tee|/    * |src  |-&gt;|Filter|-&gt;|   |  |Image|   |Image |  |Image|    *                          -&gt;|queue|-&gt; |filter|-&gt;|sink |-&gt; JPEG file    */  

Between the source and sinks, there are two ffmpegcolorspace filters, one to configure the camera frame rate and the picture size expected by the JPEG encoder, and the second to satisfy the video sink. Capabilities ("caps") are employed to tell which format the data needs to have when exiting the filter.

The second filter is necessary, since the video sink may have different requirements (bit depth, color space) from the JPEG encoder. Those requirements can vary also according to the hardware.

Because there are two sinks, the queues are important, since they guarantee that each pipeline segment operates on its own thread downstream the queue. This ensures that the different sinks can synchronize without waiting for each other.

This sample application is not different from other GStreamer applications, be it Linux-generic or maemo-specific apps: example_camera.c

  static  gboolean   initialize_pipeline   (  <font color="#008080">AppData  <font color="#990000"> * appdata <font color="#990000">,  		 <font color="#009900">int  <font color="#990000"> * argc <font color="#990000">,  <font color="#009900">char  <font color="#990000"> *** argv <font color="#990000">) <font color="#FF0000">{ <font color="#008080">GstElement <font color="#990000"> * pipeline <font color="#990000">,  <font color="#990000"> * camera_src <font color="#990000">,  <font color="#990000"> * screen_sink <font color="#990000">,  <font color="#990000"> * image_sink <font color="#990000"> ; <font color="#008080">GstElement <font color="#990000"> * screen_queue <font color="#990000">,  <font color="#990000"> * image_queue <font color="#990000"> ; <font color="#008080">GstElement <font color="#990000"> * csp_filter <font color="#990000">,  <font color="#990000"> * image_filter <font color="#990000">,  <font color="#990000"> * tee <font color="#990000"> ; <font color="#008080">GstCaps <font color="#990000"> * caps <font color="#990000"> ; <font color="#008080">GstBus <font color="#990000"> * bus <font color="#990000"> ;  <font color="#9A1900">/* Initialize Gstreamer */   <font color="#000000">gst_init  <font color="#990000">( argc <font color="#990000">, argv <font color="#990000">);  <font color="#9A1900">/* Create pipeline and attach a callback to it's   <font color="#9A1900">	 * message bus */  pipeline <font color="#990000"> =  <font color="#000000">gst_pipeline_new   <font color="#990000">(  <font color="#FF0000">"test-camera"  <font color="#990000">); bus <font color="#990000"> =  <font color="#000000">gst_pipeline_get_bus   <font color="#990000">(   <font color="#000000">GST_PIPELINE   <font color="#990000">( pipeline <font color="#990000">));  <font color="#000000">gst_bus_add_watch  <font color="#990000">( bus <font color="#990000">,  <font color="#990000">( GstBusFunc <font color="#990000">) bus_callback <font color="#990000">, appdata <font color="#990000">);  <font color="#000000">gst_object_unref  <font color="#990000">(   <font color="#000000">GST_OBJECT   <font color="#990000">( bus <font color="#990000">));  <font color="#9A1900">/* Save pipeline to the AppData structure */  appdata <font color="#990000">-&gt; pipeline <font color="#990000"> = pipeline <font color="#990000"> ;  <font color="#9A1900">/* Create elements */   <font color="#9A1900">/* Camera video stream comes from a Video4Linux driver */  camera_src <font color="#990000"> =  <font color="#000000">gst_element_factory_make   <font color="#990000">( VIDEO_SRC <font color="#990000">,  <font color="#FF0000">"camera_src"  <font color="#990000">);  <font color="#9A1900">/* Colorspace filter is needed to make sure that sinks understands   <font color="#9A1900">	 * the stream coming from the camera */  csp_filter <font color="#990000"> =  <font color="#000000">gst_element_factory_make   <font color="#990000">(  <font color="#FF0000">"ffmpegcolorspace"  <font color="#990000">,  <font color="#FF0000">"csp_filter"  <font color="#990000">);  <font color="#9A1900">/* Tee that copies the stream to multiple outputs */  tee <font color="#990000"> =  <font color="#000000">gst_element_factory_make   <font color="#990000">(  <font color="#FF0000">"tee"  <font color="#990000">,  <font color="#FF0000">"tee"  <font color="#990000">);  <font color="#9A1900">/* Queue creates new thread for the stream */  screen_queue <font color="#990000"> =  <font color="#000000">gst_element_factory_make   <font color="#990000">(  <font color="#FF0000">"queue"  <font color="#990000">,  <font color="#FF0000">"screen_queue"  <font color="#990000">); '' <font color="#9A1900">/* Sink that shows the image on screen. Xephyr doesn't support XVideo ''  <font color="#9A1900">	 * extension, so it needs to use ximagesink, but the device uses   <font color="#9A1900">	 * xvimagesink */  screen_sink <font color="#990000"> =  <font color="#000000">gst_element_factory_make   <font color="#990000">( VIDEO_SINK <font color="#990000">,  <font color="#FF0000">"screen_sink"  <font color="#990000">);  <font color="#9A1900">/* Creates separate thread for the stream from which the image   <font color="#9A1900">	 * is captured */  image_queue <font color="#990000"> =  <font color="#000000">gst_element_factory_make   <font color="#990000">(  <font color="#FF0000">"queue"  <font color="#990000">,  <font color="#FF0000">"image_queue"  <font color="#990000">);  <font color="#9A1900">/* Filter to convert stream to use format that the gdkpixbuf library   <font color="#9A1900">	 * can use */  image_filter <font color="#990000"> =  <font color="#000000">gst_element_factory_make   <font color="#990000">(  <font color="#FF0000">"ffmpegcolorspace"  <font color="#990000">,  <font color="#FF0000">"image_filter"  <font color="#990000">); '' <font color="#9A1900">/* A dummy sink for the image stream. Goes to bitheaven */ '' image_sink <font color="#990000"> =  <font color="#000000">gst_element_factory_make   <font color="#990000">(  <font color="#FF0000">"fakesink"  <font color="#990000">,  <font color="#FF0000">"image_sink"  <font color="#990000">);  <font color="#9A1900">/* Check that elements are correctly initialized */   <font color="#0000FF">if  <font color="#990000">(!( pipeline <font color="#990000">&amp;&amp; camera_src <font color="#990000">&amp;&amp; screen_sink <font color="#990000">&amp;&amp; csp_filter <font color="#990000">&amp;&amp; screen_queue <font color="#990000">&amp;&amp; image_queue <font color="#990000">&amp;&amp; image_filter <font color="#990000">&amp;&amp; image_sink <font color="#990000">)) <font color="#FF0000">{  <font color="#000000">g_critical  <font color="#990000">(  <font color="#FF0000">"Couldn't create pipeline elements"  <font color="#990000">);  <font color="#0000FF">return  FALSE <font color="#990000"> ; <font color="#FF0000">}  <font color="#9A1900">/* Set image sink to emit handoff-signal before throwing away   <font color="#9A1900">	 * it's buffer */   <font color="#000000">g_object_set  <font color="#990000">(   <font color="#000000">G_OBJECT   <font color="#990000">( image_sink <font color="#990000">),  			 <font color="#FF0000">"signal-handoffs"  <font color="#990000">, TRUE <font color="#990000">, NULL <font color="#990000">); '' <font color="#9A1900">/* Add elements to the pipeline. This has to be done prior to ''  <font color="#9A1900">	 * linking them */   <font color="#000000">gst_bin_add_many  <font color="#990000">(   <font color="#000000">GST_BIN   <font color="#990000">( pipeline <font color="#990000">), camera_src <font color="#990000">, csp_filter <font color="#990000">,  			tee <font color="#990000">, screen_queue <font color="#990000">, screen_sink <font color="#990000">, image_queue <font color="#990000">,  			image_filter <font color="#990000">, image_sink <font color="#990000">, NULL <font color="#990000">);  <font color="#9A1900">/* Specify what kind of video is wanted from the camera */  caps <font color="#990000"> =  <font color="#000000">gst_caps_new_simple   <font color="#990000">(  <font color="#FF0000">"video/x-raw-rgb"  <font color="#990000">,  			 <font color="#FF0000">"width"  <font color="#990000">, G_TYPE_INT <font color="#990000">,  <font color="#993399">640  <font color="#990000">,  			 <font color="#FF0000">"height"  <font color="#990000">, G_TYPE_INT <font color="#990000">,  <font color="#993399">480  <font color="#990000">,  			NULL <font color="#990000">);  <font color="#9A1900">/* Link the camera source and colorspace filter using capabilities   <font color="#9A1900">	 * specified */   <font color="#0000FF">if  <font color="#990000">(!   <font color="#000000">gst_element_link_filtered   <font color="#990000">( camera_src <font color="#990000">, csp_filter <font color="#990000">, caps <font color="#990000">)) <font color="#FF0000">{  <font color="#0000FF">return  FALSE <font color="#990000"> ; <font color="#FF0000">}  <font color="#000000">gst_caps_unref  <font color="#990000">( caps <font color="#990000">);  <font color="#9A1900">/* Connect Colorspace Filter -&gt; Tee -&gt; Screen Queue -&gt; Screen Sink   <font color="#9A1900">	 * This finalizes the initialization of the screen-part of the pipeline */   <font color="#0000FF">if  <font color="#990000">(!   <font color="#000000">gst_element_link_many   <font color="#990000">( csp_filter <font color="#990000">, tee <font color="#990000">, screen_queue <font color="#990000">, screen_sink <font color="#990000">, NULL <font color="#990000">)) <font color="#FF0000">{  <font color="#0000FF">return  FALSE <font color="#990000"> ; <font color="#FF0000">}  <font color="#9A1900">/* gdkpixbuf requires 8 bits per sample which is 24 bits per   <font color="#9A1900">	 * pixel */  caps <font color="#990000"> =  <font color="#000000">gst_caps_new_simple   <font color="#990000">(  <font color="#FF0000">"video/x-raw-rgb"  <font color="#990000">,  			 <font color="#FF0000">"width"  <font color="#990000">, G_TYPE_INT <font color="#990000">,  <font color="#993399">640  <font color="#990000">,  			 <font color="#FF0000">"height"  <font color="#990000">, G_TYPE_INT <font color="#990000">,  <font color="#993399">480  <font color="#990000">,  			 <font color="#FF0000">"bpp"  <font color="#990000">, G_TYPE_INT <font color="#990000">,  <font color="#993399">24  <font color="#990000">,  			 <font color="#FF0000">"depth"  <font color="#990000">, G_TYPE_INT <font color="#990000">,  <font color="#993399">24  <font color="#990000">,  			 <font color="#FF0000">"framerate"  <font color="#990000">, GST_TYPE_FRACTION <font color="#990000">,  <font color="#993399">15  <font color="#990000">,  <font color="#993399">1  <font color="#990000">, NULL <font color="#990000">); 	  <font color="#9A1900">/* Link the image-branch of the pipeline. The pipeline is    <font color="#9A1900">	 * ready after this */   	  <font color="#0000FF">if   <font color="#990000">(!  <font color="#000000">gst_element_link_many  <font color="#990000">( tee <font color="#990000">, image_queue <font color="#990000">, image_filter <font color="#990000">, NULL <font color="#990000">))   <font color="#0000FF">return  FALSE <font color="#990000"> ;  	  <font color="#0000FF">if   <font color="#990000">(!  <font color="#000000">gst_element_link_filtered  <font color="#990000">( image_filter <font color="#990000">, image_sink <font color="#990000">, caps <font color="#990000">))   <font color="#0000FF">return  FALSE <font color="#990000"> ;  	  <font color="#000000">gst_caps_unref   <font color="#990000">( caps <font color="#990000">);  	  <font color="#9A1900">/* As soon as screen is exposed, window ID will be advised to the sink */   	  <font color="#000000">g_signal_connect   <font color="#990000">( appdata <font color="#990000">-&gt; screen <font color="#990000">,  <font color="#FF0000">"expose-event"  <font color="#990000">,   <font color="#000000">G_CALLBACK   <font color="#990000">( expose_cb <font color="#990000">), screen_sink <font color="#990000">); 	  <font color="#000000">gst_element_set_state   <font color="#990000">( pipeline <font color="#990000">, GST_STATE_PLAYING <font color="#990000">);  	  <font color="#0000FF">return  TRUE <font color="#990000"> ;  <font color="#FF0000">} </tt>

The following function is called back when the user has pressed the "Take photo" button, and the image sink has data. It will forward the image buffer to create_jpeg : example_camera.c

  <font color="#9A1900">/* This callback will be registered to the image sink   <font color="#9A1900"> * after user requests a photo */   <font color="#0000FF">static  <font color="#008080">gboolean   <font color="#000000">buffer_probe_callback   <font color="#990000">(  		 <font color="#008080">GstElement  <font color="#990000"> * image_sink <font color="#990000">,  		 <font color="#008080">GstBuffer  <font color="#990000"> * buffer <font color="#990000">,  <font color="#008080">GstPad  <font color="#990000"> * pad <font color="#990000">,  <font color="#008080">AppData  <font color="#990000"> * appdata <font color="#990000">) <font color="#FF0000">{ <font color="#008080">GstMessage <font color="#990000"> * message <font color="#990000"> ; <font color="#008080">gchar <font color="#990000"> * message_name <font color="#990000"> ;  <font color="#9A1900">/* This is the raw RGB-data that image sink is about   <font color="#9A1900">	 * to discard */  <font color="#009900">unsigned <font color="#009900">char  <font color="#990000"> * data_photo <font color="#990000"> = <font color="#990000">( <font color="#009900">unsigned  <font color="#009900">char  <font color="#990000"> *)   <font color="#000000">GST_BUFFER_DATA   <font color="#990000">( buffer <font color="#990000">);  <font color="#9A1900">/* Create a JPEG of the data and check the status */   <font color="#0000FF">if  <font color="#990000">(!   <font color="#000000">create_jpeg   <font color="#990000">( data_photo <font color="#990000">)) message_name <font color="#990000"> = <font color="#FF0000">"photo-failed"  <font color="#990000"> ;  <font color="#0000FF">else  message_name <font color="#990000"> = <font color="#FF0000">"photo-taken"  <font color="#990000"> ;  <font color="#9A1900">/* Disconnect the handler so no more photos   <font color="#9A1900">	 * are taken */   <font color="#000000">g_signal_handler_disconnect  <font color="#990000">(   <font color="#000000">G_OBJECT   <font color="#990000">( image_sink <font color="#990000">),  			appdata <font color="#990000">-&gt; buffer_cb_id <font color="#990000">);  <font color="#9A1900">/* Create and send an application message which will be  '' <font color="#9A1900">	 * catched in the bus watcher function. This has to be ''  <font color="#9A1900">	 * sent as a message because this callback is called in   <font color="#9A1900">	 * a gstreamer thread and calling GUI-functions here would   <font color="#9A1900">	 * lead to X-server synchronization problems */  message <font color="#990000"> =  <font color="#000000">gst_message_new_application   <font color="#990000">(   <font color="#000000">GST_OBJECT   <font color="#990000">( appdata <font color="#990000">-&gt; pipeline <font color="#990000">),  			  <font color="#000000">gst_structure_new   <font color="#990000">( message_name <font color="#990000">, NULL <font color="#990000">));  <font color="#000000">gst_element_post_message  <font color="#990000">( appdata <font color="#990000">-&gt; pipeline <font color="#990000">, message <font color="#990000">);  <font color="#9A1900">/* Returning TRUE means that the buffer can is OK to be  '' <font color="#9A1900">	 * sent forward. When using fakesink this doesn't really ''  <font color="#9A1900">	 * matter because the data is discarded anyway */   <font color="#0000FF">return  TRUE <font color="#990000"> ; <font color="#FF0000">} </tt>

The xvimagesink GStreamer module will normally create a new window just for itself. Since the video is supposed to be shown inside the main application window, the X-Window window ID needs to be passed to the module, as soon as the ID exists: example_camera.c

  <font color="#9A1900">/* Callback to be called when the screen-widget is exposed */   <font color="#0000FF">static  <font color="#008080">gboolean   <font color="#000000">expose_cb   <font color="#990000">( GtkWidget <font color="#990000"> * widget <font color="#990000">, GdkEventExpose <font color="#990000"> * event <font color="#990000">,  <font color="#008080">gpointer data <font color="#990000">) <font color="#FF0000">{  <font color="#9A1900">/* Tell the xvimagesink/ximagesink the x-window-id of the screen  '' <font color="#9A1900">	 * widget in which the video is shown. After this the video ''  <font color="#9A1900">	 * is shown in the correct widget */   <font color="#000000">gst_x_overlay_set_xwindow_id  <font color="#990000">(   <font color="#000000">GST_X_OVERLAY   <font color="#990000">( data <font color="#990000">),  				      <font color="#000000">GDK_WINDOW_XWINDOW   <font color="#990000">( widget <font color="#990000">-&gt; window <font color="#990000">));  <font color="#0000FF">return  FALSE <font color="#990000"> ; <font color="#FF0000">} </tt>

For the sake of completeness, it follows the JPEG encoding function. It is worthwhile to mention that the buffer that came from GStreamer is a simple linear framebuffer: example_camera.c

  <font color="#9A1900">/* Creates a jpeg file from the buffer's raw image data */   <font color="#0000FF">static  <font color="#008080">gboolean   <font color="#000000">create_jpeg   <font color="#990000">(  <font color="#009900">unsigned  <font color="#009900">char  <font color="#990000"> * data <font color="#990000">) <font color="#FF0000">{ <font color="#008080">GdkPixbuf <font color="#990000"> * pixbuf <font color="#990000"> = NULL <font color="#990000"> ; <font color="#008080">GError <font color="#990000"> * error <font color="#990000"> = NULL <font color="#990000"> ; <font color="#008080">guint height <font color="#990000">, width <font color="#990000">, bpp <font color="#990000"> ;  <font color="#0000FF">const  <font color="#008080">gchar  <font color="#990000"> * directory <font color="#990000"> ; <font color="#008080">GString <font color="#990000"> * filename <font color="#990000"> ; <font color="#008080">guint base_len <font color="#990000">, i <font color="#990000"> ;  <font color="#0000FF">struct  <font color="#008080">stat statbuf <font color="#990000"> ; width <font color="#990000"> = <font color="#993399">640  <font color="#990000"> ; height <font color="#990000"> =  <font color="#993399">480  <font color="#990000"> ; bpp <font color="#990000"> =  <font color="#993399">24  <font color="#990000"> ;  <font color="#9A1900">/* Define the save folder */  directory <font color="#990000"> = SAVE_FOLDER_DEFAULT <font color="#990000"> ;  <font color="#0000FF">if  <font color="#990000">( directory <font color="#990000"> == NULL <font color="#990000">) <font color="#FF0000">{ directory <font color="#990000"> =  <font color="#000000">g_get_tmp_dir   <font color="#990000">; <font color="#FF0000">}  <font color="#9A1900">/* Create an unique file name */  filename <font color="#990000"> =  <font color="#000000">g_string_new   <font color="#990000">(   <font color="#000000">g_build_filename   <font color="#990000">( directory <font color="#990000">, PHOTO_NAME_DEFAULT <font color="#990000">, NULL <font color="#990000">)); base_len <font color="#990000"> = filename <font color="#990000">-&gt; len <font color="#990000"> ;  <font color="#000000">g_string_append  <font color="#990000">( filename <font color="#990000">, PHOTO_NAME_SUFFIX_DEFAULT <font color="#990000">);  <font color="#0000FF">for  <font color="#990000">( i <font color="#990000"> =  <font color="#993399">1  <font color="#990000"> ;  <font color="#990000"> !   <font color="#000000">stat   <font color="#990000">( filename <font color="#990000">-&gt; str <font color="#990000">,  <font color="#990000">&amp; statbuf <font color="#990000">);  <font color="#990000">++ i <font color="#990000">) <font color="#FF0000">{  <font color="#000000">g_string_truncate  <font color="#990000">( filename <font color="#990000">, base_len <font color="#990000">);  <font color="#000000">g_string_append_printf  <font color="#990000">( filename <font color="#990000">,  <font color="#FF0000">"%d%s"  <font color="#990000">, i <font color="#990000">, PHOTO_NAME_SUFFIX_DEFAULT <font color="#990000">); <font color="#FF0000">}  <font color="#9A1900">/* Create a pixbuf object from the data */  pixbuf <font color="#990000"> =  <font color="#000000">gdk_pixbuf_new_from_data   <font color="#990000">( data <font color="#990000">,  			GDK_COLORSPACE_RGB <font color="#990000">,   <font color="#9A1900">/* RGB-colorspace */   			FALSE <font color="#990000">,   <font color="#9A1900">/* No alpha-channel */   			bpp <font color="#990000">/  <font color="#993399">3  <font color="#990000">,   <font color="#9A1900">/* Bits per RGB-component */   			width <font color="#990000">, height <font color="#990000">,   <font color="#9A1900">/* Dimensions */   			 <font color="#993399">3  <font color="#990000"> * width <font color="#990000">,   <font color="#9A1900">/* Number of bytes between lines (ie stride) */   			NULL <font color="#990000">, NULL <font color="#990000">);   <font color="#9A1900">/* Callbacks */   <font color="#9A1900">/* Save the pixbuf content's in to a jpeg file and check for   <font color="#9A1900">	 * errors */   <font color="#0000FF">if  <font color="#990000">(!   <font color="#000000">gdk_pixbuf_save   <font color="#990000">( pixbuf <font color="#990000">, filename <font color="#990000">-&gt; str <font color="#990000">,  <font color="#FF0000">"jpeg"  <font color="#990000">,  <font color="#990000">&amp; error <font color="#990000">, NULL <font color="#990000">)) <font color="#FF0000">{  <font color="#000000">g_warning  <font color="#990000">(  <font color="#FF0000">"%s  <font color="#CC33CC">\n  <font color="#FF0000">"  <font color="#990000">, error <font color="#990000">-&gt; message <font color="#990000">);  <font color="#000000">g_error_free  <font color="#990000">( error <font color="#990000">);  <font color="#000000">gdk_pixbuf_unref  <font color="#990000">( pixbuf <font color="#990000">);  <font color="#000000">g_string_free  <font color="#990000">( filename <font color="#990000">, TRUE <font color="#990000">);  <font color="#0000FF">return  FALSE <font color="#990000"> ; <font color="#FF0000">}  <font color="#9A1900">/* Free allocated resources and return TRUE which means   <font color="#9A1900">	 * that the operation was succesful */   <font color="#000000">g_string_free  <font color="#990000">( filename <font color="#990000">, TRUE <font color="#990000">);  <font color="#000000">gdk_pixbuf_unref  <font color="#990000">( pixbuf <font color="#990000">);  <font color="#0000FF">return  TRUE <font color="#990000"> ; <font color="#FF0000">} </tt>