[cheese] Port CheeseCamera to GST_DEBUG



commit aceeeb95cf3694b64b9d2648295e4860873202a2
Author: Filippo Argiolas <filippo argiolas gmail com>
Date:   Mon Dec 14 22:29:31 2009 +0100

    Port CheeseCamera to GST_DEBUG

 libcheese/cheese-camera.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
index c4662da..d5f3bd2 100644
--- a/libcheese/cheese-camera.c
+++ b/libcheese/cheese-camera.c
@@ -133,6 +133,9 @@ static const EffectToPipelineDesc EFFECT_TO_PIPELINE_DESC[] = {
 
 static const int NUM_EFFECTS = G_N_ELEMENTS (EFFECT_TO_PIPELINE_DESC);
 
+GST_DEBUG_CATEGORY (cheese_camera);
+#define GST_CAT_DEFAULT cheese_camera
+
 GQuark
 cheese_camera_error_quark (void)
 {
@@ -257,7 +260,7 @@ cheese_camera_bus_message_cb (GstBus *bus, GstMessage *message, CheeseCamera *ca
   {
     if (priv->is_recording)
     {
-      g_print ("Received EOS message\n");
+      GST_DEBUG ("Received EOS message");
 
       g_source_remove (priv->eos_timeout_id);
 
@@ -817,7 +820,7 @@ cheese_camera_force_stop_video_recording (gpointer data)
 
   if (priv->is_recording)
   {
-    g_print ("Cannot cleanly shutdown recording pipeline, forcing\n");
+    GST_WARNING ("Cannot cleanly shutdown recording pipeline, forcing");
     g_signal_emit (camera, camera_signals[VIDEO_SAVED], 0);
 
     cheese_camera_change_sink (camera, priv->video_display_bin,
@@ -839,7 +842,7 @@ cheese_camera_stop_video_recording (CheeseCamera *camera)
   if (state == GST_STATE_PLAYING)
   {
     /* Send EOS message down the pipeline by stopping video and audio source*/
-    g_print ("Sending EOS event down the recording pipeline\n");
+    GST_DEBUG ("Sending EOS event down the recording pipeline");
     gst_element_send_event (priv->video_source, gst_event_new_eos ());
     gst_element_send_event (priv->audio_source, gst_event_new_eos ());
     priv->eos_timeout_id = g_timeout_add (3000, cheese_camera_force_stop_video_recording, camera);
@@ -857,7 +860,7 @@ cheese_camera_take_photo (CheeseCamera *camera, char *filename)
 
   if (priv->photo_handler_signal_id != 0)
   {
-    g_print ("Still waiting for previous photo data, ignoring new request\n");
+    GST_WARNING ("Still waiting for previous photo data, ignoring new request");
     return FALSE;
   }
 
@@ -879,7 +882,7 @@ cheese_camera_take_photo_pixbuf (CheeseCamera *camera)
 
   if (priv->photo_handler_signal_id != 0)
   {
-    g_print ("Still waiting for previous photo data, ignoring new request\n");
+    GST_WARNING ("Still waiting for previous photo data, ignoring new request");
     return FALSE;
   }
 
@@ -1034,6 +1037,10 @@ cheese_camera_init (CheeseCamera *camera)
 {
   CheeseCameraPrivate *priv = CHEESE_CAMERA_GET_PRIVATE (camera);
 
+  GST_DEBUG_CATEGORY_INIT (cheese_camera,
+                           "cheese-camera",
+                           0, "Cheese Camera");
+
   priv->is_recording            = FALSE;
   priv->pipeline_is_playing     = FALSE;
   priv->photo_filename          = NULL;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]