gstinfo.h 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557
  1. /* GStreamer
  2. * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
  3. * 2000 Wim Taymans <wtay@chello.be>
  4. * 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
  5. *
  6. * gstinfo.h: debugging functions
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Library General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Library General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Library General Public
  19. * License along with this library; if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  21. * Boston, MA 02110-1301, USA.
  22. */
  23. #ifndef __GSTINFO_H__
  24. #define __GSTINFO_H__
  25. #include <glib.h>
  26. #include <glib-object.h>
  27. #include <gst/gstconfig.h>
  28. G_BEGIN_DECLS
  29. /**
  30. * GstDebugLevel:
  31. * @GST_LEVEL_NONE: No debugging level specified or desired. Used to deactivate
  32. * debugging output.
  33. * @GST_LEVEL_ERROR: Error messages are to be used only when an error occurred
  34. * that stops the application from keeping working correctly.
  35. * An examples is gst_element_error, which outputs a message with this priority.
  36. * It does not mean that the application is terminating as with g_error.
  37. * @GST_LEVEL_WARNING: Warning messages are to inform about abnormal behaviour
  38. * that could lead to problems or weird behaviour later on. An example of this
  39. * would be clocking issues ("your computer is pretty slow") or broken input
  40. * data ("Can't synchronize to stream.")
  41. * @GST_LEVEL_FIXME: Fixme messages are messages that indicate that something
  42. * in the executed code path is not fully implemented or handled yet. Note
  43. * that this does not replace proper error handling in any way, the purpose
  44. * of this message is to make it easier to spot incomplete/unfinished pieces
  45. * of code when reading the debug log.
  46. * @GST_LEVEL_INFO: Informational messages should be used to keep the developer
  47. * updated about what is happening.
  48. * Examples where this should be used are when a typefind function has
  49. * successfully determined the type of the stream or when an mp3 plugin detects
  50. * the format to be used. ("This file has mono sound.")
  51. * @GST_LEVEL_DEBUG: Debugging messages should be used when something common
  52. * happens that is not the expected default behavior, or something that's
  53. * useful to know but doesn't happen all the time (ie. per loop iteration or
  54. * buffer processed or event handled).
  55. * An example would be notifications about state changes or receiving/sending
  56. * of events.
  57. * @GST_LEVEL_LOG: Log messages are messages that are very common but might be
  58. * useful to know. As a rule of thumb a pipeline that is running as expected
  59. * should never output anything else but LOG messages whilst processing data.
  60. * Use this log level to log recurring information in chain functions and
  61. * loop functions, for example.
  62. * @GST_LEVEL_TRACE: Tracing-related messages.
  63. * Examples for this are referencing/dereferencing of objects.
  64. * @GST_LEVEL_MEMDUMP: memory dump messages are used to log (small) chunks of
  65. * data as memory dumps in the log. They will be displayed as hexdump with
  66. * ASCII characters.
  67. * @GST_LEVEL_COUNT: The number of defined debugging levels.
  68. *
  69. * The level defines the importance of a debugging message. The more important a
  70. * message is, the greater the probability that the debugging system outputs it.
  71. */
  72. typedef enum {
  73. GST_LEVEL_NONE = 0,
  74. GST_LEVEL_ERROR = 1,
  75. GST_LEVEL_WARNING = 2,
  76. GST_LEVEL_FIXME = 3,
  77. GST_LEVEL_INFO = 4,
  78. GST_LEVEL_DEBUG = 5,
  79. GST_LEVEL_LOG = 6,
  80. GST_LEVEL_TRACE = 7,
  81. /* add more */
  82. GST_LEVEL_MEMDUMP = 9,
  83. /* add more */
  84. GST_LEVEL_COUNT
  85. } GstDebugLevel;
  86. /**
  87. * GST_LEVEL_DEFAULT:
  88. *
  89. * Defines the default debugging level to be used with GStreamer. It is normally
  90. * set to #GST_LEVEL_NONE so nothing get printed.
  91. * As it can be configured at compile time, developer builds may chose to
  92. * override that though.
  93. * You can use this as an argument to gst_debug_set_default_threshold() to
  94. * reset the debugging output to default behaviour.
  95. */
  96. #ifndef GST_LEVEL_DEFAULT
  97. #define GST_LEVEL_DEFAULT GST_LEVEL_NONE
  98. #endif
  99. /**
  100. * GST_LEVEL_MAX:
  101. *
  102. * Defines the maximum debugging level to be enabled at compilation time. By default
  103. * it is set such that all debugging statements will be enabled.
  104. *
  105. * If you wish to compile GStreamer and plugins with only some debugging statements
  106. * (Such as just warnings and errors), you can define it at compile time to the
  107. * maximum debug level. Any debug statements above that level will be compiled out.
  108. *
  109. * Since: 1.6
  110. */
  111. #ifndef GST_LEVEL_MAX
  112. #define GST_LEVEL_MAX GST_LEVEL_COUNT
  113. #endif
  114. /* defines for format (colors etc)
  115. * don't change them around, it uses terminal layout
  116. * Terminal color strings:
  117. * 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
  118. * Text color codes:
  119. * 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
  120. * Background color codes:
  121. * 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
  122. */
  123. /**
  124. * GstDebugColorFlags:
  125. * @GST_DEBUG_FG_BLACK: Use black as foreground color.
  126. * @GST_DEBUG_FG_RED: Use red as foreground color.
  127. * @GST_DEBUG_FG_GREEN: Use green as foreground color.
  128. * @GST_DEBUG_FG_YELLOW: Use yellow as foreground color.
  129. * @GST_DEBUG_FG_BLUE: Use blue as foreground color.
  130. * @GST_DEBUG_FG_MAGENTA: Use magenta as foreground color.
  131. * @GST_DEBUG_FG_CYAN: Use cyan as foreground color.
  132. * @GST_DEBUG_FG_WHITE: Use white as foreground color.
  133. * @GST_DEBUG_BG_BLACK: Use black as background color.
  134. * @GST_DEBUG_BG_RED: Use red as background color.
  135. * @GST_DEBUG_BG_GREEN: Use green as background color.
  136. * @GST_DEBUG_BG_YELLOW: Use yellow as background color.
  137. * @GST_DEBUG_BG_BLUE: Use blue as background color.
  138. * @GST_DEBUG_BG_MAGENTA: Use magenta as background color.
  139. * @GST_DEBUG_BG_CYAN: Use cyan as background color.
  140. * @GST_DEBUG_BG_WHITE: Use white as background color.
  141. * @GST_DEBUG_BOLD: Make the output bold.
  142. * @GST_DEBUG_UNDERLINE: Underline the output.
  143. *
  144. * These are some terminal style flags you can use when creating your
  145. * debugging categories to make them stand out in debugging output.
  146. */
  147. typedef enum {
  148. /* colors */
  149. GST_DEBUG_FG_BLACK = 0x0000,
  150. GST_DEBUG_FG_RED = 0x0001,
  151. GST_DEBUG_FG_GREEN = 0x0002,
  152. GST_DEBUG_FG_YELLOW = 0x0003,
  153. GST_DEBUG_FG_BLUE = 0x0004,
  154. GST_DEBUG_FG_MAGENTA = 0x0005,
  155. GST_DEBUG_FG_CYAN = 0x0006,
  156. GST_DEBUG_FG_WHITE = 0x0007,
  157. /* background colors */
  158. GST_DEBUG_BG_BLACK = 0x0000,
  159. GST_DEBUG_BG_RED = 0x0010,
  160. GST_DEBUG_BG_GREEN = 0x0020,
  161. GST_DEBUG_BG_YELLOW = 0x0030,
  162. GST_DEBUG_BG_BLUE = 0x0040,
  163. GST_DEBUG_BG_MAGENTA = 0x0050,
  164. GST_DEBUG_BG_CYAN = 0x0060,
  165. GST_DEBUG_BG_WHITE = 0x0070,
  166. /* other formats */
  167. GST_DEBUG_BOLD = 0x0100,
  168. GST_DEBUG_UNDERLINE = 0x0200
  169. } GstDebugColorFlags;
  170. /**
  171. * GstDebugColorMode:
  172. * @GST_DEBUG_COLOR_MODE_OFF: Do not use colors in logs.
  173. * @GST_DEBUG_COLOR_MODE_ON: Paint logs in a platform-specific way.
  174. * @GST_DEBUG_COLOR_MODE_UNIX: Paint logs with UNIX terminal color codes
  175. * no matter what platform GStreamer is running on.
  176. */
  177. typedef enum {
  178. GST_DEBUG_COLOR_MODE_OFF = 0,
  179. GST_DEBUG_COLOR_MODE_ON = 1,
  180. GST_DEBUG_COLOR_MODE_UNIX = 2
  181. } GstDebugColorMode;
  182. #define GST_DEBUG_FG_MASK (0x000F)
  183. #define GST_DEBUG_BG_MASK (0x00F0)
  184. #define GST_DEBUG_FORMAT_MASK (0xFF00)
  185. typedef struct _GstDebugCategory GstDebugCategory;
  186. /**
  187. * GstDebugCategory:
  188. *
  189. * This is the struct that describes the categories. Once initialized with
  190. * #GST_DEBUG_CATEGORY_INIT, its values can't be changed anymore.
  191. */
  192. struct _GstDebugCategory {
  193. /*< private >*/
  194. gint threshold;
  195. guint color; /* see defines above */
  196. const gchar * name;
  197. const gchar * description;
  198. };
  199. /********** some convenience macros for debugging **********/
  200. /**
  201. * GST_STR_NULL:
  202. * @str: (allow-none): The string to check.
  203. *
  204. * Macro to use when a string must not be %NULL, but may be %NULL. If the string
  205. * is %NULL, "(NULL)" is printed instead.
  206. * In GStreamer printf string arguments may not be %NULL, because on some
  207. * platforms (ie Solaris) the libc crashes in that case. This includes debugging
  208. * strings.
  209. */
  210. #define GST_STR_NULL(str) ((str) ? (str) : "(NULL)")
  211. /* FIXME, not MT safe */
  212. /**
  213. * GST_DEBUG_PAD_NAME:
  214. * @pad: The pad to debug.
  215. *
  216. * Evaluates to 2 strings, that describe the pad. Often used in debugging
  217. * statements.
  218. */
  219. #define GST_DEBUG_PAD_NAME(pad) \
  220. (pad != NULL) ? \
  221. ((GST_OBJECT_PARENT(pad) != NULL) ? \
  222. GST_STR_NULL (GST_OBJECT_NAME (GST_OBJECT_PARENT(pad))) : \
  223. "''" ) : "''", \
  224. (pad != NULL) ? GST_STR_NULL (GST_OBJECT_NAME (pad)) : "''"
  225. /**
  226. * GST_FUNCTION:
  227. *
  228. * This macro should evaluate to the name of the current function and be should
  229. * be defined when configuring your project, as it is compiler dependant. If it
  230. * is not defined, some default value is used. It is used to provide debugging
  231. * output with the function name of the message.
  232. *
  233. * Note that this is different from G_STRFUNC as we do not want the full
  234. * function signature in C++ code.
  235. */
  236. #ifndef GST_FUNCTION
  237. #if defined (__STDC__) && defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  238. # define GST_FUNCTION ((const char*) (__func__))
  239. #elif defined (__GNUC__) || (defined (_MSC_VER) && _MSC_VER >= 1300)
  240. # define GST_FUNCTION ((const char*) (__FUNCTION__))
  241. #else
  242. # define GST_FUNCTION ((const char*) ("???"))
  243. #endif
  244. #endif /* ifndef GST_FUNCTION */
  245. /**
  246. * GST_PTR_FORMAT:
  247. *
  248. * printf format type used to debug GStreamer types.
  249. * This can only be used on types whose size is >= sizeof(gpointer).
  250. */
  251. #define GST_PTR_FORMAT "p\aA"
  252. /**
  253. * GST_SEGMENT_FORMAT:
  254. *
  255. * printf format type used to debug GStreamer segments.
  256. * This can only be used on pointers to GstSegment structures.
  257. */
  258. #define GST_SEGMENT_FORMAT "p\aB"
  259. typedef struct _GstDebugMessage GstDebugMessage;
  260. /**
  261. * GstLogFunction:
  262. * @category: a #GstDebugCategory
  263. * @level: a #GstDebugLevel
  264. * @file: file name
  265. * @function: function name
  266. * @line: line number
  267. * @object: a #GObject
  268. * @message: the message
  269. * @user_data: user data for the log function
  270. *
  271. * Function prototype for a logging function that can be registered with
  272. * gst_debug_add_log_function().
  273. * Use G_GNUC_NO_INSTRUMENT on that function.
  274. */
  275. typedef void (*GstLogFunction) (GstDebugCategory * category,
  276. GstDebugLevel level,
  277. const gchar * file,
  278. const gchar * function,
  279. gint line,
  280. GObject * object,
  281. GstDebugMessage * message,
  282. gpointer user_data);
  283. void gst_debug_log (GstDebugCategory * category,
  284. GstDebugLevel level,
  285. const gchar * file,
  286. const gchar * function,
  287. gint line,
  288. GObject * object,
  289. const gchar * format,
  290. ...) G_GNUC_PRINTF (7, 8) G_GNUC_NO_INSTRUMENT;
  291. void gst_debug_log_valist (GstDebugCategory * category,
  292. GstDebugLevel level,
  293. const gchar * file,
  294. const gchar * function,
  295. gint line,
  296. GObject * object,
  297. const gchar * format,
  298. va_list args) G_GNUC_NO_INSTRUMENT;
  299. /* do not use this function, use the GST_DEBUG_CATEGORY_INIT macro */
  300. GstDebugCategory *_gst_debug_category_new (const gchar * name,
  301. guint color,
  302. const gchar * description);
  303. /* do not use this function, use the GST_DEBUG_CATEGORY_GET macro */
  304. GstDebugCategory *_gst_debug_get_category (const gchar *name);
  305. /* do not use this function, use the GST_CAT_MEMDUMP_* macros */
  306. void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
  307. const gchar * func, gint line, GObject * obj, const gchar * msg,
  308. const guint8 * data, guint length);
  309. /* we define this to avoid a compiler warning regarding a cast from a function
  310. * pointer to a void pointer
  311. * (see https://bugzilla.gnome.org/show_bug.cgi?id=309253)
  312. */
  313. typedef void (* GstDebugFuncPtr) (void);
  314. /* do no use these functions, use the GST_DEBUG*_FUNCPTR macros */
  315. void _gst_debug_register_funcptr (GstDebugFuncPtr func,
  316. const gchar * ptrname);
  317. const gchar *
  318. _gst_debug_nameof_funcptr (GstDebugFuncPtr func) G_GNUC_NO_INSTRUMENT;
  319. const gchar * gst_debug_message_get (GstDebugMessage * message);
  320. void gst_debug_log_default (GstDebugCategory * category,
  321. GstDebugLevel level,
  322. const gchar * file,
  323. const gchar * function,
  324. gint line,
  325. GObject * object,
  326. GstDebugMessage * message,
  327. gpointer user_data) G_GNUC_NO_INSTRUMENT;
  328. const gchar * gst_debug_level_get_name (GstDebugLevel level);
  329. void gst_debug_add_log_function (GstLogFunction func,
  330. gpointer user_data,
  331. GDestroyNotify notify);
  332. guint gst_debug_remove_log_function (GstLogFunction func);
  333. guint gst_debug_remove_log_function_by_data (gpointer data);
  334. void gst_debug_set_active (gboolean active);
  335. gboolean gst_debug_is_active (void);
  336. void gst_debug_set_colored (gboolean colored);
  337. void gst_debug_set_color_mode (GstDebugColorMode mode);
  338. void gst_debug_set_color_mode_from_string (const gchar * mode);
  339. gboolean gst_debug_is_colored (void);
  340. GstDebugColorMode gst_debug_get_color_mode (void);
  341. void gst_debug_set_default_threshold (GstDebugLevel level);
  342. GstDebugLevel gst_debug_get_default_threshold (void);
  343. void gst_debug_set_threshold_for_name (const gchar * name,
  344. GstDebugLevel level);
  345. void gst_debug_set_threshold_from_string (const gchar * list, gboolean reset);
  346. void gst_debug_unset_threshold_for_name (const gchar * name);
  347. void gst_debug_category_free (GstDebugCategory * category);
  348. void gst_debug_category_set_threshold (GstDebugCategory * category,
  349. GstDebugLevel level);
  350. void gst_debug_category_reset_threshold (GstDebugCategory * category);
  351. GstDebugLevel gst_debug_category_get_threshold (GstDebugCategory * category);
  352. const gchar * gst_debug_category_get_name (GstDebugCategory * category);
  353. guint gst_debug_category_get_color (GstDebugCategory * category);
  354. const gchar * gst_debug_category_get_description (GstDebugCategory * category);
  355. GSList * gst_debug_get_all_categories (void);
  356. gchar * gst_debug_construct_term_color (guint colorinfo);
  357. gint gst_debug_construct_win_color (guint colorinfo);
  358. gint gst_info_vasprintf (gchar ** result,
  359. const gchar * format,
  360. va_list args) G_GNUC_PRINTF (2, 0);
  361. gchar * gst_info_strdup_vprintf (const gchar *format, va_list args) G_GNUC_PRINTF (1, 0);
  362. gchar * gst_info_strdup_printf (const gchar *format, ...) G_GNUC_PRINTF (1, 2);
  363. #ifndef GST_DISABLE_GST_DEBUG
  364. #define gst_debug_add_log_function(func,data,notify) \
  365. G_STMT_START{ \
  366. if (func == gst_debug_log_default) { \
  367. gst_debug_add_log_function(NULL,data,notify); \
  368. } else { \
  369. gst_debug_add_log_function(func,data,notify); \
  370. } \
  371. }G_STMT_END
  372. #define gst_debug_remove_log_function(func) \
  373. (func == gst_debug_log_default) ? \
  374. gst_debug_remove_log_function(NULL) : \
  375. gst_debug_remove_log_function(func)
  376. /**
  377. * GST_DEBUG_CATEGORY:
  378. * @cat: the category
  379. *
  380. * Defines a GstDebugCategory variable.
  381. * This macro expands to nothing if debugging is disabled.
  382. */
  383. #define GST_DEBUG_CATEGORY(cat) GstDebugCategory *cat = NULL
  384. /**
  385. * GST_DEBUG_CATEGORY_EXTERN:
  386. * @cat: the category
  387. *
  388. * Declares a GstDebugCategory variable as extern. Use in header files.
  389. * This macro expands to nothing if debugging is disabled.
  390. */
  391. #define GST_DEBUG_CATEGORY_EXTERN(cat) extern GstDebugCategory *cat
  392. /**
  393. * GST_DEBUG_CATEGORY_STATIC:
  394. * @cat: the category
  395. *
  396. * Defines a static GstDebugCategory variable.
  397. * This macro expands to nothing if debugging is disabled.
  398. */
  399. #define GST_DEBUG_CATEGORY_STATIC(cat) static GstDebugCategory *cat = NULL
  400. /**
  401. * GST_DEBUG_CATEGORY_INIT:
  402. * @cat: the category to initialize.
  403. * @name: the name of the category.
  404. * @color: the colors to use for a color representation or 0 for no color.
  405. * @description: optional description of the category.
  406. *
  407. * Initializes a new #GstDebugCategory with the given properties and set to
  408. * the default threshold.
  409. *
  410. * <note>
  411. * <para>
  412. * This macro expands to nothing if debugging is disabled.
  413. * </para>
  414. * <para>
  415. * When naming your category, please follow the following conventions to ensure
  416. * that the pattern matching for categories works as expected. It is not
  417. * earth-shattering if you don't follow these conventions, but it would be nice
  418. * for everyone.
  419. * </para>
  420. * <para>
  421. * If you define a category for a plugin or a feature of it, name the category
  422. * like the feature. So if you wanted to write a "filesrc" element, you would
  423. * name the category "filesrc". Use lowercase letters only.
  424. * If you define more than one category for the same element, append an
  425. * underscore and an identifier to your categories, like this: "filesrc_cache"
  426. * </para>
  427. * <para>
  428. * If you create a library or an application using debugging categories, use a
  429. * common prefix followed by an underscore for all your categories. GStreamer
  430. * uses the GST prefix so GStreamer categories look like "GST_STATES". Be sure
  431. * to include uppercase letters.
  432. * </para>
  433. * </note>
  434. */
  435. #define GST_DEBUG_CATEGORY_INIT(cat,name,color,description) G_STMT_START{\
  436. if (cat == NULL) \
  437. cat = _gst_debug_category_new (name,color,description); \
  438. }G_STMT_END
  439. /**
  440. * GST_DEBUG_CATEGORY_GET:
  441. * @cat: the category to initialize.
  442. * @name: log category name
  443. *
  444. * Looks up an existing #GstDebugCategory by its @name and sets @cat. If the
  445. * category is not found, but GST_CAT_DEFAULT is defined, that is assigned to
  446. * @cat. Otherwise @cat will be %NULL.
  447. *
  448. * |[<!-- language="C" -->
  449. * GST_DEBUG_CATEGORY_STATIC (gst_myplugin_debug);
  450. * #define GST_CAT_DEFAULT gst_myplugin_debug
  451. * GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
  452. * ...
  453. * GST_DEBUG_CATEGORY_INIT (gst_myplugin_debug, "myplugin", 0, "nice element");
  454. * GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
  455. * ]|
  456. */
  457. #ifdef GST_CAT_DEFAULT
  458. #define GST_DEBUG_CATEGORY_GET(cat,name) G_STMT_START{\
  459. cat = _gst_debug_get_category (name); \
  460. if (!cat) { \
  461. cat = GST_CAT_DEFAULT; \
  462. } \
  463. }G_STMT_END
  464. #else
  465. #define GST_DEBUG_CATEGORY_GET(cat,name) G_STMT_START{\
  466. cat = _gst_debug_get_category (name); \
  467. }G_STMT_END
  468. #endif
  469. /**
  470. * GST_CAT_DEFAULT:
  471. *
  472. * Default gstreamer core debug log category. Please define your own.
  473. */
  474. GST_EXPORT GstDebugCategory * GST_CAT_DEFAULT;
  475. /* this symbol may not be used */
  476. GST_EXPORT gboolean _gst_debug_enabled;
  477. /* the min debug level, used for quickly discarding debug
  478. * messages that fall under the threshold. */
  479. GST_EXPORT GstDebugLevel _gst_debug_min;
  480. /**
  481. * GST_CAT_LEVEL_LOG:
  482. * @cat: category to use
  483. * @level: the severity of the message
  484. * @object: (allow-none): the #GObject the message belongs to or %NULL if none
  485. * @...: A printf-style message to output
  486. *
  487. * Outputs a debugging message. This is the most general macro for outputting
  488. * debugging messages. You will probably want to use one of the ones described
  489. * below.
  490. */
  491. #ifdef G_HAVE_ISO_VARARGS
  492. #define GST_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{ \
  493. if (G_UNLIKELY (level <= GST_LEVEL_MAX && level <= _gst_debug_min)) { \
  494. gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
  495. (GObject *) (object), __VA_ARGS__); \
  496. } \
  497. }G_STMT_END
  498. #else /* G_HAVE_GNUC_VARARGS */
  499. #ifdef G_HAVE_GNUC_VARARGS
  500. #define GST_CAT_LEVEL_LOG(cat,level,object,args...) G_STMT_START{ \
  501. if (G_UNLIKELY (level <= GST_LEVEL_MAX && level <= _gst_debug_min)) { \
  502. gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
  503. (GObject *) (object), ##args ); \
  504. } \
  505. }G_STMT_END
  506. #else /* no variadic macros, use inline */
  507. static inline void
  508. GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
  509. GstDebugLevel level, gpointer object, const char *format, va_list varargs)
  510. {
  511. if (G_UNLIKELY (level <= GST_LEVEL_MAX && level <= _gst_debug_min)) {
  512. gst_debug_log_valist (cat, level, "", "", 0, (GObject *) object, format,
  513. varargs);
  514. }
  515. }
  516. static inline void
  517. GST_CAT_LEVEL_LOG (GstDebugCategory * cat, GstDebugLevel level,
  518. gpointer object, const char *format, ...)
  519. {
  520. va_list varargs;
  521. va_start (varargs, format);
  522. GST_CAT_LEVEL_LOG_valist (cat, level, object, format, varargs);
  523. va_end (varargs);
  524. }
  525. #endif
  526. #endif /* G_HAVE_ISO_VARARGS */
  527. /* This one doesn't have varargs in the macro, so it's different than all the
  528. * other macros and hence in a separate block right here. Docs chunks are
  529. * with the other doc chunks below though. */
  530. #define __GST_CAT_MEMDUMP_LOG(cat,object,msg,data,length) G_STMT_START{ \
  531. if (G_UNLIKELY (GST_LEVEL_MEMDUMP <= GST_LEVEL_MAX && \
  532. GST_LEVEL_MEMDUMP <= _gst_debug_min)) { \
  533. _gst_debug_dump_mem ((cat), __FILE__, GST_FUNCTION, __LINE__, \
  534. (GObject *) (object), (msg), (data), (length)); \
  535. } \
  536. }G_STMT_END
  537. #define GST_CAT_MEMDUMP_OBJECT(cat,obj,msg,data,length) \
  538. __GST_CAT_MEMDUMP_LOG(cat,obj,msg,data,length)
  539. #define GST_CAT_MEMDUMP(cat,msg,data,length) \
  540. __GST_CAT_MEMDUMP_LOG(cat,NULL,msg,data,length)
  541. #define GST_MEMDUMP_OBJECT(obj,msg,data,length) \
  542. __GST_CAT_MEMDUMP_LOG(GST_CAT_DEFAULT,obj,msg,data,length)
  543. #define GST_MEMDUMP(msg,data,length) \
  544. __GST_CAT_MEMDUMP_LOG(GST_CAT_DEFAULT,NULL,msg,data,length)
  545. /**
  546. * GST_CAT_ERROR_OBJECT:
  547. * @cat: category to use
  548. * @obj: the #GObject the message belongs to
  549. * @...: printf-style message to output
  550. *
  551. * Output an error message belonging to the given object in the given category.
  552. */
  553. /**
  554. * GST_CAT_WARNING_OBJECT:
  555. * @cat: category to use
  556. * @obj: the #GObject the message belongs to
  557. * @...: printf-style message to output
  558. *
  559. * Output a warning message belonging to the given object in the given category.
  560. */
  561. /**
  562. * GST_CAT_INFO_OBJECT:
  563. * @cat: category to use
  564. * @obj: the #GObject the message belongs to
  565. * @...: printf-style message to output
  566. *
  567. * Output an informational message belonging to the given object in the given
  568. * category.
  569. */
  570. /**
  571. * GST_CAT_DEBUG_OBJECT:
  572. * @cat: category to use
  573. * @obj: the #GObject the message belongs to
  574. * @...: printf-style message to output
  575. *
  576. * Output an debugging message belonging to the given object in the given category.
  577. */
  578. /**
  579. * GST_CAT_LOG_OBJECT:
  580. * @cat: category to use
  581. * @obj: the #GObject the message belongs to
  582. * @...: printf-style message to output
  583. *
  584. * Output an logging message belonging to the given object in the given category.
  585. */
  586. /**
  587. * GST_CAT_FIXME_OBJECT:
  588. * @cat: category to use
  589. * @obj: the #GObject the message belongs to
  590. * @...: printf-style message to output
  591. *
  592. * Output a fixme message belonging to the given object in the given category.
  593. */
  594. /**
  595. * GST_CAT_TRACE_OBJECT:
  596. * @cat: category to use
  597. * @obj: the #GObject the message belongs to
  598. * @...: printf-style message to output
  599. *
  600. * Output a tracing message belonging to the given object in the given
  601. * category.
  602. */
  603. /**
  604. * GST_CAT_MEMDUMP_OBJECT:
  605. * @cat: category to use
  606. * @obj: the #GObject the message belongs to
  607. * @msg: message string to log with the data
  608. * @data: pointer to the data to output
  609. * @length: length of the data to output
  610. *
  611. * Output a hexdump of @data relating to the given object in the given
  612. * category.
  613. */
  614. /**
  615. * GST_CAT_ERROR:
  616. * @cat: category to use
  617. * @...: printf-style message to output
  618. *
  619. * Output an error message in the given category.
  620. */
  621. /**
  622. * GST_CAT_WARNING:
  623. * @cat: category to use
  624. * @...: printf-style message to output
  625. *
  626. * Output an warning message in the given category.
  627. */
  628. /**
  629. * GST_CAT_INFO:
  630. * @cat: category to use
  631. * @...: printf-style message to output
  632. *
  633. * Output an informational message in the given category.
  634. */
  635. /**
  636. * GST_CAT_DEBUG:
  637. * @cat: category to use
  638. * @...: printf-style message to output
  639. *
  640. * Output an debugging message in the given category.
  641. */
  642. /**
  643. * GST_CAT_LOG:
  644. * @cat: category to use
  645. * @...: printf-style message to output
  646. *
  647. * Output an logging message in the given category.
  648. */
  649. /**
  650. * GST_CAT_FIXME:
  651. * @cat: category to use
  652. * @...: printf-style message to output
  653. *
  654. * Output an fixme message in the given category.
  655. */
  656. /**
  657. * GST_CAT_TRACE:
  658. * @cat: category to use
  659. * @...: printf-style message to output
  660. *
  661. * Output a tracing message in the given category.
  662. */
  663. /**
  664. * GST_CAT_MEMDUMP:
  665. * @cat: category to use
  666. * @msg: message string to log with the data
  667. * @data: pointer to the data to output
  668. * @length: length of the data to output
  669. *
  670. * Output a hexdump of @data in the given category.
  671. */
  672. /**
  673. * GST_ERROR_OBJECT:
  674. * @obj: the #GObject the message belongs to
  675. * @...: printf-style message to output
  676. *
  677. * Output an error message belonging to the given object in the default category.
  678. */
  679. /**
  680. * GST_WARNING_OBJECT:
  681. * @obj: the #GObject the message belongs to
  682. * @...: printf-style message to output
  683. *
  684. * Output a warning message belonging to the given object in the default category.
  685. */
  686. /**
  687. * GST_INFO_OBJECT:
  688. * @obj: the #GObject the message belongs to
  689. * @...: printf-style message to output
  690. *
  691. * Output an informational message belonging to the given object in the default
  692. * category.
  693. */
  694. /**
  695. * GST_DEBUG_OBJECT:
  696. * @obj: the #GObject the message belongs to
  697. * @...: printf-style message to output
  698. *
  699. * Output a debugging message belonging to the given object in the default
  700. * category.
  701. */
  702. /**
  703. * GST_LOG_OBJECT:
  704. * @obj: the #GObject the message belongs to
  705. * @...: printf-style message to output
  706. *
  707. * Output a logging message belonging to the given object in the default category.
  708. */
  709. /**
  710. * GST_FIXME_OBJECT:
  711. * @obj: the #GObject the message belongs to
  712. * @...: printf-style message to output
  713. *
  714. * Output a fixme message belonging to the given object in the default category.
  715. */
  716. /**
  717. * GST_TRACE_OBJECT:
  718. * @obj: the #GObject the message belongs to
  719. * @...: printf-style message to output
  720. *
  721. * Output a tracing message belonging to the given object in the default category.
  722. */
  723. /**
  724. * GST_MEMDUMP_OBJECT:
  725. * @obj: the #GObject the message belongs to
  726. * @msg: message string to log with the data
  727. * @data: pointer to the data to output
  728. * @length: length of the data to output
  729. *
  730. * Output a logging message belonging to the given object in the default category.
  731. */
  732. /**
  733. * GST_ERROR:
  734. * @...: printf-style message to output
  735. *
  736. * Output an error message in the default category.
  737. */
  738. /**
  739. * GST_WARNING:
  740. * @...: printf-style message to output
  741. *
  742. * Output a warning message in the default category.
  743. */
  744. /**
  745. * GST_INFO:
  746. * @...: printf-style message to output
  747. *
  748. * Output an informational message in the default category.
  749. */
  750. /**
  751. * GST_DEBUG:
  752. * @...: printf-style message to output
  753. *
  754. * Output a debugging message in the default category.
  755. */
  756. /**
  757. * GST_LOG:
  758. * @...: printf-style message to output
  759. *
  760. * Output a logging message in the default category.
  761. */
  762. /**
  763. * GST_FIXME:
  764. * @...: printf-style message to output
  765. *
  766. * Output a fixme message in the default category.
  767. */
  768. /**
  769. * GST_TRACE:
  770. * @...: printf-style message to output
  771. *
  772. * Output a tracing message in the default category.
  773. */
  774. /**
  775. * GST_MEMDUMP:
  776. * @msg: message string to log with the data
  777. * @data: pointer to the data to output
  778. * @length: length of the data to output
  779. *
  780. * Output a hexdump of @data.
  781. */
  782. #ifdef G_HAVE_ISO_VARARGS
  783. #define GST_CAT_ERROR_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, obj, __VA_ARGS__)
  784. #define GST_CAT_WARNING_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj, __VA_ARGS__)
  785. #define GST_CAT_INFO_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, obj, __VA_ARGS__)
  786. #define GST_CAT_DEBUG_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, obj, __VA_ARGS__)
  787. #define GST_CAT_LOG_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, obj, __VA_ARGS__)
  788. #define GST_CAT_FIXME_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, obj, __VA_ARGS__)
  789. #define GST_CAT_TRACE_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, obj, __VA_ARGS__)
  790. #define GST_CAT_ERROR(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, NULL, __VA_ARGS__)
  791. #define GST_CAT_WARNING(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
  792. #define GST_CAT_INFO(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, NULL, __VA_ARGS__)
  793. #define GST_CAT_DEBUG(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, NULL, __VA_ARGS__)
  794. #define GST_CAT_LOG(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, NULL, __VA_ARGS__)
  795. #define GST_CAT_FIXME(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, NULL, __VA_ARGS__)
  796. #define GST_CAT_TRACE(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, NULL, __VA_ARGS__)
  797. #define GST_ERROR_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, __VA_ARGS__)
  798. #define GST_WARNING_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, __VA_ARGS__)
  799. #define GST_INFO_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, __VA_ARGS__)
  800. #define GST_DEBUG_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, __VA_ARGS__)
  801. #define GST_LOG_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, __VA_ARGS__)
  802. #define GST_FIXME_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, __VA_ARGS__)
  803. #define GST_TRACE_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, obj, __VA_ARGS__)
  804. #define GST_ERROR(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, __VA_ARGS__)
  805. #define GST_WARNING(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
  806. #define GST_INFO(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, __VA_ARGS__)
  807. #define GST_DEBUG(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, __VA_ARGS__)
  808. #define GST_LOG(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL, __VA_ARGS__)
  809. #define GST_FIXME(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, __VA_ARGS__)
  810. #define GST_TRACE(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, __VA_ARGS__)
  811. #else
  812. #ifdef G_HAVE_GNUC_VARARGS
  813. #define GST_CAT_ERROR_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, obj, ##args )
  814. #define GST_CAT_WARNING_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj, ##args )
  815. #define GST_CAT_INFO_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, obj, ##args )
  816. #define GST_CAT_DEBUG_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, obj, ##args )
  817. #define GST_CAT_LOG_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, obj, ##args )
  818. #define GST_CAT_FIXME_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, obj, ##args )
  819. #define GST_CAT_TRACE_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, obj, ##args )
  820. #define GST_CAT_ERROR(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, NULL, ##args )
  821. #define GST_CAT_WARNING(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, ##args )
  822. #define GST_CAT_INFO(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, NULL, ##args )
  823. #define GST_CAT_DEBUG(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, NULL, ##args )
  824. #define GST_CAT_LOG(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, NULL, ##args )
  825. #define GST_CAT_FIXME(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, NULL, ##args )
  826. #define GST_CAT_TRACE(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, NULL, ##args )
  827. #define GST_ERROR_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, ##args )
  828. #define GST_WARNING_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, ##args )
  829. #define GST_INFO_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, ##args )
  830. #define GST_DEBUG_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, ##args )
  831. #define GST_LOG_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, ##args )
  832. #define GST_FIXME_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, ##args )
  833. #define GST_TRACE_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, obj, ##args )
  834. #define GST_ERROR(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, ##args )
  835. #define GST_WARNING(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, ##args )
  836. #define GST_INFO(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, ##args )
  837. #define GST_DEBUG(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, ##args )
  838. #define GST_LOG(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL, ##args )
  839. #define GST_FIXME(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, ##args )
  840. #define GST_TRACE(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, ##args )
  841. #else
  842. /* no variadic macros, use inline */
  843. static inline void
  844. GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
  845. ...)
  846. {
  847. va_list varargs;
  848. va_start (varargs, format);
  849. GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, obj, format, varargs);
  850. va_end (varargs);
  851. }
  852. static inline void
  853. GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
  854. const char *format, ...)
  855. {
  856. va_list varargs;
  857. va_start (varargs, format);
  858. GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, obj, format, varargs);
  859. va_end (varargs);
  860. }
  861. static inline void
  862. GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
  863. ...)
  864. {
  865. va_list varargs;
  866. va_start (varargs, format);
  867. GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, obj, format, varargs);
  868. va_end (varargs);
  869. }
  870. static inline void
  871. GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
  872. ...)
  873. {
  874. va_list varargs;
  875. va_start (varargs, format);
  876. GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, obj, format, varargs);
  877. va_end (varargs);
  878. }
  879. static inline void
  880. GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
  881. ...)
  882. {
  883. va_list varargs;
  884. va_start (varargs, format);
  885. GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, obj, format, varargs);
  886. va_end (varargs);
  887. }
  888. static inline void
  889. GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
  890. ...)
  891. {
  892. va_list varargs;
  893. va_start (varargs, format);
  894. GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_FIXME, obj, format, varargs);
  895. va_end (varargs);
  896. }
  897. static inline void
  898. GST_CAT_TRACE_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
  899. ...)
  900. {
  901. va_list varargs;
  902. va_start (varargs, format);
  903. GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_TRACE, obj, format, varargs);
  904. va_end (varargs);
  905. }
  906. static inline void
  907. GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
  908. {
  909. va_list varargs;
  910. va_start (varargs, format);
  911. GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, NULL, format, varargs);
  912. va_end (varargs);
  913. }
  914. static inline void
  915. GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
  916. {
  917. va_list varargs;
  918. va_start (varargs, format);
  919. GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, NULL, format, varargs);
  920. va_end (varargs);
  921. }
  922. static inline void
  923. GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
  924. {
  925. va_list varargs;
  926. va_start (varargs, format);
  927. GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, NULL, format, varargs);
  928. va_end (varargs);
  929. }
  930. static inline void
  931. GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
  932. {
  933. va_list varargs;
  934. va_start (varargs, format);
  935. GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, NULL, format, varargs);
  936. va_end (varargs);
  937. }
  938. static inline void
  939. GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
  940. {
  941. va_list varargs;
  942. va_start (varargs, format);
  943. GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, NULL, format, varargs);
  944. va_end (varargs);
  945. }
  946. static inline void
  947. GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
  948. {
  949. va_list varargs;
  950. va_start (varargs, format);
  951. GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_FIXME, NULL, format, varargs);
  952. va_end (varargs);
  953. }
  954. static inline void
  955. GST_CAT_TRACE (GstDebugCategory * cat, const char *format, ...)
  956. {
  957. va_list varargs;
  958. va_start (varargs, format);
  959. GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_TRACE, NULL, format, varargs);
  960. va_end (varargs);
  961. }
  962. static inline void
  963. GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
  964. {
  965. va_list varargs;
  966. va_start (varargs, format);
  967. GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, format,
  968. varargs);
  969. va_end (varargs);
  970. }
  971. static inline void
  972. GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
  973. {
  974. va_list varargs;
  975. va_start (varargs, format);
  976. GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, format,
  977. varargs);
  978. va_end (varargs);
  979. }
  980. static inline void
  981. GST_INFO_OBJECT (gpointer obj, const char *format, ...)
  982. {
  983. va_list varargs;
  984. va_start (varargs, format);
  985. GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, format,
  986. varargs);
  987. va_end (varargs);
  988. }
  989. static inline void
  990. GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
  991. {
  992. va_list varargs;
  993. va_start (varargs, format);
  994. GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, format,
  995. varargs);
  996. va_end (varargs);
  997. }
  998. static inline void
  999. GST_LOG_OBJECT (gpointer obj, const char *format, ...)
  1000. {
  1001. va_list varargs;
  1002. va_start (varargs, format);
  1003. GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, format,
  1004. varargs);
  1005. va_end (varargs);
  1006. }
  1007. static inline void
  1008. GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
  1009. {
  1010. va_list varargs;
  1011. va_start (varargs, format);
  1012. GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, format,
  1013. varargs);
  1014. va_end (varargs);
  1015. }
  1016. static inline void
  1017. GST_TRACE_OBJECT (gpointer obj, const char *format, ...)
  1018. {
  1019. va_list varargs;
  1020. va_start (varargs, format);
  1021. GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_TRACE, obj, format,
  1022. varargs);
  1023. va_end (varargs);
  1024. }
  1025. static inline void
  1026. GST_ERROR (const char *format, ...)
  1027. {
  1028. va_list varargs;
  1029. va_start (varargs, format);
  1030. GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, format,
  1031. varargs);
  1032. va_end (varargs);
  1033. }
  1034. static inline void
  1035. GST_WARNING (const char *format, ...)
  1036. {
  1037. va_list varargs;
  1038. va_start (varargs, format);
  1039. GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, format,
  1040. varargs);
  1041. va_end (varargs);
  1042. }
  1043. static inline void
  1044. GST_INFO (const char *format, ...)
  1045. {
  1046. va_list varargs;
  1047. va_start (varargs, format);
  1048. GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, format,
  1049. varargs);
  1050. va_end (varargs);
  1051. }
  1052. static inline void
  1053. GST_DEBUG (const char *format, ...)
  1054. {
  1055. va_list varargs;
  1056. va_start (varargs, format);
  1057. GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, format,
  1058. varargs);
  1059. va_end (varargs);
  1060. }
  1061. static inline void
  1062. GST_LOG (const char *format, ...)
  1063. {
  1064. va_list varargs;
  1065. va_start (varargs, format);
  1066. GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL,
  1067. format, varargs);
  1068. va_end (varargs);
  1069. }
  1070. static inline void
  1071. GST_FIXME (const char *format, ...)
  1072. {
  1073. va_list varargs;
  1074. va_start (varargs, format);
  1075. GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, format,
  1076. varargs);
  1077. va_end (varargs);
  1078. }
  1079. static inline void
  1080. GST_TRACE (const char *format, ...)
  1081. {
  1082. va_list varargs;
  1083. va_start (varargs, format);
  1084. GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, format,
  1085. varargs);
  1086. va_end (varargs);
  1087. }
  1088. #endif
  1089. #endif
  1090. /********** function pointer stuff **********/
  1091. /**
  1092. * GST_DEBUG_REGISTER_FUNCPTR:
  1093. * @ptr: pointer to the function to register
  1094. *
  1095. * Register a pointer to a function with its name, so it can later be used by
  1096. * GST_DEBUG_FUNCPTR_NAME().
  1097. *
  1098. * Use this variant of #GST_DEBUG_FUNCPTR if you do not need to use @ptr.
  1099. */
  1100. #define GST_DEBUG_REGISTER_FUNCPTR(ptr) \
  1101. _gst_debug_register_funcptr((GstDebugFuncPtr)(ptr), #ptr)
  1102. /**
  1103. * GST_DEBUG_FUNCPTR:
  1104. * @ptr: pointer to the function to register
  1105. *
  1106. * Register a pointer to a function with its name, so it can later be used by
  1107. * GST_DEBUG_FUNCPTR_NAME().
  1108. *
  1109. * Returns: the value passed to @ptr.
  1110. */
  1111. #define GST_DEBUG_FUNCPTR(ptr) \
  1112. (_gst_debug_register_funcptr((GstDebugFuncPtr)(ptr), #ptr) , ptr)
  1113. /**
  1114. * GST_DEBUG_FUNCPTR_NAME:
  1115. * @ptr: address of the function of which to look up the name
  1116. *
  1117. * Retrieves the name of the function, if it was previously registered with
  1118. * GST_DEBUG_FUNCPTR(). If not, it returns a description of the pointer.
  1119. *
  1120. * This macro returns a constant string which must not be modified or
  1121. * freed by the caller.
  1122. */
  1123. #define GST_DEBUG_FUNCPTR_NAME(ptr) \
  1124. _gst_debug_nameof_funcptr((GstDebugFuncPtr)ptr)
  1125. #else /* GST_DISABLE_GST_DEBUG */
  1126. #ifndef GST_INFO_C
  1127. #if defined(__GNUC__) && __GNUC__ >= 3
  1128. # pragma GCC poison gst_debug_log
  1129. # pragma GCC poison gst_debug_log_valist
  1130. # pragma GCC poison _gst_debug_category_new
  1131. #endif
  1132. #define _gst_debug_min GST_LEVEL_NONE
  1133. #define gst_debug_set_default_threshold(level) G_STMT_START{ }G_STMT_END
  1134. #define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
  1135. #define gst_debug_level_get_name(level) ("NONE")
  1136. #define gst_debug_message_get(message) ("")
  1137. #define gst_debug_add_log_function(func,data,notify) G_STMT_START{ }G_STMT_END
  1138. #define gst_debug_set_active(active) G_STMT_START{ }G_STMT_END
  1139. #define gst_debug_is_active() (FALSE)
  1140. #define gst_debug_set_colored(colored) G_STMT_START{ }G_STMT_END
  1141. #define gst_debug_set_color_mode(mode) G_STMT_START{ }G_STMT_END
  1142. #define gst_debug_set_color_mode_from_string(mode) G_STMT_START{ }G_STMT_END
  1143. #define gst_debug_is_colored() (FALSE)
  1144. #define gst_debug_get_color_mode() (GST_DEBUG_COLOR_MODE_OFF)
  1145. #define gst_debug_set_default_threshold(level) G_STMT_START{ }G_STMT_END
  1146. #define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
  1147. #define gst_debug_set_threshold_for_name(name,level) G_STMT_START{ }G_STMT_END
  1148. #define gst_debug_unset_threshold_for_name(name) G_STMT_START{ }G_STMT_END
  1149. /* we are using dummy function prototypes here to eat ';' as these macros are
  1150. * used outside of functions */
  1151. #define GST_DEBUG_CATEGORY(var) void _gst_debug_dummy_##var (void)
  1152. #define GST_DEBUG_CATEGORY_EXTERN(var) void _gst_debug_dummy_extern_##var (void)
  1153. #define GST_DEBUG_CATEGORY_STATIC(var) void _gst_debug_dummy_static_##var (void)
  1154. #define GST_DEBUG_CATEGORY_INIT(var,name,color,desc) G_STMT_START{ }G_STMT_END
  1155. #define GST_DEBUG_CATEGORY_GET(var,name) G_STMT_START{ }G_STMT_END
  1156. #define gst_debug_category_free(category) G_STMT_START{ }G_STMT_END
  1157. #define gst_debug_category_set_threshold(category,level) G_STMT_START{ }G_STMT_END
  1158. #define gst_debug_category_reset_threshold(category) G_STMT_START{ }G_STMT_END
  1159. #define gst_debug_category_get_threshold(category) (GST_LEVEL_NONE)
  1160. #define gst_debug_category_get_name(cat) ("")
  1161. #define gst_debug_category_get_color(cat) (0)
  1162. #define gst_debug_category_get_description(cat) ("")
  1163. #define gst_debug_get_all_categories() (NULL)
  1164. #define gst_debug_construct_term_color(colorinfo) (g_strdup ("00"))
  1165. #define gst_debug_construct_win_color(colorinfo) (0)
  1166. #endif /* !GST_INFO_C */
  1167. #ifdef G_HAVE_ISO_VARARGS
  1168. #define GST_CAT_LEVEL_LOG(cat,level,...) G_STMT_START{ }G_STMT_END
  1169. #define GST_CAT_ERROR_OBJECT(...) G_STMT_START{ }G_STMT_END
  1170. #define GST_CAT_WARNING_OBJECT(...) G_STMT_START{ }G_STMT_END
  1171. #define GST_CAT_INFO_OBJECT(...) G_STMT_START{ }G_STMT_END
  1172. #define GST_CAT_DEBUG_OBJECT(...) G_STMT_START{ }G_STMT_END
  1173. #define GST_CAT_LOG_OBJECT(...) G_STMT_START{ }G_STMT_END
  1174. #define GST_CAT_FIXME_OBJECT(...) G_STMT_START{ }G_STMT_END
  1175. #define GST_CAT_TRACE_OBJECT(...) G_STMT_START{ }G_STMT_END
  1176. #define GST_CAT_ERROR(...) G_STMT_START{ }G_STMT_END
  1177. #define GST_CAT_WARNING(...) G_STMT_START{ }G_STMT_END
  1178. #define GST_CAT_INFO(...) G_STMT_START{ }G_STMT_END
  1179. #define GST_CAT_DEBUG(...) G_STMT_START{ }G_STMT_END
  1180. #define GST_CAT_LOG(...) G_STMT_START{ }G_STMT_END
  1181. #define GST_CAT_FIXME(...) G_STMT_START{ }G_STMT_END
  1182. #define GST_CAT_TRACE(...) G_STMT_START{ }G_STMT_END
  1183. #define GST_ERROR_OBJECT(...) G_STMT_START{ }G_STMT_END
  1184. #define GST_WARNING_OBJECT(...) G_STMT_START{ }G_STMT_END
  1185. #define GST_INFO_OBJECT(...) G_STMT_START{ }G_STMT_END
  1186. #define GST_DEBUG_OBJECT(...) G_STMT_START{ }G_STMT_END
  1187. #define GST_LOG_OBJECT(...) G_STMT_START{ }G_STMT_END
  1188. #define GST_FIXME_OBJECT(...) G_STMT_START{ }G_STMT_END
  1189. #define GST_TRACE_OBJECT(...) G_STMT_START{ }G_STMT_END
  1190. #define GST_ERROR(...) G_STMT_START{ }G_STMT_END
  1191. #define GST_WARNING(...) G_STMT_START{ }G_STMT_END
  1192. #define GST_INFO(...) G_STMT_START{ }G_STMT_END
  1193. #define GST_DEBUG(...) G_STMT_START{ }G_STMT_END
  1194. #define GST_LOG(...) G_STMT_START{ }G_STMT_END
  1195. #define GST_FIXME(...) G_STMT_START{ }G_STMT_END
  1196. #define GST_TRACE(...) G_STMT_START{ }G_STMT_END
  1197. #else /* !G_HAVE_ISO_VARARGS */
  1198. #ifdef G_HAVE_GNUC_VARARGS
  1199. #define GST_CAT_LEVEL_LOG(cat,level,args...) G_STMT_START{ }G_STMT_END
  1200. #define GST_CAT_ERROR_OBJECT(args...) G_STMT_START{ }G_STMT_END
  1201. #define GST_CAT_WARNING_OBJECT(args...) G_STMT_START{ }G_STMT_END
  1202. #define GST_CAT_INFO_OBJECT(args...) G_STMT_START{ }G_STMT_END
  1203. #define GST_CAT_DEBUG_OBJECT(args...) G_STMT_START{ }G_STMT_END
  1204. #define GST_CAT_LOG_OBJECT(args...) G_STMT_START{ }G_STMT_END
  1205. #define GST_CAT_FIXME_OBJECT(args...) G_STMT_START{ }G_STMT_END
  1206. #define GST_CAT_TRACE_OBJECT(args...) G_STMT_START{ }G_STMT_END
  1207. #define GST_CAT_ERROR(args...) G_STMT_START{ }G_STMT_END
  1208. #define GST_CAT_WARNING(args...) G_STMT_START{ }G_STMT_END
  1209. #define GST_CAT_INFO(args...) G_STMT_START{ }G_STMT_END
  1210. #define GST_CAT_DEBUG(args...) G_STMT_START{ }G_STMT_END
  1211. #define GST_CAT_LOG(args...) G_STMT_START{ }G_STMT_END
  1212. #define GST_CAT_FIXME(args...) G_STMT_START{ }G_STMT_END
  1213. #define GST_CAT_TRACE(args...) G_STMT_START{ }G_STMT_END
  1214. #define GST_ERROR_OBJECT(args...) G_STMT_START{ }G_STMT_END
  1215. #define GST_WARNING_OBJECT(args...) G_STMT_START{ }G_STMT_END
  1216. #define GST_INFO_OBJECT(args...) G_STMT_START{ }G_STMT_END
  1217. #define GST_DEBUG_OBJECT(args...) G_STMT_START{ }G_STMT_END
  1218. #define GST_LOG_OBJECT(args...) G_STMT_START{ }G_STMT_END
  1219. #define GST_FIXME_OBJECT(args...) G_STMT_START{ }G_STMT_END
  1220. #define GST_TRACE_OBJECT(args...) G_STMT_START{ }G_STMT_END
  1221. #define GST_ERROR(args...) G_STMT_START{ }G_STMT_END
  1222. #define GST_WARNING(args...) G_STMT_START{ }G_STMT_END
  1223. #define GST_INFO(args...) G_STMT_START{ }G_STMT_END
  1224. #define GST_DEBUG(args...) G_STMT_START{ }G_STMT_END
  1225. #define GST_LOG(args...) G_STMT_START{ }G_STMT_END
  1226. #define GST_FIXME(args...) G_STMT_START{ }G_STMT_END
  1227. #define GST_TRACE(args...) G_STMT_START{ }G_STMT_END
  1228. #else /* !G_HAVE_GNUC_VARARGS */
  1229. static inline void
  1230. GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
  1231. GstDebugLevel level, gpointer object, const char *format, va_list varargs)
  1232. {
  1233. }
  1234. static inline void
  1235. GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
  1236. ...)
  1237. {
  1238. }
  1239. static inline void
  1240. GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
  1241. const char *format, ...)
  1242. {
  1243. }
  1244. static inline void
  1245. GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
  1246. ...)
  1247. {
  1248. }
  1249. static inline void
  1250. GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
  1251. ...)
  1252. {
  1253. }
  1254. static inline void
  1255. GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
  1256. ...)
  1257. {
  1258. }
  1259. static inline void
  1260. GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
  1261. ...)
  1262. {
  1263. }
  1264. static inline void
  1265. GST_CAT_TRACE_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
  1266. ...)
  1267. {
  1268. }
  1269. static inline void
  1270. GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
  1271. {
  1272. }
  1273. static inline void
  1274. GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
  1275. {
  1276. }
  1277. static inline void
  1278. GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
  1279. {
  1280. }
  1281. static inline void
  1282. GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
  1283. {
  1284. }
  1285. static inline void
  1286. GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
  1287. {
  1288. }
  1289. static inline void
  1290. GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
  1291. {
  1292. }
  1293. static inline void
  1294. GST_CAT_TRACE (GstDebugCategory * cat, const char *format, ...)
  1295. {
  1296. }
  1297. static inline void
  1298. GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
  1299. {
  1300. }
  1301. static inline void
  1302. GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
  1303. {
  1304. }
  1305. static inline void
  1306. GST_INFO_OBJECT (gpointer obj, const char *format, ...)
  1307. {
  1308. }
  1309. static inline void
  1310. GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
  1311. {
  1312. }
  1313. static inline void
  1314. GST_LOG_OBJECT (gpointer obj, const char *format, ...)
  1315. {
  1316. }
  1317. static inline void
  1318. GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
  1319. {
  1320. }
  1321. static inline void
  1322. GST_TRACE_OBJECT (gpointer obj, const char *format, ...)
  1323. {
  1324. }
  1325. static inline void
  1326. GST_ERROR (const char *format, ...)
  1327. {
  1328. }
  1329. static inline void
  1330. GST_WARNING (const char *format, ...)
  1331. {
  1332. }
  1333. static inline void
  1334. GST_INFO (const char *format, ...)
  1335. {
  1336. }
  1337. static inline void
  1338. GST_DEBUG (const char *format, ...)
  1339. {
  1340. }
  1341. static inline void
  1342. GST_LOG (const char *format, ...)
  1343. {
  1344. }
  1345. static inline void
  1346. GST_FIXME (const char *format, ...)
  1347. {
  1348. }
  1349. static inline void
  1350. GST_TRACE (const char *format, ...)
  1351. {
  1352. }
  1353. #endif /* G_HAVE_GNUC_VARARGS */
  1354. #endif /* G_HAVE_ISO_VARARGS */
  1355. #define GST_DEBUG_REGISTER_FUNCPTR(ptr) G_STMT_START{ }G_STMT_END
  1356. #define GST_DEBUG_FUNCPTR(ptr) (ptr)
  1357. #define GST_DEBUG_FUNCPTR_NAME(ptr) (g_strdup_printf ("%p", ptr))
  1358. #define GST_CAT_MEMDUMP_OBJECT(cat,obj,msg,data,length) G_STMT_START{ }G_STMT_END
  1359. #define GST_CAT_MEMDUMP(cat,msg,data,length) G_STMT_START{ }G_STMT_END
  1360. #define GST_MEMDUMP_OBJECT(obj,msg,data,length) G_STMT_START{ }G_STMT_END
  1361. #define GST_MEMDUMP(msg,data,length) G_STMT_START{ }G_STMT_END
  1362. #endif /* GST_DISABLE_GST_DEBUG */
  1363. void gst_debug_print_stack_trace (void);
  1364. G_END_DECLS
  1365. #endif /* __GSTINFO_H__ */