/* GStreamer * Copyright (C) 1999,2000 Erik Walthinsen * 2000 Wim Taymans * * gstinfo.h: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __GSTINFO_H__ #define __GSTINFO_H__ #include #include #include #ifdef HAVE_CONFIG_H #include #endif /***** are we in the core or not? *****/ #ifdef __GST_PRIVATE_H__ #define _GST_DEBUG_INCORE TRUE #else #define _GST_DEBUG_INCORE FALSE #endif /* colorization stuff */ #ifdef GST_DEBUG_COLOR #ifdef __GST_PRIVATE_H__ /* FIXME this should be some libgst.la -specific thing */ #define GST_DEBUG_CHAR_MODE "00" #else #define GST_DEBUG_CHAR_MODE "01" #endif #endif gint _gst_debug_stringhash_color(gchar *file); /********************************************************************** * Categories **********************************************************************/ const gchar * gst_get_category_name (gint category); enum { GST_CAT_GST_INIT = 0, /* Library initialization */ GST_CAT_COTHREADS, /* Cothread creation, etc. */ GST_CAT_COTHREAD_SWITCH, /* Cothread switching */ GST_CAT_AUTOPLUG, /* Successful autoplug results */ GST_CAT_AUTOPLUG_ATTEMPT, /* Attempted autoplug operations */ GST_CAT_PARENTAGE, /* GstBin parentage issues */ GST_CAT_STATES, /* State changes and such */ GST_CAT_PLANNING, /* Plan generation */ GST_CAT_SCHEDULING, /* Schedule construction */ GST_CAT_DATAFLOW, /* Events during actual data movement */ GST_CAT_BUFFER, /* Buffer creation/destruction */ GST_CAT_CAPS, /* Capabilities matching */ GST_CAT_CLOCK, /* Clocking */ GST_CAT_ELEMENT_PADS, /* Element pad management */ GST_CAT_ELEMENTFACTORY, /* Elementfactory stuff */ GST_CAT_PADS, /* Pad creation/connection */ GST_CAT_PIPELINE, /* Pipeline stuff */ GST_CAT_PLUGIN_LOADING, /* Plugin loading */ GST_CAT_PLUGIN_ERRORS, /* Errors during plugin loading */ GST_CAT_PLUGIN_INFO, /* Plugin state information */ GST_CAT_PROPERTIES, /* Properties */ GST_CAT_THREAD, /* Thread creation/management */ GST_CAT_TYPES, /* Typing */ GST_CAT_XML, /* XML load/save of everything */ GST_CAT_NEGOTIATION, /* Caps Negotiation stuff */ GST_CAT_REFCOUNTING, /* Ref Counting stuff */ GST_CAT_EVENT, /* Event system */ GST_CAT_PARAMS, /* Dynamic parameters */ GST_CAT_CALL_TRACE = 30, /* Call tracing */ GST_CAT_MAX_CATEGORY = 31 }; extern const gchar *_gst_category_colors[32]; /********************************************************************** * DEBUG system **********************************************************************/ /* for include files that make too much noise normally */ #ifdef GST_DEBUG_FORCE_DISABLE #undef GST_DEBUG_ENABLED #endif /* for applications that really really want all the noise */ #ifdef GST_DEBUG_FORCE_ENABLE #define GST_DEBUG_ENABLED #endif /*#ifdef GST_DEBUG_ENABLED */ #define GST_DEBUG_ENABLE_CATEGORIES 0xffffffff /*#else */ /*#define GST_DEBUG_ENABLE_CATEGORIES 0x00000000 */ /*#endif */ typedef void (*GstDebugHandler) (gint category,gboolean core, const gchar *file,const gchar *function, gint line,const gchar *debug_string, void *element,gchar *string); void gst_default_debug_handler (gint category,gboolean incore, const gchar *file, const gchar *function, gint line,const gchar *debug_string, void *element,gchar *string); extern guint32 _gst_debug_categories; extern GstDebugHandler _gst_debug_handler; /* fallback, this should probably be a 'weak' symbol or something */ G_GNUC_UNUSED static gchar *_debug_string = NULL; #ifdef GST_DEBUG_ENABLED #define GST_DEBUG(cat,format,args...) G_STMT_START{ \ if ((1<