private debugging cat better error reporting
authorThomas Vander Stichele <thomas@apestaart.org>
Fri, 23 Jan 2004 15:34:50 +0000 (15:34 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Fri, 23 Jan 2004 15:34:50 +0000 (15:34 +0000)
Original commit message from CVS:
private debugging cat
better error reporting

ChangeLog
ext/esd/esdsink.c
ext/esd/gstesd.c

index a077bc6..f4c195d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-01-23  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+       * ext/esd/esdsink.c: (gst_esdsink_open_audio):
+       * ext/esd/gstesd.c: (plugin_init):
+          private debugging, better error reporting
+
 2004-01-23  Ronald Bultje  <rbultje@ronald.bitfreak.net>
 
        * gst-libs/gst/riff/riff-read.c: (gst_riff_read_class_init),
index a66be1a..b7f9145 100644 (file)
@@ -28,6 +28,8 @@
 #include <unistd.h>
 #include <errno.h>
 
+GST_DEBUG_CATEGORY_EXTERN (esd_debug);
+
 /* elementfactory information */
 static GstElementDetails esdsink_details = {
   "Esound audio sink",
@@ -428,14 +430,16 @@ gst_esdsink_open_audio (GstEsdsink *sink)
   if (sink->depth == 16) esdformat |= ESD_BITS16;
   else if (sink->depth == 8) esdformat |= ESD_BITS8;
   else {
-    GST_DEBUG ("esdsink: invalid bit depth (%d)", sink->depth);
+    gst_element_error (sink, STREAM, FORMAT, NULL,
+                       ("invalid bit depth (%d)", sink->depth));
     return FALSE;
   }
 
   if (sink->channels == 2) esdformat |= ESD_STEREO;
   else if (sink->channels == 1) esdformat |= ESD_MONO;
   else {
-    GST_DEBUG ("esdsink: invalid number of channels (%d)", sink->channels);
+    gst_element_error (sink, STREAM, FORMAT, NULL,
+                       ("invalid number of channels (%d)", sink->channels));
     return FALSE;
   }
 
@@ -446,7 +450,8 @@ gst_esdsink_open_audio (GstEsdsink *sink)
     sink->fd = esd_play_stream(esdformat, sink->frequency, sink->host, connname);
   }
   if ( sink->fd < 0 ) {
-    GST_DEBUG ("esdsink: can't open connection to esound server");
+    gst_element_error (sink, RESOURCE, OPEN_WRITE, NULL,
+                       ("can't open connection to esound server"));
     return FALSE;
   }
 
index e804b72..ea480a3 100644 (file)
@@ -24,6 +24,7 @@
 #include "esdsink.h"
 #include "esdmon.h"
 
+GST_DEBUG_CATEGORY (esd_debug);
 
 static gboolean
 plugin_init (GstPlugin *plugin)
@@ -38,6 +39,7 @@ plugin_init (GstPlugin *plugin)
   ret = gst_esdmon_factory_init(plugin);
   if(ret == FALSE) return FALSE;
 
+  GST_DEBUG_CATEGORY_INIT (esd_debug, "esd", 0, "ESounD elements");
   return TRUE;
 }