From 7fdca5f42804b76149cd394efce2d17a689a0d43 Mon Sep 17 00:00:00 2001 From: Erik Walthinsen Date: Sat, 28 Apr 2001 02:54:53 +0000 Subject: [PATCH] Updated the colorization a bit more, and did a significant pass through all the other code to change categories on DE... Original commit message from CVS: Updated the colorization a bit more, and did a significant pass through all the other code to change categories on DEBUG and INFO statements to be correct, and not simply zero. There are still more, but this is a good first pass. --- gst/gstbin.c | 12 +++++------ gst/gstclock.c | 17 ++++++++------- gst/gstelement.c | 22 +++++++++++--------- gst/gstelementfactory.c | 8 +++---- gst/gstinfo.c | 13 ++++++++---- gst/gstpad.c | 46 ++++++++++++++++++++--------------------- gst/gstpipeline.c | 2 +- gst/gstthread.c | 10 ++++----- gst/gsttype.c | 8 +++---- gst/gstutils.c | 8 ++++++- 10 files changed, 81 insertions(+), 65 deletions(-) diff --git a/gst/gstbin.c b/gst/gstbin.c index 1a329e0d22..4bbeb6e7c1 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -349,7 +349,7 @@ gst_bin_change_state (GstElement *element) bin = GST_BIN (element); -// GST_DEBUG (0,"currently %d(%s), %d(%s) pending\n",GST_STATE (element), +// GST_DEBUG (GST_CAT_STATES,"currently %d(%s), %d(%s) pending\n",GST_STATE (element), // _gst_print_statename (GST_STATE (element)), GST_STATE_PENDING (element), // _gst_print_statename (GST_STATE_PENDING (element))); @@ -370,7 +370,7 @@ gst_bin_change_state (GstElement *element) if (!parent || !GST_IS_BIN (parent)) gst_bin_create_plan (bin); else - GST_DEBUG (0,"not creating plan for '%s'\n",GST_ELEMENT_NAME (bin)); + GST_DEBUG (GST_CAT_STATES,"not creating plan for '%s'\n",GST_ELEMENT_NAME (bin)); break; } @@ -385,16 +385,16 @@ gst_bin_change_state (GstElement *element) children = bin->children; while (children) { child = GST_ELEMENT (children->data); - GST_DEBUG (0,"setting state on '%s'\n",GST_ELEMENT_NAME (child)); + GST_DEBUG (GST_CAT_STATES,"setting state on '%s'\n",GST_ELEMENT_NAME (child)); switch (gst_element_set_state (child, GST_STATE_PENDING (element))) { case GST_STATE_FAILURE: GST_STATE_PENDING (element) = GST_STATE_NONE_PENDING; - GST_DEBUG (0,"child '%s' failed to go to state %d(%s)\n", GST_ELEMENT_NAME (child), + GST_DEBUG (GST_CAT_STATES,"child '%s' failed to go to state %d(%s)\n", GST_ELEMENT_NAME (child), GST_STATE_PENDING (element), _gst_print_statename (GST_STATE_PENDING (element))); return GST_STATE_FAILURE; break; case GST_STATE_ASYNC: - GST_DEBUG (0,"child '%s' is changing state asynchronously\n", GST_ELEMENT_NAME (child)); + GST_DEBUG (GST_CAT_STATES,"child '%s' is changing state asynchronously\n", GST_ELEMENT_NAME (child)); break; } // g_print("\n"); @@ -471,7 +471,7 @@ gst_bin_set_state_type (GstBin *bin, { GstBinClass *oclass; - GST_DEBUG (0,"gst_bin_set_state_type(\"%s\",%d,%d)\n", + GST_DEBUG (GST_CAT_STATES,"gst_bin_set_state_type(\"%s\",%d,%d)\n", GST_ELEMENT_NAME (bin), state,type); g_return_val_if_fail (bin != NULL, FALSE); diff --git a/gst/gstclock.c b/gst/gstclock.c index 8040baf339..0c3caad5b8 100644 --- a/gst/gstclock.c +++ b/gst/gstclock.c @@ -71,7 +71,7 @@ void gst_clock_register (GstClock *clock, GstObject *obj) { if ((GST_ELEMENT(obj))->numsrcpads == 0) { - GST_DEBUG (0,"gst_clock: setting registered sink object 0x%p\n", obj); + GST_DEBUG (GST_CAT_CLOCK,"gst_clock: setting registered sink object 0x%p\n", obj); clock->sinkobjects = g_list_append (clock->sinkobjects, obj); clock->num++; } @@ -88,7 +88,8 @@ gst_clock_set (GstClock *clock, GstClockTime time) g_mutex_lock (clock->lock); clock->start_time = now - time; g_mutex_unlock (clock->lock); - GST_DEBUG (0,"gst_clock: setting clock to %llu %llu %llu\n", time, now, clock->start_time); + GST_DEBUG (GST_CAT_CLOCK,"gst_clock: setting clock to %llu %llu %llu\n", + time, now, clock->start_time); } GstClockTimeDiff @@ -115,7 +116,7 @@ gst_clock_reset (GstClock *clock) clock->start_time = ((guint64)tfnow.tv_sec)*1000000LL+tfnow.tv_usec; clock->current_time = clock->start_time; clock->adjust = 0LL; - GST_DEBUG (0,"gst_clock: setting start clock %llu\n", clock->start_time); + GST_DEBUG (GST_CAT_CLOCK,"gst_clock: setting start clock %llu\n", clock->start_time); g_mutex_unlock (clock->lock); } @@ -133,7 +134,8 @@ gst_clock_wait (GstClock *clock, GstClockTime time, GstObject *obj) diff = GST_CLOCK_DIFF (time, now); // if we are not behind wait a bit - GST_DEBUG (0,"gst_clock: %s waiting for time %08llu %08llu %08lld\n", GST_OBJECT_NAME (obj), time, now, diff); + GST_DEBUG (GST_CAT_CLOCK,"gst_clock: %s waiting for time %08llu %08llu %08lld\n", + GST_OBJECT_NAME (obj), time, now, diff); g_mutex_unlock (clock->lock); if (diff > 10000 ) { @@ -143,8 +145,9 @@ gst_clock_wait (GstClock *clock, GstClockTime time, GstObject *obj) if (!tfnow.tv_sec) { select(0, NULL, NULL, NULL, &tfnow); } - else GST_DEBUG (0,"gst_clock: %s waiting %u %llu %llu %llu seconds\n", GST_OBJECT_NAME (obj), - (int)tfnow.tv_sec, now, diff, time); + else GST_DEBUG (GST_CAT_CLOCK,"gst_clock: %s waiting %u %llu %llu %llu seconds\n", + GST_OBJECT_NAME (obj), (int)tfnow.tv_sec, now, diff, time); } - GST_DEBUG (0,"gst_clock: %s waiting for time %08llu %08llu %08lld done \n", GST_OBJECT_NAME (obj), time, now, diff); + GST_DEBUG (GST_CAT_CLOCK,"gst_clock: %s waiting for time %08llu %08llu %08lld done \n", + GST_OBJECT_NAME (obj), time, now, diff); } diff --git a/gst/gstelement.c b/gst/gstelement.c index a30bc8632e..edb8504cbf 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -280,7 +280,7 @@ gst_element_add_pad (GstElement *element, GstPad *pad) g_return_if_fail (gst_object_check_uniqueness (element->pads, GST_PAD_NAME(pad)) == TRUE); /* set the pad's parent */ - GST_DEBUG (0,"setting parent of pad '%s' to '%s'\n", + GST_DEBUG (GST_CAT_ELEMENT_PADS,"setting parent of pad '%s' to '%s'\n", GST_PAD_NAME (pad), GST_ELEMENT_NAME (element)); gst_object_set_parent (GST_OBJECT (pad), GST_OBJECT (element)); @@ -318,17 +318,19 @@ gst_element_add_ghost_pad (GstElement *element, GstPad *pad, gchar *name) // then check to see if there's already a pad by that name here g_return_if_fail (gst_object_check_uniqueness (element->pads, name) == TRUE); - GST_DEBUG(0,"creating new ghost pad called %s, from pad %s:%s\n",name,GST_DEBUG_PAD_NAME(pad)); + GST_DEBUG(GST_CAT_ELEMENT_PADS,"creating new ghost pad called %s, from pad %s:%s\n", + name,GST_DEBUG_PAD_NAME(pad)); ghostpad = gst_ghost_pad_new (name, pad); /* add it to the list */ - GST_DEBUG(0,"adding ghost pad %s to element %s\n", name, GST_ELEMENT_NAME (element)); + GST_DEBUG(GST_CAT_ELEMENT_PADS,"adding ghost pad %s to element %s\n", + name, GST_ELEMENT_NAME (element)); element->pads = g_list_append (element->pads, ghostpad); element->numpads++; // set the parent of the ghostpad gst_object_set_parent (GST_OBJECT (ghostpad), GST_OBJECT (element)); - GST_DEBUG(0,"added ghostpad %s:%s\n",GST_DEBUG_PAD_NAME(ghostpad)); + GST_DEBUG(GST_CAT_ELEMENT_PADS,"added ghostpad %s:%s\n",GST_DEBUG_PAD_NAME(ghostpad)); /* emit the NEW_GHOST_PAD signal */ gtk_signal_emit (GTK_OBJECT (element), gst_element_signals[NEW_GHOST_PAD], ghostpad); @@ -485,7 +487,7 @@ gst_element_get_padtemplate_by_compatible (GstElement *element, GstPadTemplate * GstPadTemplate *newtempl = NULL; GList *padlist; - GST_DEBUG(0,"gst_element_get_padtemplate_by_compatible()\n"); + GST_DEBUG(GST_CAT_ELEMENT_PADS,"gst_element_get_padtemplate_by_compatible()\n"); g_return_val_if_fail (element != NULL, NULL); g_return_val_if_fail (GST_IS_ELEMENT (element), NULL); @@ -502,19 +504,19 @@ gst_element_get_padtemplate_by_compatible (GstElement *element, GstPadTemplate * // Check direction (must be opposite) // Check caps - GST_DEBUG(0,"checking direction and caps\n"); + GST_DEBUG(GST_CAT_CAPS,"checking direction and caps\n"); if (padtempl->direction == GST_PAD_SRC && compattempl->direction == GST_PAD_SINK) { - GST_DEBUG(0,"compatible direction: found src pad template\n"); + GST_DEBUG(GST_CAT_CAPS,"compatible direction: found src pad template\n"); compat = gst_caps_check_compatibility(GST_PADTEMPLATE_CAPS (padtempl), GST_PADTEMPLATE_CAPS (compattempl)); - GST_DEBUG(0,"caps are %scompatible\n", (compat?"":"not ")); + GST_DEBUG(GST_CAT_CAPS,"caps are %scompatible\n", (compat?"":"not ")); } else if (padtempl->direction == GST_PAD_SINK && compattempl->direction == GST_PAD_SRC) { - GST_DEBUG(0,"compatible direction: found sink pad template\n"); + GST_DEBUG(GST_CAT_CAPS,"compatible direction: found sink pad template\n"); compat = gst_caps_check_compatibility(GST_PADTEMPLATE_CAPS (compattempl), GST_PADTEMPLATE_CAPS (padtempl)); - GST_DEBUG(0,"caps are %scompatible\n", (compat?"":"not ")); + GST_DEBUG(GST_CAT_CAPS,"caps are %scompatible\n", (compat?"":"not ")); } if (compat) { diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c index 997cb20553..0e2f275ca1 100644 --- a/gst/gstelementfactory.c +++ b/gst/gstelementfactory.c @@ -68,7 +68,7 @@ gst_elementfactory_find (const gchar *name) g_return_val_if_fail(name != NULL, NULL); - GST_DEBUG (0,"gstelementfactory: find \"%s\"\n", name); + GST_DEBUG (GST_CAT_ELEMENTFACTORY,"gstelementfactory: find \"%s\"\n", name); walk = _gst_elementfactories; while (walk) { @@ -148,7 +148,7 @@ gst_elementfactory_create (GstElementFactory *factory, g_return_val_if_fail(factory != NULL, NULL); g_return_val_if_fail(name != NULL, NULL); - GST_DEBUG (0,"gstelementfactory: create \"%s\" \"%s\"\n", factory->name, name); + GST_DEBUG (GST_CAT_ELEMENTFACTORY,"gstelementfactory: create \"%s\" \"%s\"\n", factory->name, name); // it's not loaded, try to load the plugin if (factory->type == 0) { @@ -165,7 +165,7 @@ gst_elementfactory_create (GstElementFactory *factory, // attempt to set the elemenfactory class pointer if necessary oclass = GST_ELEMENT_CLASS(GTK_OBJECT(element)->klass); if (oclass->elementfactory == NULL) { - GST_DEBUG (0,"gstelementfactory: class %s\n", factory->name); + GST_DEBUG (GST_CAT_ELEMENTFACTORY,"gstelementfactory: class %s\n", factory->name); oclass->elementfactory = factory; } @@ -194,7 +194,7 @@ gst_elementfactory_make (const gchar *factoryname, const gchar *name) g_return_val_if_fail(factoryname != NULL, NULL); g_return_val_if_fail(name != NULL, NULL); - GST_DEBUG (0,"gstelementfactory: make \"%s\" \"%s\"\n", factoryname, name); + GST_DEBUG (GST_CAT_ELEMENTFACTORY,"gstelementfactory: make \"%s\" \"%s\"\n", factoryname, name); //gst_plugin_load_elementfactory(factoryname); factory = gst_elementfactory_find(factoryname); diff --git a/gst/gstinfo.c b/gst/gstinfo.c index 7dea925a17..4efa3ba04b 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -48,7 +48,7 @@ static gchar *_gst_info_category_strings[] = { "AUTOPLUG_ATTEMPT", "PARENTAGE", "STATES", - "PLANING", + "PLANNING", "SCHEDULING", "OPERATION", "BUFFER", @@ -129,6 +129,10 @@ gst_default_info_handler (gint category, gchar *file, gchar *function, { gchar *empty = ""; gchar *elementname = empty,*location = empty; + int cothread_id = cothread_getcurrent(); +#ifdef GST_DEBUG_COLOR + int cothread_color = (cothread_id < 0) ? 37 : (cothread_id%6 + 31); +#endif if (debug_string == NULL) debug_string = ""; if (category != GST_CAT_GST_INIT) @@ -138,11 +142,12 @@ gst_default_info_handler (gint category, gchar *file, gchar *function, #ifdef GST_DEBUG_ENABLED #ifdef GST_DEBUG_COLOR - fprintf(stderr,"INFO(%d:%d):\033[" GST_DEBUG_CHAR_MODE ";%sm%s%s\033[00m %s\n", - getpid(),cothread_getcurrent(),_gst_category_colors[category],location,elementname,string); + fprintf(stderr,"INFO(%d:\033[00;%dm%d\033[00m):\033[" GST_DEBUG_CHAR_MODE ";%sm%s%s\033[00m %s\n", + getpid(),cothread_color,cothread_id, + _gst_category_colors[category],location,elementname,string); #else fprintf(stderr,"INFO(%d:%d):%s%s %s\n", - getpid(),cothread_getcurrent(),location,elementname,string); + getpid(),cothread_id,location,elementname,string); #endif /* GST_DEBUG_COLOR */ #else #ifdef GST_DEBUG_COLOR diff --git a/gst/gstpad.c b/gst/gstpad.c index abfdc39da4..4327ac5fe8 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -343,7 +343,7 @@ void gst_pad_set_chain_function (GstPad *pad, g_return_if_fail (GST_IS_REAL_PAD (pad)); GST_RPAD_CHAINFUNC(pad) = chain; - GST_DEBUG (0,"chainfunc for %s:%s is set to %p\n",GST_DEBUG_PAD_NAME(pad),chain); + GST_DEBUG (GST_CAT_PADS,"chainfunc for %s:%s is set to %p\n",GST_DEBUG_PAD_NAME(pad),chain); } /** @@ -361,7 +361,7 @@ gst_pad_set_get_function (GstPad *pad, g_return_if_fail (GST_IS_REAL_PAD (pad)); GST_RPAD_GETFUNC(pad) = get; - GST_DEBUG (0,"getfunc for %s:%s(@%p) at %p is set to %p\n", + GST_DEBUG (GST_CAT_PADS,"getfunc for %s:%s(@%p) at %p is set to %p\n", GST_DEBUG_PAD_NAME(pad),pad,&GST_RPAD_GETFUNC(pad),get); } @@ -380,7 +380,7 @@ gst_pad_set_getregion_function (GstPad *pad, g_return_if_fail (GST_IS_REAL_PAD (pad)); GST_RPAD_GETREGIONFUNC(pad) = getregion; - GST_DEBUG (0,"getregionfunc for %s:%s(@%p) at %p is set to %p\n", + GST_DEBUG (GST_CAT_PADS,"getregionfunc for %s:%s(@%p) at %p is set to %p\n", GST_DEBUG_PAD_NAME(pad),pad,&GST_RPAD_GETREGIONFUNC(pad),getregion); } @@ -399,7 +399,7 @@ gst_pad_set_qos_function (GstPad *pad, g_return_if_fail (GST_IS_REAL_PAD (pad)); GST_RPAD_QOSFUNC(pad) = qos; - GST_DEBUG (0,"qosfunc for %s:%s(@%p) at %p is set to %p\n", + GST_DEBUG (GST_CAT_PADS,"qosfunc for %s:%s(@%p) at %p is set to %p\n", GST_DEBUG_PAD_NAME(pad),pad,&GST_RPAD_QOSFUNC(pad),qos); } @@ -418,7 +418,7 @@ gst_pad_set_eos_function (GstPad *pad, g_return_if_fail (GST_IS_REAL_PAD (pad)); GST_RPAD_EOSFUNC(pad) = eos; - GST_DEBUG (0,"eosfunc for %s:%s(@%p) at %p is set to %p\n", + GST_DEBUG (GST_CAT_PADS,"eosfunc for %s:%s(@%p) at %p is set to %p\n", GST_DEBUG_PAD_NAME(pad),pad,&GST_RPAD_EOSFUNC(pad),eos); } @@ -437,7 +437,7 @@ gst_pad_set_negotiate_function (GstPad *pad, g_return_if_fail (GST_IS_REAL_PAD (pad)); GST_RPAD_NEGOTIATEFUNC(pad) = nego; - GST_DEBUG (0,"negotiatefunc for %s:%s(@%p) at %p is set to %p\n", + GST_DEBUG (GST_CAT_PADS,"negotiatefunc for %s:%s(@%p) at %p is set to %p\n", GST_DEBUG_PAD_NAME(pad),pad,&GST_RPAD_NEGOTIATEFUNC(pad),nego); } @@ -457,7 +457,7 @@ gst_pad_set_newcaps_function (GstPad *pad, g_return_if_fail (GST_IS_REAL_PAD (pad)); GST_RPAD_NEWCAPSFUNC (pad) = newcaps; - GST_DEBUG (0,"newcapsfunc for %s:%s(@%p) at %p is set to %p\n", + GST_DEBUG (GST_CAT_PADS,"newcapsfunc for %s:%s(@%p) at %p is set to %p\n", GST_DEBUG_PAD_NAME(pad),pad,&GST_RPAD_NEWCAPSFUNC(pad),newcaps); } @@ -476,7 +476,7 @@ gst_pad_set_bufferpool_function (GstPad *pad, g_return_if_fail (GST_IS_REAL_PAD (pad)); GST_RPAD_BUFFERPOOLFUNC (pad) = bufpool; - GST_DEBUG (0,"bufferpoolfunc for %s:%s(@%p) at %p is set to %p\n", + GST_DEBUG (GST_CAT_PADS,"bufferpoolfunc for %s:%s(@%p) at %p is set to %p\n", GST_DEBUG_PAD_NAME (pad), pad, &GST_RPAD_BUFFERPOOLFUNC (pad), bufpool); } @@ -484,10 +484,10 @@ static void gst_pad_push_func(GstPad *pad, GstBuffer *buf) { if (GST_RPAD_CHAINFUNC(GST_RPAD_PEER(pad)) != NULL) { - GST_DEBUG (0,"calling chain function\n"); + GST_DEBUG (GST_CAT_DATAFLOW,"calling chain function\n"); (GST_RPAD_CHAINFUNC(GST_RPAD_PEER(pad)))(pad,buf); } else { - GST_DEBUG (0,"got a problem here: default pad_push handler in place, no chain function\n"); + GST_DEBUG (GST_CAT_DATAFLOW,"got a problem here: default pad_push handler in place, no chain function\n"); } } @@ -507,7 +507,7 @@ gst_pad_handle_qos(GstPad *pad, GList *pads; GstPad *target_pad; - GST_DEBUG (0,"gst_pad_handle_qos(\"%s\",%08ld)\n", GST_OBJECT_NAME (GST_PAD_PARENT (pad)),qos_message); + GST_DEBUG (GST_CAT_PADS,"gst_pad_handle_qos(\"%s\",%08ld)\n", GST_OBJECT_NAME (GST_PAD_PARENT (pad)),qos_message); if (GST_RPAD_QOSFUNC(pad)) { (GST_RPAD_QOSFUNC(pad)) (pad,qos_message); @@ -515,7 +515,7 @@ gst_pad_handle_qos(GstPad *pad, element = GST_ELEMENT (GST_PAD_PARENT(GST_RPAD_PEER(pad))); pads = element->pads; - GST_DEBUG (0,"gst_pad_handle_qos recurse(\"%s\",%08ld)\n", GST_ELEMENT_NAME (element), qos_message); + GST_DEBUG (GST_CAT_PADS,"gst_pad_handle_qos recurse(\"%s\",%08ld)\n", GST_ELEMENT_NAME (element), qos_message); while (pads) { target_pad = GST_PAD (pads->data); if (GST_RPAD_DIRECTION(target_pad) == GST_PAD_SINK) { @@ -939,7 +939,7 @@ gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad) } } else { - GST_DEBUG (0,"gstpad: could not check capabilities of pads (%s:%s) and (%s:%s) %p %p\n", + GST_DEBUG (GST_CAT_PADS,"could not check capabilities of pads (%s:%s) and (%s:%s) %p %p\n", GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad), GST_PAD_CAPS (srcpad), GST_PAD_CAPS (sinkpad)); return TRUE; @@ -987,11 +987,11 @@ gst_pad_get_bufferpool (GstPad *pad) GST_DEBUG_ENTER("(%s:%s)",GST_DEBUG_PAD_NAME(pad)); if (peer->bufferpoolfunc) { - GST_DEBUG (0,"calling bufferpoolfunc &%s (@%p) of peer pad %s:%s\n", + GST_DEBUG (GST_CAT_PADS,"calling bufferpoolfunc &%s (@%p) of peer pad %s:%s\n", GST_DEBUG_FUNCPTR_NAME(peer->bufferpoolfunc),&peer->bufferpoolfunc,GST_DEBUG_PAD_NAME(((GstPad*)peer))); return (peer->bufferpoolfunc)(((GstPad*)peer)); } else { - GST_DEBUG (0,"no bufferpoolfunc for peer pad %s:%s at %p\n",GST_DEBUG_PAD_NAME(((GstPad*)peer)),&peer->bufferpoolfunc); + GST_DEBUG (GST_CAT_PADS,"no bufferpoolfunc for peer pad %s:%s at %p\n",GST_DEBUG_PAD_NAME(((GstPad*)peer)),&peer->bufferpoolfunc); return NULL; } } @@ -1365,11 +1365,11 @@ gst_pad_push (GstPad *pad, GstBuffer *buf) GST_DEBUG_ENTER ("(%s:%s)", GST_DEBUG_PAD_NAME (pad)); if (peer->pushfunc) { - GST_DEBUG (0, "calling pushfunc &%s of peer pad %s:%s\n", + GST_DEBUG (GST_CAT_DATAFLOW, "calling pushfunc &%s of peer pad %s:%s\n", GST_DEBUG_FUNCPTR_NAME (peer->pushfunc), GST_DEBUG_PAD_NAME (((GstPad*)peer))); (peer->pushfunc) (((GstPad*)peer), buf); } else - GST_DEBUG (0, "no pushfunc\n"); + GST_DEBUG (GST_CAT_DATAFLOW, "no pushfunc\n"); } #endif @@ -1392,11 +1392,11 @@ gst_pad_pull (GstPad *pad) GST_DEBUG_ENTER("(%s:%s)",GST_DEBUG_PAD_NAME(pad)); if (peer->pullfunc) { - GST_DEBUG (0,"calling pullfunc &%s (@%p) of peer pad %s:%s\n", + GST_DEBUG (GST_CAT_DATAFLOW,"calling pullfunc &%s (@%p) of peer pad %s:%s\n", GST_DEBUG_FUNCPTR_NAME(peer->pullfunc),&peer->pullfunc,GST_DEBUG_PAD_NAME(((GstPad*)peer))); return (peer->pullfunc)(((GstPad*)peer)); } else { - GST_DEBUG (0,"no pullfunc for peer pad %s:%s at %p\n",GST_DEBUG_PAD_NAME(((GstPad*)peer)),&peer->pullfunc); + GST_DEBUG (GST_CAT_DATAFLOW,"no pullfunc for peer pad %s:%s at %p\n",GST_DEBUG_PAD_NAME(((GstPad*)peer)),&peer->pullfunc); return NULL; } } @@ -1427,11 +1427,11 @@ gst_pad_pullregion (GstPad *pad, GstRegionType type, guint64 offset, guint64 len GST_DEBUG_ENTER("(%s:%s,%d,%lld,%lld)",GST_DEBUG_PAD_NAME(pad),type,offset,len); if (peer->pullregionfunc) { - GST_DEBUG (0,"calling pullregionfunc &%s of peer pad %s:%s\n", + GST_DEBUG (GST_CAT_DATAFLOW,"calling pullregionfunc &%s of peer pad %s:%s\n", GST_DEBUG_FUNCPTR_NAME(peer->pullregionfunc),GST_DEBUG_PAD_NAME(((GstPad*)peer))); return (peer->pullregionfunc)(((GstPad*)peer),type,offset,len); } else { - GST_DEBUG (0,"no pullregionfunc\n"); + GST_DEBUG (GST_CAT_DATAFLOW,"no pullregionfunc\n"); return NULL; } } @@ -1575,7 +1575,7 @@ gst_padtemplate_save_thyself (GstPadTemplate *templ, xmlNodePtr parent) xmlNodePtr subtree; guchar *presence; - GST_DEBUG (0,"saving padtemplate %s\n", templ->name_template); + GST_DEBUG (GST_CAT_XML,"saving padtemplate %s\n", templ->name_template); xmlNewChild(parent,NULL,"nametemplate", templ->name_template); xmlNewChild(parent,NULL,"direction", (templ->direction == GST_PAD_SINK? "sink":"src")); @@ -1834,7 +1834,7 @@ gst_ghost_pad_new (gchar *name, // FIXME need to ref the real pad here... ? - GST_DEBUG(0,"created ghost pad \"%s\"\n",name); + GST_DEBUG(GST_CAT_PADS,"created ghost pad \"%s\"\n",name); return GST_PAD(ghostpad); } diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index c6ba7ab913..47b2b1c696 100644 --- a/gst/gstpipeline.c +++ b/gst/gstpipeline.c @@ -123,7 +123,7 @@ gst_pipeline_new (const guchar *name) static void gst_pipeline_prepare (GstPipeline *pipeline) { - GST_DEBUG (0,"GstPipeline: preparing pipeline \"%s\" for playing\n", + GST_DEBUG (GST_CAT_PIPELINE,"preparing pipeline \"%s\" for playing (DEPRACATED!!)\n", GST_ELEMENT_NAME(GST_ELEMENT(pipeline))); } diff --git a/gst/gstthread.c b/gst/gstthread.c index b631bc1405..69f73b5606 100644 --- a/gst/gstthread.c +++ b/gst/gstthread.c @@ -130,7 +130,7 @@ static void gst_thread_init (GstThread *thread) { - GST_DEBUG (0,"initializing thread '%s'\n",GST_ELEMENT_NAME (thread)); + GST_DEBUG (GST_CAT_THREAD,"initializing thread '%s'\n",GST_ELEMENT_NAME (thread)); // we're a manager by default GST_FLAG_SET (thread, GST_BIN_FLAG_MANAGER); @@ -170,11 +170,11 @@ gst_thread_set_arg (GtkObject *object, if (GTK_VALUE_BOOL (*arg)) { GST_INFO (GST_CAT_THREAD,"turning ON the creation of the thread"); GST_FLAG_SET (object, GST_THREAD_CREATE); -// GST_DEBUG (0,"flags are 0x%08x\n", GST_FLAGS (object)); +// GST_DEBUG (GST_CAT_THREAD,"flags are 0x%08x\n", GST_FLAGS (object)); } else { GST_INFO (GST_CAT_THREAD,"gstthread: turning OFF the creation of the thread"); GST_FLAG_UNSET (object, GST_THREAD_CREATE); -// GST_DEBUG (0,"gstthread: flags are 0x%08x\n", GST_FLAGS (object)); +// GST_DEBUG (GST_CAT_THREAD,"gstthread: flags are 0x%08x\n", GST_FLAGS (object)); } break; default: @@ -469,7 +469,7 @@ gst_thread_main_loop (void *arg) while (GST_FLAG_IS_SET (thread, GST_THREAD_STATE_SPINNING)) { if (!gst_bin_iterate (GST_BIN (thread))) { GST_FLAG_UNSET (thread, GST_THREAD_STATE_SPINNING); - GST_DEBUG(0,"sync: removed spinning state due to failed iteration\n"); + GST_DEBUG(GST_CAT_THREAD,"sync: removed spinning state due to failed iteration\n"); } } GST_DEBUG (GST_CAT_THREAD, "sync: waiting at bottom of while for signal from main process\n"); @@ -528,7 +528,7 @@ static void gst_thread_restore_thyself (GstObject *object, xmlNodePtr self) { - GST_DEBUG (0,"gstthread: restore\n"); + GST_DEBUG (GST_CAT_THREAD,"gstthread: restore\n"); if (GST_OBJECT_CLASS (parent_class)->restore_thyself) GST_OBJECT_CLASS (parent_class)->restore_thyself (object, self); diff --git a/gst/gsttype.c b/gst/gsttype.c index 437da194df..744089885e 100644 --- a/gst/gsttype.c +++ b/gst/gsttype.c @@ -80,7 +80,7 @@ gst_type_register (GstTypeFactory *factory) _gst_types = g_list_prepend (_gst_types, type); id = type->id; - GST_DEBUG (0,"gsttype: new mime type '%s', id %d\n", type->mime, type->id); + GST_DEBUG (GST_CAT_TYPES,"gsttype: new mime type '%s', id %d\n", type->mime, type->id); } else { type = gst_type_find_by_id (id); @@ -108,12 +108,12 @@ guint16 gst_type_find_by_mime_func (const gchar *mime) g_return_val_if_fail (mime != NULL, 0); walk = _gst_types; -// GST_DEBUG (0,"searching for '%s'\n",mime); +// GST_DEBUG (GST_CAT_TYPES,"searching for '%s'\n",mime); mimelen = strlen (mime); while (walk) { type = (GstType *)walk->data; search = type->mime; -// GST_DEBUG (0,"checking against '%s'\n",search); +// GST_DEBUG (GST_CAT_TYPES,"checking against '%s'\n",search); typelen = strlen (search); while ((search - type->mime) < typelen) { found = strstr (search, mime); @@ -232,7 +232,7 @@ gst_type_typefind_dummy (GstBuffer *buffer, gpointer priv) guint16 typeid; GSList *funcs; - GST_DEBUG (0,"gsttype: need to load typefind function for %s\n", type->mime); + GST_DEBUG (GST_CAT_TYPES,"gsttype: need to load typefind function for %s\n", type->mime); type->typefindfuncs = NULL; gst_plugin_load_typefactory (type->mime); diff --git a/gst/gstutils.c b/gst/gstutils.c index 3e4f6648d9..95f428163e 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -235,6 +235,7 @@ gst_util_set_object_arg (GtkObject *object, guchar *name, gchar *value) case GTK_TYPE_STRING: gtk_object_set (GTK_OBJECT (object), name, value, NULL); break; + case GTK_TYPE_ENUM: case GTK_TYPE_INT: { gint i; sscanf (value, "%d", &i); @@ -284,7 +285,12 @@ gst_util_set_object_arg (GtkObject *object, guchar *name, gchar *value) break; } default: - if (info->type == GST_TYPE_FILENAME) { + if (GTK_FUNDAMENTAL_TYPE(info->type) == GTK_TYPE_ENUM) { + gint i; + sscanf (value, "%d", &i); + gtk_object_set (GTK_OBJECT (object), name, i, NULL); + } + else if (info->type == GST_TYPE_FILENAME) { gtk_object_set (GTK_OBJECT (object), name, value, NULL); } break;