GST_DEBUG reorganization containing loads of stuff:

Original commit message from CVS:
GST_DEBUG reorganization
This is a big diff (ca 450k), containing loads of stuff:
- gstinfo.[ch] complete rewrite
- changing of all GST_DEBUG messages to reflect that change
- reorganization of subsystem disabling
- addition of gstconfig.h.in so we can track the disablings
- <gst/gst.h> does not include <unistd.h> and <config.h> anymore
- documentation updated for gstinfo stuff (build the docs yourself to know what changed)
- bugfixes for making of the docs (files from CVS are not deleted anymore
- testsuite for debugging changes in testsuite/debug

expect breakage
This commit is contained in:
Benjamin Otte 2003-06-29 14:05:49 +00:00
parent 30438fd472
commit 803ce6bf48
190 changed files with 4716 additions and 2581 deletions

2
common

@ -1 +1 @@
Subproject commit 4e379694ae9ff9843d65cf08928642eea44abdf8
Subproject commit 2a3efdc282fb1ecfd2720dea40523b3441f10fed

View file

@ -255,8 +255,6 @@ AC_HELP_STRING([--enable-plugin-builddir],[allow tests/demos to use non-installe
esac],
[PLUGINS_USE_BUILDDIR=no]) dnl Default value
GST_DEBUGINFO
AC_ARG_ENABLE(profiling,
AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
[case "${enableval}" in
@ -327,6 +325,18 @@ AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
dnl Next, check for the optional components:
dnl ========================================
dnl debugging stuff
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--disable-debug],[disable addition of -g debugging info]),
[case "${enableval}" in
yes) USE_DEBUG=yes ;;
no) USE_DEBUG=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],
[USE_DEBUG=yes]) dnl Default value
translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_GST_DEBUG, true)
GST_SUBSYSTEM_DISABLE(GST_DEBUG,[debugging subsystem])
translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
@ -351,8 +361,6 @@ GST_SUBSYSTEM_DISABLE(PLUGIN,[plugin])
translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_URI, true)
GST_SUBSYSTEM_DISABLE(URI,[uri handlers])
GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
dnl ################################################
dnl # Set defines according to variables set above #
dnl ################################################
@ -514,6 +522,7 @@ AC_OUTPUT(
Makefile
include/Makefile
gst/Makefile
gst/gstconfig.h
gst/gstversion.h
gst/autoplug/Makefile
gst/indexers/Makefile
@ -541,6 +550,7 @@ testsuite/bytestream/Makefile
testsuite/caps/Makefile
testsuite/cleanup/Makefile
testsuite/clock/Makefile
testsuite/debug/Makefile
testsuite/dynparams/Makefile
testsuite/elements/Makefile
testsuite/indexers/Makefile
@ -569,7 +579,6 @@ tools/Makefile
docs/Makefile
docs/faq/Makefile
docs/gst/Makefile
docs/gst/gstreamer.types
docs/libs/Makefile
docs/manual/Makefile
docs/pwg/Makefile

View file

@ -113,6 +113,7 @@ DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
SCANOBJ_FILES = \
$(DOC_MODULE).args \
$(DOC_MODULE).hierarchy \
$(DOC_MODULE)-scan.o \
$(DOC_MODULE).signals
if HAVE_GTK_DOC
@ -182,12 +183,15 @@ clean-local:
maintainer-clean-local: clean
cd $(srcdir) && rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
# company: don't delete .sgml and -sections.txt as they're in CVS
# FIXME : thomas added all sgml files and some other things to make
# make distcheck work
distclean-local: clean
rm -rf $(DOC_MODULE)-decl-list.txt
rm -rf $(DOC_MODULE)-*.txt
rm -rf tmpl/*.sgml
rm -rf $(DOC_MODULE)-decl.txt
rm -rf $(DOC_MODULE)-undocumented.txt
rm -rf $(DOC_MODULE)-unused.txt
rm -rf tmpl/*.sgml.bak
rm -f $(DOC_MODULE).hierarchy
rm -f *.stamp || true

View file

@ -3,23 +3,21 @@
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY Gst SYSTEM "xml/gst.xml">
<!ENTITY GstAutoplug SYSTEM "xml/gstautoplug.xml">
<!ENTITY GstAutoplugFactory SYSTEM "xml/gstautoplugfactory.xml">
<!ENTITY GstAtomic SYSTEM "xml/gstatomic.xml">
<!ENTITY GstBin SYSTEM "xml/gstbin.xml">
<!ENTITY GstConfig SYSTEM "xml/gstconfig.xml">
<!ENTITY GstData SYSTEM "xml/gstdata.xml">
<!ENTITY GstBuffer SYSTEM "xml/gstbuffer.xml">
<!ENTITY GstEvent SYSTEM "xml/gstevent.xml">
<!ENTITY GstBufferPool SYSTEM "xml/gstbufferpool.xml">
<!ENTITY GstBufferPool SYSTEM "xml/gstbuffer.xml">
<!ENTITY GstCpu SYSTEM "xml/gstcpu.xml">
<!ENTITY GstElement SYSTEM "xml/gstelement.xml">
<!ENTITY GstElementFactory SYSTEM "xml/gstelementfactory.xml">
<!ENTITY GstFormat SYSTEM "xml/gstformat.xml">
<!ENTITY GstInfo SYSTEM "xml/gstinfo.xml">
<!ENTITY GstLog SYSTEM "xml/gstlog.xml">
<!ENTITY GstMemChunk SYSTEM "xml/gstmemchunk.xml">
<!ENTITY GstObject SYSTEM "xml/gstobject.xml">
<!ENTITY GstPad SYSTEM "xml/gstpad.xml">
<!ENTITY GstPadTemplate SYSTEM "xml/gstpadtemplate.xml">
<!ENTITY GstParse SYSTEM "xml/gstparse.xml">
<!ENTITY GstProbe SYSTEM "xml/gstprobe.xml">
<!ENTITY GstPipeline SYSTEM "xml/gstpipeline.xml">
@ -30,10 +28,9 @@
<!ENTITY GstRegistry SYSTEM "xml/gstregistry.xml">
<!ENTITY GstRegistryPool SYSTEM "xml/gstregistrypool.xml">
<!ENTITY GstScheduler SYSTEM "xml/gstscheduler.xml">
<!ENTITY GstSchedulerFactory SYSTEM "xml/gstschedulerfactory.xml">
<!ENTITY GstTrace SYSTEM "xml/gsttrace.xml">
<!ENTITY GstType SYSTEM "xml/gsttype.xml">
<!ENTITY GstTypeFactory SYSTEM "xml/gsttypefactory.xml">
<!ENTITY GstTypeFactory SYSTEM "xml/gsttype.xml">
<!ENTITY GstCaps SYSTEM "xml/gstcaps.xml">
<!ENTITY GstProps SYSTEM "xml/gstprops.xml">
<!ENTITY GstClock SYSTEM "xml/gstclock.xml">
@ -46,7 +43,6 @@
<!ENTITY GstTypeFind SYSTEM "xml/gsttypefind.xml">
-->
<!ENTITY GstIndex SYSTEM "xml/gstindex.xml">
<!ENTITY GstIndexFactory SYSTEM "xml/gstindexfactory.xml">
<!ENTITY cothreads SYSTEM "xml/cothreads.xml">
<!-- if none of the API is documented, these shouldn't go in
@ -67,6 +63,8 @@
<!ENTITY GstTee SYSTEM "xml/gsttee.xml">
<!ENTITY gstreamer-tree-index SYSTEM "xml/tree_index.xml">
<!ENTITY hash "#">
]>
<book>
<bookinfo>
@ -92,24 +90,20 @@ with some more specialized elements.</para>
&Gst;
&GstAutoplug;
&GstAutoplugFactory;
&GstBin;
&GstBuffer;
&GstBufferPool;
&GstConfig;
&GstCaps;
&GstClock;
&GstCpu;
&GstData;
&GstElement;
&GstElementFactory;
&GstEvent;
&GstFormat;
&GstIndex;
&GstIndexFactory;
&GstInfo;
&GstObject;
&GstPad;
&GstPadTemplate;
&GstParse;
&GstPipeline;
&GstPlugin;
@ -122,11 +116,9 @@ with some more specialized elements.</para>
&GstRegistry;
&GstRegistryPool;
&GstScheduler;
&GstSchedulerFactory;
&GstSystemClock;
&GstThread;
&GstType;
&GstTypeFactory;
<!-- no API docs
&GstTypeFind; -->
&GstUri;

View file

@ -82,41 +82,72 @@ gst_marshal_VOID__VOID
<SECTION>
<FILE>gstinfo</FILE>
<TITLE>GstInfo</TITLE>
gst_get_category_name
gst_info_get_categories
gst_info_set_categories
gst_info_enable_category
gst_info_disable_category
gst_default_info_handler
GST_INFO_ENABLED
GST_STR_NULL
GST_DEBUG_PAD_NAME
GST_FUNCTION
<SUBSECTION>
GstDebugLevel
GST_LEVEL_DEFAULT
gst_debug_level_get_name
GstDebugColorFlags
gst_debug_construct_term_color
GstDebugCategory
GST_CAT_DEFAULT
<SUBSECTION>
GstLogFunction
gst_debug_log
gst_debug_logv
gst_debug_log_default
gst_debug_add_log_function
gst_debug_remove_log_function
gst_debug_remove_log_function_by_data
<SUBSECTION>
gst_debug_set_active
gst_debug_is_active
gst_debug_set_colored
gst_debug_is_colored
gst_debug_set_default_threshold
gst_debug_get_default_threshold
gst_debug_set_threshold_for_name
gst_debug_unset_threshold_for_name
<SUBSECTION>
GST_DEBUG_CATEGORY
GST_DEBUG_CATEGORY_EXTERN
GST_DEBUG_CATEGORY_STATIC
GST_DEBUG_CATEGORY_INIT
gst_debug_category_free
gst_debug_category_set_threshold
gst_debug_category_reset_threshold
gst_debug_category_get_threshold
gst_debug_category_get_name
gst_debug_category_get_color
gst_debug_category_get_description
gst_debug_get_all_categories
<SUBSECTION>
GST_CAT_LEVEL_LOG
GST_INFO
GST_INFO_ELEMENT
gst_debug_get_categories
gst_debug_set_categories
gst_debug_enable_category
gst_debug_disable_category
GST_DEBUG_ENTER
GST_DEBUG_LEAVE
GST_DEBUG
GST_CAT_ERROR_OBJECT
GST_CAT_WARNING_OBJECT
GST_CAT_INFO_OBJECT
GST_CAT_DEBUG_OBJECT
GST_CAT_LOG_OBJECT
GST_CAT_ERROR
GST_CAT_WARNING
GST_CAT_LOG
GST_ERROR_OBJECT
GST_WARNING_OBJECT
GST_INFO_OBJECT
GST_DEBUG_OBJECT
GST_LOG_OBJECT
GST_ERROR
GST_WARNING
GST_CAT_INFO
GST_CAT_DEBUG
GST_LOG
<SUBSECTION>
GST_DEBUG_FUNCPTR
GST_DEBUG_FUNCPTR_NAME
GST_DEBUG_PAD_NAME
GST_DEBUG_THREAD_ARGS
GST_DEBUG_THREAD_FORMAT
GST_DEBUG_ELEMENT
GST_ERROR
GST_ERROR_OBJECT
GstDebugHandler
gst_default_debug_handler
gst_default_error_handler
GstInfoHandler
GstErrorHandler
<SUBSECTION Standard>
gst_debug_print_stack_trace
GST_DEBUG_CHAR_MODE
GST_DEBUG_ENABLED
GST_DEBUG_ENABLE_CATEGORIES
</SECTION>
<SECTION>
@ -166,6 +197,23 @@ GST_SCHEDULER_FACTORY_GET_CLASS
GST_SCHEDULER_GET_CLASS
</SECTION>
<SECTION>
<FILE>gstconfig</FILE>
GST_DISABLE_ALLOC_TRACE
GST_DISABLE_AUTOPLUG
GST_DISABLE_ENUMTYPES
GST_DISABLE_GST_DEBUG
GST_DISABLE_INDEX
GST_DISABLE_LOADSAVE
GST_DISABLE_LOADSAVE_REGISTRY
GST_DISABLE_PARSE
GST_DISABLE_PLUGIN
GST_DISABLE_TRACE
GST_DISABLE_TYPEFIND
GST_DISABLE_URI
GST_DISABLE_REGISTRY
</SECTION>
<SECTION>
<FILE>gstschedulerfactory</FILE>
<TITLE>GstSchedulerFactory</TITLE>

View file

@ -0,0 +1,131 @@
<!-- ##### SECTION Title ##### -->
GstConfig
<!-- ##### SECTION Short_Description ##### -->
configuration options
<!-- ##### SECTION Long_Description ##### -->
<para>
This describes the configureation options for GStreamer. When building
GStreamer there are a lot of parts (known internally as "subsystems" ) that can
be disabled for various reasons. The most common reasons are speed and size,
which is important because GStreamer is designed to run on embedded systems.
</para>
<para>
If a subsystem is disabled, most of this changes are done in an API compatible
way, so you don't need to adapt your code in most cases. It is never done in an
ABI compatible way though. So if you want to disable a suybsystem, you have to
rebuild all programs depending on GStreamer, too.
</para>
<para>
If a subsystem is disabled in GStreamer, a value is defined in
&lt;gst/gst.h&gt;. You can check this if you do subsystem-specific stuff.
<example>
<title>Doing subsystem specific things</title>
<programlisting>
&hash;ifndef GST_DISABLE_GST_DEBUG
/* do stuff specific to the debugging subsystem */
&hash;endif /* GST_DISABLE_GST_DEBUG */
</programlisting>
</example>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### MACRO GST_DISABLE_LOADSAVE_REGISTRY ##### -->
<para>
</para>
<!-- ##### MACRO GST_DISABLE_GST_DEBUG ##### -->
<para>
If this is defined, the <link linkend="gstreamer-gstinfo">debugging subsystem
</link> is disabled and debugging messages are not output.
</para>
<!-- ##### MACRO GST_DISABLE_LOADSAVE ##### -->
<para>
</para>
<!-- ##### MACRO GST_DISABLE_TYPEFIND ##### -->
<para>
</para>
<!-- ##### MACRO GST_DISABLE_AUTOPLUG ##### -->
<para>
</para>
<!-- ##### MACRO GST_DISABLE_PARSE ##### -->
<para>
</para>
<!-- ##### MACRO GST_DISABLE_TRACE ##### -->
<para>
</para>
<!-- ##### MACRO GST_DISABLE_ALLOC_TRACE ##### -->
<para>
</para>
<!-- ##### MACRO GST_DISABLE_REGISTRY ##### -->
<para>
</para>
<!-- ##### MACRO GST_DISABLE_ENUMTYPES ##### -->
<para>
</para>
<!-- ##### MACRO GST_DISABLE_INDEX ##### -->
<para>
</para>
<!-- ##### MACRO GST_DISABLE_PLUGIN ##### -->
<para>
</para>
<!-- ##### MACRO GST_DISABLE_URI ##### -->
<para>
</para>

View file

@ -2,315 +2,668 @@
GstInfo
<!-- ##### SECTION Short_Description ##### -->
info/debugging/error handling
debugging subsystem
<!-- ##### SECTION Long_Description ##### -->
<para>
gstinfo.c contains a number of debuggins subsystems.
This file describes the debugging subsystem. The debugging subsystem works
only after GStreamer was initilized - for example by calling #gst_init.
</para>
<para>The INFO subsystem is used to provide informative printouts to
application and plugin developers. These messages can be enabled and
disabled via a category system, which is a bitmask enabling you to turn
on and off any subset of categories.</para>
<para>The DEBUG subsystem is similar, but is intended for core developers
and those writing more complex pipelines or filters. It uses the same
category system, but must be enabled at configure time else it's not
compiled into the library. autogen.sh automatically enables the DEBUG
subsystem.
<para>
The debugging subsystem is used to send informational strings to the debugging
developer. Each messages has some properties attached to it. These properties
are the debugging category, the severity (called "level" here) and an obtional
#GObject it belongs to. Each of these messages is sent to all registered
debugging handlers, which then handle the messages. GStreamer attaches a
default handler on startup, which outputs requested messages to stderr.
</para>
<para>The ERROR subsystem doesn't use categories, but will print out a
more verbose message, and attempt to print out a stack trace of the error
before aborting the application.
<para>
Messages are output by using shortcut macros like #GST_DEBUG,
#GST_CAT_ERROR_OBJECT or similar. These all expand to calling #gst_debug_log
with the right parameters.
The only thing a developer will probably want to do is define his own
categories. This is easily done with 3 lines. At the top of your code, declare
the variables and set the default category.
<informalexample>
<programlisting>
GST_DEBUG_CATEGORY (my_category); /* define category */
&hash;define GST_CAT_DEFAULT my_category /* set as default */
</programlisting>
</informalexample>
After that you only need to initialize the category.
<informalexample>
<programlisting>
GST_DEBUG_CATEGORY_INIT (my_category, "my category", 0, "This is my very own");
</programlisting>
</informalexample>
Initialization must be done before the category is used first. Plugins do this
in their plugin_init function, libraries and applications should do that
during their initialization.
</para>
<para>
The whole debugging subsystem can be disabled at build time with passing the
--disable-gst-debug switch to configure. If this is done, every function, macro
and even structs described in this file evaluate to default values or nothing
at all. So don't take addresses of these functions or use other tricks.
If you must do that for some reason, there is still an option. If the debugging
subsystem was compiled out, #GST_DISABLE_GST_DEBUG is defined in &lt;gst/gst.h&gt;,
so you can check that before doing your trick.
Disabling the debugging subsystem will give you a slight (read: unnoticable)
speed increase and will reduce the size of your compiled code. The GStreamer
library itself becomes around 10% smaller.
</para>
<para>
Please note that there are naming conventions for the names of debugging
categories. These are explained at GST_DEBUG_CATEGORY_INIT().
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
<link linkend="gstreamer-gstconfig">configuration</link>,
<link linkend="gstreamer-gst">initialization</link> for command line parameters
and environment variables that affect the debugging output.
</para>
<!-- ##### FUNCTION gst_get_category_name ##### -->
<!-- ##### MACRO GST_STR_NULL ##### -->
<para>
Macro to use when a string must not be NULL, but may be NULL. If the string is
NULL, "(NULL)" is printed instead.
In GStreamer printf string arguments may not be NULL, because on some platforms
(ie Solaris) the libc crashes in that case. This includes debugging strings.
</para>
@category:
@Returns:
<!-- ##### FUNCTION gst_info_get_categories ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gst_info_set_categories ##### -->
<para>
</para>
@categories:
<!-- ##### FUNCTION gst_info_enable_category ##### -->
<para>
</para>
@category:
<!-- ##### FUNCTION gst_info_disable_category ##### -->
<para>
</para>
@category:
<!-- ##### FUNCTION gst_default_info_handler ##### -->
<para>
</para>
@category:
@incore:
@file:
@function:
@line:
@debug_string:
@element:
@string:
<!-- ##### MACRO GST_INFO_ENABLED ##### -->
<para>
When defined, INFO printouts are compiled into the library.
</para>
<!-- ##### MACRO GST_INFO ##### -->
<para>
Print out any information usable at run-time by application developers.
</para>
@cat: the GST_CAT_... category for the information
@...: printf arguments
<!-- ##### MACRO GST_INFO_ELEMENT ##### -->
<para>
Print out information like #GST_INFO, but with an element pointer to clarify things.
</para>
@cat: the GST_CAT_... category for the information
@element: pointer to the #GstElement in question
@...: printf arguments
<!-- ##### FUNCTION gst_debug_get_categories ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gst_debug_set_categories ##### -->
<para>
</para>
@categories:
<!-- ##### FUNCTION gst_debug_enable_category ##### -->
<para>
</para>
@category:
<!-- ##### FUNCTION gst_debug_disable_category ##### -->
<para>
</para>
@category:
<!-- ##### MACRO GST_DEBUG_ENTER ##### -->
<para>
Called at the beginning of a function, it simply prints out a DEBUG string of "entering"
in addition to the given string.
</para>
@...: printf arguments
<!-- ##### MACRO GST_DEBUG_LEAVE ##### -->
<para>
Called at the end of a function, it simply prints out a DEBUG string of "leaving"
in addition to the given string.
</para>
@...: printf arguments
<!-- ##### MACRO GST_DEBUG ##### -->
<para>
Print out debugging information.
</para>
@cat: the GST_CAT_... the debug falls within
@...: printf arguments
<!-- ##### MACRO GST_DEBUG_FUNCPTR ##### -->
<para>
Add a function to the global function pointer table used for debugging.
</para>
@ptr: The pointer to add to the function table.
<!-- ##### MACRO GST_DEBUG_FUNCPTR_NAME ##### -->
<para>
Get the name of the given function pointer by looking up its name in the global
function table.
</para>
@ptr: The pointer to look up.
@str: The string to check.
@Returns: A string that is guaranteed to be not NULL.
<!-- ##### MACRO GST_DEBUG_PAD_NAME ##### -->
<para>
Print out debugging statements for a pad.
Evaluates to 2 strings, that describe the pad. Often used in debugging
statements.
</para>
@pad: The pad to debug.
<!-- ##### MACRO GST_DEBUG_THREAD_ARGS ##### -->
<!-- ##### MACRO GST_FUNCTION ##### -->
<para>
Part of the colorized debug functions for threads
</para>
@id: The thread id.
<!-- ##### MACRO GST_DEBUG_THREAD_FORMAT ##### -->
<para>
Part of the colorized debug functions for threads
This macro should evaluate to the name of the current function and be should
be defined when configuring your project, as it is compiler dependant. If it
is not defined, some default value is used. It is used to provide debugging
output with the function name of the message.
</para>
<!-- ##### MACRO GST_DEBUG_ELEMENT ##### -->
<!-- ##### ENUM GstDebugLevel ##### -->
<para>
Print out usefull debugging info of an element.
The level defines the importance of a debugging message. The more important a
message is, the greater the probability that the debugging system outputs it.
</para>
@cat: The category of this debugging statement.
@element: The element to debug.
@...: printf arguments
@GST_LEVEL_NONE: No debugging level specified or desired. Used to deactivate
debugging output.
@GST_LEVEL_ERROR: Error messages are to be used only when an error occured
that stops the application from keeping working correctly.
An examples is gst_element_error, which outputs a message with this priority.
It does not mean that the application is terminating as with g_errror.
@GST_LEVEL_WARNING: Warning messages are to inform about abnormal behaviour
that could lead to problems or weird behaviour later on. An example of this
would be clocking issues ("your computer is pretty slow") or broken input
data ("Can't synchronize to stream.")
@GST_LEVEL_INFO: Informational messages should be used to keep the developer
updated about what is happening.
Examples where this should be used are when a typefind function has
successfully determined the type of the stream or when an mp3 plugin detects
the format to be used. ("This file has mono sound.")
@GST_LEVEL_DEBUG: Debugging messages should be used when something common
happens that is not the expected default behavior.
An example would be notifications about state changes or receiving/sending of
events.
@GST_LEVEL_LOG: Log messages are messages that are very common but might be
useful to know. As a rule of thumb a pipeline that is iterating as expected
should never output anzthing else but LOG messages.
Examples for this are referencing/dereferencing of objects or cothread switches.
@GST_LEVEL_COUNT: The number of defined debugging levels.
<!-- ##### MACRO GST_ERROR ##### -->
<!-- ##### MACRO GST_LEVEL_DEFAULT ##### -->
<para>
Print out an error condition and abort the application.
Defines the default debugging level to be used with GStreamer. It is
normally set to #GST_LEVEL_ERROR so only errors are printed. Developer
builds may chose to override that though.
You can use this as an argument to gst_debug_set_default_threshold() to
reset the debugging output to default behaviour.
</para>
@element: the #GstElement in question
@...: printf arguments
<!-- ##### FUNCTION gst_debug_level_get_name ##### -->
<para>
</para>
@level:
@Returns:
<!-- ##### ENUM GstDebugColorFlags ##### -->
<para>
These are some terminal-oriented flags you can use when creating your debugging
categories to make them stand out in debugging output.
</para>
@GST_DEBUG_FG_BLACK: Use black as foreground color.
@GST_DEBUG_FG_RED: Use red as foreground color.
@GST_DEBUG_FG_GREEN: Use green as foreground color.
@GST_DEBUG_FG_YELLOW: Use yellow as foreground color.
@GST_DEBUG_FG_BLUE: Use blue as foreground color.
@GST_DEBUG_FG_MAGENTA: Use magenta as foreground color.
@GST_DEBUG_FG_CYAN: Use cyan as foreground color.
@GST_DEBUG_FG_WHITE: Use white as foreground color.
@GST_DEBUG_BG_BLACK: Use black as background color.
@GST_DEBUG_BG_RED: Use red as background color.
@GST_DEBUG_BG_GREEN: Use green as background color.
@GST_DEBUG_BG_YELLOW: Use yellow as background color.
@GST_DEBUG_BG_BLUE: Use blue as background color.
@GST_DEBUG_BG_MAGENTA: Use magenta as background color.
@GST_DEBUG_BG_CYAN: Use cyan as background color.
@GST_DEBUG_BG_WHITE: Use white as background color.
@GST_DEBUG_BOLD: Make the output bold.
@GST_DEBUG_UNDERLINE: Underline the output.
<!-- ##### FUNCTION gst_debug_construct_term_color ##### -->
<para>
</para>
@colorinfo:
@Returns:
<!-- ##### STRUCT GstDebugCategory ##### -->
<para>
This is the struct that describes the categories. Once initialized with
#GST_DEBUG_CATEGORY_INIT, its values can't be changed anymore.
</para>
<!-- ##### VARIABLE GST_CAT_DEFAULT ##### -->
<para>
The default category that is used when no other category is defined as the
default. If you want to define a default category, do it like this:
<informalexample>
<programlisting>
&hash;define GST_CAT_DEFAULT category_to_be_default
</programlisting>
</informalexample>
</para>
<!-- ##### USER_FUNCTION GstLogFunction ##### -->
<para>
</para>
@category:
@level:
@file:
@function:
@line:
@object:
@message:
@data:
<!-- ##### FUNCTION gst_debug_log ##### -->
<para>
</para>
@category:
@level:
@file:
@function:
@line:
@object:
@format:
@Varargs:
<!-- ##### FUNCTION gst_debug_logv ##### -->
<para>
</para>
@category:
@level:
@file:
@function:
@line:
@object:
@format:
@args:
<!-- ##### FUNCTION gst_debug_log_default ##### -->
<para>
</para>
@category:
@level:
@file:
@function:
@line:
@object:
@message:
@unused:
<!-- ##### FUNCTION gst_debug_add_log_function ##### -->
<para>
</para>
@func:
@data:
<!-- ##### FUNCTION gst_debug_remove_log_function ##### -->
<para>
</para>
@func:
@Returns:
<!-- ##### FUNCTION gst_debug_remove_log_function_by_data ##### -->
<para>
</para>
@data:
@Returns:
<!-- ##### FUNCTION gst_debug_set_active ##### -->
<para>
</para>
@active:
<!-- ##### FUNCTION gst_debug_is_active ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gst_debug_set_colored ##### -->
<para>
</para>
@colored:
<!-- ##### FUNCTION gst_debug_is_colored ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gst_debug_set_default_threshold ##### -->
<para>
</para>
@level:
<!-- ##### FUNCTION gst_debug_get_default_threshold ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gst_debug_set_threshold_for_name ##### -->
<para>
</para>
@name:
@level:
<!-- ##### FUNCTION gst_debug_unset_threshold_for_name ##### -->
<para>
</para>
@name:
<!-- ##### MACRO GST_DEBUG_CATEGORY ##### -->
<para>
</para>
@cat:
<!-- ##### MACRO GST_DEBUG_CATEGORY_EXTERN ##### -->
<para>
</para>
@cat:
<!-- ##### MACRO GST_DEBUG_CATEGORY_STATIC ##### -->
<para>
</para>
@cat:
<!-- ##### MACRO GST_DEBUG_CATEGORY_INIT ##### -->
<para>
</para>
@cat:
@name:
@color:
@description:
<!-- ##### FUNCTION gst_debug_category_free ##### -->
<para>
</para>
@category:
<!-- ##### FUNCTION gst_debug_category_set_threshold ##### -->
<para>
</para>
@category:
@level:
<!-- ##### FUNCTION gst_debug_category_reset_threshold ##### -->
<para>
</para>
@category:
<!-- ##### FUNCTION gst_debug_category_get_threshold ##### -->
<para>
</para>
@category:
@Returns:
<!-- ##### FUNCTION gst_debug_category_get_name ##### -->
<para>
</para>
@category:
@Returns:
<!-- ##### FUNCTION gst_debug_category_get_color ##### -->
<para>
</para>
@category:
@Returns:
<!-- ##### FUNCTION gst_debug_category_get_description ##### -->
<para>
</para>
@category:
@Returns:
<!-- ##### FUNCTION gst_debug_get_all_categories ##### -->
<para>
</para>
@Returns:
<!-- ##### MACRO GST_CAT_LEVEL_LOG ##### -->
<para>
</para>
@cat:
@level:
@object:
@...:
<!-- ##### MACRO GST_CAT_ERROR_OBJECT ##### -->
<para>
Output an error message belonging to the given object in the given category.
</para>
@cat: category to use
@obj: the #GObject the message belongs to
@...: printf-style message to output
<!-- ##### MACRO GST_CAT_WARNING_OBJECT ##### -->
<para>
Output a warning message belonging to the given object in the given category.
</para>
@cat: category to use
@obj: the #GObject the message belongs to
@...: printf-style message to output
<!-- ##### MACRO GST_CAT_INFO_OBJECT ##### -->
<para>
Output an informational message belonging to the given object in the given
category.
</para>
@cat: category to use
@obj: the #GObject the message belongs to
@...: printf-style message to output
<!-- ##### MACRO GST_CAT_DEBUG_OBJECT ##### -->
<para>
Output an debugging message belonging to the given object in the given category.
</para>
@cat: category to use
@obj: the #GObject the message belongs to
@...: printf-style message to output
<!-- ##### MACRO GST_CAT_LOG_OBJECT ##### -->
<para>
Output an logging message belonging to the given object in the given category.
</para>
@cat: category to use
@obj: the #GObject the message belongs to
@...: printf-style message to output
<!-- ##### MACRO GST_CAT_ERROR ##### -->
<para>
Output an error message in the given category.
</para>
@cat: category to use
@...: printf-style message to output
<!-- ##### MACRO GST_CAT_WARNING ##### -->
<para>
Output a warning message in the given category.
</para>
@cat: category to use
@...: printf-style message to output
<!-- ##### MACRO GST_CAT_INFO ##### -->
<para>
Output an informational message in the given category.
</para>
@cat: category to use
@...: printf-style message to output
<!-- ##### MACRO GST_CAT_DEBUG ##### -->
<para>
Output a debuggign message in the given category.
</para>
@cat: category to use
@...: printf-style message to output
<!-- ##### MACRO GST_CAT_LOG ##### -->
<para>
Output a logging message in the given category.
</para>
@cat: category to use
@...: printf-style message to output
<!-- ##### MACRO GST_ERROR_OBJECT ##### -->
<para>
Print out an error condition and abort the application.
Output an error message belonging to the given object in the default category.
</para>
@element: the #GstElement in question
@object: pointer to a 'contributing' object
@...: printf arguments
@obj: the #GObject the message belongs to
@...: printf-style message to output
<!-- ##### USER_FUNCTION GstDebugHandler ##### -->
<!-- ##### MACRO GST_WARNING_OBJECT ##### -->
<para>
The debug handler
Output a warning message belonging to the given object in the default category.
</para>
@category:
@core:
@file:
@function:
@line:
@debug_string:
@element:
@string:
@obj: the #GObject the message belongs to
@...: printf-style message to output
<!-- ##### FUNCTION gst_default_debug_handler ##### -->
<!-- ##### MACRO GST_INFO_OBJECT ##### -->
<para>
Output an informational message belonging to the given object in the default
category.
</para>
@obj: the #GObject the message belongs to
@...: printf-style message to output
<!-- ##### MACRO GST_DEBUG_OBJECT ##### -->
<para>
Output a debugging message belonging to the given object in the default
category.
</para>
@obj: the #GObject the message belongs to
@...: printf-style message to output
<!-- ##### MACRO GST_LOG_OBJECT ##### -->
<para>
Output a logging message belonging to the given object in the default category.
</para>
@obj: the #GObject the message belongs to
@...: printf-style message to output
<!-- ##### MACRO GST_ERROR ##### -->
<para>
Output an error message in the default category.
</para>
@...: printf-style message to output
<!-- ##### MACRO GST_WARNING ##### -->
<para>
Output a warning message in the default category.
</para>
@...: printf-style message to output
<!-- ##### MACRO GST_INFO ##### -->
<para>
Output an informational message in the default category.
</para>
@...: printf-style message to output
<!-- ##### MACRO GST_DEBUG ##### -->
<para>
Output a debugging message in the default category.
</para>
@...: printf-style message to output
<!-- ##### MACRO GST_LOG ##### -->
<para>
Output a logging message in the default category.
</para>
@...: printf-style message to output
<!-- ##### MACRO GST_DEBUG_FUNCPTR ##### -->
<para>
</para>
@category:
@incore:
@file:
@function:
@line:
@debug_string:
@element:
@string:
@ptr:
<!-- ##### FUNCTION gst_default_error_handler ##### -->
<!-- ##### MACRO GST_DEBUG_FUNCPTR_NAME ##### -->
<para>
</para>
@file:
@function:
@line:
@debug_string:
@element:
@object:
@string:
<!-- ##### USER_FUNCTION GstInfoHandler ##### -->
<para>
The info handler
</para>
@category:
@incore:
@file:
@function:
@line:
@debug_string:
@element:
@string:
<!-- ##### USER_FUNCTION GstErrorHandler ##### -->
<para>
The error handler
</para>
@file:
@function:
@line:
@debug_string:
@element:
@object:
@string:
@ptr:

View file

@ -185,8 +185,10 @@ maintainer-clean-local: clean
# make distcheck work
distclean-local: clean
rm -rf $(DOC_MODULE)-decl-list.txt
rm -rf $(DOC_MODULE)-*.txt
rm -rf tmpl/*.sgml
rm -rf $(DOC_MODULE)-decl.txt
rm -rf $(DOC_MODULE)-undocumented.txt
rm -rf $(DOC_MODULE)-unused.txt
rm -rf tmpl/*.sgml.bak
rm -f $(DOC_MODULE).hierarchy
rm -f *.stamp || true

View file

@ -1,10 +1,9 @@
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY GstGetbits SYSTEM "xml/gstgetbits.xml">
<!ENTITY GstIDCT SYSTEM "xml/gstidct.xml">
<!ENTITY GstPutbits SYSTEM "xml/gstputbits.xml">
<!ENTITY GstControl SYSTEM "xml/gstcontrol.xml">
<!ENTITY GstGetbits SYSTEM "xml/getbits.xml">
<!ENTITY GstPutbits SYSTEM "xml/putbits.xml">
<!ENTITY GstControl SYSTEM "xml/control.xml">
]>
@ -24,7 +23,6 @@
GStreamer provides some standard libraries you can use to create plugins.
</para>
&GstGetbits;
&GstIDCT;
&GstPutbits;
&GstControl;

View file

@ -10,6 +10,7 @@
<!ENTITY INTRO_BASICS SYSTEM "intro_basics.xml">
<!ENTITY BUILDING_BOILER SYSTEM "building_boiler.xml">
<!ENTITY BUILDING_DEBUG SYSTEM "building_debug.xml">
<!ENTITY BUILDING_PADS SYSTEM "building_pads.xml">
<!ENTITY BUILDING_CHAINFN SYSTEM "building_chainfn.xml">
<!ENTITY BUILDING_STATE SYSTEM "building_state.xml">

View file

@ -10,7 +10,7 @@ gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline)
GstElement *filesrc;
GstElement *cache;
GST_DEBUG (0,"GstPipeline: play have type");
GST_DEBUG ("GstPipeline: play have type");
gst_element_set_state (pipeline, GST_STATE_PAUSED);

View file

@ -10,7 +10,7 @@ gst_play_have_type (GstElement *typefind, GstCaps *caps, GstElement *pipeline)
GstElement *filesrc;
GstElement *cache;
GST_DEBUG (0,"GstPipeline: play have type");
GST_DEBUG ("GstPipeline: play have type");
gst_element_set_state (pipeline, GST_STATE_PAUSED);

View file

@ -47,7 +47,7 @@ gst_play_type_find (GstBin *bin, GstElement *element)
GstElement *pipeline;
GstCaps *caps = NULL;
GST_DEBUG (0,"GstPipeline: typefind for element \"%s\"",
GST_DEBUG ("GstPipeline: typefind for element \"%s\"",
GST_ELEMENT_NAME(element));
pipeline = gst_pipeline_new ("autoplug_pipeline");
@ -116,9 +116,9 @@ int main(int argc,char *argv[])
main_bin = gst_pipeline_new("bin");
/* link adder and output to bin */
GST_INFO (0, "main: adding adder to bin");
GST_INFO ( "main: adding adder to bin");
gst_bin_add (GST_BIN(main_bin), adder);
GST_INFO (0, "main: adding audiosink to bin");
GST_INFO ( "main: adding audiosink to bin");
gst_bin_add (GST_BIN(main_bin), audiosink);
/* link adder and audiosink */
@ -139,7 +139,7 @@ int main(int argc,char *argv[])
gst_bin_add (GST_BIN(main_bin), channel_in->pipe);
/* request pads and link to adder */
GST_INFO (0, "requesting pad\n");
GST_INFO ( "requesting pad\n");
pad = gst_element_get_request_pad (adder, "sink%d");
printf ("\tGot new adder sink pad %s\n", gst_pad_get_name (pad));
sprintf (buffer, "channel%d", i);
@ -242,7 +242,7 @@ create_input_channel (int id, char* location)
GstElement *new_element;
GstElement *decoder;
GST_DEBUG (0, "c_i_p : creating channel with id %d for file %s",
GST_DEBUG ( "c_i_p : creating channel with id %d for file %s",
id, location);
/* allocate channel */
@ -256,7 +256,7 @@ create_input_channel (int id, char* location)
/* create channel */
GST_DEBUG (0, "c_i_p : creating pipeline");
GST_DEBUG ( "c_i_p : creating pipeline");
sprintf (buffer, "pipeline%d", id);
channel->pipe = gst_bin_new (buffer);
@ -264,13 +264,13 @@ create_input_channel (int id, char* location)
/* create elements */
GST_DEBUG(0, "c_i_p : creating filesrc");
GST_DEBUG ( "c_i_p : creating filesrc");
sprintf (buffer, "filesrc%d", id);
channel->filesrc = gst_element_factory_make ("filesrc", buffer);
g_assert(channel->filesrc != NULL);
GST_DEBUG(0, "c_i_p : setting location");
GST_DEBUG ( "c_i_p : setting location");
g_object_set(G_OBJECT(channel->filesrc),"location", location, NULL);
/* add filesrc to the bin before autoplug */

View file

@ -30,7 +30,7 @@ static GstElementDetails example_details = {
"An example plugin",
"Example/FirstExample",
"Shows the basic structure of a plugin",
VERSION,
"0.1",
"your name <your.name@your.isp>",
"(C) 2001",
};

View file

@ -134,7 +134,7 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
$(GST_LOADSAVE_SRC)
BUILT_SOURCES = gstmarshal.h gstmarshal.c gstenumtypes.h $(GST_ENUMTYPES_SRC)
BUILT_SOURCES = gstversion.h gstconfig.h gstmarshal.h gstmarshal.c gstenumtypes.h $(GST_ENUMTYPES_SRC)
libgstreamer_@GST_MAJORMINOR@_la_CFLAGS = -D_GNU_SOURCE \
$(GST_CFLAGS) \
@ -150,7 +150,6 @@ libgstreamer_@GST_MAJORMINOR@includedir = $(includedir)/gstreamer-@GST_MAJORMINO
gst_headers = \
gst.h \
gstatomic.h \
gstconfig.h \
gstobject.h \
gsttypes.h \
gstautoplug.h \
@ -195,6 +194,7 @@ gst_headers = \
gstxml.h
built_headers = \
gstconfig.h \
gstversion.h \
gstmarshal.h \
gstenumtypes.h

View file

@ -19,8 +19,15 @@
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <gst/gst.h>
GST_DEBUG_CATEGORY_STATIC(debug_category);
#define GST_CAT_DEFAULT debug_category
GstElementDetails gst_autoplugcache_details = {
"AutoplugCache",
"Generic",
@ -230,12 +237,12 @@ gst_autoplugcache_loop (GstElement *element)
/* if we've been told to fire an empty signal (after a reset) */
if (cache->fire_empty) {
int oldstate = GST_STATE(cache);
GST_DEBUG(0,"at front of cache, about to pull, but firing signal");
GST_DEBUG ("at front of cache, about to pull, but firing signal");
gst_object_ref (GST_OBJECT (cache));
g_signal_emit (G_OBJECT(cache), gst_autoplugcache_signals[CACHE_EMPTY], 0, NULL);
if (GST_STATE(cache) != oldstate) {
gst_object_unref (GST_OBJECT (cache));
GST_DEBUG(GST_CAT_AUTOPLUG, "state changed during signal, aborting");
GST_DEBUG ("state changed during signal, aborting");
return;
}
gst_object_unref (GST_OBJECT (cache));
@ -295,7 +302,7 @@ gst_autoplugcache_set_property (GObject *object, guint prop_id, const GValue *va
switch (prop_id) {
case ARG_CAPS_PROXY:
cache->caps_proxy = g_value_get_boolean (value);
GST_DEBUG(0,"caps_proxy is %d",cache->caps_proxy);
GST_DEBUG ("caps_proxy is %d",cache->caps_proxy);
if (cache->caps_proxy) {
} else {
}
@ -303,7 +310,7 @@ GST_DEBUG(0,"caps_proxy is %d",cache->caps_proxy);
case ARG_RESET:
/* no idea why anyone would set this to FALSE, but just in case ;-) */
if (g_value_get_boolean (value)) {
GST_DEBUG(0,"resetting playout pointer");
GST_DEBUG ("resetting playout pointer");
/* reset the playout pointer to the begining again */
cache->current_playout = cache->cache_start;
/* now we can fire a signal when the cache runs dry */
@ -342,6 +349,8 @@ plugin_init (GModule *module, GstPlugin *plugin)
{
GstElementFactory *factory;
GST_DEBUG_CATEGORY_INIT (debug_category, "AUTOPLUGCACHE", 0, "autoplugcache element");
factory = gst_element_factory_new ("autoplugcache", GST_TYPE_AUTOPLUGCACHE,
&gst_autoplugcache_details);
g_return_val_if_fail (factory != NULL, FALSE);
@ -357,4 +366,3 @@ GstPluginDesc plugin_desc = {
"autoplugcache",
plugin_init
};

View file

@ -19,6 +19,10 @@
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <gst/gst.h>
GstElementDetails gst_autoplugger_details = {
@ -171,7 +175,7 @@ gst_autoplugger_init (GstAutoplugger *autoplugger)
autoplugger->cache = gst_element_factory_make("autoplugcache", "unnamed_autoplugcache");
g_return_if_fail (autoplugger->cache != NULL);
GST_DEBUG(GST_CAT_AUTOPLUG, "turning on caps nego proxying in cache");
GST_DEBUG ("turning on caps nego proxying in cache");
g_object_set(G_OBJECT(autoplugger->cache),"caps_proxy",TRUE,NULL);
/* attach signals to the cache */
@ -213,19 +217,19 @@ gst_autoplugger_external_sink_linked(GstPad *pad, GstPad *peerpad, GstAutoplugge
GstPadTemplate *peertemplate;
GstCaps *peercaps, *peertemplatecaps;
GST_INFO(GST_CAT_AUTOPLUG, "have cache:sink linked");*/
GST_INFO ("have cache:sink linked");*/
/* autoplugger->sinkpadpeer = peerpad; */
/*
if (autoplugger->sinkpadpeer) {
peercaps = GST_PAD_CAPS(autoplugger->sinkpadpeer);
if (peercaps)
GST_INFO(GST_CAT_AUTOPLUG, "there are some caps on this pad's peer: %s",
GST_INFO ("there are some caps on this pad's peer: %s",
gst_caps_get_mime(peercaps));
peertemplate = GST_PAD_PAD_TEMPLATE(autoplugger->sinkpadpeer);
if (peertemplate) {
peertemplatecaps = GST_PAD_TEMPLATE_CAPS(peertemplate);
if (peertemplatecaps) {
GST_INFO(GST_CAT_AUTOPLUG, "there are some caps on this pad's peer's padtemplate %s",
GST_INFO ("there are some caps on this pad's peer's padtemplate %s",
gst_caps_get_mime(peertemplatecaps));
}
}
@ -238,22 +242,22 @@ gst_autoplugger_external_src_linked(GstPad *pad, GstPad *peerpad, GstAutoplugger
GstPadTemplate *peertemplate;
GstCaps *peercaps, *peertemplatecaps;
GST_INFO(GST_CAT_AUTOPLUG, "have cache:src linked");*/
GST_INFO ("have cache:src linked");*/
/* autoplugger->srcpadpeer = peerpad; */
/*
if (autoplugger->srcpadpeer) {
peercaps = GST_PAD_CAPS(autoplugger->srcpadpeer);
if (peercaps)
GST_INFO(GST_CAT_AUTOPLUG, "there are some caps on this pad's peer: %s",
GST_INFO ("there are some caps on this pad's peer: %s",
gst_caps_get_mime(peercaps));
peertemplate = GST_PAD_PAD_TEMPLATE(autoplugger->srcpadpeer);
if (peertemplate) {
peertemplatecaps = GST_PAD_TEMPLATE_CAPS(peertemplate);
if (peertemplatecaps) {
GST_INFO(GST_CAT_AUTOPLUG, "there are some caps on this pad's peer's padtemplate %s",
GST_INFO ("there are some caps on this pad's peer's padtemplate %s",
gst_caps_get_mime(peertemplatecaps));
autoplugger->sinktemplatecaps = peertemplatecaps;*/
/* GST_DEBUG(GST_CAT_AUTOPLUG, "turning on caps nego proxying in cache"); */
/* GST_DEBUG ("turning on caps nego proxying in cache"); */
/* gtk_object_set(G_OBJECT(autoplugger->cache),"caps_proxy",TRUE,NULL);*/
/* }
}
@ -265,14 +269,14 @@ gst_autoplugger_external_src_linked(GstPad *pad, GstPad *peerpad, GstAutoplugger
static void
gst_autoplugger_external_sink_caps_changed(GstPad *pad, GstCaps *caps, GstAutoplugger *autoplugger)
{
GST_INFO(GST_CAT_AUTOPLUG, "have cache:sink caps of %s\n",gst_caps_get_mime(caps));
GST_INFO ("have cache:sink caps of %s\n",gst_caps_get_mime(caps));
autoplugger->sinkcaps = caps;
}
static void
gst_autoplugger_external_src_caps_changed(GstPad *pad, GstCaps *caps, GstAutoplugger *autoplugger)
{
GST_INFO(GST_CAT_AUTOPLUG, "have cache:src caps of %s\n",gst_caps_get_mime(caps));
GST_INFO ("have cache:src caps of %s\n",gst_caps_get_mime(caps));
autoplugger->srccaps = caps;
}
*/
@ -284,20 +288,20 @@ gst_autoplugger_autoplug(GstAutoplugger *autoplugger,GstPad *srcpad,GstCaps *src
GstPad *sinkpad;
sinkpad = GST_PAD(GST_PAD_PEER(srcpad));
GST_DEBUG(GST_CAT_AUTOPLUG,"unlinking %s:%s and %s:%s to autoplug between them",
GST_DEBUG ("unlinking %s:%s and %s:%s to autoplug between them",
GST_DEBUG_PAD_NAME(srcpad),GST_DEBUG_PAD_NAME(sinkpad));
GST_DEBUG(GST_CAT_AUTOPLUG,"srcpadcaps are of type %s",gst_caps_get_mime(srccaps));
GST_DEBUG(GST_CAT_AUTOPLUG,"sinkpadcaps are of type %s",gst_caps_get_mime(sinkcaps));
GST_DEBUG ("srcpadcaps are of type %s",gst_caps_get_mime(srccaps));
GST_DEBUG ("sinkpadcaps are of type %s",gst_caps_get_mime(sinkcaps));
/* unlink the pads */
GST_DEBUG(GST_CAT_AUTOPLUG, "unlinking the pads that will be joined by an autobin");
GST_DEBUG ("unlinking the pads that will be joined by an autobin");
gst_pad_unlink(srcpad,sinkpad);
if (!autoplugger->autoplug) {
autoplugger->autoplug = gst_autoplug_factory_make("static");
g_return_val_if_fail(autoplugger->autoplug != NULL, FALSE);
}
GST_DEBUG(GST_CAT_AUTOPLUG, "building autoplugged bin between caps");
GST_DEBUG ("building autoplugged bin between caps");
autoplugger->autobin = gst_autoplug_to_caps(autoplugger->autoplug,
srccaps,sinkcaps,NULL);
g_return_val_if_fail(autoplugger->autobin != NULL, FALSE);
@ -306,20 +310,20 @@ gst_autoplugger_autoplug(GstAutoplugger *autoplugger,GstPad *srcpad,GstCaps *src
gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
/* FIXME this is a hack */
/* GST_DEBUG(GST_CAT_AUTOPLUG, "copying failed caps to srcpad %s:%s to ensure renego",GST_DEBUG_PAD_NAME(autoplugger->cache_srcpad)); */
/* GST_DEBUG ("copying failed caps to srcpad %s:%s to ensure renego",GST_DEBUG_PAD_NAME(autoplugger->cache_srcpad)); */
/* gst_pad_set_caps(srcpad,srccaps); */
if (GST_PAD_CAPS(srcpad) == NULL) GST_DEBUG(GST_CAT_AUTOPLUG,"no caps on cache:src!");
if (GST_PAD_CAPS(srcpad) == NULL) GST_DEBUG ("no caps on cache:src!");
/* attach the autoplugged bin */
GST_DEBUG(GST_CAT_AUTOPLUG, "attaching the autoplugged bin between the two pads");
GST_DEBUG ("attaching the autoplugged bin between the two pads");
gst_pad_link(srcpad,gst_element_get_pad(autoplugger->autobin,"sink"));
gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
gst_pad_link(gst_element_get_pad(autoplugger->autobin,"src_00"),sinkpad);
gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
/* FIXME try to force the renego */
/* GST_DEBUG(GST_CAT_AUTOPLUG, "trying to force everyone to nego"); */
/* GST_DEBUG ("trying to force everyone to nego"); */
/* gst_pad_renegotiate(gst_element_get_pad(autoplugger->autobin,"sink")); */
/* gst_pad_renegotiate(sinkpad); */
@ -335,7 +339,7 @@ gst_autoplugger_external_sink_caps_nego_failed(GstPad *pad, gboolean *result, Gs
GstPad *sinkpad_peer;
GstCaps *sinkpad_peer_caps;
GST_INFO(GST_CAT_AUTOPLUG, "have caps nego failure on sinkpad %s:%s!!!",GST_DEBUG_PAD_NAME(pad));
GST_INFO ("have caps nego failure on sinkpad %s:%s!!!",GST_DEBUG_PAD_NAME(pad));
autoplugger->paused++;
if (autoplugger->paused == 1)
@ -362,7 +366,7 @@ gst_autoplugger_external_sink_caps_nego_failed(GstPad *pad, gboolean *result, Gs
/* try to PLAY the whole thing */
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PLAYING);
GST_INFO(GST_CAT_AUTOPLUG, "done dealing with caps nego failure on sinkpad %s:%s",GST_DEBUG_PAD_NAME(pad));
GST_INFO ("done dealing with caps nego failure on sinkpad %s:%s",GST_DEBUG_PAD_NAME(pad));
}
static void
@ -373,7 +377,7 @@ gst_autoplugger_external_src_caps_nego_failed(GstPad *pad, gboolean *result, Gst
GstPadTemplate *srcpad_peer_template;
GstCaps *srcpad_peer_caps;
GST_INFO(GST_CAT_AUTOPLUG, "have caps nego failure on srcpad %s:%s!!!",GST_DEBUG_PAD_NAME(pad));
GST_INFO ("have caps nego failure on srcpad %s:%s!!!",GST_DEBUG_PAD_NAME(pad));
autoplugger->paused++;
if (autoplugger->paused == 1)
@ -399,7 +403,7 @@ gst_autoplugger_external_src_caps_nego_failed(GstPad *pad, gboolean *result, Gst
autoplugger->disable_nocaps = TRUE;
GST_INFO(GST_CAT_AUTOPLUG, "done dealing with caps nego failure on srcpad %s:%s",GST_DEBUG_PAD_NAME(pad));
GST_INFO ("done dealing with caps nego failure on srcpad %s:%s",GST_DEBUG_PAD_NAME(pad));
}
@ -408,7 +412,7 @@ gst_autoplugger_cache_empty(GstElement *element, GstAutoplugger *autoplugger)
{
GstPad *cache_sinkpad_peer,*cache_srcpad_peer;
GST_INFO(GST_CAT_AUTOPLUG, "autoplugger cache has hit empty, we can now remove it");
GST_INFO ("autoplugger cache has hit empty, we can now remove it");
autoplugger->paused++;
if (autoplugger->paused == 1)
@ -416,18 +420,18 @@ gst_autoplugger_cache_empty(GstElement *element, GstAutoplugger *autoplugger)
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PAUSED);
/* unlink the cache from its peers */
GST_DEBUG(GST_CAT_AUTOPLUG, "unlinking autoplugcache from its peers");
GST_DEBUG ("unlinking autoplugcache from its peers");
cache_sinkpad_peer = GST_PAD (GST_PAD_PEER(autoplugger->cache_sinkpad));
cache_srcpad_peer = GST_PAD (GST_PAD_PEER(autoplugger->cache_srcpad));
gst_pad_unlink(cache_sinkpad_peer,autoplugger->cache_sinkpad);
gst_pad_unlink(autoplugger->cache_srcpad,cache_srcpad_peer);
/* remove the cache from self */
GST_DEBUG(GST_CAT_AUTOPLUG, "removing the cache from the autoplugger");
GST_DEBUG ("removing the cache from the autoplugger");
gst_bin_remove (GST_BIN(autoplugger), autoplugger->cache);
/* link the two pads */
GST_DEBUG(GST_CAT_AUTOPLUG, "relinking the autoplugcache's former peers");
GST_DEBUG ("relinking the autoplugcache's former peers");
gst_pad_link(cache_sinkpad_peer,cache_srcpad_peer);
autoplugger->paused--;
@ -437,13 +441,13 @@ gst_autoplugger_cache_empty(GstElement *element, GstAutoplugger *autoplugger)
/* xmlSaveFile("autoplugger.gst", gst_xml_write(GST_ELEMENT_SCHED(autoplugger)->parent)); */
GST_INFO(GST_CAT_AUTOPLUG, "autoplugger_cache_empty finished");
GST_INFO ("autoplugger_cache_empty finished");
}
static void
gst_autoplugger_type_find_have_type(GstElement *element, GstCaps *caps, GstAutoplugger *autoplugger)
{
GST_INFO(GST_CAT_AUTOPLUG, "typefind claims to have a type: %s",gst_caps_get_mime(caps));
GST_INFO ("typefind claims to have a type: %s",gst_caps_get_mime(caps));
gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
@ -453,7 +457,7 @@ gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PAUSED);
/* first unlink the typefind and shut it down */
GST_DEBUG(GST_CAT_AUTOPLUG, "unlinking typefind from the cache");
GST_DEBUG ("unlinking typefind from the cache");
gst_pad_unlink(autoplugger->cache_srcpad,autoplugger->typefind_sinkpad);
gst_bin_remove(GST_BIN(autoplugger),autoplugger->typefind);
@ -470,25 +474,25 @@ gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
gst_bin_add(GST_BIN(autoplugger),autoplugger->autobin);
* * re-attach the srcpad's original peer to the cache *
* GST_DEBUG(GST_CAT_AUTOPLUG, "relinking the cache to the downstream peer"); *
* GST_DEBUG ("relinking the cache to the downstream peer"); *
* gst_pad_link(autoplugger->cache_srcpad,autoplugger->srcpadpeer); *
* attach the autoplugged bin *
GST_DEBUG(GST_CAT_AUTOPLUG, "attaching the autoplugged bin between cache and downstream peer");
GST_DEBUG ("attaching the autoplugged bin between cache and downstream peer");
gst_pad_link(autoplugger->cache_srcpad,gst_element_get_pad(autoplugger->autobin,"sink"));
gst_pad_link(gst_element_get_pad(autoplugger->autobin,"src_00"),autoplugger->srcpadpeer);
*/
/* FIXME set the caps on the new link
* GST_DEBUG(GST_CAT_AUTOPLUG,"forcing caps on the typefound pad");
* GST_DEBUG ("forcing caps on the typefound pad");
* gst_pad_set_caps(autoplugger->cache_srcpad,caps);
* reattach the original outside srcpad
*/
GST_DEBUG(GST_CAT_AUTOPLUG,"re-attaching downstream peer to autoplugcache");
GST_DEBUG ("re-attaching downstream peer to autoplugcache");
gst_pad_link(autoplugger->cache_srcpad,autoplugger->srcpadpeer);
/* now reset the autoplugcache */
GST_DEBUG(GST_CAT_AUTOPLUG, "resetting the cache to send first buffer(s) again");
GST_DEBUG ("resetting the cache to send first buffer(s) again");
g_object_set(G_OBJECT(autoplugger->cache),"reset",TRUE,NULL);
/* attach the cache_empty handler */
@ -501,22 +505,22 @@ gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
/* try to PLAY the whole thing */
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PLAYING);
GST_INFO(GST_CAT_AUTOPLUG, "typefind_have_type finished");
GST_INFO ("typefind_have_type finished");
gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
}
static void
gst_autoplugger_cache_first_buffer(GstElement *element,GstBuffer *buf,GstAutoplugger *autoplugger)
{
GST_INFO(GST_CAT_AUTOPLUG, "have first buffer through cache");
GST_INFO ("have first buffer through cache");
autoplugger->cache_first_buffer = TRUE;
/* if there are no established caps, worry */
if (!autoplugger->sinkcaps) {
GST_INFO(GST_CAT_AUTOPLUG, "have no caps for the buffer, Danger Will Robinson!");
GST_INFO ("have no caps for the buffer, Danger Will Robinson!");
if (autoplugger->disable_nocaps) {
GST_DEBUG(GST_CAT_AUTOPLUG, "not dealing with lack of caps this time");
GST_DEBUG ("not dealing with lack of caps this time");
return;
}
@ -528,25 +532,25 @@ gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PAUSED);
/* detach the srcpad */
GST_DEBUG(GST_CAT_AUTOPLUG, "unlinking cache from its downstream peer");
GST_DEBUG ("unlinking cache from its downstream peer");
autoplugger->srcpadpeer = GST_PAD(GST_PAD_PEER(autoplugger->cache_srcpad));
gst_pad_unlink(autoplugger->cache_srcpad,autoplugger->srcpadpeer);
/* instantiate the typefind and set up the signal handlers */
if (!autoplugger->typefind) {
GST_DEBUG(GST_CAT_AUTOPLUG, "creating typefind and setting signal handler");
GST_DEBUG ("creating typefind and setting signal handler");
autoplugger->typefind = gst_element_factory_make("typefind","unnamed_type_find");
autoplugger->typefind_sinkpad = gst_element_get_pad(autoplugger->typefind,"sink");
g_signal_connect (G_OBJECT(autoplugger->typefind),"have_type",
G_CALLBACK (gst_autoplugger_type_find_have_type), autoplugger);
}
/* add it to self and attach it */
GST_DEBUG(GST_CAT_AUTOPLUG, "adding typefind to self and linking to cache");
GST_DEBUG ("adding typefind to self and linking to cache");
gst_bin_add(GST_BIN(autoplugger),autoplugger->typefind);
gst_pad_link(autoplugger->cache_srcpad,autoplugger->typefind_sinkpad);
/* bring the typefind into playing state */
GST_DEBUG(GST_CAT_AUTOPLUG, "setting typefind state to PLAYING");
GST_DEBUG ("setting typefind state to PLAYING");
gst_element_set_state(autoplugger->cache,GST_STATE_PLAYING);
autoplugger->paused--;
@ -554,7 +558,7 @@ gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
/* try to PLAY the whole thing */
gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PLAYING);
GST_INFO(GST_CAT_AUTOPLUG,"here we go into nothingness, hoping the typefind will return us to safety");
GST_INFO ("here we go into nothingness, hoping the typefind will return us to safety");
gst_scheduler_show(GST_ELEMENT_SCHED(autoplugger));
} else {
/* * attach the cache_empty handler, since the cache simply isn't needed *

View file

@ -20,13 +20,23 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstsearchfuncs.h"
/* FIXME: "evil hack" alarm, we need a better way to get a category in here */
#ifndef GST_DISABLE_GST_DEBUG
extern GstDebugCategory *GST_CAT_AUTOPLUG_ATTEMPT;
#define GST_CAT_DEFAULT GST_CAT_AUTOPLUG_ATTEMPT
#endif
/* function that really misses in GLib
* though the GLib version should take a function as argument...
*/
void
static void
g_list_free_list_and_elements (GList *list)
{
GList *walk = list;
@ -145,8 +155,7 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)
desttemp->direction == GST_PAD_SINK) {
if (gst_autoplug_caps_intersect (gst_pad_template_get_caps (srctemp),
gst_pad_template_get_caps (desttemp))) {
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT,
"factory \"%s\" can connect with factory \"%s\"",
GST_DEBUG ("factory \"%s\" can connect with factory \"%s\"",
GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest));
return desttemp;
}
@ -156,8 +165,7 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)
}
srctemps = g_list_next (srctemps);
}
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT,
"factory \"%s\" cannot connect with factory \"%s\"",
GST_DEBUG ("factory \"%s\" cannot connect with factory \"%s\"",
GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest));
return NULL;
}
@ -331,8 +339,7 @@ gst_autoplug_sp (GstCaps *srccaps, GstCaps *sinkcaps, GList *factories)
g_return_val_if_fail (srccaps != NULL, NULL);
g_return_val_if_fail (sinkcaps != NULL, NULL);
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,
"attempting to autoplug via shortest path from %s to %s",
GST_INFO ("attempting to autoplug via shortest path from %s to %s",
gst_caps_get_mime (srccaps), gst_caps_get_mime (sinkcaps));
gst_caps_debug (srccaps, "source caps");
gst_caps_debug (sinkcaps, "sink caps");
@ -343,18 +350,16 @@ gst_autoplug_sp (GstCaps *srccaps, GstCaps *sinkcaps, GList *factories)
GstAutoplugNode *node = g_new0 (GstAutoplugNode, 1);
node->prev = NULL;
node->fac = (GstElementFactory *) factories->data;
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT,
"trying with %s", node->fac->details->longname);
GST_DEBUG ("trying with %s", node->fac->details->longname);
node->templ = gst_autoplug_can_connect_src (node->fac, srccaps);
node->cost = (node->templ ? gst_autoplug_get_cost (node->fac)
: GST_AUTOPLUG_MAX_COST);
node->endpoint = gst_autoplug_can_connect_sink (node->fac, sinkcaps);
if (node->templ && node->endpoint)
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "%s makes connection possible",
GST_DEBUG ("%s makes connection possible",
node->fac->details->longname);
else
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT,
"direct connection with %s not possible",
GST_DEBUG ("direct connection with %s not possible",
node->fac->details->longname);
if ((node->endpoint != NULL) &&
((bestnode == NULL) || (node->cost < bestnode->cost)))
@ -370,8 +375,7 @@ gst_autoplug_sp (GstCaps *srccaps, GstCaps *sinkcaps, GList *factories)
/* check if we even have possible endpoints */
if (bestnode == NULL)
{
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT,
"no factory found that could connect to sink caps");
GST_DEBUG ("no factory found that could connect to sink caps");
g_list_free_list_and_elements (factory_nodes);
return NULL;
}
@ -381,12 +385,12 @@ gst_autoplug_sp (GstCaps *srccaps, GstCaps *sinkcaps, GList *factories)
{
GList *nodes = factory_nodes;
guint nextcost = GST_AUTOPLUG_MAX_COST; /* next cost to check */
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "iterating at current cost %d, bestnode %s at %d", curcost, GST_OBJECT_NAME (bestnode->fac), bestnode->cost);
GST_DEBUG ("iterating at current cost %d, bestnode %s at %d", curcost, GST_OBJECT_NAME (bestnode->fac), bestnode->cost);
/* check if we already have a valid best connection to the sink */
if (bestnode->cost <= curcost)
{
GList *ret;
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "found a way to connect via %s", GST_OBJECT_NAME ((GstObject *) bestnode->fac));
GST_DEBUG ("found a way to connect via %s", GST_OBJECT_NAME ((GstObject *) bestnode->fac));
/* enter all factories into the return list */
ret = g_list_prepend (NULL, bestnode->fac);
bestnode = bestnode->prev;
@ -440,12 +444,7 @@ gst_autoplug_sp (GstCaps *srccaps, GstCaps *sinkcaps, GList *factories)
curcost = nextcost;
}
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "found no path from source caps to sink caps");
GST_DEBUG ("found no path from source caps to sink caps");
g_list_free_list_and_elements (factory_nodes);
return NULL;
}

View file

@ -40,11 +40,18 @@
* - fix bugs
* ...
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstspider.h"
#include "gstspideridentity.h"
#include "gstsearchfuncs.h"
GST_DEBUG_CATEGORY (gst_spider_debug);
#define GST_CAT_DEFAULT gst_spider_debug
/* signals and args */
enum {
/* FILL ME */
@ -202,7 +209,7 @@ gst_spider_request_new_pad (GstElement *element, GstPadTemplate *templ, const gc
returnpad = gst_element_add_ghost_pad (element, returnpad, padname);
gst_spider_link_new (identity);
GST_DEBUG (GST_CAT_ELEMENT_PADS, "successuflly created requested pad %s:%s", GST_DEBUG_PAD_NAME (returnpad));
GST_DEBUG ("successuflly created requested pad %s:%s", GST_DEBUG_PAD_NAME (returnpad));
return returnpad;
}
@ -270,11 +277,11 @@ static void
gst_spider_link_sometimes (GstElement *src, GstPad *pad, GstSpiderConnection *conn)
{
gulong signal_id = conn->signal_id;
GstPad *sinkpad = conn->src->sink;
/* try to autoplug the elements */
if (gst_spider_plug_from_srcpad (conn, pad) != GST_PAD_LINK_REFUSED) {
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "%s:%s was autoplugged to %s:%s, removing callback", GST_DEBUG_PAD_NAME (pad), GST_DEBUG_PAD_NAME (sinkpad));
GST_DEBUG ("%s:%s was autoplugged to %s:%s, removing callback",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_PAD_NAME (conn->src->sink));
g_signal_handler_disconnect (src, signal_id);
signal_id = 0;
}
@ -305,7 +312,7 @@ static void
gst_spider_link_reset (GstSpiderConnection *conn, GstElement *to)
{
GstSpider *spider = GST_SPIDER (GST_OBJECT_PARENT (conn->src));
GST_DEBUG (GST_CAT_AUTOPLUG, "resetting link from %s to %s, currently at %s to %s", GST_ELEMENT_NAME (spider->sink_ident),
GST_DEBUG ("resetting link from %s to %s, currently at %s to %s", GST_ELEMENT_NAME (spider->sink_ident),
GST_ELEMENT_NAME (conn->src), GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (to));
while ((conn->path != NULL) && ((GstElement *) conn->path->data != to))
{
@ -487,7 +494,7 @@ gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath)
element = (GstElement *) (endelements == NULL ? conn->src : endelements->data);
} else {
element = gst_element_factory_create ((GstElementFactory *) plugpath->data, NULL);
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "Adding element %s of type %s and syncing state with autoplugger",
GST_DEBUG ("Adding element %s of type %s and syncing state with autoplugger",
GST_ELEMENT_NAME (element), GST_PLUGIN_FEATURE_NAME (plugpath->data));
gst_bin_add (GST_BIN (spider), element);
}
@ -506,7 +513,7 @@ gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath)
GstPadTemplate *templ = (GstPadTemplate *) templs->data;
if ((GST_PAD_TEMPLATE_DIRECTION (templ) == GST_PAD_SRC) && (GST_PAD_TEMPLATE_PRESENCE(templ) == GST_PAD_SOMETIMES))
{
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "adding callback to link element %s to %s", GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (conn->src));
GST_DEBUG ("adding callback to link element %s to %s", GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (conn->src));
conn->signal_id = g_signal_connect (G_OBJECT (conn->current), "new_pad",
G_CALLBACK (gst_spider_link_sometimes), conn);
g_list_free (plugpath);
@ -514,11 +521,11 @@ gst_spider_create_and_plug (GstSpiderConnection *conn, GList *plugpath)
}
templs = g_list_next (templs);
}
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "no chance to link element %s to %s", GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (conn->src));
GST_DEBUG ("no chance to link element %s to %s", GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (conn->src));
g_list_free (plugpath);
return GST_PAD_LINK_REFUSED;
}
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "added element %s and attached it to element %s", GST_ELEMENT_NAME (element), GST_ELEMENT_NAME (conn->current));
GST_DEBUG ("added element %s and attached it to element %s", GST_ELEMENT_NAME (element), GST_ELEMENT_NAME (conn->current));
gst_spider_link_add (conn, element);
if (plugpath != NULL)
plugpath = g_list_delete_link (plugpath, plugpath);
@ -579,7 +586,7 @@ gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad)
GstElement *startelement = conn->current;
g_assert ((GstElement *) GST_OBJECT_PARENT (srcpad) == conn->current);
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "trying to plug from %s:%s to %s",
GST_DEBUG ("trying to plug from %s:%s to %s",
GST_DEBUG_PAD_NAME (srcpad), GST_ELEMENT_NAME (conn->src));
/* find a path from src to sink */
@ -596,10 +603,10 @@ gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad)
/* if there is no way to plug: return */
if (plugpath == NULL) {
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "no chance to plug from %s to %s", GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (conn->src));
GST_DEBUG ("no chance to plug from %s to %s", GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (conn->src));
return GST_PAD_LINK_REFUSED;
}
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "found a link that needs %d elements", g_list_length (plugpath));
GST_DEBUG ("found a link that needs %d elements", g_list_length (plugpath));
/* now remove non-needed elements from the beginning of the path
* alter src to point to the new element where we need to start
@ -612,7 +619,7 @@ gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad)
plugpath = g_list_delete_link (plugpath, plugpath);
}
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "%d elements must be inserted to establish the link", g_list_length (plugpath));
GST_DEBUG ("%d elements must be inserted to establish the link", g_list_length (plugpath));
/* create the elements and plug them */
result = gst_spider_create_and_plug (conn, plugpath);
@ -640,6 +647,9 @@ plugin_init (GModule *module, GstPlugin *plugin)
{
GstElementFactory *factory;
GST_DEBUG_CATEGORY_INIT (gst_spider_debug, "spider", 0, "spider autoplugging element");
GST_DEBUG_CATEGORY_INIT (gst_spider_identity_debug, "spideridentity", 0, "spider autoplugging proxy element");
factory = gst_element_factory_new("spider", GST_TYPE_SPIDER,
&gst_spider_details);
gst_plugin_set_longname (plugin, "Spider autoplugging elements");

View file

@ -29,6 +29,7 @@
G_BEGIN_DECLS
extern GstElementDetails gst_spider_details;
GST_DEBUG_CATEGORY_EXTERN(gst_spider_debug);
/*
* Theory of operation:

View file

@ -20,11 +20,16 @@
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstspideridentity.h"
#include "gstspider.h"
GST_DEBUG_CATEGORY (gst_spider_identity_debug);
#define GST_CAT_DEFAULT gst_spider_identity_debug
GstElementDetails gst_spider_identity_details = {
"SpiderIdentity",
"Generic",
@ -179,7 +184,7 @@ gst_spider_identity_chain (GstPad *pad, GstBuffer *buf)
GstSpiderConnection *conn = (GstSpiderConnection *) list->data;
list = g_list_next (list);
if (conn->current != (GstElement *) conn->src) {
GST_DEBUG (GST_CAT_AUTOPLUG, "sending EOS to unconnected element %s from %s",
GST_DEBUG ("sending EOS to unconnected element %s from %s",
GST_ELEMENT_NAME (conn->src), GST_ELEMENT_NAME (ident));
gst_pad_push (conn->src->src, GST_BUFFER (gst_event_new (GST_EVENT_EOS)));
gst_element_set_eos (GST_ELEMENT (conn->src));
@ -194,7 +199,7 @@ gst_spider_identity_chain (GstPad *pad, GstBuffer *buf)
if ((ident->src != NULL) && (GST_PAD_PEER (ident->src) != NULL)) {
/* g_print("pushing buffer %p (refcount %d - buffersize %d) to pad %s:%s\n", buf, GST_BUFFER_REFCOUNT (buf), GST_BUFFER_SIZE (buf), GST_DEBUG_PAD_NAME (ident->src)); */
GST_DEBUG (0, "push %p %" G_GINT64_FORMAT, buf, GST_BUFFER_OFFSET (buf));
GST_LOG ( "push %p %" G_GINT64_FORMAT, buf, GST_BUFFER_OFFSET (buf));
gst_pad_push (ident->src, buf);
} else if (GST_IS_BUFFER (buf)) {
gst_buffer_unref (buf);
@ -272,7 +277,7 @@ gst_spider_identity_request_new_pad (GstElement *element, GstPadTemplate *templ
case GST_PAD_SINK:
if (ident->sink != NULL) break;
/* sink */
GST_DEBUG(0, "element %s requests new sink pad", GST_ELEMENT_NAME(ident));
GST_DEBUG ( "element %s requests new sink pad", GST_ELEMENT_NAME(ident));
ident->sink = gst_pad_new ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (ident), ident->sink);
gst_pad_set_link_function (ident->sink, GST_DEBUG_FUNCPTR (gst_spider_identity_link));
@ -282,7 +287,7 @@ gst_spider_identity_request_new_pad (GstElement *element, GstPadTemplate *templ
case GST_PAD_SRC:
/* src */
if (ident->src != NULL) break;
GST_DEBUG(0, "element %s requests new src pad", GST_ELEMENT_NAME(ident));
GST_DEBUG ( "element %s requests new src pad", GST_ELEMENT_NAME(ident));
ident->src = gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (ident), ident->src);
gst_pad_set_link_function (ident->src, GST_DEBUG_FUNCPTR (gst_spider_identity_link));
@ -293,7 +298,7 @@ gst_spider_identity_request_new_pad (GstElement *element, GstPadTemplate *templ
break;
}
GST_DEBUG(0, "element %s requested a new pad but none could be created", GST_ELEMENT_NAME(ident));
GST_DEBUG ( "element %s requested a new pad but none could be created", GST_ELEMENT_NAME(ident));
return NULL;
}
@ -354,7 +359,7 @@ gst_spider_identity_start_type_finding (GstSpiderIdentity *ident)
gchar *name;*/
gboolean restart = FALSE;
GST_DEBUG (GST_CAT_AUTOPLUG, "element %s starts typefinding", GST_ELEMENT_NAME(ident));
GST_DEBUG ("element %s starts typefinding", GST_ELEMENT_NAME(ident));
if (GST_STATE (GST_ELEMENT_PARENT (ident)) == GST_STATE_PLAYING)
{
gst_element_set_state (GST_ELEMENT (GST_ELEMENT_PARENT (ident)), GST_STATE_PAUSED);
@ -481,9 +486,9 @@ gst_spider_identity_sink_loop_type_finding (GstSpiderIdentity *ident)
GstTypeFactory *factory = GST_TYPE_FACTORY (factories->data);
GstTypeFindFunc typefindfunc = (GstTypeFindFunc)factory->typefindfunc;
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "trying typefind function %s", GST_PLUGIN_FEATURE_NAME (factory));
GST_DEBUG ("trying typefind function %s", GST_PLUGIN_FEATURE_NAME (factory));
if (typefindfunc && (caps = typefindfunc (buf, factory))) {
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT, "typefind function %s found caps", GST_PLUGIN_FEATURE_NAME (factory));
GST_INFO ("typefind function %s found caps", GST_PLUGIN_FEATURE_NAME (factory));
if (gst_pad_try_set_caps (ident->src, caps) <= 0) {
g_warning ("typefind: found type but peer didn't accept it");
gst_caps_sink (caps);
@ -526,7 +531,7 @@ gst_spider_identity_handle_src_event (GstPad *pad, GstEvent *event)
gboolean res = TRUE;
GstSpiderIdentity *ident;
GST_DEBUG (0, "spider_identity src_event");
GST_DEBUG ( "spider_identity src_event");
ident = GST_SPIDER_IDENTITY (gst_pad_get_parent (pad));

View file

@ -24,14 +24,12 @@
#ifndef __GST_SPIDER_IDENTITY_H__
#define __GST_SPIDER_IDENTITY_H__
#include <config.h>
#include <gst/gst.h>
G_BEGIN_DECLS
GstElementDetails gst_spider_identity_details;
extern GstElementDetails gst_spider_identity_details;
GST_DEBUG_CATEGORY_EXTERN(gst_spider_identity_debug);
#define GST_TYPE_SPIDER_IDENTITY \
(gst_spider_identity_get_type())

View file

@ -26,6 +26,9 @@
#define GST_AUTOPLUG_MAX_COST 999999
GST_DEBUG_CATEGORY_STATIC(debug_category);
#define GST_CAT_DEFAULT debug_category
typedef guint (*GstAutoplugCostFunction) (gpointer src, gpointer dest, gpointer data);
typedef const GList* (*GstAutoplugListFunction) (gpointer data);
@ -86,6 +89,8 @@ plugin_init (GModule *module, GstPlugin *plugin)
{
GstAutoplugFactory *factory;
GST_DEBUG_CATEGORY_INIT (debug_category, "STATIC_AUTOPLUG", 0, "static autoplugger element");
gst_plugin_set_longname (plugin, "A static autoplugger");
factory = gst_autoplug_factory_new ("static",
@ -124,9 +129,8 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)
desttemp->direction == GST_PAD_SINK) {
if (gst_caps_is_always_compatible (gst_pad_template_get_caps (srctemp),
gst_pad_template_get_caps (desttemp))) {
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT,
"factory \"%s\" can link with factory \"%s\"\n", GST_OBJECT_NAME (src),
GST_OBJECT_NAME (dest));
GST_DEBUG ("factory \"%s\" can link with factory \"%s\"\n", GST_OBJECT_NAME (src),
GST_OBJECT_NAME (dest));
return TRUE;
}
}
@ -135,9 +139,8 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)
}
srctemps = g_list_next (srctemps);
}
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT,
"factory \"%s\" cannot link with factory \"%s\"\n", GST_OBJECT_NAME (src),
GST_OBJECT_NAME (dest));
GST_DEBUG ("factory \"%s\" cannot link with factory \"%s\"\n", GST_OBJECT_NAME (src),
GST_OBJECT_NAME (dest));
return FALSE;
}
@ -147,8 +150,8 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink)
const GList *sinkpads;
gboolean linked = FALSE;
GST_DEBUG (0,"gstpipeline: autoplug pad link function for \"%s\" to \"%s\"",
GST_ELEMENT_NAME(src), GST_ELEMENT_NAME(sink));
GST_DEBUG ("gstpipeline: autoplug pad link function for \"%s\" to \"%s\"",
GST_ELEMENT_NAME(src), GST_ELEMENT_NAME(sink));
sinkpads = gst_element_get_pad_list(sink);
while (sinkpads) {
@ -160,22 +163,22 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink)
{
if (gst_caps_is_always_compatible (gst_pad_get_caps(pad), gst_pad_get_caps(sinkpad))) {
gst_pad_link(pad, sinkpad);
GST_DEBUG (0,"gstpipeline: autolink pad \"%s\" in element %s <-> ", GST_PAD_NAME (pad),
GST_DEBUG ("gstpipeline: autolink pad \"%s\" in element %s <-> ", GST_PAD_NAME (pad),
GST_ELEMENT_NAME(src));
GST_DEBUG (0,"pad \"%s\" in element %s", GST_PAD_NAME (sinkpad),
GST_DEBUG ("pad \"%s\" in element %s", GST_PAD_NAME (sinkpad),
GST_ELEMENT_NAME(sink));
linked = TRUE;
break;
}
else {
GST_DEBUG (0,"pads incompatible %s, %s", GST_PAD_NAME (pad), GST_PAD_NAME (sinkpad));
GST_DEBUG ("pads incompatible %s, %s", GST_PAD_NAME (pad), GST_PAD_NAME (sinkpad));
}
}
sinkpads = g_list_next(sinkpads);
}
if (!linked) {
GST_DEBUG (0,"gstpipeline: no path to sinks for type");
GST_DEBUG ("gstpipeline: no path to sinks for type");
}
return linked;
}
@ -192,8 +195,8 @@ autoplug_dynamic_pad (GstElement *element, GstPad *pad, gpointer data)
dynamic_pad_struct *info = (dynamic_pad_struct *)data;
const GList *pads = gst_element_get_pad_list (element);
GST_DEBUG (0,"attempting to dynamically create a ghostpad for %s=%s", GST_ELEMENT_NAME (element),
GST_PAD_NAME (pad));
GST_DEBUG ("attempting to dynamically create a ghostpad for %s=%s", GST_ELEMENT_NAME (element),
GST_PAD_NAME (pad));
while (pads) {
GstPad *pad = GST_PAD (pads->data);
@ -207,7 +210,7 @@ autoplug_dynamic_pad (GstElement *element, GstPad *pad, gpointer data)
gst_element_add_ghost_pad (info->result, pad, name);
g_free (name);
GST_DEBUG (0,"gstpipeline: new dynamic pad %s", GST_PAD_NAME (pad));
GST_DEBUG ("gstpipeline: new dynamic pad %s", GST_PAD_NAME (pad));
break;
}
}
@ -231,7 +234,7 @@ gst_autoplug_pads_autoplug (GstElement *src, GstElement *sink)
}
if (!linked) {
GST_DEBUG (0,"gstpipeline: delaying pad links for \"%s\" to \"%s\"",
GST_DEBUG ("gstpipeline: delaying pad links for \"%s\" to \"%s\"",
GST_ELEMENT_NAME(src), GST_ELEMENT_NAME(sink));
g_signal_connect (G_OBJECT(src), "new_pad",
G_CALLBACK (gst_autoplug_pads_autoplug_func), sink);
@ -302,7 +305,7 @@ gst_static_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *s
caps.sink = capslist;
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"autoplugging two caps structures");
GST_INFO ("autoplugging two caps structures");
elements = gst_autoplug_func (caps.src, caps.sink,
gst_autoplug_element_factory_get_list,
@ -371,7 +374,7 @@ gst_static_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *s
}
}
GST_DEBUG (0,"common factory \"%s\"", GST_OBJECT_NAME (factory));
GST_DEBUG ("common factory \"%s\"", GST_OBJECT_NAME (factory));
/* it is likely that the plugin is not loaded yet. thus when it loads it
* will replace the elementfactory that gst built from the cache, and the
@ -433,10 +436,10 @@ differ:
factory = (GstElementFactory *)(factories[i]->data);
GST_DEBUG (0,"factory \"%s\"", GST_OBJECT_NAME (factory));
GST_DEBUG ("factory \"%s\"", GST_OBJECT_NAME (factory));
element = gst_element_factory_create(factory, GST_OBJECT_NAME (factory));
GST_DEBUG (0,"adding element %s", GST_ELEMENT_NAME (element));
GST_DEBUG ("adding element %s", GST_ELEMENT_NAME (element));
gst_bin_add(GST_BIN(thebin), element);
gst_autoplug_signal_new_object (GST_AUTOPLUG (autoplug), GST_OBJECT (element));
@ -457,7 +460,7 @@ differ:
gboolean have_pad = FALSE;
endcaps = g_list_next (endcaps);
GST_DEBUG (0,"attempting to create a ghostpad for %s", GST_ELEMENT_NAME (thesrcelement));
GST_DEBUG ("attempting to create a ghostpad for %s", GST_ELEMENT_NAME (thesrcelement));
while (pads) {
GstPad *pad = GST_PAD (pads->data);
@ -482,7 +485,7 @@ differ:
data->endcap = endcap;
data->i = i;
GST_DEBUG (0,"delaying the creation of a ghostpad for %s", GST_ELEMENT_NAME (thesrcelement));
GST_DEBUG ("delaying the creation of a ghostpad for %s", GST_ELEMENT_NAME (thesrcelement));
g_signal_connect (G_OBJECT (thesrcelement), "new_pad",
G_CALLBACK (autoplug_dynamic_pad), data);
}
@ -525,7 +528,7 @@ construct_path (gst_autoplug_node *rgnNodes, gpointer factory)
current = rgnNodes[find_factory(rgnNodes, factory)].iPrev;
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factories found in autoplugging (reversed order)");
GST_INFO ("factories found in autoplugging (reversed order)");
while (current != NULL)
{
@ -534,7 +537,7 @@ construct_path (gst_autoplug_node *rgnNodes, gpointer factory)
next = rgnNodes[find_factory(rgnNodes, current)].iPrev;
if (next) {
factories = g_list_prepend (factories, current);
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory: \"%s\"", GST_OBJECT_NAME (current));
GST_INFO ("factory: \"%s\"", GST_OBJECT_NAME (current));
}
current = next;
}
@ -642,4 +645,3 @@ gst_autoplug_func (gpointer src, gpointer sink,
return construct_path (rgnNodes, sink);
}

View file

@ -26,6 +26,9 @@
#define GST_AUTOPLUG_MAX_COST 999999
GST_DEBUG_CATEGORY_STATIC(debug_category);
#define GST_CAT_DEFAULT debug_category
typedef guint (*GstAutoplugCostFunction) (gpointer src, gpointer dest, gpointer data);
typedef GList* (*GstAutoplugListFunction) (gpointer data);
@ -88,6 +91,8 @@ plugin_init (GModule *module, GstPlugin *plugin)
gst_plugin_set_longname (plugin, "A static autoplugger");
GST_DEBUG_CATEGORY_INIT (debug_category, "STATIC_AUTOPLUG", 0, "static autoplug render element");
factory = gst_autoplug_factory_new ("staticrender",
"A static autoplugger, it constructs the complete element before running it",
gst_static_autoplug_render_get_type ());
@ -153,18 +158,16 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)
if (desttemp->direction == GST_PAD_SINK && desttemp->presence != GST_PAD_REQUEST) {
if (gst_caps_is_always_compatible (GST_PAD_TEMPLATE_CAPS (srctemp), GST_PAD_TEMPLATE_CAPS (desttemp))) {
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT,
"factory \"%s\" can link with factory \"%s\"",
GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest));
GST_DEBUG ("factory \"%s\" can link with factory \"%s\"",
GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest));
return TRUE;
}
}
}
}
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT,
"factory \"%s\" cannot link with factory \"%s\"",
GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest));
GST_DEBUG ("factory \"%s\" cannot link with factory \"%s\"",
GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest));
return FALSE;
}
@ -175,7 +178,7 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink)
gboolean linked = FALSE;
GstElementState state = GST_STATE (gst_element_get_parent (src));
GST_DEBUG (0,"gstpipeline: autoplug pad link function for %s %s:%s to \"%s\"",
GST_DEBUG ("gstpipeline: autoplug pad link function for %s %s:%s to \"%s\"",
GST_ELEMENT_NAME (src), GST_DEBUG_PAD_NAME(pad), GST_ELEMENT_NAME(sink));
if (state == GST_STATE_PLAYING)
@ -194,7 +197,7 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink)
break;
}
else {
GST_DEBUG (0,"pads incompatible %s, %s", GST_PAD_NAME (pad), GST_PAD_NAME (sinkpad));
GST_DEBUG ("pads incompatible %s, %s", GST_PAD_NAME (pad), GST_PAD_NAME (sinkpad));
}
}
sinkpads = g_list_next(sinkpads);
@ -204,7 +207,7 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink)
gst_element_set_state (GST_ELEMENT (gst_element_get_parent (src)), GST_STATE_PLAYING);
if (!linked) {
GST_DEBUG (0,"gstpipeline: no path to sinks for type");
GST_DEBUG ("gstpipeline: no path to sinks for type");
}
return linked;
}
@ -230,7 +233,7 @@ gst_autoplug_pads_autoplug (GstElement *src, GstElement *sink)
}
if (!linked) {
GST_DEBUG (0,"gstpipeline: delaying pad links for \"%s\" to \"%s\"",
GST_DEBUG ("gstpipeline: delaying pad links for \"%s\" to \"%s\"",
GST_ELEMENT_NAME(src), GST_ELEMENT_NAME(sink));
g_signal_connect (G_OBJECT(src),"new_pad",
G_CALLBACK (gst_autoplug_pads_autoplug_func), sink);
@ -257,7 +260,6 @@ gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
if (IS_CAPS (src) && IS_CAPS (dest)) {
res = gst_caps_is_always_compatible ((GstCaps *)src, (GstCaps *)dest);
/*GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"caps %d to caps %d %d", ((GstCaps *)src)->id, ((GstCaps *)dest)->id, res); */
}
else if (IS_CAPS (src)) {
GstPadTemplate *templ;
@ -269,7 +271,6 @@ gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
else
res = FALSE;
/*GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory %s to src caps %d %d", ((GstElementFactory *)dest)->name, ((GstCaps *)src)->id, res);*/
}
else if (IS_CAPS (dest)) {
GstPadTemplate *templ;
@ -280,12 +281,10 @@ gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
res = TRUE;
else
res = FALSE;
/*GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory %s to sink caps %d %d", ((GstElementFactory *)src)->name, ((GstCaps *)dest)->id, res);*/
}
else {
res = gst_autoplug_can_match ((GstElementFactory *)src, (GstElementFactory *)dest);
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory %s to factory %s %d",
GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest), res);
GST_INFO ("factory %s to factory %s %d", GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest), res);
}
if (res)
@ -328,7 +327,7 @@ gst_static_autoplug_to_render (GstAutoplug *autoplug, GstCaps *srccaps, GstEleme
else
goto next;
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"autoplugging two caps structures");
GST_INFO ("autoplugging two caps structures");
elements = gst_autoplug_func (caps.src, caps.sink,
gst_autoplug_element_factory_get_list,
@ -396,7 +395,7 @@ next:
}
}
GST_DEBUG (0,"common factory \"%s\"", GST_OBJECT_NAME (factory));
GST_DEBUG ("common factory \"%s\"", GST_OBJECT_NAME (factory));
element = gst_element_factory_create (factory, g_strdup (GST_OBJECT_NAME (factory)));
gst_bin_add (GST_BIN(result), element);
@ -456,7 +455,7 @@ differ:
if (factories[i]) {
factory = (GstElementFactory *)(factories[i]->data);
GST_DEBUG (0,"factory \"%s\"", GST_OBJECT_NAME (factory));
GST_DEBUG ("factory \"%s\"", GST_OBJECT_NAME (factory));
element = gst_element_factory_create(factory, g_strdup (GST_OBJECT_NAME (factory)));
}
else {
@ -472,11 +471,11 @@ differ:
use_thread = FALSE;
GST_DEBUG (0,"sugest new thread for \"%s\" %08x", GST_ELEMENT_NAME (element), GST_FLAGS(element));
GST_DEBUG ("sugest new thread for \"%s\" %08x", GST_ELEMENT_NAME (element), GST_FLAGS(element));
/* create a new queue and add to the previous bin */
queue = gst_element_factory_make("queue", g_strconcat("queue_", GST_ELEMENT_NAME(element), NULL));
GST_DEBUG (0,"adding element \"%s\"", GST_ELEMENT_NAME (element));
GST_DEBUG ("adding element \"%s\"", GST_ELEMENT_NAME (element));
/* this will be the new bin for all following elements */
thebin = gst_element_factory_make("thread", g_strconcat("thread_", GST_ELEMENT_NAME(element), NULL));
@ -488,17 +487,17 @@ differ:
gst_autoplug_pads_autoplug(thesrcelement, queue);
GST_DEBUG (0,"adding element %s", GST_ELEMENT_NAME (element));
GST_DEBUG ("adding element %s", GST_ELEMENT_NAME (element));
gst_bin_add(GST_BIN(thebin), element);
gst_autoplug_signal_new_object (GST_AUTOPLUG (autoplug), GST_OBJECT (element));
GST_DEBUG (0,"adding element %s", GST_ELEMENT_NAME (thebin));
GST_DEBUG ("adding element %s", GST_ELEMENT_NAME (thebin));
gst_bin_add(GST_BIN(current_bin), thebin);
gst_autoplug_signal_new_object (GST_AUTOPLUG (autoplug), GST_OBJECT (thebin));
thesrcelement = queue;
}
/* no thread needed, easy case */
else {
GST_DEBUG (0,"adding element %s", GST_ELEMENT_NAME (element));
GST_DEBUG ("adding element %s", GST_ELEMENT_NAME (element));
gst_bin_add(GST_BIN(thebin), element);
gst_autoplug_signal_new_object (GST_AUTOPLUG (autoplug), GST_OBJECT (element));
}
@ -547,7 +546,7 @@ construct_path (gst_autoplug_node *rgnNodes, gpointer factory)
current = rgnNodes[find_factory(rgnNodes, factory)].iPrev;
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factories found in autoplugging (reversed order)");
GST_INFO ("factories found in autoplugging (reversed order)");
while (current != NULL)
{
@ -556,7 +555,7 @@ construct_path (gst_autoplug_node *rgnNodes, gpointer factory)
next = rgnNodes[find_factory(rgnNodes, current)].iPrev;
if (next) {
factories = g_list_prepend (factories, current);
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory: \"%s\"", GST_OBJECT_NAME (current));
GST_INFO ("factory: \"%s\"", GST_OBJECT_NAME (current));
}
current = next;
}
@ -664,4 +663,3 @@ gst_autoplug_func (gpointer src, gpointer sink,
return construct_path (rgnNodes, sink);
}

View file

@ -34,7 +34,7 @@
#include "cothreads.h"
#include "gstarch.h"
#include "gstlog.h"
#include "gstinfo.h"
#include "gstutils.h"
#ifdef HAVE_UCONTEXT_H
@ -113,7 +113,7 @@ cothread_context_init (void)
* just return it */
ctx = g_static_private_get (&_cothread_ctx_key);
if (ctx) {
GST_INFO (GST_CAT_COTHREADS,
GST_CAT_INFO (GST_CAT_COTHREADS,
"returning private _cothread_ctx_key %p", ctx);
return ctx;
}
@ -129,10 +129,10 @@ cothread_context_init (void)
ctx->data = g_hash_table_new (g_str_hash, g_str_equal);
ctx->thread = g_thread_self();
GST_INFO (GST_CAT_COTHREADS, "initializing cothreads");
GST_CAT_INFO (GST_CAT_COTHREADS, "initializing cothreads");
/* set this thread's context pointer */
GST_INFO (GST_CAT_COTHREADS, "setting private _cothread_ctx_key to %p in thread %p",
GST_CAT_INFO (GST_CAT_COTHREADS, "setting private _cothread_ctx_key to %p in thread %p",
ctx,g_thread_self());
g_static_private_set (&_cothread_ctx_key, ctx, NULL);
@ -149,7 +149,7 @@ cothread_context_init (void)
/* FIXME: an assumption is made that the stack segment is STACK_SIZE
* aligned. */
ctx->stack_top = ((gulong) current_stack_frame | (STACK_SIZE - 1)) + 1;
GST_DEBUG (GST_CAT_COTHREADS, "stack top is 0x%08lx", ctx->stack_top);
GST_CAT_DEBUG (GST_CAT_COTHREADS, "stack top is 0x%08lx", ctx->stack_top);
/*
* initialize the 0th cothread
@ -164,7 +164,7 @@ cothread_context_init (void)
ctx->cothreads[0]->flags = COTHREAD_STARTED;
ctx->cothreads[0]->sp = (void *) current_stack_frame;
GST_INFO (GST_CAT_COTHREADS, "0th cothread is %p at sp:%p",
GST_CAT_INFO (GST_CAT_COTHREADS, "0th cothread is %p at sp:%p",
ctx->cothreads[0], ctx->cothreads[0]->sp);
return ctx;
@ -185,7 +185,7 @@ cothread_context_free (cothread_context *ctx)
g_assert (ctx->thread == g_thread_self());
g_assert (ctx->current == 0);
GST_INFO (GST_CAT_COTHREADS, "free cothread context");
GST_CAT_INFO (GST_CAT_COTHREADS, "free cothread context");
for (i = 1; i < COTHREAD_MAXTHREADS; i++) {
if (ctx->cothreads[i]) {
@ -198,7 +198,7 @@ cothread_context_free (cothread_context *ctx)
}
g_hash_table_destroy (ctx->data);
/* make sure we free the private key for cothread context */
GST_INFO (GST_CAT_COTHREADS, "setting private _cothread_ctx_key to NULL in thread %p",
GST_CAT_INFO (GST_CAT_COTHREADS, "setting private _cothread_ctx_key to NULL in thread %p",
g_thread_self());
g_static_private_set (&_cothread_ctx_key, NULL, NULL);
g_free (ctx);
@ -222,7 +222,7 @@ cothread_create (cothread_context *ctx)
g_return_val_if_fail (ctx != NULL, NULL);
GST_DEBUG (GST_CAT_COTHREADS, "manager sef %p, cothread self %p",
GST_CAT_DEBUG (GST_CAT_COTHREADS, "manager sef %p, cothread self %p",
ctx->thread, g_thread_self());
if (ctx->ncothreads == COTHREAD_MAXTHREADS) {
@ -241,21 +241,21 @@ cothread_create (cothread_context *ctx)
}
}
GST_DEBUG (GST_CAT_COTHREADS, "Found free cothread slot %d", slot);
GST_CAT_DEBUG (GST_CAT_COTHREADS, "Found free cothread slot %d", slot);
/* cothread stack space of the thread is mapped in reverse, with cothread 0
* stack space at the top */
cothread = (cothread_state *) (ctx->stack_top - (slot + 1) * COTHREAD_STACKSIZE);
GST_DEBUG (GST_CAT_COTHREADS, "cothread pointer is %p", cothread);
GST_CAT_DEBUG (GST_CAT_COTHREADS, "cothread pointer is %p", cothread);
#if 0
/* This tests to see whether or not we can grow down the stack */
{
unsigned long ptr;
for(ptr=ctx->stack_top - 4096; ptr > (unsigned long)cothread; ptr -= 4096){
GST_DEBUG (GST_CAT_COTHREADS, "touching location 0x%08lx", ptr);
GST_CAT_DEBUG (GST_CAT_COTHREADS, "touching location 0x%08lx", ptr);
*(volatile unsigned int *)ptr = *(volatile unsigned int *)ptr;
GST_DEBUG (GST_CAT_COTHREADS, "ok (0x%08x)", *(unsigned int *)ptr);
GST_CAT_DEBUG (GST_CAT_COTHREADS, "ok (0x%08x)", *(unsigned int *)ptr);
}
}
#endif
@ -268,7 +268,7 @@ cothread_create (cothread_context *ctx)
/* The mmap is necessary on Linux/i386, and possibly others, since the
* kernel is picky about when we can expand our stack. */
GST_DEBUG (GST_CAT_COTHREADS, "mmaping %p, size 0x%08x", cothread,
GST_CAT_DEBUG (GST_CAT_COTHREADS, "mmaping %p, size 0x%08x", cothread,
COTHREAD_STACKSIZE);
/* Remap with a guard page. This decreases our stack size by 8 kB (for
* 4 kB pages) and also wastes almost 4 kB for the cothreads
@ -281,7 +281,7 @@ cothread_create (cothread_context *ctx)
COTHREAD_STACKSIZE - page_size * 2,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
GST_DEBUG (GST_CAT_COTHREADS, "coming out of mmap");
GST_CAT_DEBUG (GST_CAT_COTHREADS, "coming out of mmap");
if (mmaped == MAP_FAILED) {
perror ("mmap'ing cothread stack space");
return NULL;
@ -292,7 +292,7 @@ cothread_create (cothread_context *ctx)
}
cothread->magic_number = COTHREAD_MAGIC_NUMBER;
GST_DEBUG (GST_CAT_COTHREADS, "create cothread %d with magic number 0x%x",
GST_CAT_DEBUG (GST_CAT_COTHREADS, "create cothread %d with magic number 0x%x",
slot, cothread->magic_number);
cothread->ctx = ctx;
cothread->cothreadnum = slot;
@ -302,7 +302,7 @@ cothread_create (cothread_context *ctx)
cothread->stack_size = COTHREAD_STACKSIZE - page_size * 2;
cothread->stack_base = (void *)cothread + 2 * page_size;
GST_INFO (GST_CAT_COTHREADS,
GST_CAT_INFO (GST_CAT_COTHREADS,
"created cothread #%d in slot %d: %p at sp:%p",
ctx->ncothreads, slot, cothread, cothread->sp);
@ -323,7 +323,7 @@ cothread_free (cothread_state *cothread)
{
g_return_if_fail (cothread != NULL);
GST_INFO (GST_CAT_COTHREADS, "flag cothread %d for destruction",
GST_CAT_INFO (GST_CAT_COTHREADS, "flag cothread %d for destruction",
cothread->cothreadnum);
/* we simply flag the cothread for destruction here */
@ -346,7 +346,7 @@ cothread_destroy (cothread_state *cothread)
g_assert (ctx->thread == g_thread_self());
g_assert (ctx == cothread_get_current_context());
GST_INFO (GST_CAT_COTHREADS, "destroy cothread %d %p %d",
GST_CAT_INFO (GST_CAT_COTHREADS, "destroy cothread %d %p %d",
cothreadnum, cothread, ctx->current);
/* cothread 0 needs to be destroyed specially */
@ -357,7 +357,7 @@ cothread_destroy (cothread_state *cothread)
cothread_unlock (cothread);
/* doing cleanups of the cothread create */
GST_DEBUG (GST_CAT_COTHREADS, "destroy cothread %d with magic number 0x%x",
GST_CAT_DEBUG (GST_CAT_COTHREADS, "destroy cothread %d with magic number 0x%x",
cothreadnum, cothread->magic_number);
g_assert (cothread->magic_number == COTHREAD_MAGIC_NUMBER);
@ -411,7 +411,7 @@ cothread_main (cothread_context* ctx)
{
g_assert (ctx->thread == g_thread_self());
GST_DEBUG (GST_CAT_COTHREADS, "returning %p, the 0th cothread",
GST_CAT_DEBUG (GST_CAT_COTHREADS, "returning %p, the 0th cothread",
ctx->cothreads[0]);
return ctx->cothreads[0];
}
@ -451,22 +451,22 @@ cothread_stub (void)
{
cothread_context *ctx = cothread_get_current_context();
cothread_state *cothread = ctx->cothreads[ctx->current];
#ifndef GST_DISABLE_GST_DEBUG
char __csf;
void *current_stack_frame = &__csf;
#endif
GST_DEBUG_ENTER ("");
GST_DEBUG (GST_CAT_COTHREADS, "stack addr %p", &ctx);
GST_CAT_DEBUG (GST_CAT_COTHREADS, "stack addr %p", &ctx);
cothread->flags |= COTHREAD_STARTED;
while (TRUE) {
cothread->func (cothread->argc, cothread->argv);
GST_DEBUG (GST_CAT_COTHREADS, "cothread[%d] thread->func exited", ctx->current);
GST_CAT_DEBUG (GST_CAT_COTHREADS, "cothread[%d] thread->func exited", ctx->current);
GST_DEBUG (GST_CAT_COTHREADS, "sp=%p", current_stack_frame);
GST_DEBUG (GST_CAT_COTHREADS, "ctx=%p current=%p", ctx,cothread_get_current_context());
GST_CAT_DEBUG (GST_CAT_COTHREADS, "sp=%p", current_stack_frame);
GST_CAT_DEBUG (GST_CAT_COTHREADS, "ctx=%p current=%p", ctx,cothread_get_current_context());
g_assert (ctx == cothread_get_current_context());
g_assert (ctx->current != 0);
@ -474,7 +474,6 @@ cothread_stub (void)
/* we do this to avoid ever returning, we just switch to 0th thread */
cothread_switch (cothread_main (ctx));
}
GST_DEBUG_LEAVE ("");
}
/**
@ -594,26 +593,23 @@ cothread_switch (cothread_state *cothread)
/* find the number of the thread to switch to */
GST_INFO (GST_CAT_COTHREAD_SWITCH,
GST_CAT_INFO (GST_CAT_COTHREAD_SWITCH,
"switching from cothread #%d to cothread #%d",
ctx->current, cothread->cothreadnum);
ctx->current = cothread->cothreadnum;
g_static_private_set (&_gst_debug_cothread_index,
GINT_TO_POINTER(ctx->current), NULL);
/* save the current stack pointer, frame pointer, and pc */
#ifdef GST_ARCH_PRESETJMP
GST_ARCH_PRESETJMP ();
#endif
enter = setjmp (current->jmp);
if (enter != 0) {
GST_DEBUG (GST_CAT_COTHREADS,
GST_CAT_DEBUG (GST_CAT_COTHREADS,
"enter cothread #%d %d sp=%p jmpbuf=%p",
current->cothreadnum, enter, current->sp, current->jmp);
return;
}
GST_DEBUG (GST_CAT_COTHREADS, "exit cothread #%d %d sp=%p jmpbuf=%p",
GST_CAT_DEBUG (GST_CAT_COTHREADS, "exit cothread #%d %d sp=%p jmpbuf=%p",
current->cothreadnum, enter, current->sp, current->jmp);
enter = 1;
@ -621,10 +617,10 @@ cothread_switch (cothread_state *cothread)
cothread_destroy (current);
}
GST_DEBUG (GST_CAT_COTHREADS, "set stack to %p", cothread->sp);
GST_CAT_DEBUG (GST_CAT_COTHREADS, "set stack to %p", cothread->sp);
/* restore stack pointer and other stuff of new cothread */
if (cothread->flags & COTHREAD_STARTED) {
GST_DEBUG (GST_CAT_COTHREADS, "via longjmp() jmpbuf %p", cothread->jmp);
GST_CAT_DEBUG (GST_CAT_COTHREADS, "via longjmp() jmpbuf %p", cothread->jmp);
/* switch to it */
longjmp (cothread->jmp, 1);
}
@ -632,7 +628,7 @@ cothread_switch (cothread_state *cothread)
#ifdef HAVE_MAKECONTEXT
ucontext_t ucp;
GST_DEBUG (GST_CAT_COTHREADS, "making context");
GST_CAT_DEBUG (GST_CAT_COTHREADS, "making context");
g_assert (cothread != cothread_main(ctx));
@ -648,7 +644,7 @@ cothread_switch (cothread_state *cothread)
GST_ARCH_CALL (cothread_stub);
#endif
GST_DEBUG (GST_CAT_COTHREADS, "exit thread ");
GST_CAT_DEBUG (GST_CAT_COTHREADS, "exit thread ");
ctx->current = 0;
}

View file

@ -20,8 +20,14 @@
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstaggregator.h"
GST_DEBUG_CATEGORY (gst_aggregator_debug);
#define GST_CAT_DEFAULT gst_aggregator_debug
GstElementDetails gst_aggregator_details = {
"Aggregator pipe fitting",
@ -354,4 +360,3 @@ gst_aggregator_factory_init (GstElementFactory *factory)
return TRUE;
}

View file

@ -29,6 +29,7 @@
G_BEGIN_DECLS
extern GstElementDetails gst_aggregator_details;
GST_DEBUG_CATEGORY_EXTERN(gst_aggregator_debug);
typedef enum {
AGGREGATOR_LOOP = 1,

View file

@ -21,8 +21,13 @@
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <gst/gst.h>
#include "gstfilesrc.h"
#include "gstfilesink.h"
#include "gstidentity.h"
#include "gstfakesink.h"
@ -75,7 +80,22 @@ plugin_init (GModule *module, GstPlugin *plugin)
gst_plugin_set_longname (plugin, "Standard GST Elements");
while (_elements[i].name) {
GST_DEBUG_CATEGORY_INIT (gst_fakesrc_debug, "fakesrc", 0, "fakesrc element");
GST_DEBUG_CATEGORY_INIT (gst_fakesink_debug, "fakesink", 0, "fakesink element");
GST_DEBUG_CATEGORY_INIT (gst_filesrc_debug, "filesrc", 0, "filesrc element");
GST_DEBUG_CATEGORY_INIT (gst_filesink_debug, "fakesink", 0, "filesink element");
GST_DEBUG_CATEGORY_INIT (gst_identity_debug, "identity", 0, "identity element");
GST_DEBUG_CATEGORY_INIT (gst_fdsrc_debug, "fdsrc", 0, "fdsrc element");
GST_DEBUG_CATEGORY_INIT (gst_fdsink_debug, "fdsink", 0, "fdsink element");
GST_DEBUG_CATEGORY_INIT (gst_multidisksrc_debug, "multidisksrc", 0, "multidisksrc element");
GST_DEBUG_CATEGORY_INIT (gst_pipefilter_debug, "pipefilter", 0, "pipefilter element");
GST_DEBUG_CATEGORY_INIT (gst_tee_debug, "tee", 0, "tee element");
GST_DEBUG_CATEGORY_INIT (gst_aggregator_debug, "aggregator", 0, "aggregator element");
GST_DEBUG_CATEGORY_INIT (gst_shaper_debug, "shaper", 0, "shaper element");
GST_DEBUG_CATEGORY_INIT (gst_statistics_debug, "statistics", 0, "statistics element");
GST_DEBUG_CATEGORY_INIT (gst_md5sink_debug, "md5sink", 0, "md5sink element");
while (_elements[i].name) {
factory = gst_element_factory_new (_elements[i].name,
(_elements[i].type) (),
_elements[i].details);
@ -107,4 +127,3 @@ GstPluginDesc plugin_desc = {
"gstelements",
plugin_init
};

View file

@ -21,8 +21,14 @@
*/
#include <gstfakesink.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstfakesink.h"
GST_DEBUG_CATEGORY (gst_fakesink_debug);
#define GST_CAT_DEFAULT gst_fakesink_debug
GstElementDetails gst_fakesink_details = {
"Fake Sink",

View file

@ -24,14 +24,12 @@
#ifndef __GST_FAKESINK_H__
#define __GST_FAKESINK_H__
#include <config.h>
#include <gst/gst.h>
G_BEGIN_DECLS
GstElementDetails gst_fakesink_details;
extern GstElementDetails gst_fakesink_details;
GST_DEBUG_CATEGORY_EXTERN(gst_fakesink_debug);
#define GST_TYPE_FAKESINK \
(gst_fakesink_get_type())

View file

@ -24,12 +24,19 @@
#include <stdlib.h>
#include <string.h>
#include <gstfakesrc.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstfakesrc.h"
#define DEFAULT_SIZEMIN 0
#define DEFAULT_SIZEMAX 4096
#define DEFAULT_PARENTSIZE 4096*10
GST_DEBUG_CATEGORY (gst_fakesrc_debug);
#define GST_CAT_DEFAULT gst_fakesrc_debug
GstElementDetails gst_fakesrc_details = {
"Fake Source",
"Source",
@ -502,7 +509,7 @@ gst_fakesrc_set_property (GObject *object, guint prop_id, const GValue *value, G
break;
case ARG_EOS:
src->eos = g_value_get_boolean (value);
GST_INFO (0, "will EOS on next buffer");
GST_INFO ( "will EOS on next buffer");
break;
case ARG_SILENT:
src->silent = g_value_get_boolean (value);
@ -753,7 +760,7 @@ gst_fakesrc_get(GstPad *pad)
}
if (src->eos) {
GST_INFO (0, "fakesrc is setting eos on pad");
GST_INFO ( "fakesrc is setting eos on pad");
return GST_BUFFER(gst_event_new (GST_EVENT_EOS));
}
@ -770,10 +777,10 @@ gst_fakesrc_get(GstPad *pad)
g_object_notify (G_OBJECT (src), "last_message");
}
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, src, "pre handoff emit");
GST_LOG_OBJECT (src, "pre handoff emit");
g_signal_emit (G_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF], 0,
buf, pad);
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, src, "post handoff emit");
GST_LOG_OBJECT (src, "post handoff emit");
return buf;
}
@ -866,4 +873,3 @@ gst_fakesrc_factory_init (GstElementFactory *factory)
return TRUE;
}

View file

@ -24,13 +24,12 @@
#ifndef __GST_FAKESRC_H__
#define __GST_FAKESRC_H__
#include <config.h>
#include <gst/gst.h>
G_BEGIN_DECLS
GstElementDetails gst_fakesrc_details;
extern GstElementDetails gst_fakesrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_fakesrc_debug);
typedef enum {
FAKESRC_FIRST_LAST_LOOP = 1,

View file

@ -20,9 +20,15 @@
* Boston, MA 02111-1307, USA.
*/
#include <gstfdsink.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstfdsink.h"
#include <unistd.h>
GST_DEBUG_CATEGORY (gst_fdsink_debug);
#define GST_CAT_DEFAULT gst_fdsink_debug
GstElementDetails gst_fdsink_details = {
"Filedescriptor Sink",
@ -122,7 +128,7 @@ gst_fdsink_chain (GstPad *pad, GstBuffer *buf)
g_return_if_fail (fdsink->fd >= 0);
if (GST_BUFFER_DATA (buf)) {
GST_DEBUG (0,"writing %d bytes to file descriptor %d",GST_BUFFER_SIZE (buf), fdsink->fd);
GST_DEBUG ("writing %d bytes to file descriptor %d",GST_BUFFER_SIZE (buf), fdsink->fd);
write (fdsink->fd, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
}

View file

@ -24,14 +24,12 @@
#ifndef __GST_FDSINK_H__
#define __GST_FDSINK_H__
#include <config.h>
#include <gst/gst.h>
G_BEGIN_DECLS
GstElementDetails gst_fdsink_details;
extern GstElementDetails gst_fdsink_details;
GST_DEBUG_CATEGORY_EXTERN(gst_fdsink_debug);
#define GST_TYPE_FDSINK \
(gst_fdsink_get_type())

View file

@ -27,10 +27,17 @@
#include <unistd.h>
#include <stdlib.h>
#include <gstfdsrc.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstfdsrc.h"
#define DEFAULT_BLOCKSIZE 4096
GST_DEBUG_CATEGORY (gst_fdsrc_debug);
#define GST_CAT_DEFAULT gst_fdsrc_debug
GstElementDetails gst_fdsrc_details =
{
"Disk Source",

View file

@ -24,14 +24,12 @@
#ifndef __GST_FDSRC_H__
#define __GST_FDSRC_H__
#include <config.h>
#include <gst/gst.h>
G_BEGIN_DECLS
GstElementDetails gst_fdsrc_details;
extern GstElementDetails gst_fdsrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_fdsrc_debug);
#define GST_TYPE_FDSRC \
(gst_fdsrc_get_type())

View file

@ -21,11 +21,18 @@
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <gst/gst.h>
#include <errno.h>
#include "gstfilesink.h"
#include <string.h>
GST_DEBUG_CATEGORY (gst_filesink_debug);
#define GST_CAT_DEFAULT gst_filesink_debug
GstElementDetails gst_filesink_details = {
"File Sink",
"Sink/File",

View file

@ -24,14 +24,12 @@
#ifndef __GST_FILESINK_H__
#define __GST_FILESINK_H__
#include <config.h>
#include <gst/gst.h>
G_BEGIN_DECLS
GstElementDetails gst_filesink_details;
extern GstElementDetails gst_filesink_details;
GST_DEBUG_CATEGORY_EXTERN(gst_filesink_debug);
#define GST_TYPE_FILESINK \
(gst_filesink_get_type())

View file

@ -20,8 +20,11 @@
* Boston, MA 02111-1307, USA.
*/
#include <gst/gst.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <gst/gst.h>
#include "gstfilesrc.h"
#include <stdio.h>
@ -69,6 +72,9 @@
*/
GST_DEBUG_CATEGORY (gst_filesrc_debug);
#define GST_CAT_DEFAULT gst_filesrc_debug
GstElementDetails gst_filesrc_details = {
"File Source",
"Source/File",
@ -299,7 +305,7 @@ gst_filesrc_set_property (GObject *object, guint prop_id, const GValue *value, G
src->mapsize = g_value_get_ulong (value);
g_object_notify (G_OBJECT (src), "mmapsize");
} else {
GST_INFO (0, "invalid mapsize, must a multiple of pagesize, which is %d",
GST_INFO ( "invalid mapsize, must a multiple of pagesize, which is %d",
src->pagesize);
}
break;
@ -369,7 +375,7 @@ gst_filesrc_free_parent_mmap (GstBuffer *buf)
munmap (GST_BUFFER_DATA (buf), GST_BUFFER_MAXSIZE (buf));
/* cast to unsigned long, since there's no gportable way to print
* guint64 as hex */
GST_DEBUG (0, "unmapped region %08lx+%08lx at %p",
GST_DEBUG ( "unmapped region %08lx+%08lx at %p",
(unsigned long) GST_BUFFER_OFFSET (buf),
(unsigned long) GST_BUFFER_MAXSIZE (buf),
GST_BUFFER_DATA (buf));
@ -400,7 +406,7 @@ gst_filesrc_map_region (GstFileSrc *src, off_t offset, size_t size)
size, src->fd, offset, strerror (errno));
return NULL;
}
GST_DEBUG (0, "mapped region %08lx+%08lx from file into memory at %p",
GST_DEBUG ( "mapped region %08lx+%08lx from file into memory at %p",
(unsigned long)offset, (unsigned long)size, mmapregion);
/* time to allocate a new mapbuf */
@ -504,7 +510,7 @@ gst_filesrc_get (GstPad *pad)
GstEvent *event;
src->seek_happened = FALSE;
GST_DEBUG (GST_CAT_EVENT, "filesrc sending discont");
GST_DEBUG ("filesrc sending discont");
event = gst_event_new_discontinuous (FALSE, GST_FORMAT_BYTES, src->curoffset, NULL);
src->need_flush = FALSE;
return GST_BUFFER (event);
@ -512,14 +518,14 @@ gst_filesrc_get (GstPad *pad)
/* check for flush */
if (src->need_flush) {
src->need_flush = FALSE;
GST_DEBUG (GST_CAT_EVENT, "filesrc sending flush");
GST_DEBUG ("filesrc sending flush");
return GST_BUFFER (gst_event_new_flush ());
}
/* check for EOF */
if (src->curoffset == src->filelen) {
GST_DEBUG (0, "filesrc eos %" G_GINT64_FORMAT
" %" G_GINT64_FORMAT, src->curoffset, src->filelen);
GST_DEBUG ("filesrc eos %" G_GINT64_FORMAT" %" G_GINT64_FORMAT,
src->curoffset, src->filelen);
gst_element_set_eos (GST_ELEMENT (src));
return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
}
@ -537,9 +543,9 @@ gst_filesrc_get (GstPad *pad)
readend = src->curoffset + readsize;
}
GST_DEBUG (0, "attempting to read %08lx, %08lx, %08lx, %08lx",
(unsigned long)readsize, (unsigned long)readend,
(unsigned long)mapstart, (unsigned long)mapend);
GST_LOG ("attempting to read %08lx, %08lx, %08lx, %08lx",
(unsigned long)readsize, (unsigned long)readend,
(unsigned long)mapstart, (unsigned long)mapend);
/* if the start is past the mapstart */
if (src->curoffset >= mapstart) {
@ -649,7 +655,7 @@ gst_filesrc_open_file (GstFileSrc *src)
{
g_return_val_if_fail (!GST_FLAG_IS_SET (src ,GST_FILESRC_OPEN), FALSE);
GST_DEBUG(0, "opening file %s",src->filename);
GST_DEBUG ( "opening file %s",src->filename);
/* open the file */
src->fd = open (src->filename, O_RDONLY);
@ -779,7 +785,7 @@ gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event)
{
GstFileSrc *src = GST_FILESRC (GST_PAD_PARENT (pad));
GST_DEBUG(0, "event %d", GST_EVENT_TYPE (event));
GST_DEBUG ( "event %d", GST_EVENT_TYPE (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:
@ -797,19 +803,19 @@ gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event)
if (offset > src->filelen)
goto error;
src->curoffset = offset;
GST_DEBUG(0, "seek set pending to %" G_GINT64_FORMAT, src->curoffset);
GST_DEBUG ( "seek set pending to %" G_GINT64_FORMAT, src->curoffset);
break;
case GST_SEEK_METHOD_CUR:
if (offset + src->curoffset > src->filelen)
goto error;
src->curoffset += offset;
GST_DEBUG(0, "seek cur pending to %" G_GINT64_FORMAT, src->curoffset);
GST_DEBUG ( "seek cur pending to %" G_GINT64_FORMAT, src->curoffset);
break;
case GST_SEEK_METHOD_END:
if (ABS (offset) > src->filelen)
goto error;
src->curoffset = src->filelen - ABS (offset);
GST_DEBUG(0, "seek end pending to %" G_GINT64_FORMAT, src->curoffset);
GST_DEBUG ( "seek end pending to %" G_GINT64_FORMAT, src->curoffset);
break;
default:
goto error;

View file

@ -30,6 +30,9 @@
G_BEGIN_DECLS
extern GstElementDetails gst_filesrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_filesrc_debug);
#define GST_TYPE_FILESRC \
(gst_filesrc_get_type())
#define GST_FILESRC(obj) \

View file

@ -22,8 +22,15 @@
#include <stdlib.h>
#include <gstidentity.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstidentity.h"
GST_DEBUG_CATEGORY (gst_identity_debug);
#define GST_CAT_DEFAULT gst_identity_debug
GstElementDetails gst_identity_details = {
"Identity",
@ -282,7 +289,7 @@ gst_identity_chain (GstPad *pad, GstBuffer *buf)
gst_pad_push (identity->srcpad, buf);
if (identity->sleep_time)
usleep (identity->sleep_time);
g_usleep (identity->sleep_time);
}
}

View file

@ -25,13 +25,12 @@
#define __GST_IDENTITY_H__
#include <config.h>
#include <gst/gst.h>
G_BEGIN_DECLS
GstElementDetails gst_identity_details;
extern GstElementDetails gst_identity_details;
GST_DEBUG_CATEGORY_EXTERN(gst_identity_debug);
#define GST_TYPE_IDENTITY \
(gst_identity_get_type())

View file

@ -25,11 +25,16 @@
#include <string.h>
#include <config.h>
#include <gst/gst.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <gst/gst.h>
#include "gstmd5sink.h"
GST_DEBUG_CATEGORY (gst_md5sink_debug);
#define GST_CAT_DEFAULT gst_md5sink_debug
/* MD5Sink signals and args */
enum {
/* FILL ME */
@ -519,4 +524,3 @@ gst_md5sink_factory_init (GstElementFactory *factory)
return TRUE;
}

View file

@ -25,13 +25,12 @@
#define __GST_MD5SINK_H__
#include <config.h>
#include <gst/gst.h>
G_BEGIN_DECLS
GstElementDetails gst_md5sink_details;
extern GstElementDetails gst_md5sink_details;
GST_DEBUG_CATEGORY_EXTERN(gst_md5sink_debug);
#define GST_TYPE_MD5SINK \
(gst_md5sink_get_type())

View file

@ -27,10 +27,15 @@
#include <unistd.h>
#include <sys/mman.h>
/*#define GST_DEBUG_ENABLED*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstmultidisksrc.h"
GST_DEBUG_CATEGORY (gst_multidisksrc_debug);
#define GST_CAT_DEFAULT gst_multidisksrc_debug
GstElementDetails gst_multidisksrc_details = {
"Multi Disk Source",
"Source/File",

View file

@ -28,7 +28,8 @@
G_BEGIN_DECLS
GstElementDetails gst_multidisksrc_details;
extern GstElementDetails gst_multidisksrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_multidisksrc_debug);
#define GST_TYPE_MULTIDISKSRC \
(gst_multidisksrc_get_type())

View file

@ -27,10 +27,15 @@
#include <unistd.h>
#include <sys/mman.h>
/*#define GST_DEBUG_ENABLED*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstmultidisksrc.h"
GST_DEBUG_CATEGORY (gst_multidisksrc_debug);
#define GST_CAT_DEFAULT gst_multidisksrc_debug
GstElementDetails gst_multidisksrc_details = {
"Multi Disk Source",
"Source/File",

View file

@ -28,7 +28,8 @@
G_BEGIN_DECLS
GstElementDetails gst_multidisksrc_details;
extern GstElementDetails gst_multidisksrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_multidisksrc_debug);
#define GST_TYPE_MULTIDISKSRC \
(gst_multidisksrc_get_type())

View file

@ -29,9 +29,14 @@
#include <unistd.h>
#include <errno.h>
/*#define DEBUG_ENABLED*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstpipefilter.h"
GST_DEBUG_CATEGORY (gst_pipefilter_debug);
#define GST_CAT_DEFAULT gst_pipefilter_debug
GstElementDetails gst_pipefilter_details = {
"Pipefilter",
@ -141,7 +146,7 @@ gst_pipefilter_handle_event (GstPad *pad, GstEvent *event)
pipefilter = GST_PIPEFILTER (gst_pad_get_parent (pad));
GST_DEBUG (0,"pipefilter: %s received event", GST_ELEMENT_NAME (pipefilter));
GST_DEBUG ("pipefilter: %s received event", GST_ELEMENT_NAME (pipefilter));
if (close (pipefilter->fdin[1]) < 0)
perror("close");
if (close (pipefilter->fdout[0]) < 0)
@ -169,9 +174,9 @@ gst_pipefilter_get (GstPad *pad)
g_return_val_if_fail(GST_BUFFER_DATA(newbuf) != NULL, NULL);
/* read it in from the file */
GST_DEBUG (0,"attemting to read %ld bytes", pipefilter->bytes_per_read);
GST_DEBUG ("attemting to read %ld bytes", pipefilter->bytes_per_read);
readbytes = read(pipefilter->fdout[0], GST_BUFFER_DATA(newbuf), pipefilter->bytes_per_read);
GST_DEBUG (0,"read %ld bytes", readbytes);
GST_DEBUG ("read %ld bytes", readbytes);
if (readbytes < 0) {
perror("read");
gst_element_error(GST_ELEMENT(pipefilter),"reading");
@ -207,9 +212,9 @@ gst_pipefilter_chain (GstPad *pad,GstBuffer *buf)
data = GST_BUFFER_DATA(buf);
size = GST_BUFFER_SIZE(buf);
GST_DEBUG (0,"attemting to write %ld bytes", size);
GST_DEBUG ("attemting to write %ld bytes", size);
writebytes = write(pipefilter->fdin[1],data,size);
GST_DEBUG (0,"written %ld bytes", writebytes);
GST_DEBUG ("written %ld bytes", writebytes);
if (writebytes < 0) {
perror("write");
gst_element_error(GST_ELEMENT(pipefilter),"writing");

View file

@ -27,11 +27,10 @@
#include <sys/types.h>
#include <gst/gst.h>
#include "config.h"
G_BEGIN_DECLS
GstElementDetails gst_pipefilter_details;
extern GstElementDetails gst_pipefilter_details;
GST_DEBUG_CATEGORY_EXTERN(gst_pipefilter_debug);
#define GST_TYPE_PIPEFILTER \
(gst_pipefilter_get_type())

View file

@ -22,7 +22,15 @@
#include <stdlib.h>
#include <gstshaper.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstshaper.h"
GST_DEBUG_CATEGORY (gst_shaper_debug);
#define GST_CAT_DEFAULT gst_shaper_debug
GstElementDetails gst_shaper_details = {
"Shaper",
@ -380,4 +388,3 @@ gst_shaper_factory_init (GstElementFactory *factory)
return TRUE;
}

View file

@ -25,13 +25,12 @@
#define __GST_SHAPER_H__
#include <config.h>
#include <gst/gst.h>
G_BEGIN_DECLS
GstElementDetails gst_shaper_details;
extern GstElementDetails gst_shaper_details;
GST_DEBUG_CATEGORY_EXTERN(gst_shaper_debug);
#define GST_TYPE_SHAPER \
(gst_shaper_get_type())

View file

@ -21,8 +21,14 @@
*/
#include <gststatistics.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gststatistics.h"
GST_DEBUG_CATEGORY (gst_statistics_debug);
#define GST_CAT_DEFAULT gst_statistics_debug
GstElementDetails gst_statistics_details = {
"Statistics",
@ -299,9 +305,9 @@ gst_statistics_chain (GstPad *pad, GstBuffer *buf)
if (update) {
if (statistics->update) {
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, statistics, "pre update emit\n");
GST_DEBUG ("[%s]: pre update emit", GST_ELEMENT_NAME (statistics));
g_signal_emit (G_OBJECT (statistics), gst_statistics_signals[SIGNAL_UPDATE], 0);
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, statistics, "post update emit\n");
GST_DEBUG ("[%s]: post update emit", GST_ELEMENT_NAME (statistics));
}
if (!statistics->silent) {
gst_statistics_print(statistics);

View file

@ -24,13 +24,12 @@
#define __GST_STATISTICS_H__
#include <config.h>
#include <gst/gst.h>
G_BEGIN_DECLS
GstElementDetails gst_statistics_details;
extern GstElementDetails gst_statistics_details;
GST_DEBUG_CATEGORY_EXTERN(gst_statistics_debug);
#define GST_TYPE_STATISTICS \
(gst_statistics_get_type())

View file

@ -20,8 +20,14 @@
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gsttee.h"
GST_DEBUG_CATEGORY (gst_tee_debug);
#define GST_CAT_DEFAULT gst_tee_debug
GstElementDetails gst_tee_details = {
"Tee pipe fitting",
@ -127,7 +133,7 @@ gst_tee_sinklink (GstPad *pad, GstCaps *caps)
GstPadLinkReturn set_retval;
GstCaps *caps1;
GST_DEBUG (0, "gst_tee_sinklink caps=%s", gst_caps_to_string(caps));
GST_DEBUG ( "gst_tee_sinklink caps=%s", gst_caps_to_string(caps));
tee = GST_TEE (gst_pad_get_parent (pad));
@ -162,7 +168,7 @@ gst_tee_srclink (GstPad *pad, GstCaps *caps)
{
GstTee *tee;
GST_DEBUG (0, "gst_tee_srclink caps=%s", gst_caps_to_string(caps));
GST_DEBUG ( "gst_tee_srclink caps=%s", gst_caps_to_string(caps));
tee = GST_TEE (gst_pad_get_parent (pad));
@ -176,7 +182,7 @@ gst_tee_getcaps (GstPad *pad, GstCaps *filter)
GstTee *tee;
const GList *pads;
GST_DEBUG (0, "gst_tee_getcaps");
GST_DEBUG ( "gst_tee_getcaps");
tee = GST_TEE (gst_pad_get_parent (pad));
@ -380,4 +386,3 @@ gst_tee_factory_init (GstElementFactory *factory)
return TRUE;
}

View file

@ -29,6 +29,7 @@
G_BEGIN_DECLS
extern GstElementDetails gst_tee_details;
GST_DEBUG_CATEGORY_EXTERN(gst_tee_debug);
#define GST_TYPE_TEE \
(gst_tee_get_type())

160
gst/gst.c
View file

@ -35,6 +35,8 @@
#endif /* GST_DISABLE_REGISTRY */
#include "gstregistrypool.h"
#define GST_CAT_DEFAULT GST_CAT_GST_INIT
#define MAX_PATH_SPLIT 16
#define GST_PLUGIN_SEPARATOR ","
@ -86,10 +88,11 @@ debug_log_handler (const gchar *log_domain,
enum {
ARG_VERSION=1,
ARG_FATAL_WARNINGS,
ARG_INFO_MASK,
ARG_DEBUG_MASK,
ARG_MASK,
ARG_MASK_HELP,
ARG_DEBUG_LEVEL,
ARG_DEBUG,
ARG_DEBUG_DISABLE,
ARG_DEBUG_NO_COLOR,
ARG_DEBUG_HELP,
ARG_DISABLE_CPU_OPT,
ARG_PLUGIN_SPEW,
ARG_PLUGIN_PATH,
@ -110,10 +113,13 @@ static const struct poptOption gstreamer_options[] = {
{NULL, NUL, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, (void *) &init_popt_callback, 0, NULL, NULL},
{"gst-version", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_VERSION, "Print the GStreamer version", NULL},
{"gst-fatal-warnings", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_FATAL_WARNINGS, "Make all warnings fatal", NULL},
{"gst-info-mask", NUL, POPT_ARG_INT|POPT_ARGFLAG_STRIP, NULL, ARG_INFO_MASK, "info bitmask", "MASK"},
{"gst-debug-mask", NUL, POPT_ARG_INT|POPT_ARGFLAG_STRIP, NULL, ARG_DEBUG_MASK, "debugging bitmask", "MASK"},
{"gst-mask", NUL, POPT_ARG_INT|POPT_ARGFLAG_STRIP, NULL, ARG_MASK, "bitmask for both info and debugging", "MASK"},
{"gst-mask-help", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_MASK_HELP, "how to set the level of diagnostic output (-mask values)", NULL},
#ifndef GST_DISABLE_GST_DEBUG
{"gst-debug-level", NUL, POPT_ARG_INT|POPT_ARGFLAG_STRIP, NULL, ARG_DEBUG_LEVEL, "default debug level from 1 (only error) to 5 (anything) or 0 for no output", "LEVEL"},
{"gst-debug", NUL, POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, ARG_DEBUG, "colon-seperated list of category=name pairs to use specific levels", "CATEGORIES"},
{"gst-debug-no-color", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_DEBUG_NO_COLOR, "disable color debugging output", NULL},
{"gst-disable-debug", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_DEBUG_DISABLE, "disable debugging"},
{"gst-debug-help", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_DEBUG_HELP, "print available debug categories and exit", NULL},
#endif
{"gst-disable-cpu-opt",NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_DISABLE_CPU_OPT,"Disable accelerated CPU instructions", NULL},
{"gst-plugin-spew", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_PLUGIN_SPEW, "enable verbose plugin loading diagnostics", NULL},
{"gst-plugin-path", NUL, POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, ARG_PLUGIN_PATH, "'" G_SEARCHPATH_SEPARATOR_S "'--separated path list for loading plugins", "PATHS"},
@ -235,7 +241,7 @@ gst_init_check_with_popt_table (int *argc, char **argv[],
if (gst_initialized)
{
GST_DEBUG (GST_CAT_GST_INIT, "already initialized gst\n");
GST_DEBUG ("already initialized gst");
return TRUE;
}
@ -287,7 +293,7 @@ add_path_func (gpointer data, gpointer user_data)
{
GstRegistry *registry = GST_REGISTRY (user_data);
GST_INFO (GST_CAT_GST_INIT, "Adding plugin path: \"%s\"", (gchar *)data);
GST_INFO ("Adding plugin path: \"%s\"", (gchar *) data);
gst_registry_add_path (registry, (gchar *)data);
}
#endif
@ -298,6 +304,34 @@ prepare_for_load_plugin_func (gpointer data, gpointer user_data)
preload_plugins = g_slist_prepend (preload_plugins, data);
}
static void
parse_debug_list (const gchar *list)
{
gchar **split;
gchar **walk;
g_return_if_fail (list != NULL);
walk = split = g_strsplit (list, ":", 0);
while (walk[0]) {
gchar **values = g_strsplit ( walk[0], "=", 2);
if (values[0] && values[1]) {
gint level = 0;
g_strstrip (values[0]);
g_strstrip (values[1]);
level = strtol (values[1], NULL, 0);
if (level >= 0 && level < GST_LEVEL_COUNT) {
GST_DEBUG ("setting debugging to level %d for name \"%s\"",
level, values[0]);
gst_debug_set_threshold_for_name (values[0], level);
}
}
g_strfreev (values);
walk++;
}
g_strfreev (split);
}
static void
load_plugin_func (gpointer data, gpointer user_data)
{
@ -311,22 +345,16 @@ load_plugin_func (gpointer data, gpointer user_data)
ret = gst_plugin_load_plugin (plugin, NULL);
if (ret) {
GST_INFO (GST_CAT_GST_INIT, "Loaded plugin: \"%s\"", filename);
GST_INFO ("Loaded plugin: \"%s\"", filename);
gst_registry_pool_add_plugin (plugin);
} else {
GST_WARNING ("Failed to load plugin: \"%s\"", filename);
}
else
GST_INFO (GST_CAT_GST_INIT, "Failed to load plugin: \"%s\"", filename);
g_free (data);
}
static void
parse_number (const gchar *number, gint32 *val)
{
*val = strtol(number,NULL,0);
}
static void
split_and_iterate (const gchar *stringlist, gchar *separator, GFunc iterator, gpointer user_data)
{
@ -355,8 +383,20 @@ split_and_iterate (const gchar *stringlist, gchar *separator, GFunc iterator, gp
static gboolean
init_pre (void)
{
g_type_init ();
_gst_debug_init();
#ifndef GST_DISABLE_REGISTRY
{
const gchar *debug_list;
debug_list = g_getenv ("GST_DEBUG");
if (debug_list) {
parse_debug_list (debug_list);
}
}
#endif
#ifndef GST_DISABLE_REGISTRY
{
gchar *user_reg;
@ -454,9 +494,8 @@ init_post (void)
llf = G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL;
g_log_set_handler (g_log_domain_gstreamer, llf, debug_log_handler, NULL);
GST_INFO (GST_CAT_GST_INIT,
"Initializing GStreamer Core Library version %s %s",
GST_VERSION, _gst_use_threads?"":"(no threads)");
GST_INFO ("Initializing GStreamer Core Library version %s %s",
VERSION, _gst_use_threads ? "" : "(no threads)");
_gst_format_initialize ();
_gst_query_type_initialize ();
@ -537,29 +576,39 @@ init_post (void)
}
static void
gst_mask_help (void)
gst_debug_help (void)
{
guint i;
GSList *cats, *walk;
g_print ("\n Mask (to be OR'ed) info/debug FLAGS \n");
g_print ("--------------------------------------------------------\n");
for (i = 0; i<GST_CAT_MAX_CATEGORY; i++) {
if (gst_get_category_name(i)) {
walk = cats = gst_debug_get_all_categories ();
#if GST_DEBUG_COLOR
g_print (" 0x%08x %s%s \033[%sm%s\033[00m\n", 1<<i,
(gst_info_get_categories() & (1<<i)?"(enabled)":" "),
(gst_debug_get_categories() & (1<<i)?"/(enabled)":"/ "),
_gst_category_colors[i], gst_get_category_name (i));
#else
g_print (" 0x%08x %s%s %s\n", 1<<i,
(gst_info_get_categories() & (1<<i)?"(enabled)":" "),
(gst_debug_get_categories() & (1<<i)?"/(enabled)":"/ "),
gst_get_category_name (i));
#endif
g_print ("\n");
g_print ("name level description\n");
g_print ("---------------------+--------+--------------------------------\n");
while (walk) {
/* unused when debugging is disabled */
G_GNUC_UNUSED GstDebugCategory *cat = (GstDebugCategory *) walk->data;
if (gst_debug_is_colored ()) {
gchar *color = gst_debug_construct_term_color (cat->color);
g_print ("%s%-20s\033[00m %1d %s %s%s\033[00m\n",
color,
gst_debug_category_get_name (cat),
gst_debug_category_get_threshold (cat),
gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
color,
gst_debug_category_get_description (cat));
g_free (color);
} else {
g_print ("%-20s %1d %s %s\n", gst_debug_category_get_name (cat),
gst_debug_category_get_threshold (cat),
gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
gst_debug_category_get_description (cat));
}
}
walk = g_slist_next (walk);
}
g_print ("\n");
}
@ -567,7 +616,6 @@ static void
init_popt_callback (poptContext context, enum poptCallbackReason reason,
const struct poptOption *option, const char *arg, void *data)
{
gint32 val = 0;
GLogLevelFlags fatal_mask;
if (gst_initialized)
@ -586,21 +634,25 @@ init_popt_callback (poptContext context, enum poptCallbackReason reason,
fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
g_log_set_always_fatal (fatal_mask);
break;
case ARG_INFO_MASK:
parse_number (arg, &val);
gst_info_set_categories ((guint32) val);
case ARG_DEBUG_LEVEL: {
gint tmp = 0;
tmp = strtol (arg, NULL, 0);
if (tmp >= 0 && tmp < GST_LEVEL_COUNT) {
gst_debug_set_default_threshold (tmp);
}
break;
case ARG_DEBUG_MASK:
parse_number (arg, &val);
gst_debug_set_categories ((guint32) val);
}
case ARG_DEBUG:
parse_debug_list (arg);
break;
case ARG_MASK:
parse_number (arg, &val);
gst_debug_set_categories ((guint32) val);
gst_info_set_categories ((guint32) val);
case ARG_DEBUG_NO_COLOR:
gst_debug_set_colored (FALSE);
break;
case ARG_MASK_HELP:
gst_mask_help ();
case ARG_DEBUG_DISABLE:
gst_debug_set_active (FALSE);
break;
case ARG_DEBUG_HELP:
gst_debug_help ();
exit (0);
case ARG_DISABLE_CPU_OPT:
_gst_enable_cpu_opt = FALSE;

View file

@ -25,7 +25,8 @@
#define __GST_PRIVATE_H__
#ifdef HAVE_CONFIG_H
#include "config.h"
# include "config.h"
#endif
/***** until we have gettext set up properly, don't even try this*/
#if 0
@ -48,12 +49,44 @@
# endif /* ENABLE_NLS */
#endif
#endif /* HAVE_CONFIG_H */
#include <stdlib.h>
#include <string.h>
/*** debugging categories *****************************************************/
#ifndef GST_DISABLE_GST_DEBUG
#include <gst/gstinfo.h>
extern GstDebugCategory *GST_CAT_GST_INIT;
extern GstDebugCategory *GST_CAT_COTHREADS;
extern GstDebugCategory *GST_CAT_COTHREAD_SWITCH;
extern GstDebugCategory *GST_CAT_AUTOPLUG;
extern GstDebugCategory *GST_CAT_AUTOPLUG_ATTEMPT;
extern GstDebugCategory *GST_CAT_PARENTAGE;
extern GstDebugCategory *GST_CAT_STATES;
extern GstDebugCategory *GST_CAT_PLANNING;
extern GstDebugCategory *GST_CAT_SCHEDULING;
extern GstDebugCategory *GST_CAT_DATAFLOW;
extern GstDebugCategory *GST_CAT_BUFFER;
extern GstDebugCategory *GST_CAT_CAPS;
extern GstDebugCategory *GST_CAT_CLOCK;
extern GstDebugCategory *GST_CAT_ELEMENT_PADS;
extern GstDebugCategory *GST_CAT_ELEMENT_FACTORY;
extern GstDebugCategory *GST_CAT_PADS;
extern GstDebugCategory *GST_CAT_PIPELINE;
extern GstDebugCategory *GST_CAT_PLUGIN_LOADING;
extern GstDebugCategory *GST_CAT_PLUGIN_INFO;
extern GstDebugCategory *GST_CAT_PROPERTIES;
extern GstDebugCategory *GST_CAT_THREAD;
extern GstDebugCategory *GST_CAT_TYPES;
extern GstDebugCategory *GST_CAT_XML;
extern GstDebugCategory *GST_CAT_NEGOTIATION;
extern GstDebugCategory *GST_CAT_REFCOUNTING;
extern GstDebugCategory *GST_CAT_EVENT;
extern GstDebugCategory *GST_CAT_PARAMS;
extern GstDebugCategory *GST_CAT_CALL_TRACE;
#endif
#endif /* __GST_PRIVATE_H__ */

View file

@ -20,15 +20,14 @@
* Boston, MA 02111-1307, USA.
*/
/* #define GST_DEBUG_ENABLED */
#include <gst/gstconfig.h>
#include "gst_private.h"
#include <gst/gstconfig.h>
#include "gstautoplug.h"
#include "gstregistrypool.h"
#include "gstlog.h"
#include "gstinfo.h"
enum {
NEW_OBJECT,
@ -327,7 +326,7 @@ gst_autoplug_factory_find (const gchar *name)
g_return_val_if_fail (name != NULL, NULL);
GST_DEBUG (0,"gstautoplug: find \"%s\"", name);
GST_DEBUG ("gstautoplug: find \"%s\"", name);
feature = gst_registry_pool_find_feature (name, GST_TYPE_AUTOPLUG_FACTORY);
if (feature)

View file

@ -21,13 +21,12 @@
* Boston, MA 02111-1307, USA.
*/
/* #define GST_DEBUG_ENABLED */
#include "gst_private.h"
#include "gstevent.h"
#include "gstbin.h"
#include "gstxml.h"
#include "gstlog.h"
#include "gstinfo.h"
#include "gstscheduler.h"
#include "gstindex.h"
@ -258,19 +257,19 @@ gst_bin_set_index (GstElement *element, GstIndex *index)
static void
gst_bin_set_element_sched (GstElement *element, GstScheduler *sched)
{
GST_INFO (GST_CAT_SCHEDULING, "setting element \"%s\" sched to %p", GST_ELEMENT_NAME (element),
GST_CAT_INFO (GST_CAT_SCHEDULING, "setting element \"%s\" sched to %p", GST_ELEMENT_NAME (element),
sched);
/* if it's actually a Bin */
if (GST_IS_BIN (element)) {
if (GST_FLAG_IS_SET (element, GST_BIN_FLAG_MANAGER)) {
GST_INFO_ELEMENT (GST_CAT_PARENTAGE, element, "child is already a manager, not resetting");
GST_CAT_INFO (GST_CAT_PARENTAGE, "[%s]: child is already a manager, not resetting", GST_ELEMENT_NAME (element));
if (GST_ELEMENT_SCHED (element))
gst_scheduler_add_scheduler (sched, GST_ELEMENT_SCHED (element));
return;
}
GST_INFO_ELEMENT (GST_CAT_PARENTAGE, element, "setting children's schedule to parent's");
GST_CAT_INFO (GST_CAT_PARENTAGE, "[%s]: setting children's schedule to parent's", GST_ELEMENT_NAME (element));
gst_scheduler_add_element (sched, element);
/* set the children's schedule */
@ -297,7 +296,7 @@ gst_bin_set_element_sched (GstElement *element, GstScheduler *sched)
/* if the peer element exists and is a candidate */
if (GST_PAD_PEER (pad)) {
if (gst_pad_get_scheduler (GST_PAD_PEER (pad)) == sched) {
GST_INFO (GST_CAT_SCHEDULING,
GST_CAT_INFO (GST_CAT_SCHEDULING,
"peer is in same scheduler, telling scheduler");
if (GST_PAD_IS_SRC (pad))
@ -315,20 +314,20 @@ static void
gst_bin_unset_element_sched (GstElement *element, GstScheduler *sched)
{
if (GST_ELEMENT_SCHED (element) == NULL) {
GST_INFO (GST_CAT_SCHEDULING, "element \"%s\" has no scheduler",
GST_CAT_INFO (GST_CAT_SCHEDULING, "element \"%s\" has no scheduler",
GST_ELEMENT_NAME (element));
return;
}
GST_INFO (GST_CAT_SCHEDULING, "removing element \"%s\" from its sched %p",
GST_CAT_INFO (GST_CAT_SCHEDULING, "removing element \"%s\" from its sched %p",
GST_ELEMENT_NAME (element), GST_ELEMENT_SCHED (element));
/* if it's actually a Bin */
if (GST_IS_BIN (element)) {
if (GST_FLAG_IS_SET (element, GST_BIN_FLAG_MANAGER)) {
GST_INFO_ELEMENT (GST_CAT_PARENTAGE, element,
"child is already a manager, not unsetting sched");
GST_CAT_INFO (GST_CAT_PARENTAGE, "[%s]: child is already a manager, not unsetting sched",
GST_ELEMENT_NAME (element));
if (sched) {
gst_scheduler_remove_scheduler (sched, GST_ELEMENT_SCHED (element));
}
@ -358,7 +357,7 @@ gst_bin_unset_element_sched (GstElement *element, GstScheduler *sched)
/* if the peer element exists and is a candidate */
if (GST_PAD_PEER (pad)) {
if (gst_pad_get_scheduler (GST_PAD_PEER (pad)) == sched) {
GST_INFO (GST_CAT_SCHEDULING, "peer is in same scheduler, telling scheduler");
GST_CAT_INFO (GST_CAT_SCHEDULING, "peer is in same scheduler, telling scheduler");
if (GST_PAD_IS_SRC (pad))
gst_scheduler_pad_unlink (sched, pad, GST_PAD_PEER (pad));
@ -437,7 +436,8 @@ gst_bin_add_func (GstBin *bin, GstElement *element)
gst_bin_set_element_sched (element, sched);
}
GST_INFO_ELEMENT (GST_CAT_PARENTAGE, bin, "added child \"%s\"", GST_ELEMENT_NAME (element));
GST_CAT_INFO (GST_CAT_PARENTAGE, "[%s]: added child \"%s\"",
GST_ELEMENT_NAME (bin), GST_ELEMENT_NAME (element));
g_signal_emit (G_OBJECT (bin), gst_bin_signals[ELEMENT_ADDED], 0, element);
}
@ -458,7 +458,7 @@ gst_bin_add (GstBin *bin, GstElement *element)
g_return_if_fail (GST_IS_BIN (bin));
g_return_if_fail (GST_IS_ELEMENT (element));
GST_DEBUG (GST_CAT_PARENTAGE, "adding element \"%s\" to bin \"%s\"",
GST_CAT_DEBUG (GST_CAT_PARENTAGE, "adding element \"%s\" to bin \"%s\"",
GST_ELEMENT_NAME (element), GST_ELEMENT_NAME (bin));
bclass = GST_BIN_GET_CLASS (bin);
@ -499,7 +499,8 @@ gst_bin_remove_func (GstBin *bin, GstElement *element)
while (state >>= 1) state_idx++;
bin->child_states[state_idx]--;
GST_INFO_ELEMENT (GST_CAT_PARENTAGE, bin, "removed child %s", GST_ELEMENT_NAME (element));
GST_CAT_INFO (GST_CAT_PARENTAGE, "[%s]: removed child %s",
GST_ELEMENT_NAME (bin), GST_ELEMENT_NAME (element));
/* ref as we're going to emit a signal */
gst_object_ref (GST_OBJECT (element));
@ -532,7 +533,7 @@ gst_bin_remove (GstBin *bin, GstElement *element)
{
GstBinClass *bclass;
GST_DEBUG_ELEMENT (GST_CAT_PARENTAGE, bin, "trying to remove child %s", GST_ELEMENT_NAME (element));
GST_CAT_DEBUG (GST_CAT_PARENTAGE, "[%s]: trying to remove child %s", GST_ELEMENT_NAME (bin), GST_ELEMENT_NAME (element));
g_return_if_fail (GST_IS_BIN (bin));
g_return_if_fail (GST_IS_ELEMENT (element));
@ -594,7 +595,7 @@ gst_bin_child_state_change (GstBin *bin, GstElementState oldstate,
g_return_if_fail (GST_IS_BIN (bin));
g_return_if_fail (GST_IS_ELEMENT (child));
GST_INFO (GST_CAT_STATES, "child %s changed state in bin %s from %s to %s",
GST_CAT_INFO (GST_CAT_STATES, "child %s changed state in bin %s from %s to %s",
GST_ELEMENT_NAME (child), GST_ELEMENT_NAME (bin),
gst_element_state_get_name (oldstate), gst_element_state_get_name (newstate));
@ -626,7 +627,7 @@ gst_bin_child_state_change_func (GstBin *bin, GstElementState oldstate,
if (bin->child_states[i] != 0) {
gint state = (1 << i);
if (GST_STATE (bin) != state) {
GST_INFO (GST_CAT_STATES, "bin %s need state change to %s",
GST_CAT_INFO (GST_CAT_STATES, "bin %s need state change to %s",
GST_ELEMENT_NAME (bin), gst_element_state_get_name (state));
GST_STATE_PENDING (bin) = state;
GST_UNLOCK (bin);
@ -663,19 +664,17 @@ gst_bin_change_state (GstElement * element)
pending = GST_STATE_PENDING (element);
transition = GST_STATE_TRANSITION (element);
GST_INFO_ELEMENT (GST_CAT_STATES, element,
"changing childrens' state from %s to %s",
gst_element_state_get_name (old_state),
gst_element_state_get_name (pending));
GST_CAT_INFO (GST_CAT_STATES, "[%s]: changing childrens' state from %s to %s",
GST_ELEMENT_NAME (element),
gst_element_state_get_name (old_state), gst_element_state_get_name (pending));
if (pending == GST_STATE_VOID_PENDING)
return GST_STATE_SUCCESS;
if (old_state == pending)
{
GST_INFO_ELEMENT (GST_CAT_STATES, element,
"old and pending state are both %s, returning",
gst_element_state_get_name (pending));
GST_CAT_INFO (GST_CAT_STATES, "[%s]: old and pending state are both %s, returning",
GST_ELEMENT_NAME (element), gst_element_state_get_name (pending));
return GST_STATE_SUCCESS;
}
@ -694,8 +693,7 @@ gst_bin_change_state (GstElement * element)
switch (gst_element_set_state (child, pending)) {
case GST_STATE_FAILURE:
GST_STATE_PENDING (element) = GST_STATE_VOID_PENDING;
GST_DEBUG (GST_CAT_STATES, "child '%s' failed to go to state %d(%s)",
GST_CAT_DEBUG (GST_CAT_STATES, "child '%s' failed to go to state %d(%s)",
GST_ELEMENT_NAME (child), pending, gst_element_state_get_name (pending));
gst_element_set_state (child, old_child_state);
@ -709,7 +707,7 @@ gst_bin_change_state (GstElement * element)
}
break;
case GST_STATE_ASYNC:
GST_DEBUG (GST_CAT_STATES, "child '%s' is changing state asynchronously",
GST_CAT_DEBUG (GST_CAT_STATES, "child '%s' is changing state asynchronously",
GST_ELEMENT_NAME (child));
have_async = TRUE;
break;
@ -718,7 +716,8 @@ gst_bin_change_state (GstElement * element)
}
}
GST_INFO_ELEMENT (GST_CAT_STATES, element, "done changing bin's state from %s to %s, now in %s",
GST_CAT_INFO (GST_CAT_STATES, "[%s]: done changing bin's state from %s to %s, now in %s",
GST_ELEMENT_NAME (element),
gst_element_state_get_name (old_state),
gst_element_state_get_name (pending),
gst_element_state_get_name (GST_STATE (element)));
@ -742,7 +741,7 @@ gst_bin_change_state_norecurse (GstBin * bin)
GstElementStateReturn ret;
if (parent_class->change_state) {
GST_DEBUG_ELEMENT (GST_CAT_STATES, bin, "setting bin's own state");
GST_CAT_DEBUG (GST_CAT_STATES, "[%s]: setting bin's own state", GST_ELEMENT_NAME (bin));
ret = parent_class->change_state (GST_ELEMENT (bin));
return ret;
@ -758,7 +757,7 @@ gst_bin_dispose (GObject * object)
GList *children, *orig;
GstElement *child;
GST_DEBUG (GST_CAT_REFCOUNTING, "dispose");
GST_CAT_DEBUG (GST_CAT_REFCOUNTING, "dispose");
if (gst_element_get_state (GST_ELEMENT (object)) == GST_STATE_PLAYING)
gst_element_set_state (GST_ELEMENT (object), GST_STATE_PAUSED);
@ -798,7 +797,8 @@ gst_bin_get_by_name (GstBin * bin, const gchar * name)
g_return_val_if_fail (GST_IS_BIN (bin), NULL);
g_return_val_if_fail (name != NULL, NULL);
GST_INFO_ELEMENT (GST_CAT_PARENTAGE, bin, "looking up child element %s", name);
GST_CAT_INFO (GST_CAT_PARENTAGE, "[%s]: looking up child element %s",
GST_ELEMENT_NAME (bin), name);
children = bin->children;
while (children) {
@ -890,7 +890,7 @@ gst_bin_sync_children_state (GstBin *bin)
state = GST_STATE (bin);
children = bin->children;
GST_INFO (GST_CAT_STATES, "syncing state of children with bin \"%s\"'s state %s",
GST_CAT_INFO (GST_CAT_STATES, "syncing state of children with bin \"%s\"'s state %s",
GST_ELEMENT_NAME (bin), gst_element_state_get_name (state));
while (children) {
@ -929,7 +929,8 @@ gst_bin_save_thyself (GstObject * object, xmlNodePtr parent)
childlist = xmlNewChild (parent, NULL, "children", NULL);
GST_INFO_ELEMENT (GST_CAT_XML, bin, "saving %d children", bin->numchildren);
GST_CAT_INFO (GST_CAT_XML, "[%s]: saving %d children",
GST_ELEMENT_NAME (bin), bin->numchildren);
children = bin->children;
while (children) {
@ -950,7 +951,7 @@ gst_bin_restore_thyself (GstObject * object, xmlNodePtr self)
while (field) {
if (!strcmp (field->name, "children")) {
GST_INFO_ELEMENT (GST_CAT_XML, GST_ELEMENT (object), "loading children");
GST_CAT_INFO (GST_CAT_XML, "[%s]: loading children", GST_ELEMENT_NAME (object));
childlist = field->xmlChildrenNode;
while (childlist) {
if (!strcmp (childlist->name, "element")) {
@ -1012,7 +1013,7 @@ gst_bin_iterate (GstBin *bin)
GstBinClass *oclass;
gboolean running = TRUE;
GST_DEBUG_ENTER ("(\"%s\")", GST_ELEMENT_NAME (bin));
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, bin, "starting iteration");
g_return_val_if_fail (bin != NULL, FALSE);
g_return_val_if_fail (GST_IS_BIN (bin), FALSE);
@ -1030,15 +1031,14 @@ gst_bin_iterate (GstBin *bin)
if (bin->post_iterate_func)
(bin->post_iterate_func) (bin, bin->post_iterate_data);
GST_DEBUG_LEAVE ("(\"%s\") %d", GST_ELEMENT_NAME (bin), running);
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, bin, "finished iteration");
if (!running) {
if (GST_STATE (bin) == GST_STATE_PLAYING &&
GST_STATE_PENDING (bin) == GST_STATE_VOID_PENDING) {
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, bin,
"polling for child shutdown after useless iteration");
usleep (1);
//gst_element_wait_state_change (GST_ELEMENT (bin));
GST_CAT_DEBUG (GST_CAT_DATAFLOW, "[%s]: polling for child shutdown after useless iteration",
GST_ELEMENT_NAME (bin));
g_usleep (1);
running = TRUE;
}
}

View file

@ -20,15 +20,13 @@
* Boston, MA 02111-1307, USA.
*/
/* this file makes too much noise for most debugging sessions */
#define GST_DEBUG_FORCE_DISABLE
#include "gst_private.h"
#include "gstatomic_impl.h"
#include "gstdata_private.h"
#include "gstbuffer.h"
#include "gstmemchunk.h"
#include "gstlog.h"
#include "gstinfo.h"
#include "gstbufferpool-default.h"
GType _gst_buffer_type;
@ -63,7 +61,7 @@ _gst_buffer_initialize (void)
chunk = gst_mem_chunk_new ("GstBufferChunk", sizeof (GstBuffer),
sizeof (GstBuffer) * 200, 0);
GST_INFO (GST_CAT_BUFFER, "Buffers are initialized now");
GST_CAT_INFO (GST_CAT_BUFFER, "Buffers are initialized now");
}
GType
@ -192,7 +190,7 @@ gst_buffer_new (void)
gst_alloc_trace_new (_gst_buffer_trace, newbuf);
#endif
GST_DEBUG (GST_CAT_BUFFER, "new %p", newbuf);
GST_CAT_LOG (GST_CAT_BUFFER, "new %p", newbuf);
_GST_DATA_INIT (GST_DATA (newbuf),
_gst_buffer_type,
@ -312,7 +310,7 @@ gst_buffer_create_sub (GstBuffer *parent, guint offset, guint size)
gst_alloc_trace_new (_gst_buffer_trace, buffer);
#endif
GST_DEBUG (GST_CAT_BUFFER, "new %p", buf);
GST_CAT_LOG (GST_CAT_BUFFER, "new subbuffer %p", buffer);
/* make sure nobody overwrites data in the new buffer
* by setting the READONLY flag */
@ -435,7 +433,7 @@ gst_buffer_span (GstBuffer *buf1, guint32 offset, GstBuffer *buf2, guint32 len)
buf1->data - parent->data + offset, len);
}
else {
GST_DEBUG (GST_CAT_BUFFER, "slow path taken while spanning buffers %p and %p",
GST_CAT_DEBUG (GST_CAT_BUFFER, "slow path taken while spanning buffers %p and %p",
buf1, buf2);
/* otherwise we simply have to brute-force copy the buffers */
newbuf = gst_buffer_new_and_alloc (len);
@ -524,7 +522,7 @@ gst_buffer_pool_new (GstDataFreeFunction free,
gst_alloc_trace_new (_gst_buffer_pool_trace, pool);
#endif
GST_DEBUG (GST_CAT_BUFFER, "allocating new buffer pool %p\n", pool);
GST_CAT_DEBUG (GST_CAT_BUFFER, "allocating new buffer pool %p\n", pool);
/* init data struct */
_GST_DATA_INIT (GST_DATA (pool),

View file

@ -20,11 +20,12 @@
* Boston, MA 02111-1307, USA.
*/
#include "gst_private.h"
#include "gstbuffer.h"
#include "gstinfo.h"
#include "gstmemchunk.h"
/* methods prefixed with underscores to avoid namespace collisions with
* gstbuffer.c */
@ -106,7 +107,7 @@ gst_buffer_pool_get_default (guint buffer_size, guint pool_size)
g_hash_table_insert (_default_pools, GINT_TO_POINTER (real_buffer_size), pool);
g_mutex_unlock (_default_pool_lock);
GST_DEBUG (GST_CAT_BUFFER,"new default buffer pool %p bytes:%d size:%d",
GST_CAT_DEBUG (GST_CAT_BUFFER,"new default buffer pool %p bytes:%d size:%d",
pool, real_buffer_size, pool_size);
return pool;
@ -121,7 +122,7 @@ _gst_buffer_pool_default_buffer_new (GstBufferPool *pool, guint64 offset,
GstMemChunk *data_chunk = def->mem_chunk;
buffer = gst_buffer_new ();
GST_INFO (GST_CAT_BUFFER, "creating new buffer %p from pool %p", buffer, pool);
GST_CAT_INFO (GST_CAT_BUFFER, "creating new buffer %p from pool %p", buffer, pool);
GST_BUFFER_DATA (buffer) = gst_mem_chunk_alloc (data_chunk);
@ -155,7 +156,7 @@ _gst_buffer_pool_default_free (GstData *data)
real_buffer_size = (((def->size-1) / 32) + 1) * 32;
GST_DEBUG (GST_CAT_BUFFER,"destroying default buffer pool %p bytes:%d size:%d",
GST_CAT_DEBUG (GST_CAT_BUFFER,"destroying default buffer pool %p bytes:%d size:%d",
pool, real_buffer_size, def->size);
g_mutex_lock (_default_pool_lock);

View file

@ -25,7 +25,7 @@
#include "gstcaps.h"
#include "gsttype.h"
#include "gstmemchunk.h"
#include "gstlog.h"
#include "gstinfo.h"
#ifndef GST_DISABLE_TRACE
/* #define GST_WITH_ALLOC_TRACE */
@ -253,7 +253,7 @@ gst_caps_new_id (const gchar *name, const guint16 id, GstProps *props)
gst_alloc_trace_new (_gst_caps_trace, caps);
#endif
GST_DEBUG (GST_CAT_CAPS, "new %p, props %p", caps, props);
GST_CAT_LOG (GST_CAT_CAPS, "new %p, props %p", caps, props);
gst_props_ref (props);
gst_props_sink (props);
@ -318,7 +318,7 @@ gst_caps_destroy (GstCaps *caps)
next = caps->next;
GST_DEBUG (GST_CAT_CAPS, "destroy %p", caps);
GST_CAT_LOG (GST_CAT_CAPS, "destroy %p", caps);
gst_props_unref (caps->properties);
g_free (caps->name);
@ -342,10 +342,14 @@ gst_caps_destroy (GstCaps *caps)
void
gst_caps_debug (GstCaps *caps, const gchar *label)
{
GST_DEBUG_ENTER ("caps debug: %s", label);
GST_CAT_DEBUG (GST_CAT_CAPS, "starting caps debug: %s", label);
if (caps && caps->refcount == 0) {
g_warning ("Warning: refcount of caps %s is 0", label);
return;
}
while (caps) {
GST_DEBUG (GST_CAT_CAPS, "caps: %p %s %s (%sfixed) (refcount %d) %s",
GST_CAT_DEBUG (GST_CAT_CAPS, "caps: %p %s %s (%sfixed) (refcount %d) %s",
caps, caps->name, gst_caps_get_mime (caps),
GST_CAPS_IS_FIXED (caps) ? "" : "NOT ", caps->refcount,
GST_CAPS_IS_FLOATING (caps) ? "FLOATING" : "");
@ -354,12 +358,12 @@ gst_caps_debug (GstCaps *caps, const gchar *label)
gst_props_debug (caps->properties);
}
else {
GST_DEBUG (GST_CAT_CAPS, "no properties");
GST_CAT_DEBUG (GST_CAT_CAPS, "no properties");
}
caps = caps->next;
}
GST_DEBUG_LEAVE ("caps debug");
GST_CAT_DEBUG (GST_CAT_CAPS, "finished caps debug");
}
/**
@ -381,7 +385,7 @@ gst_caps_unref (GstCaps *caps)
g_return_val_if_fail (caps->refcount > 0, NULL);
GST_DEBUG (GST_CAT_CAPS, "unref %p (%d->%d) %d",
GST_CAT_LOG (GST_CAT_CAPS, "unref %p (%d->%d) %d",
caps, caps->refcount, caps->refcount-1, GST_CAPS_FLAGS (caps));
caps->refcount--;
@ -410,7 +414,7 @@ gst_caps_ref (GstCaps *caps)
g_return_val_if_fail (caps->refcount > 0, NULL);
GST_DEBUG (GST_CAT_CAPS, "ref %p (%d->%d) %d",
GST_CAT_LOG (GST_CAT_CAPS, "ref %p (%d->%d) %d",
caps, caps->refcount, caps->refcount+1, GST_CAPS_FLAGS (caps));
caps->refcount++;
@ -431,7 +435,7 @@ gst_caps_sink (GstCaps *caps)
return;
if (GST_CAPS_IS_FLOATING (caps)) {
GST_DEBUG (GST_CAT_CAPS, "sink %p", caps);
GST_CAT_LOG (GST_CAT_CAPS, "sink %p", caps);
GST_CAPS_FLAG_UNSET (caps, GST_CAPS_FLOATING);
gst_caps_unref (caps);
@ -785,7 +789,7 @@ static gboolean
gst_caps_check_compatibility_func (GstCaps *fromcaps, GstCaps *tocaps)
{
if (fromcaps->id != tocaps->id) {
GST_DEBUG (GST_CAT_CAPS,"mime types differ (%s to %s)",
GST_CAT_DEBUG (GST_CAT_CAPS,"mime types differ (%s to %s)",
gst_type_find_by_id (fromcaps->id)->mime,
gst_type_find_by_id (tocaps->id)->mime);
return FALSE;
@ -796,13 +800,13 @@ gst_caps_check_compatibility_func (GstCaps *fromcaps, GstCaps *tocaps)
return gst_props_check_compatibility (fromcaps->properties, tocaps->properties);
}
else {
GST_DEBUG (GST_CAT_CAPS,"no source caps");
GST_CAT_DEBUG (GST_CAT_CAPS,"no source caps");
return FALSE;
}
}
else {
/* assume it accepts everything */
GST_DEBUG (GST_CAT_CAPS,"no caps");
GST_CAT_DEBUG (GST_CAT_CAPS,"no caps");
return TRUE;
}
}
@ -823,13 +827,13 @@ gst_caps_is_always_compatible (GstCaps *fromcaps, GstCaps *tocaps)
if (fromcaps == NULL) {
if (tocaps == NULL) {
/* if both are NULL, they can always link. Think filesrc ! filesink */
GST_DEBUG (GST_CAT_CAPS, "both caps NULL, compatible");
GST_CAT_DEBUG (GST_CAT_CAPS, "both caps NULL, compatible");
return TRUE;
}
else {
/* if source caps are NULL, it could be sending anything, so the
* destination can't know if it can accept this. Think filesrc ! mad */
GST_DEBUG (GST_CAT_CAPS, "source caps NULL, not guaranteed compatible");
GST_CAT_DEBUG (GST_CAT_CAPS, "source caps NULL, not guaranteed compatible");
return FALSE;
}
}
@ -837,7 +841,7 @@ gst_caps_is_always_compatible (GstCaps *fromcaps, GstCaps *tocaps)
if (tocaps == NULL) {
/* if the dest caps are NULL, the element can accept anything, always,
* so they're compatible by definition. Think mad ! filesink */
GST_DEBUG (GST_CAT_CAPS,"destination caps NULL");
GST_CAT_DEBUG (GST_CAT_CAPS,"destination caps NULL");
return TRUE;
}
}
@ -868,7 +872,7 @@ gst_caps_intersect_func (GstCaps *caps1, GstCaps *caps2)
GstProps *props;
if (caps1->id != caps2->id) {
GST_DEBUG (GST_CAT_CAPS, "mime types differ (%s to %s)",
GST_CAT_DEBUG (GST_CAT_CAPS, "mime types differ (%s to %s)",
gst_type_find_by_id (caps1->id)->mime,
gst_type_find_by_id (caps2->id)->mime);
return NULL;
@ -907,14 +911,14 @@ gst_caps_intersect (GstCaps *caps1, GstCaps *caps2)
GstCaps *result = NULL, *walk = NULL;
/* printing the name is not useful here since caps can be chained */
GST_DEBUG (GST_CAT_CAPS, "intersecting caps %p and %p", caps1, caps2);
GST_CAT_DEBUG (GST_CAT_CAPS, "intersecting caps %p and %p", caps1, caps2);
if (caps1 == NULL) {
GST_DEBUG (GST_CAT_CAPS, "first caps is NULL, return other caps");
GST_CAT_DEBUG (GST_CAT_CAPS, "first caps is NULL, return other caps");
return gst_caps_ref (caps2);
}
if (caps2 == NULL) {
GST_DEBUG (GST_CAT_CAPS, "second caps is NULL, return other caps");
GST_CAT_DEBUG (GST_CAT_CAPS, "second caps is NULL, return other caps");
return gst_caps_ref (caps1);
}
@ -953,14 +957,14 @@ gst_caps_union (GstCaps *caps1, GstCaps *caps2)
GstCaps *result = NULL;
/* printing the name is not useful here since caps can be chained */
GST_DEBUG (GST_CAT_CAPS, "making union of caps %p and %p", caps1, caps2);
GST_CAT_DEBUG (GST_CAT_CAPS, "making union of caps %p and %p", caps1, caps2);
if (caps1 == NULL) {
GST_DEBUG (GST_CAT_CAPS, "first caps is NULL, return other caps");
GST_CAT_DEBUG (GST_CAT_CAPS, "first caps is NULL, return other caps");
return gst_caps_ref (caps2);
}
if (caps2 == NULL) {
GST_DEBUG (GST_CAT_CAPS, "second caps is NULL, return other caps");
GST_CAT_DEBUG (GST_CAT_CAPS, "second caps is NULL, return other caps");
return gst_caps_ref (caps1);
}
@ -986,7 +990,7 @@ gst_caps_normalize (GstCaps *caps)
if (caps == NULL)
return caps;
GST_DEBUG (GST_CAT_CAPS, "normalizing caps %p ", caps);
GST_CAT_DEBUG (GST_CAT_CAPS, "normalizing caps %p ", caps);
walk = caps;

View file

@ -23,8 +23,9 @@
#include <sys/time.h>
#include "gst_private.h"
#include "gstclock.h"
#include "gstlog.h"
#include "gstinfo.h"
#include "gstmemchunk.h"
#ifndef GST_DISABLE_TRACE
@ -166,7 +167,7 @@ gst_clock_id_wait (GstClockID id, GstClockTimeDiff *jitter)
requested = GST_CLOCK_ENTRY_TIME (entry);
if (! GST_CLOCK_TIME_IS_VALID (requested)) {
GST_DEBUG (GST_CAT_CLOCK, "invalid time requested, returning _TIMEOUT");
GST_CAT_DEBUG (GST_CAT_CLOCK, "invalid time requested, returning _TIMEOUT");
return GST_CLOCK_TIMEOUT;
}
@ -180,12 +181,12 @@ gst_clock_id_wait (GstClockID id, GstClockTimeDiff *jitter)
clock->entries = g_list_prepend (clock->entries, entry);
GST_UNLOCK (clock);
GST_DEBUG (GST_CAT_CLOCK, "waiting on clock");
GST_CAT_DEBUG (GST_CAT_CLOCK, "waiting on clock");
do {
res = cclass->wait (clock, entry);
}
while (res == GST_CLOCK_ENTRY_RESTART);
GST_DEBUG (GST_CAT_CLOCK, "done waiting");
GST_CAT_DEBUG (GST_CAT_CLOCK, "done waiting");
GST_LOCK (clock);
clock->entries = g_list_remove (clock->entries, entry);
@ -600,7 +601,7 @@ gst_clock_handle_discont (GstClock *clock, guint64 time)
{
GstClockTime itime = G_GINT64_CONSTANT (0);
GST_DEBUG (GST_CAT_CLOCK, "clock discont %" G_GUINT64_FORMAT
GST_CAT_DEBUG (GST_CAT_CLOCK, "clock discont %" G_GUINT64_FORMAT
" %" G_GUINT64_FORMAT " %d",
time, clock->start_time, clock->accept_discont);
@ -619,7 +620,7 @@ gst_clock_handle_discont (GstClock *clock, guint64 time)
}
else {
GST_UNLOCK (clock);
GST_DEBUG (GST_CAT_CLOCK, "clock discont refused %" G_GUINT64_FORMAT
GST_CAT_DEBUG (GST_CAT_CLOCK, "clock discont refused %" G_GUINT64_FORMAT
" %" G_GUINT64_FORMAT,
time, clock->start_time);
return FALSE;
@ -631,7 +632,7 @@ gst_clock_handle_discont (GstClock *clock, guint64 time)
g_list_foreach (clock->entries, (GFunc) gst_clock_reschedule_func, NULL);
GST_UNLOCK (clock);
GST_DEBUG (GST_CAT_CLOCK, "new time %" G_GUINT64_FORMAT,
GST_CAT_DEBUG (GST_CAT_CLOCK, "new time %" G_GUINT64_FORMAT,
gst_clock_get_time (clock));
g_mutex_lock (clock->active_mutex);

View file

@ -1,24 +0,0 @@
/* This header interprets the various GST_* macros that are typically *
* provided by the gstreamer-config or gstreamer.pc files. */
#ifndef __GST_CONFIG_H__
#define __GST_CONFIG_H__
/***** We include config.h in case someone perhaps used a gstreamer.m4 or
something else that provides funky overrides. BEWARE! *****/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
/***** Deal with XML stuff, we have to handle both loadsave and registry *****/
#if (! (defined(GST_DISABLE_LOADSAVE) && defined(GST_DISABLE_REGISTRY)) )
# include <libxml/parser.h>
#else
# define GST_DISABLE_LOADSAVE_REGISTRY
#endif
#endif /* __GST_CONFIG_H__ */

73
gst/gstconfig.h.in Normal file
View file

@ -0,0 +1,73 @@
/* This header interprets the various GST_* macros that are typically *
* provided by the gstreamer-config or gstreamer.pc files. */
#ifndef __GST_CONFIG_H__
#define __GST_CONFIG_H__
/***** trick gtk-doc into believing these symbols are defined (yes, it's ugly) */
#if 0
#define GST_DISABLE_LOADSAVE_REGISTRY 1
#define GST_DISABLE_GST_DEBUG 1
#define GST_DISABLE_LOADSAVE 1
#define GST_DISABLE_TYPEFIND 1
#define GST_DISABLE_AUTOPLUG 1
#define GST_DISABLE_PARSE 1
#define GST_DISABLE_TRACE 1
#define GST_DISABLE_ALLOC_TRACE 1
#define GST_DISABLE_REGISTRY 1
#define GST_DISABLE_ENUMTYPES 1
#define GST_DISABLE_INDEX 1
#define GST_DISABLE_PLUGIN 1
#define GST_DISABLE_URI 1
#endif
/***** disabling of subsystems *****/
/* wether or not the debugging subsystem is enabled */
@GST_DISABLE_GST_DEBUG_DEFINE@
/* DOES NOT WORK */
@GST_DISABLE_LOADSAVE_DEFINE@
/* DOES NOT WORK */
@GST_DISABLE_TYPEFIND_DEFINE@
/* DOES NOT WORK */
@GST_DISABLE_AUTOPLUG_DEFINE@
/* DOES NOT WORK */
@GST_DISABLE_PARSE_DEFINE@
/* DOES NOT WORK */
@GST_DISABLE_TRACE_DEFINE@
/* DOES NOT WORK */
@GST_DISABLE_ALLOC_TRACE_DEFINE@
/* DOES NOT WORK */
@GST_DISABLE_REGISTRY_DEFINE@
/* DOES NOT WORK */
@GST_DISABLE_ENUMTYPES_DEFINE@
/* DOES NOT WORK */
@GST_DISABLE_INDEX_DEFINE@
/* DOES NOT WORK */
@GST_DISABLE_PLUGIN_DEFINE@
/* DOES NOT WORK */
@GST_DISABLE_URI_DEFINE@
/***** Deal with XML stuff, we have to handle both loadsave and registry *****/
#if (! (defined(GST_DISABLE_LOADSAVE) && defined(GST_DISABLE_REGISTRY)) )
# include <libxml/parser.h>
#else
# define GST_DISABLE_LOADSAVE_REGISTRY
#endif
#endif /* __GST_CONFIG_H__ */

View file

@ -24,7 +24,9 @@
#include <glib.h>
#include "gst_private.h"
#include "gstcpu.h"
#include "gstinfo.h"
static guint32 _gst_cpu_flags = 0;
@ -50,7 +52,7 @@ _gst_cpu_initialize (gboolean opt)
} else
g_string_append (featurelist, "(DISABLED)");
GST_INFO (GST_CAT_GST_INIT, "CPU features: (%08lx) %s", flags, featurelist->str);
GST_CAT_INFO (GST_CAT_GST_INIT, "CPU features: (%08lx) %s", flags, featurelist->str);
g_string_free (featurelist, TRUE);
}

View file

@ -20,15 +20,12 @@
* Boston, MA 02111-1307, USA.
*/
/* this file makes too much noise for most debugging sessions */
#define GST_DEBUG_FORCE_DISABLE
#include "gst_private.h"
#include "gstatomic_impl.h"
#include "gstdata.h"
#include "gstdata_private.h"
#include "gstlog.h"
#include "gstinfo.h"
/**
* gst_data_init:
@ -234,8 +231,8 @@ gst_data_unref (GstData *data)
g_return_if_fail (data != NULL);
GST_INFO (GST_CAT_BUFFER, "unref data %p, count before unref is %d",
data, GST_DATA_REFCOUNT_VALUE (data));
GST_CAT_LOG (GST_CAT_BUFFER, "unref data %p, count before unref is %d",
data, GST_DATA_REFCOUNT_VALUE (data));
g_return_if_fail (GST_DATA_REFCOUNT_VALUE (data) > 0);
zero = gst_atomic_int_dec_and_test (&data->refcount);

View file

@ -20,7 +20,6 @@
* Boston, MA 02111-1307, USA.
*/
/* #define GST_DEBUG_ENABLED */
#include <glib.h>
#include <stdarg.h>
#include <gobject/gvaluecollector.h>
@ -31,7 +30,7 @@
#include "gstscheduler.h"
#include "gstevent.h"
#include "gstutils.h"
#include "gstlog.h"
#include "gstinfo.h"
/* Element signals and args */
enum {
@ -239,7 +238,7 @@ element_get_property (GstElement *element, const GParamSpec *pspec, GValue *valu
static void
gst_element_threadsafe_properties_pre_run (GstElement *element)
{
GST_DEBUG (GST_CAT_THREAD, "locking element %s", GST_OBJECT_NAME (element));
GST_CAT_DEBUG (GST_CAT_THREAD, "locking element %s", GST_OBJECT_NAME (element));
g_mutex_lock (element->property_mutex);
gst_element_set_pending_properties (element);
}
@ -247,7 +246,7 @@ gst_element_threadsafe_properties_pre_run (GstElement *element)
static void
gst_element_threadsafe_properties_post_run (GstElement *element)
{
GST_DEBUG (GST_CAT_THREAD, "unlocking element %s", GST_OBJECT_NAME (element));
GST_CAT_DEBUG (GST_CAT_THREAD, "unlocking element %s", GST_OBJECT_NAME (element));
g_mutex_unlock (element->property_mutex);
}
@ -375,7 +374,7 @@ gst_element_set_valist (GstElement *element, const gchar *first_property_name, v
object = (GObject *) element;
GST_DEBUG (GST_CAT_PROPERTIES,
GST_CAT_DEBUG (GST_CAT_PROPERTIES,
"setting valist of properties starting with %s on element %s",
first_property_name, gst_element_get_name (element));
@ -532,7 +531,7 @@ gst_element_set_property (GstElement *element, const gchar *property_name,
object = (GObject*) element;
GST_DEBUG (GST_CAT_PROPERTIES, "setting property %s on element %s",
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "setting property %s on element %s",
property_name, gst_element_get_name (element));
if (!GST_FLAG_IS_SET (element, GST_ELEMENT_USE_THREADSAFE_PROPERTIES)) {
g_object_set_property (object, property_name, value);
@ -757,11 +756,11 @@ gst_element_clock_wait (GstElement *element, GstClockID id, GstClockTimeDiff *ji
g_return_val_if_fail (GST_IS_ELEMENT (element), GST_CLOCK_ERROR);
if (GST_ELEMENT_SCHED (element)) {
GST_DEBUG (GST_CAT_CLOCK, "waiting on scheduler clock");
GST_CAT_DEBUG (GST_CAT_CLOCK, "waiting on scheduler clock");
res = gst_scheduler_clock_wait (GST_ELEMENT_SCHED (element), element, id, jitter);
}
else {
GST_DEBUG (GST_CAT_CLOCK, "no scheduler, returning GST_CLOCK_TIMEOUT");
GST_CAT_DEBUG (GST_CAT_CLOCK, "no scheduler, returning GST_CLOCK_TIMEOUT");
res = GST_CLOCK_TIMEOUT;
}
@ -877,7 +876,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 (GST_CAT_ELEMENT_PADS,"setting parent of pad '%s' to '%s'",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS,"setting parent of pad '%s' to '%s'",
GST_PAD_NAME (pad), GST_STR_NULL (GST_ELEMENT_NAME (element)));
gst_object_set_parent (GST_OBJECT (pad), GST_OBJECT (element));
@ -958,20 +957,20 @@ gst_element_add_ghost_pad (GstElement *element, GstPad *pad, const gchar *name)
/* then check to see if there's already a pad by that name here */
g_return_val_if_fail (gst_object_check_uniqueness (element->pads, name) == TRUE, NULL);
GST_DEBUG (GST_CAT_ELEMENT_PADS,
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS,
"creating new ghost pad called %s, from pad %s:%s",
name, GST_DEBUG_PAD_NAME(pad));
ghostpad = gst_ghost_pad_new (name, pad);
/* add it to the list */
GST_DEBUG(GST_CAT_ELEMENT_PADS,"adding ghost pad %s to element %s",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS,"adding ghost pad %s to element %s",
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(GST_CAT_ELEMENT_PADS,"added ghostpad %s:%s",GST_DEBUG_PAD_NAME(ghostpad));
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS,"added ghostpad %s:%s",GST_DEBUG_PAD_NAME(ghostpad));
/* emit the NEW_GHOST_PAD signal */
g_signal_emit (G_OBJECT (element), gst_element_signals[NEW_PAD], 0, ghostpad);
@ -1054,13 +1053,13 @@ gst_element_get_static_pad (GstElement *element, const gchar *name)
pad = GST_PAD(walk->data);
if (strcmp (GST_PAD_NAME(pad), name) == 0) {
GST_INFO (GST_CAT_ELEMENT_PADS, "found pad %s:%s", GST_DEBUG_PAD_NAME (pad));
GST_CAT_INFO (GST_CAT_ELEMENT_PADS, "found pad %s:%s", GST_DEBUG_PAD_NAME (pad));
return pad;
}
walk = g_list_next (walk);
}
GST_INFO (GST_CAT_ELEMENT_PADS, "no such pad '%s' in element \"%s\"", name, GST_OBJECT_NAME (element));
GST_CAT_INFO (GST_CAT_ELEMENT_PADS, "no such pad '%s' in element \"%s\"", name, GST_OBJECT_NAME (element));
return NULL;
}
@ -1102,7 +1101,7 @@ gst_element_get_request_pad (GstElement *element, const gchar *name)
if (templ->presence == GST_PAD_REQUEST) {
/* we know that %s and %d are the only possibilities because of sanity
checks in gst_pad_template_new */
GST_DEBUG (GST_CAT_PADS, "comparing %s to %s", name, templ->name_template);
GST_CAT_DEBUG (GST_CAT_PADS, "comparing %s to %s", name, templ->name_template);
if ((str = strchr (templ->name_template, '%')) &&
strncmp (templ->name_template, name, str - templ->name_template) == 0 &&
strlen (name) > str - templ->name_template) {
@ -1246,7 +1245,7 @@ gst_element_get_compatible_pad_template (GstElement *element,
GstPadTemplate *newtempl = NULL;
GList *padlist;
GST_DEBUG (GST_CAT_ELEMENT_PADS, "gst_element_get_compatible_pad_template()");
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "gst_element_get_compatible_pad_template()");
g_return_val_if_fail (element != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
@ -1263,19 +1262,19 @@ gst_element_get_compatible_pad_template (GstElement *element,
* Check direction (must be opposite)
* Check caps
*/
GST_DEBUG (GST_CAT_CAPS, "checking direction and caps");
GST_CAT_DEBUG (GST_CAT_CAPS, "checking direction and caps");
if (padtempl->direction == GST_PAD_SRC &&
compattempl->direction == GST_PAD_SINK) {
GST_DEBUG (GST_CAT_CAPS, "compatible direction: found src pad template");
GST_CAT_DEBUG (GST_CAT_CAPS, "compatible direction: found src pad template");
comp = gst_caps_is_always_compatible (GST_PAD_TEMPLATE_CAPS (padtempl),
GST_PAD_TEMPLATE_CAPS (compattempl));
GST_DEBUG(GST_CAT_CAPS, "caps are %scompatible", (comp ? "" : "not "));
GST_CAT_DEBUG (GST_CAT_CAPS, "caps are %scompatible", (comp ? "" : "not "));
} else if (padtempl->direction == GST_PAD_SINK &&
compattempl->direction == GST_PAD_SRC) {
GST_DEBUG (GST_CAT_CAPS, "compatible direction: found sink pad template");
GST_CAT_DEBUG (GST_CAT_CAPS, "compatible direction: found sink pad template");
comp = gst_caps_is_always_compatible (GST_PAD_TEMPLATE_CAPS (compattempl),
GST_PAD_TEMPLATE_CAPS (padtempl));
GST_DEBUG (GST_CAT_CAPS, "caps are %scompatible", (comp ? "" : "not "));
GST_CAT_DEBUG (GST_CAT_CAPS, "caps are %scompatible", (comp ? "" : "not "));
}
if (comp) {
@ -1435,7 +1434,7 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
g_return_val_if_fail (GST_IS_ELEMENT (src), FALSE);
g_return_val_if_fail (GST_IS_ELEMENT (dest), FALSE);
GST_INFO (GST_CAT_ELEMENT_PADS, "trying to link element %s:%s to element %s:%s",
GST_CAT_INFO (GST_CAT_ELEMENT_PADS, "trying to link element %s:%s to element %s:%s",
GST_ELEMENT_NAME (src), srcpadname ? srcpadname : "(any)",
GST_ELEMENT_NAME (dest), destpadname ? destpadname : "(any)");
@ -1443,15 +1442,15 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
if (srcpadname) {
srcpad = gst_element_get_pad (src, srcpadname);
if (!srcpad) {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "no pad %s:%s", GST_ELEMENT_NAME (src), srcpadname);
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "no pad %s:%s", GST_ELEMENT_NAME (src), srcpadname);
return FALSE;
} else {
if (!(GST_RPAD_DIRECTION (srcpad) == GST_PAD_SRC)) {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is no src pad", GST_DEBUG_PAD_NAME (srcpad));
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is no src pad", GST_DEBUG_PAD_NAME (srcpad));
return FALSE;
}
if (GST_PAD_PEER (srcpad) != NULL) {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is already linked", GST_DEBUG_PAD_NAME (srcpad));
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is already linked", GST_DEBUG_PAD_NAME (srcpad));
return FALSE;
}
}
@ -1463,15 +1462,15 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
if (destpadname) {
destpad = gst_element_get_pad (dest, destpadname);
if (!destpad) {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "no pad %s:%s", GST_ELEMENT_NAME (dest), destpadname);
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "no pad %s:%s", GST_ELEMENT_NAME (dest), destpadname);
return FALSE;
} else {
if (!(GST_RPAD_DIRECTION (destpad) == GST_PAD_SINK)) {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is no sink pad", GST_DEBUG_PAD_NAME (destpad));
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is no sink pad", GST_DEBUG_PAD_NAME (destpad));
return FALSE;
}
if (GST_PAD_PEER (destpad) != NULL) {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is already linked", GST_DEBUG_PAD_NAME (destpad));
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is already linked", GST_DEBUG_PAD_NAME (destpad));
return FALSE;
}
}
@ -1488,16 +1487,16 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
if (srcpad) {
/* loop through the allowed pads in the source, trying to find a
* compatible destination pad */
GST_DEBUG (GST_CAT_ELEMENT_PADS, "looping through allowed src and dest pads");
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "looping through allowed src and dest pads");
do {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "trying src pad %s:%s",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "trying src pad %s:%s",
GST_DEBUG_PAD_NAME (srcpad));
if ((GST_RPAD_DIRECTION (srcpad) == GST_PAD_SRC) &&
(GST_PAD_PEER (srcpad) == NULL)) {
GstPad *temp = gst_element_get_compatible_pad_filtered (dest, srcpad,
filtercaps);
if (temp && gst_pad_link_filtered (srcpad, temp, filtercaps)) {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "linked pad %s:%s to pad %s:%s",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "linked pad %s:%s to pad %s:%s",
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (temp));
return TRUE;
}
@ -1511,21 +1510,21 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
} while (srcpads);
}
if (srcpadname) {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "no link possible from %s:%s to %s",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "no link possible from %s:%s to %s",
GST_DEBUG_PAD_NAME (srcpad), GST_ELEMENT_NAME (dest));
return FALSE;
}
if (destpad) {
/* loop through the existing pads in the destination */
do {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "trying dest pad %s:%s",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "trying dest pad %s:%s",
GST_DEBUG_PAD_NAME (destpad));
if ((GST_RPAD_DIRECTION (destpad) == GST_PAD_SINK) &&
(GST_PAD_PEER (destpad) == NULL)) {
GstPad *temp = gst_element_get_compatible_pad_filtered (src, destpad,
filtercaps);
if (temp && gst_pad_link_filtered (temp, destpad, filtercaps)) {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "linked pad %s:%s to pad %s:%s",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "linked pad %s:%s to pad %s:%s",
GST_DEBUG_PAD_NAME (temp), GST_DEBUG_PAD_NAME (destpad));
return TRUE;
}
@ -1538,12 +1537,12 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
} while (destpads);
}
if (destpadname) {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "no link possible from %s to %s:%s",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "no link possible from %s to %s:%s",
GST_ELEMENT_NAME (src), GST_DEBUG_PAD_NAME (destpad));
return FALSE;
}
GST_DEBUG (GST_CAT_ELEMENT_PADS,
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS,
"we might have request pads on both sides, checking...");
srctempls = gst_element_get_pad_template_list (src);
desttempls = gst_element_get_pad_template_list (dest);
@ -1563,7 +1562,7 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
destpad = gst_element_get_request_pad (dest,
desttempl->name_template);
if (gst_pad_link_filtered (srcpad, destpad, filtercaps)) {
GST_DEBUG (GST_CAT_ELEMENT_PADS,
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS,
"linked pad %s:%s to pad %s:%s",
GST_DEBUG_PAD_NAME (srcpad),
GST_DEBUG_PAD_NAME (destpad));
@ -1578,7 +1577,7 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
}
}
GST_DEBUG (GST_CAT_ELEMENT_PADS, "no link possible from %s to %s",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "no link possible from %s to %s",
GST_ELEMENT_NAME (src), GST_ELEMENT_NAME (dest));
return FALSE;
}
@ -1704,12 +1703,12 @@ gst_element_unlink_pads (GstElement *src, const gchar *srcpadname,
/* obtain the pads requested */
srcpad = gst_element_get_pad (src, srcpadname);
if (srcpad == NULL) {
GST_ERROR(src,"source element has no pad \"%s\"",srcpadname);
GST_WARNING_OBJECT (src, "source element has no pad \"%s\"", srcpadname);
return;
}
destpad = gst_element_get_pad (dest, destpadname);
if (srcpad == NULL) {
GST_ERROR(dest,"destination element has no pad \"%s\"",destpadname);
GST_WARNING_OBJECT (dest, "destination element has no pad \"%s\"", destpadname);
return;
}
@ -1762,7 +1761,7 @@ gst_element_unlink (GstElement *src, GstElement *dest)
g_return_if_fail (GST_IS_ELEMENT (src));
g_return_if_fail (GST_IS_ELEMENT (dest));
GST_DEBUG (GST_CAT_ELEMENT_PADS, "unlinking \"%s\" and \"%s\"",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "unlinking \"%s\" and \"%s\"",
GST_ELEMENT_NAME (src), GST_ELEMENT_NAME (dest));
srcpads = gst_element_get_pad_list (src);
@ -1793,7 +1792,7 @@ gst_element_error_func (GstElement* element, GstElement *source,
{
/* tell the parent */
if (GST_OBJECT_PARENT (element)) {
GST_DEBUG (GST_CAT_EVENT, "forwarding error \"%s\" from %s to %s",
GST_CAT_DEBUG (GST_CAT_EVENT, "forwarding error \"%s\" from %s to %s",
errormsg, GST_ELEMENT_NAME (element),
GST_OBJECT_NAME (GST_OBJECT_PARENT (element)));
@ -1808,11 +1807,11 @@ static GstPad*
gst_element_get_random_pad (GstElement *element, GstPadDirection dir)
{
GList *pads = element->pads;
GST_DEBUG (GST_CAT_ELEMENT_PADS, "getting a random pad");
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "getting a random pad");
while (pads) {
GstPad *pad = GST_PAD_CAST (pads->data);
GST_DEBUG (GST_CAT_ELEMENT_PADS, "checking pad %s:%s",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "checking pad %s:%s",
GST_DEBUG_PAD_NAME (pad));
if (GST_PAD_DIRECTION (pad) == dir) {
@ -1820,12 +1819,12 @@ gst_element_get_random_pad (GstElement *element, GstPadDirection dir)
return pad;
}
else {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is not linked",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is not linked",
GST_DEBUG_PAD_NAME (pad));
}
}
else {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is in wrong direction",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s is in wrong direction",
GST_DEBUG_PAD_NAME (pad));
}
@ -1891,12 +1890,12 @@ gst_element_send_event (GstElement *element, GstEvent *event)
else {
GstPad *pad = gst_element_get_random_pad (element, GST_PAD_SINK);
if (pad) {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "sending event to random pad %s:%s",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "sending event to random pad %s:%s",
GST_DEBUG_PAD_NAME (pad));
return gst_pad_send_event (GST_PAD_PEER (pad), event);
}
}
GST_DEBUG (GST_CAT_ELEMENT_PADS, "can't send event on element %s",
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "can't send event on element %s",
GST_ELEMENT_NAME (element));
return FALSE;
}
@ -2073,11 +2072,11 @@ gst_element_error (GstElement *element, const gchar *error, ...)
va_start (var_args, error);
string = g_strdup_vprintf (error, var_args);
va_end (var_args);
GST_INFO (GST_CAT_EVENT, "ERROR in %s: %s", GST_ELEMENT_NAME (element), string);
GST_CAT_INFO (GST_CAT_EVENT, "ERROR in %s: %s", GST_ELEMENT_NAME (element), string);
/* if the element was already in error, stop now */
if (GST_FLAG_IS_SET (element, GST_ELEMENT_ERROR)) {
GST_INFO (GST_CAT_EVENT, "recursive ERROR detected in %s", GST_ELEMENT_NAME (element));
GST_CAT_INFO (GST_CAT_EVENT, "recursive ERROR detected in %s", GST_ELEMENT_NAME (element));
g_free (string);
return;
}
@ -2149,11 +2148,11 @@ gst_element_set_locked_state (GstElement *element, gboolean locked_state)
return;
if (locked_state) {
GST_DEBUG (GST_CAT_STATES, "locking state of element %s",
GST_CAT_DEBUG (GST_CAT_STATES, "locking state of element %s",
GST_ELEMENT_NAME (element));
GST_FLAG_SET (element, GST_ELEMENT_LOCKED_STATE);
} else {
GST_DEBUG (GST_CAT_STATES, "unlocking state of element %s",
GST_CAT_DEBUG (GST_CAT_STATES, "unlocking state of element %s",
GST_ELEMENT_NAME (element));
GST_FLAG_UNSET (element, GST_ELEMENT_LOCKED_STATE);
}
@ -2176,7 +2175,7 @@ gst_element_sync_state_with_parent (GstElement *element)
parent = GST_ELEMENT (GST_ELEMENT_PARENT(element));
g_return_val_if_fail (GST_IS_BIN (parent), FALSE);
GST_DEBUG (GST_CAT_STATES, "syncing state of element %s (%s) to %s (%s)",
GST_CAT_DEBUG (GST_CAT_STATES, "syncing state of element %s (%s) to %s (%s)",
GST_ELEMENT_NAME (element), gst_element_state_get_name (GST_STATE (element)),
GST_ELEMENT_NAME (parent), gst_element_state_get_name (GST_STATE (parent)));
if (gst_element_set_state (element, GST_STATE (parent)) == GST_STATE_FAILURE) {
@ -2240,13 +2239,13 @@ gst_element_set_state (GstElement *element, GstElementState state)
if (state == curpending)
{
GST_DEBUG_ELEMENT (GST_CAT_STATES, element,
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
"element is already in requested state %s",
gst_element_state_get_name (state));
return (GST_STATE_SUCCESS);
}
GST_DEBUG_ELEMENT (GST_CAT_STATES, element, "setting state from %s to %s",
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element, "setting state from %s to %s",
gst_element_state_get_name (curpending),
gst_element_state_get_name (state));
@ -2264,7 +2263,7 @@ gst_element_set_state (GstElement *element, GstElementState state)
GST_STATE_PENDING (element) = curpending;
if (curpending != state) {
GST_DEBUG_ELEMENT (GST_CAT_STATES, element,
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
"intermediate: setting state from %s to %s",
gst_element_state_get_name (GST_STATE (element)),
gst_element_state_get_name (curpending));
@ -2277,11 +2276,11 @@ gst_element_set_state (GstElement *element, GstElementState state)
switch (return_val) {
case GST_STATE_FAILURE:
GST_DEBUG_ELEMENT (GST_CAT_STATES, element,
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
"have failed change_state return");
goto exit;
case GST_STATE_ASYNC:
GST_DEBUG_ELEMENT (GST_CAT_STATES, element,
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
"element will change state async");
goto exit;
case GST_STATE_SUCCESS:
@ -2314,7 +2313,7 @@ gst_element_negotiate_pads (GstElement *element)
{
GList *pads = GST_ELEMENT_PADS (element);
GST_DEBUG_ELEMENT (GST_CAT_CAPS, element, "negotiating pads");
GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, element, "negotiating pads");
while (pads) {
GstPad *pad = GST_PAD (pads->data);
@ -2359,7 +2358,7 @@ gst_element_negotiate_pads (GstElement *element)
/* only try to negotiate if the peer element is in PAUSED or higher too */
if (otherstate >= GST_STATE_READY) {
GST_DEBUG_ELEMENT (GST_CAT_CAPS, element,
GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, element,
"perform negotiate for %s:%s and %s:%s",
GST_DEBUG_PAD_NAME (srcpad),
GST_DEBUG_PAD_NAME (sinkpad));
@ -2367,7 +2366,7 @@ gst_element_negotiate_pads (GstElement *element)
return FALSE;
}
else {
GST_DEBUG_ELEMENT (GST_CAT_CAPS, element,
GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, element,
"not negotiating %s:%s and %s:%s, not in READY yet",
GST_DEBUG_PAD_NAME (srcpad),
GST_DEBUG_PAD_NAME (sinkpad));
@ -2383,7 +2382,7 @@ gst_element_clear_pad_caps (GstElement *element)
{
GList *pads = GST_ELEMENT_PADS (element);
GST_DEBUG_ELEMENT (GST_CAT_CAPS, element, "clearing pad caps");
GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, element, "clearing pad caps");
while (pads) {
GstRealPad *pad = GST_PAD_REALIZE (pads->data);
@ -2425,13 +2424,13 @@ gst_element_change_state (GstElement *element)
if (old_pending == GST_STATE_VOID_PENDING ||
old_state == GST_STATE_PENDING (element)) {
GST_INFO (GST_CAT_STATES,
GST_CAT_INFO (GST_CAT_STATES,
"no state change needed for element %s (VOID_PENDING)",
GST_ELEMENT_NAME (element));
return GST_STATE_SUCCESS;
}
GST_INFO (GST_CAT_STATES, "%s default handler sets state from %s to %s %04x",
GST_CAT_INFO (GST_CAT_STATES, "%s default handler sets state from %s to %s %04x",
GST_ELEMENT_NAME (element),
gst_element_state_get_name (old_state),
gst_element_state_get_name (old_pending),
@ -2463,7 +2462,7 @@ gst_element_change_state (GstElement *element)
parent = GST_ELEMENT_PARENT (element);
GST_DEBUG_ELEMENT (GST_CAT_STATES, element,
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
"signaling state change from %s to %s",
gst_element_state_get_name (old_state),
gst_element_state_get_name (GST_STATE (element)));
@ -2472,7 +2471,7 @@ gst_element_change_state (GstElement *element)
if (element->sched) {
if (gst_scheduler_state_transition (element->sched, element,
old_transition) != GST_STATE_SUCCESS) {
GST_DEBUG_ELEMENT (GST_CAT_STATES, element,
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
"scheduler could not change state");
goto failure;
}
@ -2526,7 +2525,7 @@ gst_element_dispose (GObject *object)
GList *pads;
GstPad *pad;
GST_DEBUG_ELEMENT (GST_CAT_REFCOUNTING, element, "dispose");
GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, element, "dispose");
gst_element_set_state (element, GST_STATE_NULL);
@ -2538,7 +2537,7 @@ gst_element_dispose (GObject *object)
pad = GST_PAD (pads->data);
if (GST_PAD_PEER (pad)) {
GST_DEBUG (GST_CAT_REFCOUNTING, "unlinking pad '%s'",
GST_CAT_DEBUG (GST_CAT_REFCOUNTING, "unlinking pad '%s'",
GST_OBJECT_NAME (GST_OBJECT (GST_PAD (GST_PAD_PEER (pad)))));
gst_pad_unlink (pad, GST_PAD (GST_PAD_PEER (pad)));
}
@ -2751,7 +2750,7 @@ gst_element_set_scheduler (GstElement *element,
{
g_return_if_fail (GST_IS_ELEMENT (element));
GST_INFO_ELEMENT (GST_CAT_PARENTAGE, element, "setting scheduler to %p", sched);
GST_CAT_INFO_OBJECT (GST_CAT_PARENTAGE, element, "setting scheduler to %p", sched);
gst_object_replace ((GstObject **)&GST_ELEMENT_SCHED (element), GST_OBJECT (sched));
}
@ -2821,7 +2820,7 @@ gst_element_set_eos_recursive (GstElement *element)
parent that's PAUSED was PLAYING before. That means it has reached EOS. */
GstElement *parent;
GST_DEBUG (GST_CAT_EVENT, "setting recursive EOS on %s",
GST_CAT_DEBUG (GST_CAT_EVENT, "setting recursive EOS on %s",
GST_OBJECT_NAME (element));
g_signal_emit (G_OBJECT (element), gst_element_signals[EOS], 0);
@ -2843,7 +2842,7 @@ gst_element_set_eos (GstElement *element)
{
g_return_if_fail (GST_IS_ELEMENT (element));
GST_DEBUG (GST_CAT_EVENT, "setting EOS on element %s",
GST_CAT_DEBUG (GST_CAT_EVENT, "setting EOS on element %s",
GST_OBJECT_NAME (element));
if (GST_STATE (element) == GST_STATE_PLAYING) {

View file

@ -20,12 +20,11 @@
* Boston, MA 02111-1307, USA.
*/
/* #define DEBUG_ENABLED */
#include "gst_private.h"
#include "gstelement.h"
#include "gstregistrypool.h"
#include "gstlog.h"
#include "gstinfo.h"
static void gst_element_factory_class_init (GstElementFactoryClass *klass);
static void gst_element_factory_init (GstElementFactory *factory);
@ -103,7 +102,7 @@ gst_element_factory_find (const gchar *name)
return GST_ELEMENT_FACTORY (feature);
/* this should be an ERROR */
GST_DEBUG (GST_CAT_ELEMENT_FACTORY,"no such elementfactory \"%s\"", name);
GST_CAT_DEBUG (GST_CAT_ELEMENT_FACTORY,"no such elementfactory \"%s\"", name);
return NULL;
}
@ -212,7 +211,7 @@ gst_element_factory_create (GstElementFactory *factory,
if (!gst_plugin_feature_ensure_loaded (GST_PLUGIN_FEATURE (factory)))
return NULL;
GST_DEBUG (GST_CAT_ELEMENT_FACTORY,
GST_CAT_DEBUG (GST_CAT_ELEMENT_FACTORY,
"creating element from factory \"%s\" (name \"%s\", type %d)",
GST_PLUGIN_FEATURE_NAME (factory), GST_STR_NULL (name), (gint) factory->type);
@ -225,7 +224,7 @@ gst_element_factory_create (GstElementFactory *factory,
/* attempt to set the elementfactory class pointer if necessary */
oclass = GST_ELEMENT_CLASS (g_type_class_ref (factory->type));
if (oclass->elementfactory == NULL) {
GST_DEBUG (GST_CAT_ELEMENT_FACTORY, "class %s", GST_PLUGIN_FEATURE_NAME (factory));
GST_CAT_DEBUG (GST_CAT_ELEMENT_FACTORY, "class %s", GST_PLUGIN_FEATURE_NAME (factory));
oclass->elementfactory = factory;
/* copy pad template pointers to the element class,
@ -266,19 +265,19 @@ gst_element_factory_make (const gchar *factoryname, const gchar *name)
g_return_val_if_fail (factoryname != NULL, NULL);
GST_DEBUG (GST_CAT_ELEMENT_FACTORY, "gstelementfactory: make \"%s\" \"%s\"",
GST_CAT_DEBUG (GST_CAT_ELEMENT_FACTORY, "gstelementfactory: make \"%s\" \"%s\"",
factoryname, GST_STR_NULL (name));
/* gst_plugin_load_element_factory (factoryname); */
factory = gst_element_factory_find (factoryname);
if (factory == NULL) {
GST_INFO (GST_CAT_ELEMENT_FACTORY,"no such element factory \"%s\"!",
GST_CAT_INFO (GST_CAT_ELEMENT_FACTORY,"no such element factory \"%s\"!",
factoryname);
return NULL;
}
element = gst_element_factory_create (factory, name);
if (element == NULL) {
GST_INFO (GST_CAT_ELEMENT_FACTORY,
GST_CAT_INFO (GST_CAT_ELEMENT_FACTORY,
"couldn't create instance of element factory \"%s\"!",
factoryname);
return NULL;

View file

@ -22,12 +22,13 @@
#include <string.h> /* memcpy */
#include "gstinfo.h"
#include "gst_private.h"
#include "gstdata_private.h"
#include "gstinfo.h"
#include "gstmemchunk.h"
#include "gstevent.h"
#include "gstlog.h"
#ifndef GST_DISABLE_TRACE
/* #define GST_WITH_ALLOC_TRACE */
#include "gsttrace.h"
@ -76,7 +77,7 @@ _gst_event_copy (GstEvent *event)
static void
_gst_event_free (GstEvent* event)
{
GST_INFO (GST_CAT_EVENT, "freeing event %p", event);
GST_CAT_INFO (GST_CAT_EVENT, "freeing event %p", event);
if (GST_EVENT_SRC (event)) {
gst_object_unref (GST_EVENT_SRC (event));
@ -144,7 +145,7 @@ gst_event_new (GstEventType type)
gst_alloc_trace_new (_event_trace, event);
#endif
GST_INFO (GST_CAT_EVENT, "creating new event %p %d", event, type);
GST_CAT_INFO (GST_CAT_EVENT, "creating new event %p %d", event, type);
_GST_DATA_INIT (GST_DATA (event),
_gst_event_type,

View file

@ -20,10 +20,10 @@
* Boston, MA 02111-1307, USA.
*/
#include "gstlog.h"
#include "gst_private.h"
#include "gstregistrypool.h"
#include "gstinfo.h"
#include "gstregistrypool.h"
#include "gstpad.h"
#include "gstindex.h"
@ -152,7 +152,7 @@ gst_index_init (GstIndex *index)
GST_FLAG_SET (index, GST_INDEX_WRITABLE);
GST_FLAG_SET (index, GST_INDEX_READABLE);
GST_DEBUG(0, "created new index");
GST_DEBUG ( "created new index");
}
static void
@ -203,7 +203,7 @@ gst_index_group_new(guint groupnum)
indexgroup->certainty = GST_INDEX_UNKNOWN;
indexgroup->peergroup = -1;
GST_DEBUG(0, "created new index group %d",groupnum);
GST_DEBUG ( "created new index group %d",groupnum);
return indexgroup;
}
@ -274,7 +274,7 @@ gst_index_new_group(GstIndex *index)
{
index->curgroup = gst_index_group_new(++index->maxgroup);
index->groups = g_list_append(index->groups,index->curgroup);
GST_DEBUG(0, "created new group %d in index",index->maxgroup);
GST_DEBUG ( "created new group %d in index",index->maxgroup);
return index->maxgroup;
}
@ -305,13 +305,13 @@ gst_index_set_group(GstIndex *index, gint groupnum)
list = g_list_next(list);
if (indexgroup->groupnum == groupnum) {
index->curgroup = indexgroup;
GST_DEBUG(0, "switched to index group %d", indexgroup->groupnum);
GST_DEBUG ( "switched to index group %d", indexgroup->groupnum);
return TRUE;
}
}
/* couldn't find the group in question */
GST_DEBUG(0, "couldn't find index group %d",groupnum);
GST_DEBUG ( "couldn't find index group %d",groupnum);
return FALSE;
}
@ -892,7 +892,7 @@ gst_index_factory_find (const gchar *name)
g_return_val_if_fail (name != NULL, NULL);
GST_DEBUG (0,"gstindex: find \"%s\"", name);
GST_DEBUG ("gstindex: find \"%s\"", name);
feature = gst_registry_pool_find_feature (name, GST_TYPE_INDEX_FACTORY);
if (feature)
@ -949,4 +949,3 @@ gst_index_factory_make (const gchar *name)
return gst_index_factory_create (factory);
}

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,9 @@
/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
* 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
*
* gstinfo.h:
* gstinfo.h: debugging functions
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -23,454 +24,522 @@
#ifndef __GSTINFO_H__
#define __GSTINFO_H__
#include <stdio.h>
#include <gmodule.h>
#include <unistd.h>
#include <glib/gmacros.h>
#include <glib.h>
#include <glib-object.h>
#include <gst/gstatomic.h>
#include <gst/gstlog.h>
#include <gst/gstconfig.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
/*
* GStreamer's debugging subsystem is an easy way to get information about what
* the application is doing.
* It is not meant for programming errors. Use GLibs methods (g_warning and so
* on for that.
*/
/* log levels */
typedef enum {
GST_LEVEL_NONE = 0,
GST_LEVEL_ERROR,
GST_LEVEL_WARNING,
GST_LEVEL_INFO,
GST_LEVEL_DEBUG,
GST_LEVEL_LOG,
/* add more */
GST_LEVEL_COUNT
} GstDebugLevel;
/* we can now override this to be more general in maintainer builds or cvs checkouts */
#ifndef GST_LEVEL_DEFAULT
#define GST_LEVEL_DEFAULT GST_LEVEL_ERROR
#endif
/* defines for format (colors etc) - don't change them around, it uses terminal layout
* Terminal color strings:
* 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
* Text color codes:
* 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
* Background color codes:
* 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
*/
typedef enum {
/* colors */
GST_DEBUG_FG_BLACK = 0x0000,
GST_DEBUG_FG_RED = 0x0001,
GST_DEBUG_FG_GREEN = 0x0002,
GST_DEBUG_FG_YELLOW = 0x0003,
GST_DEBUG_FG_BLUE = 0x0004,
GST_DEBUG_FG_MAGENTA = 0x0005,
GST_DEBUG_FG_CYAN = 0x0006,
GST_DEBUG_FG_WHITE = 0x0007,
/* background colors */
GST_DEBUG_BG_BLACK = 0x0000,
GST_DEBUG_BG_RED = 0x0010,
GST_DEBUG_BG_GREEN = 0x0020,
GST_DEBUG_BG_YELLOW = 0x0030,
GST_DEBUG_BG_BLUE = 0x0040,
GST_DEBUG_BG_MAGENTA = 0x0050,
GST_DEBUG_BG_CYAN = 0x0060,
GST_DEBUG_BG_WHITE = 0x0070,
/* other formats */
GST_DEBUG_BOLD = 0x0100,
GST_DEBUG_UNDERLINE = 0x0200
} GstDebugColorFlags;
#define GST_DEBUG_FG_MASK (0x000F)
#define GST_DEBUG_BG_MASK (0x00F0)
#define GST_DEBUG_FORMAT_MASK (0xFF00)
typedef struct _GstDebugCategory GstDebugCategory;
struct _GstDebugCategory {
/*< private >*/
GstAtomicInt * threshold;
guint color; /* see defines above */
const gchar * name;
const gchar * description;
};
/********** some convenience macros for debugging **********/
/* This is needed in printf's if a char* might be NULL. Solaris crashes then */
#define GST_STR_NULL(str) ((str) ? (str) : "(NULL)")
/* FIXME: convert to using G_STRLOC all the way if we can ! */
#ifndef FUNCTION
#ifdef G_GNUC_PRETTY_FUNCTION
#define FUNCTION G_GNUC_PRETTY_FUNCTION
#elif HAVE_FUNC
#define FUNCTION __func__
#elif HAVE_PRETTY_FUNCTION
#define FUNCTION __PRETTY_FUNCTION__
#elif HAVE_FUNCTION
#define FUNCTION __FUNCTION__
#else
#define FUNCTION ""
#endif
#endif /* ifndef FUNCTION */
/***** 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_ELEMENT_FACTORY, /* Elementfactory stuff */
GST_CAT_PADS, /* Pad creation/linking */
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_APPLICATION, /* Application-defined debugging */
GST_CAT_CALL_TRACE = 30, /* Call tracing */
GST_CAT_MAX_CATEGORY = 31
};
extern const gchar *_gst_category_colors[32];
extern GStaticPrivate _gst_debug_cothread_index;
/**********************************************************************
* 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 G_HAVE_ISO_VARARGS
#ifdef GST_DEBUG_ENABLED
#define GST_DEBUG(cat, ...) G_STMT_START{ \
if ((1<<cat) & _gst_debug_categories) \
_gst_debug_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
NULL,g_strdup_printf( __VA_ARGS__ )); \
}G_STMT_END
#define GST_DEBUG_ELEMENT(cat, element, ...) G_STMT_START{ \
if ((1<<cat) & _gst_debug_categories) \
_gst_debug_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
element,g_strdup_printf( __VA_ARGS__ )); \
}G_STMT_END
#else
#define GST_DEBUG(cat, ...)
#define GST_DEBUG_ELEMENT(cat,element, ...)
#endif
#elif defined(G_HAVE_GNUC_VARARGS)
#ifdef GST_DEBUG_ENABLED
#define GST_DEBUG(cat,format,args...) G_STMT_START{ \
if ((1<<cat) & _gst_debug_categories) \
_gst_debug_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
NULL,g_strdup_printf( format , ## args )); \
}G_STMT_END
#define GST_DEBUG_ELEMENT(cat,element,format,args...) G_STMT_START{ \
if ((1<<cat) & _gst_debug_categories) \
_gst_debug_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
element,g_strdup_printf( format , ## args )); \
}G_STMT_END
#else
#define GST_DEBUG(cat,format,args...)
#define GST_DEBUG_ELEMENT(cat,element,format,args...)
#endif
#endif
/********** some convenience macros for debugging **********/
/* easier debugging for pad names */
#define GST_DEBUG_PAD_NAME(pad) \
(GST_OBJECT_PARENT(pad) != NULL) ? \
GST_STR_NULL (GST_OBJECT_NAME (GST_OBJECT_PARENT(pad))) : \
"''", GST_OBJECT_NAME (pad)
#ifdef G_HAVE_ISO_VARARGS
/* You might want to define GST_FUNCTION in apps' configure script */
#ifdef GST_DEBUG_COLOR
#define GST_DEBUG_ENTER(...) GST_DEBUG( 31 , "\033[00;37mentering\033[00m: " __VA_ARGS__ )
#define GST_DEBUG_LEAVE(...) GST_DEBUG( 31 , "\033[00;37mleaving\033[00m: " __VA_ARGS__ )
#ifndef GST_FUNCTION
#ifdef G_GNUC_PRETTY_FUNCTION
#define GST_FUNCTION G_GNUC_PRETTY_FUNCTION
#elif HAVE_FUNC
#define GST_FUNCTION __func__
#elif HAVE_PRETTY_FUNCTION
#define GST_FUNCTION __PRETTY_FUNCTION__
#elif HAVE_FUNCTION
#define GST_FUNCTION __FUNCTION__
#else
#define GST_DEBUG_ENTER(...) GST_DEBUG( 31 , "entering: " __VA_ARGS__ )
#define GST_DEBUG_LEAVE(...) GST_DEBUG( 31 , "leaving: " __VA_ARGS__ )
#define GST_FUNCTION ""
#endif
#endif /* ifndef GST_FUNCTION */
typedef void (*GstLogFunction) (GstDebugCategory * category,
GstDebugLevel level,
const gchar * file,
const gchar * function,
gint line,
GObject * object,
gchar * message,
gpointer data);
/* Disable this subsystem if no varargs macro can be found.
Use a trick so the core builds the functions nonetheless if it wasn't
explicitly disabled. */
#if !defined(G_HAVE_ISO_VARARGS) && !defined(G_HAVE_GNUC_VARARGS)
#define __GST_DISABLE_GST_DEBUG
#endif
#ifdef GST_DISABLE_GST_DEBUG
#ifndef __GST_DISABLE_GST_DEBUG
#define __GST_DISABLE_GST_DEBUG
#endif
#endif
#elif defined(G_HAVE_GNUC_VARARGS)
#ifndef __GST_DISABLE_GST_DEBUG
#ifdef GST_DEBUG_COLOR
#define GST_DEBUG_ENTER(format, args...) GST_DEBUG( 31 , format ": \033[00;37mentering\033[00m" , ##args )
#define GST_DEBUG_LEAVE(format, args...) GST_DEBUG( 31 , format ": \033[00;37mleaving\033[00m" , ##args )
#else
#define GST_DEBUG_ENTER(format, args...) GST_DEBUG( 31 , format ": entering" , ##args )
#define GST_DEBUG_LEAVE(format, args...) GST_DEBUG( 31 , format ": leaving" , ##args )
#endif
void _gst_debug_init (void);
#endif
void gst_debug_log (GstDebugCategory * category,
GstDebugLevel level,
const gchar * file,
const gchar * function,
gint line,
GObject * object,
gchar * format,
...) G_GNUC_PRINTF (7, 8) G_GNUC_NO_INSTRUMENT;
void gst_debug_logv (GstDebugCategory * category,
GstDebugLevel level,
const gchar * file,
const gchar * function,
gint line,
GObject * object,
gchar * format,
va_list args) G_GNUC_NO_INSTRUMENT;
void gst_debug_log_default (GstDebugCategory * category,
GstDebugLevel level,
const gchar * file,
const gchar * function,
gint line,
GObject * object,
gchar * message,
gpointer unused) G_GNUC_NO_INSTRUMENT;
const gchar * gst_debug_level_get_name (GstDebugLevel level);
void gst_debug_add_log_function (GstLogFunction func,
gpointer data);
guint gst_debug_remove_log_function (GstLogFunction func);
guint gst_debug_remove_log_function_by_data (gpointer data);
void gst_debug_set_active (gboolean active);
gboolean gst_debug_is_active (void);
void gst_debug_set_colored (gboolean colored);
gboolean gst_debug_is_colored (void);
void gst_debug_set_default_threshold (GstDebugLevel level);
GstDebugLevel gst_debug_get_default_threshold (void);
void gst_debug_set_threshold_for_name (const gchar * name,
GstDebugLevel level);
void gst_debug_unset_threshold_for_name (const gchar * name);
/**
* GST_DEBUG_CATEGORY:
* @cat: the category
*
* Defines a GstCategory variable.
* This macro expands to nothing if debugging is disabled.
*/
#define GST_DEBUG_CATEGORY(cat) GstDebugCategory *cat = NULL
/**
* GST_DEBUG_CATEGORY_EXTERN:
* @cat: the category
*
* Defines an extern GstCategory variable. Use in header files.
* This macro expands to nothing if debugging is disabled.
*/
#define GST_DEBUG_CATEGORY_EXTERN(cat) extern GstDebugCategory *cat
/**
* GST_DEBUG_CATEGORY_STATIC:
* @cat: the category
*
* Defines a static GstCategory variable.
* This macro expands to nothing if debugging is disabled.
*/
#define GST_DEBUG_CATEGORY_STATIC(cat) static GstDebugCategory *cat = NULL
/* do not use this function, use the macros below */
GstDebugCategory *_gst_debug_category_new (gchar * name,
guint color,
gchar * description);
/**
* GST_DEBUG_CATEGORY_INIT:
* @cat: the category to initialize
* @name: the name of the category
* @color: the colors to use for a color representation or 0 for no color
* @description: optional description of the category
*
* Creates a new #GstDebugCategory cat with the given properties and sets it to
* the default threshold.
* This macro expands to nothing if debugging is disabled.
* <note>
* <para>
* When naming your category, please follow the following definitions to ensure
* that the pattern matching for categories works as expected. It is not
* earth-shattering if you don't follow these conventions, but it would be nice
* for everyone.
* </para>
* <para>
* If you define a category for a plugin or a feature of it, name the category
* like the feature. So if you wanted to write a "filesrc" element, you would
* name the category "filesink". Use lowercase letters only.
* If you define more than one category for the same element, append an
* underscore and an identifier to your categories, like this: "filesrc_cache"
* </para>
* <para>
* If you create a library or an application using debugging categories, use a
* common prefix followed by an underscore for all your categories. GStreamer
* uses the GST prefix so GStreamer categories look like "GST_STATES". Be sure
* to include uppercase letters.
* </para>
* </note>
*/
#define GST_DEBUG_CATEGORY_INIT(cat,name,color,description) G_STMT_START{ \
if (cat == NULL) \
cat = _gst_debug_category_new (name,color,description); \
}G_STMT_END
void gst_debug_category_free (GstDebugCategory * category);
void gst_debug_category_set_threshold (GstDebugCategory * category,
GstDebugLevel level);
void gst_debug_category_reset_threshold (GstDebugCategory * category);
GstDebugLevel gst_debug_category_get_threshold (GstDebugCategory * category);
const gchar * gst_debug_category_get_name (GstDebugCategory * category);
guint gst_debug_category_get_color (GstDebugCategory * category);
const gchar * gst_debug_category_get_description (GstDebugCategory * category);
GSList * gst_debug_get_all_categories (void);
gchar * gst_debug_construct_term_color (guint colorinfo);
/***** Colorized debug for thread ids *****/
#ifdef GST_DEBUG_COLOR
#define GST_DEBUG_THREAD_FORMAT "\033[00;%dm%d\033[00m"
#define GST_DEBUG_THREAD_ARGS(id) ( ((id) < 0) ? 37 : ((id) % 6 + 31) ), (id)
#else
#define GST_DEBUG_THREAD_FORMAT "%d"
#define GST_DEBUG_THREAD_ARGS(id) (id)
#endif
extern GstDebugCategory * GST_CAT_DEFAULT;
/**********************************************************************
* The following is a DEBUG_ENTER implementation that will wrap the
* function it sits at the head of. It removes the need for a
* DEBUG_LEAVE call. However, it segfaults whenever it gets anywhere
* near cothreads. We will not use it for the moment.
/**
* GST_CAT_LEVEL_LOG:
* @cat: category to use
* @level: the severity of the message
* @object: the #GObject the message belongs to or NULL if none
* @...: A printf-style message to output
*
typedef void (*_debug_function_f)();
G_GNUC_UNUSED static gchar *_debug_string_pointer = NULL;
G_GNUC_UNUSED static GModule *_debug_self_module = NULL;
* Outputs a debugging message. This is the most general macro for outputting
* debugging messages. You will probably want to use one of the ones described
* below.
*/
#ifdef G_HAVE_ISO_VARARGS
#define GST_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{ \
if (gst_debug_is_active ()) { \
gst_debug_log (cat, level, __FILE__, GST_FUNCTION, __LINE__, G_OBJECT (object), __VA_ARGS__); \
} \
}G_STMT_END
#else /* G_HAVE_GNUC_VARARGS */
#define GST_CAT_LEVEL_LOG(cat,level,object,args...) G_STMT_START{ \
if (gst_debug_is_active ()) { \
gst_debug_log (cat, level, __FILE__, GST_FUNCTION, __LINE__, G_OBJECT (object), ##args ); \
} \
}G_STMT_END
#endif /* G_HAVE_ISO_VARARGS */
#ifndef GST_DEBUG_ENABLE_DEPRECATED
#ifdef G_HAVE_ISO_VARARGS
#define _DEBUG_ENTER_BUILTIN(...) \
static int _debug_in_wrapper = 0; \
gchar *_debug_string = ({ \
if (!_debug_in_wrapper) { \
void *_return_value; \
gchar *_debug_string; \
_debug_function_f function; \
void *_function_args = __builtin_apply_args(); \
_debug_in_wrapper = 1; \
_debug_string = g_strdup_printf(GST_DEBUG_PREFIX("")); \
_debug_string_pointer = _debug_string; \
fprintf(stderr,"%s: entered " FUNCTION, _debug_string); \
fprintf(stderr, __VA_ARGS__ ); \
fprintf(stderr,"\n"); \
if (_debug_self_module == NULL) _debug_self_module = g_module_open(NULL,0); \
g_module_symbol(_debug_self_module,FUNCTION,(gpointer *)&function); \
_return_value = __builtin_apply(function,_function_args,64); \
fprintf(stderr,"%s: left " FUNCTION, _debug_string); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr,"\n"); \
g_free(_debug_string); \
__builtin_return(_return_value); \
} else { \
_debug_in_wrapper = 0; \
} \
_debug_string_pointer; \
});
#define GST_CAT_ERROR_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, obj, __VA_ARGS__)
#define GST_CAT_WARNING_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj, __VA_ARGS__)
#define GST_CAT_INFO_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, obj, __VA_ARGS__)
#define GST_CAT_DEBUG_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, obj, __VA_ARGS__)
#define GST_CAT_LOG_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, obj, __VA_ARGS__)
#elif defined(G_HAVE_GNUC_VARARGS)
#define GST_CAT_ERROR(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, NULL, __VA_ARGS__)
#define GST_CAT_WARNING(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
#define GST_CAT_INFO(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, NULL, __VA_ARGS__)
#define GST_CAT_DEBUG(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, NULL, __VA_ARGS__)
#define GST_CAT_LOG(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, NULL, __VA_ARGS__)
#define _DEBUG_ENTER_BUILTIN(format,args...) \
static int _debug_in_wrapper = 0; \
gchar *_debug_string = ({ \
if (!_debug_in_wrapper) { \
void *_return_value; \
gchar *_debug_string; \
_debug_function_f function; \
void *_function_args = __builtin_apply_args(); \
_debug_in_wrapper = 1; \
_debug_string = g_strdup_printf(GST_DEBUG_PREFIX("")); \
_debug_string_pointer = _debug_string; \
fprintf(stderr,"%s: entered " FUNCTION format "\n" , _debug_string , ## args ); \
if (_debug_self_module == NULL) _debug_self_module = g_module_open(NULL,0); \
g_module_symbol(_debug_self_module,FUNCTION,(gpointer *)&function); \
_return_value = __builtin_apply(function,_function_args,64); \
fprintf(stderr,"%s: left " FUNCTION format "\n" , _debug_string , ## args ); \
g_free(_debug_string); \
__builtin_return(_return_value); \
} else { \
_debug_in_wrapper = 0; \
} \
_debug_string_pointer; \
});
#define GST_ERROR_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, __VA_ARGS__)
#define GST_WARNING_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, __VA_ARGS__)
#define GST_INFO_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, __VA_ARGS__)
#define GST_DEBUG_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, __VA_ARGS__)
#define GST_LOG_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, __VA_ARGS__)
#endif
#define GST_ERROR(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, __VA_ARGS__)
#define GST_WARNING(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
#define GST_INFO(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, __VA_ARGS__)
#define GST_DEBUG(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, __VA_ARGS__)
#define GST_LOG(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL, __VA_ARGS__)
* WARNING: there's a gcc CPP bug lurking in here. The extra space before the ##args *
* somehow make the preprocessor leave the _debug_string. If it's removed, the *
* _debug_string somehow gets stripped along with the ##args, and that's all she wrote. *
#else /* G_HAVE_GNUC_VARARGS */
#define GST_CAT_ERROR_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, obj, ##args )
#define GST_CAT_WARNING_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj, ##args )
#define GST_CAT_INFO_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, obj, ##args )
#define GST_CAT_DEBUG_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, obj, ##args )
#define GST_CAT_LOG_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, obj, ##args )
#define GST_CAT_ERROR(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, NULL, ##args )
#define GST_CAT_WARNING(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, ##args )
#define GST_CAT_INFO(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, NULL, ##args )
#define GST_CAT_DEBUG(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, NULL, ##args )
#define GST_CAT_LOG(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, NULL, ##args )
#define GST_ERROR_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, ##args )
#define GST_WARNING_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, ##args )
#define GST_INFO_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, ##args )
#define GST_DEBUG_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, ##args )
#define GST_LOG_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, ##args )
#define GST_ERROR(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, ##args )
#define GST_WARNING(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, ##args )
#define GST_INFO(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, ##args )
#define GST_DEBUG(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, ##args )
#define GST_LOG(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL, ##args )
#endif /* G_HAVE_ISO_VARARGS */
#else /* GST_DEBUG_ENABLE_DEPRECATED */
/* This is a workaround so the old debugging stuff of Gstreamer 0.6 works.
This is undocumented and will go when 0.8 comes out. */
#ifdef G_HAVE_ISO_VARARGS
# define GST_INFO(cat,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, __VA_ARGS__)
# define GST_DEBUG(cat,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, __VA_ARGS__)
# define GST_INFO_ELEMENT(cat,obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, __VA_ARGS__)
# define GST_DEBUG_ELEMENT(cat,obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, __VA_ARGS__)
# define GST_DEBUG_ENTER(...) GST_DEBUG ("entering: " __VA_ARGS__ )
# define GST_DEBUG_LEAVE(...) GST_DEBUG ("leaving: " __VA_ARGS__ )
# define GST_INFO_ENTER(...) GST_INFO ("entering: " __VA_ARGS__ )
# define GST_INFO_LEAVE(...) GST_INFO ("leaving: " __VA_ARGS__ )
#else /* G_HAVE_GNUC_VARARGS */
# define GST_INFO(cat,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, ##args )
# define GST_DEBUG(cat,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, ##args )
# define GST_INFO_ELEMENT(cat,obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, ##args )
# define GST_DEBUG_ELEMENT(cat,obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, ##args )
# define GST_DEBUG_ENTER(args...) GST_DEBUG ("entering: " ##args )
# define GST_DEBUG_LEAVE(args...) GST_DEBUG ("leaving: " ##args )
# define GST_INFO_ENTER(args...) GST_INFO ("entering: " ##args )
# define GST_INFO_LEAVE(args...) GST_INFO ("leaving: " ##args )
#endif /* G_HAVE_ISO_VARARGS */
#define _DEBUG_BUILTIN(...) \
if (_debug_string != (void *)-1) { \
if (_debug_string) { \
fprintf(stderr, "%s: " _debug_string); \
fprintf(stderr, __VA_ARGS__); \
} else { \
fprintf(stderr,GST_DEBUG_PREFIX(": " __VA_ARGS__)); \
} \
}
#endif /* !GST_DEBUG_ENABLE_DEPRECATED */
#elif defined(G_HAVE_GNUC_VARARGS)
#define _DEBUG_BUILTIN(format,args...) \
if (_debug_string != (void *)-1) { \
if (_debug_string) \
fprintf(stderr,"%s: " format , _debug_string , ## args); \
else \
fprintf(stderr,GST_DEBUG_PREFIX(": " format , ## args)); \
}
#endif
*/
/**********************************************************************
* INFO system
**********************************************************************/
typedef void (*GstInfoHandler) (gint category,gboolean incore,
const gchar *file,const gchar *function,
gint line,const gchar *debug_string,
void *element,gchar *string);
void gst_default_info_handler (gint category,gboolean incore,
const gchar *file,const gchar *function,
gint line,const gchar *debug_string,
void *element,gchar *string);
extern GstInfoHandler _gst_info_handler;
extern guint32 _gst_info_categories;
/* for include files that make too much noise normally */
#ifdef GST_INFO_FORCE_DISABLE
#undef GST_INFO_ENABLED
#endif
/* for applications that really really want all the noise */
#ifdef GST_INFO_FORCE_ENABLE
#define GST_INFO_ENABLED
#endif
#ifdef G_HAVE_ISO_VARARGS
#ifdef GST_INFO_ENABLED
#define GST_INFO(cat,...) G_STMT_START{ \
if ((1<<cat) & _gst_info_categories) \
_gst_info_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
NULL,g_strdup_printf( __VA_ARGS__ )); \
}G_STMT_END
#define GST_INFO_ELEMENT(cat,element,...) G_STMT_START{ \
if ((1<<cat) & _gst_info_categories) \
_gst_info_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
element,g_strdup_printf( __VA_ARGS__ )); \
}G_STMT_END
#else
#define GST_INFO(cat,...)
#define GST_INFO_ELEMENT(cat,element,...)
#endif
#elif defined(G_HAVE_GNUC_VARARGS)
#ifdef GST_INFO_ENABLED
#define GST_INFO(cat,format,args...) G_STMT_START{ \
if ((1<<cat) & _gst_info_categories) \
_gst_info_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
NULL,g_strdup_printf( format , ## args )); \
}G_STMT_END
#define GST_INFO_ELEMENT(cat,element,format,args...) G_STMT_START{ \
if ((1<<cat) & _gst_info_categories) \
_gst_info_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
element,g_strdup_printf( format , ## args )); \
}G_STMT_END
#else
#define GST_INFO(cat,format,args...)
#define GST_INFO_ELEMENT(cat,element,format,args...)
#endif
#endif
void gst_info_set_categories (guint32 categories);
guint32 gst_info_get_categories (void);
void gst_info_enable_category (gint category);
void gst_info_disable_category (gint category);
void gst_debug_set_categories (guint32 categories);
guint32 gst_debug_get_categories (void);
void gst_debug_enable_category (gint category);
void gst_debug_disable_category (gint category);
/**********************************************************************
* ERROR system
**********************************************************************/
typedef void (*GstErrorHandler) (gchar *file,gchar *function,
gint line,gchar *debug_string,
void *element,void *object,gchar *string);
void gst_default_error_handler (gchar *file,gchar *function,
gint line,gchar *debug_string,
void *element,void *object,gchar *string);
extern GstErrorHandler _gst_error_handler;
#ifdef G_HAVE_ISO_VARARGS
#define GST_ERROR(element,...) \
_gst_error_handler(__FILE__,FUNCTION,__LINE__,_debug_string, \
element,NULL,g_strdup_printf( __VA_ARGS__ ))
#define GST_ERROR_OBJECT(element,object,...) \
_gst_error_handler(__FILE__,FUNCTION,__LINE__,_debug_string, \
element,object,g_strdup_printf( __VA_ARGS__ ))
#elif defined(G_HAVE_GNUC_VARARGS)
#define GST_ERROR(element,format,args...) \
_gst_error_handler(__FILE__,FUNCTION,__LINE__,_debug_string, \
element,NULL,g_strdup_printf( format , ## args ))
#define GST_ERROR_OBJECT(element,object,format,args...) \
_gst_error_handler(__FILE__,FUNCTION,__LINE__,_debug_string, \
element,object,g_strdup_printf( format , ## args ))
#endif
/********** function pointer stuff **********/
#if GST_DEBUG_ENABLED
void* _gst_debug_register_funcptr (void *ptr, gchar *ptrname);
gchar* _gst_debug_nameof_funcptr (void *ptr);
void* _gst_debug_register_funcptr (void * ptr,
gchar * ptrname);
gchar* _gst_debug_nameof_funcptr (void * ptr);
/**
* GST_DEBUG_FUNCPTR:
* @ptr: The function to register
*
* Register a pointer to a function with its name, so it can later be used by
* GST_DEBUG_FUNCPTR_NAME().
*
* Returns: The ptr to the function.
*/
#define GST_DEBUG_FUNCPTR(ptr) (_gst_debug_register_funcptr((void *)(ptr), #ptr) , ptr)
/**
* GST_DEBUG_FUNCPTR_NAME:
* @ptr: pointer to the function
*
* Retrieves the name of the function, if it was previously registered with
* GST_DEBUG_FUNCPTR(). If not, it returns a description of the pointer.
* <note>
* <para>
* Make sure you free the string after use.
* </para>
* </note>
*
* Returns: The name of the function
*/
#define GST_DEBUG_FUNCPTR_NAME(ptr) _gst_debug_nameof_funcptr((void *)ptr)
#else
#else /* GST_DISABLE_GST_DEBUG */
#ifdef __GNUC__
# pragma GCC poison gst_debug_log
# pragma GCC poison gst_debug_logv
# pragma GCC poison gst_debug_log_default
# pragma GCC poison _gst_debug_category_new
#endif
#define _gst_debug_init() /* NOP */
#define gst_debug_set_log_function(func,data) /* NOP */
#define gst_debug_reset_log_function(void) /* NOP */
#define gst_debug_set_default_threshold(level) /* NOP */
#define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
#define gst_debug_category_set_threshold_for_name(name, level) /* NOP */
#define gst_debug_category_unset_threshold_for_name(name) /* NOP */
#define gst_debug_level_get_name(level) ("NONE")
#define gst_debug_add_log_function(func,data) (FALSE)
#define gst_debug_remove_log_function(func) (0)
#define gst_debug_remove_log_function_by_data(data) (0)
#define gst_debug_set_active(active) /* NOP */
#define gst_debug_is_active() (FALSE)
#define gst_debug_set_colored(colored) /* NOP */
#define gst_debug_is_colored() (FALSE)
#define gst_debug_set_default_threshold(level) /* NOP */
#define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
#define gst_debug_set_threshold_for_name(name,level) /* NOP */
#define gst_debug_unset_threshold_for_name(name) /* NOP */
#define GST_DEBUG_CATEGORY(var) /* NOP */
#define GST_DEBUG_CATEGORY_EXTERN(var) /* NOP */
#define GST_DEBUG_CATEGORY_STATIC(var) /* NOP */
#define GST_DEBUG_CATEGORY_INIT(var,name,color,desc) /* NOP */
#define gst_debug_category_free(category) /* NOP */
#define gst_debug_category_set_threshold(category,level) /* NOP */
#define gst_debug_category_reset_threshold(category) /* NOP */
#define gst_debug_category_get_threshold(category) (GST_LEVEL_NONE)
#define gst_debug_category_get_name(cat) ("")
#define gst_debug_category_get_color(cat) (0)
#define gst_debug_category_get_description(cat) ("")
#define gst_debug_get_all_categories() (NULL)
#define gst_debug_construct_term_color(colorinfo) (g_strdup ("00"))
#ifdef G_HAVE_ISO_VARARGS
#define GST_CAT_LEVEL_LOG(cat,level,...) /* NOP */
#define GST_CAT_ERROR_OBJECT(...) /* NOP */
#define GST_CAT_WARNING_OBJECT(...) /* NOP */
#define GST_CAT_INFO_OBJECT(...) /* NOP */
#define GST_CAT_DEBUG_OBJECT(...) /* NOP */
#define GST_CAT_LOG_OBJECT(...) /* NOP */
#define GST_CAT_ERROR(...) /* NOP */
#define GST_CAT_WARNING(...) /* NOP */
#define GST_CAT_INFO(...) /* NOP */
#define GST_CAT_DEBUG(...) /* NOP */
#define GST_CAT_LOG(...) /* NOP */
#define GST_ERROR_OBJECT(...) /* NOP */
#define GST_WARNING_OBJECT(...) /* NOP */
#define GST_INFO_OBJECT(...) /* NOP */
#define GST_DEBUG_OBJECT(...) /* NOP */
#define GST_LOG_OBJECT(...) /* NOP */
#define GST_ERROR(...) /* NOP */
#define GST_WARNING(...) /* NOP */
#define GST_INFO(...) /* NOP */
#define GST_DEBUG(...) /* NOP */
#define GST_LOG(...) /* NOP */
#ifdef GST_DEBUG_ENABLE_DEPRECATED
#define GST_INFO_ELEMENT(cat,obj,...) /* NOP */
#define GST_DEBUG_ELEMENT(cat,obj,...) /* NOP */
#define GST_DEBUG_ENTER(...) /* NOP */
#define GST_DEBUG_LEAVE(...) /* NOP */
#define GST_INFO_ENTER(...) /* NOP */
#define GST_INFO_LEAVE(...) /* NOP */
#endif /* GST_DEBUG_ENABLE_DEPRECATED */
#else /* !G_HAVE_ISO_VARARGS */
#define GST_CAT_LEVEL_LOG(cat,level,args...) /* NOP */
#define GST_CAT_ERROR_OBJECT(args...) /* NOP */
#define GST_CAT_WARNING_OBJECT(args...) /* NOP */
#define GST_CAT_INFO_OBJECT(args...) /* NOP */
#define GST_CAT_DEBUG_OBJECT(args...) /* NOP */
#define GST_CAT_LOG_OBJECT(args...) /* NOP */
#define GST_CAT_ERROR(args...) /* NOP */
#define GST_CAT_WARNING(args...) /* NOP */
#define GST_CAT_INFO(args...) /* NOP */
#define GST_CAT_DEBUG(args...) /* NOP */
#define GST_CAT_LOG(args...) /* NOP */
#define GST_ERROR_OBJECT(args...) /* NOP */
#define GST_WARNING_OBJECT(args...) /* NOP */
#define GST_INFO_OBJECT(args...) /* NOP */
#define GST_DEBUG_OBJECT(args...) /* NOP */
#define GST_LOG_OBJECT(args...) /* NOP */
#define GST_ERROR(args...) /* NOP */
#define GST_WARNING(args...) /* NOP */
#define GST_INFO(args...) /* NOP */
#define GST_DEBUG(args...) /* NOP */
#define GST_LOG(args...) /* NOP */
#ifdef GST_DEBUG_ENABLE_DEPRECATED
#define GST_INFO_ELEMENT(cat,obj,args...) /* NOP */
#define GST_DEBUG_ELEMENT(cat,obj,args...) /* NOP */
#define GST_DEBUG_ENTER(args...) /* NOP */
#define GST_DEBUG_LEAVE(args...) /* NOP */
#define GST_INFO_ENTER(args...) /* NOP */
#define GST_INFO_LEAVE(args...) /* NOP */
#endif /* GST_DEBUG_ENABLE_DEPRECATED */
#endif /* G_HAVE_ISO_VARARGS */
#define GST_DEBUG_FUNCPTR(ptr) (ptr)
#define GST_DEBUG_FUNCPTR_NAME(ptr) ""
#endif /* GST_DEBUG_ENABLED */
#define GST_DEBUG_FUNCPTR_NAME(ptr) (g_strdup_printf ("%p", ptr))
#endif /* GST_DISABLE_GST_DEBUG */
void gst_debug_print_stack_trace (void);

View file

@ -23,7 +23,8 @@
#include "gst_private.h"
#include "gstobject.h"
#include "gstlog.h"
#include "gstinfo.h"
#ifndef GST_DISABLE_TRACE
#include "gsttrace.h"
#endif
@ -211,8 +212,7 @@ gst_object_ref (GstObject *object)
{
g_return_val_if_fail (GST_IS_OBJECT (object), NULL);
GST_DEBUG (GST_CAT_REFCOUNTING, "ref %p '%s' %d->%d", object,
GST_STR_NULL (GST_OBJECT_NAME (object)),
GST_CAT_LOG_OBJECT (GST_CAT_REFCOUNTING, object, "ref %d->%d",
G_OBJECT (object)->ref_count,
G_OBJECT (object)->ref_count + 1);
@ -233,8 +233,7 @@ gst_object_unref (GstObject *object)
g_return_if_fail (GST_IS_OBJECT (object));
g_return_if_fail (G_OBJECT (object)->ref_count > 0);
GST_DEBUG (GST_CAT_REFCOUNTING, "unref %p '%s' %d->%d", object,
GST_STR_NULL (GST_OBJECT_NAME (object)),
GST_CAT_LOG_OBJECT (GST_CAT_REFCOUNTING, object, "unref %d->%d",
G_OBJECT (object)->ref_count,
G_OBJECT (object)->ref_count - 1);
@ -256,7 +255,7 @@ gst_object_sink (GstObject *object)
g_return_if_fail (object != NULL);
g_return_if_fail (GST_IS_OBJECT (object));
GST_DEBUG (GST_CAT_REFCOUNTING, "sink %p '%s'", object, GST_STR_NULL (GST_OBJECT_NAME (object)));
GST_CAT_LOG_OBJECT (GST_CAT_REFCOUNTING, object, "sink");
if (GST_OBJECT_FLOATING (object)) {
GST_FLAG_UNSET (object, GST_FLOATING);
@ -275,7 +274,13 @@ gst_object_sink (GstObject *object)
void
gst_object_replace (GstObject **oldobj, GstObject *newobj)
{
GST_DEBUG (GST_CAT_REFCOUNTING, "replace %p %p", *oldobj, newobj);
g_return_if_fail (oldobj != NULL);
g_return_if_fail (*oldobj == NULL || GST_IS_OBJECT (*oldobj));
g_return_if_fail (newobj == NULL || GST_IS_OBJECT (newobj));
GST_CAT_LOG (GST_CAT_REFCOUNTING, "replace %s %s",
*oldobj ? GST_STR_NULL (GST_OBJECT_NAME (*oldobj)) : "(NONE)",
newobj ? GST_STR_NULL (GST_OBJECT_NAME (newobj)) : "(NONE)");
if (*oldobj != newobj) {
if (newobj) gst_object_ref (newobj);
@ -288,7 +293,7 @@ gst_object_replace (GstObject **oldobj, GstObject *newobj)
static void
gst_object_dispose (GObject *object)
{
GST_DEBUG (GST_CAT_REFCOUNTING, "dispose %p '%s'", object, GST_STR_NULL (GST_OBJECT_NAME (object)));
GST_CAT_LOG_OBJECT (GST_CAT_REFCOUNTING, object, "dispose");
GST_FLAG_SET (GST_OBJECT (object), GST_DESTROYED);
GST_OBJECT_PARENT (object) = NULL;
@ -302,7 +307,7 @@ gst_object_finalize (GObject *object)
{
GstObject *gstobject = GST_OBJECT (object);
GST_DEBUG (GST_CAT_REFCOUNTING, "finalize %p '%s'", object, GST_STR_NULL (GST_OBJECT_NAME (object)));
GST_CAT_LOG_OBJECT (GST_CAT_REFCOUNTING, object, "finalize");
g_signal_handlers_destroy (object);
@ -346,7 +351,7 @@ gst_object_dispatch_properties_changed (GObject *object,
while (gst_object) {
/* need own category? */
for (i = 0; i < n_pspecs; i++) {
GST_DEBUG (GST_CAT_EVENT, "deep notification from %s to %s (%s)", GST_OBJECT_NAME (object),
GST_CAT_LOG (GST_CAT_EVENT, "deep notification from %s to %s (%s)", GST_OBJECT_NAME (object),
GST_OBJECT_NAME (gst_object), pspecs[i]->name);
g_signal_emit (gst_object, gst_object_signals[DEEP_NOTIFY], g_quark_from_string (pspecs[i]->name),
(GstObject *) object, pspecs[i]);
@ -501,11 +506,7 @@ gst_object_set_parent (GstObject *object, GstObject *parent)
g_return_if_fail (parent != NULL);
g_return_if_fail (GST_IS_OBJECT (parent));
g_return_if_fail (object != parent);
if (object->parent != NULL) {
GST_ERROR_OBJECT (object,object->parent, "object's parent is already set, must unparent first");
return;
}
g_return_if_fail (object->parent == NULL);
gst_object_ref (object);
gst_object_sink (object);
@ -545,7 +546,7 @@ gst_object_unparent (GstObject *object)
if (object->parent == NULL)
return;
GST_DEBUG (GST_CAT_REFCOUNTING, "unparent '%s'",GST_OBJECT_NAME(object));
GST_CAT_LOG_OBJECT (GST_CAT_REFCOUNTING, object, "unparent");
g_signal_emit (G_OBJECT (object), gst_object_signals[PARENT_UNSET], 0, object->parent);

View file

@ -20,7 +20,6 @@
* Boston, MA 02111-1307, USA.
*/
/* #define GST_DEBUG_ENABLED */
#include "gst_private.h"
#include "gstpad.h"
@ -30,7 +29,7 @@
#include "gstbin.h"
#include "gstscheduler.h"
#include "gstevent.h"
#include "gstlog.h"
#include "gstinfo.h"
enum {
TEMPL_PAD_CREATED,
@ -398,11 +397,11 @@ gst_pad_set_active (GstPad *pad, gboolean active)
realpad = GST_PAD_REALIZE (pad);
if (active) {
GST_DEBUG (GST_CAT_PADS, "activating pad %s:%s",
GST_CAT_DEBUG (GST_CAT_PADS, "activating pad %s:%s",
GST_DEBUG_PAD_NAME (realpad));
GST_FLAG_UNSET (realpad, GST_PAD_DISABLED);
} else {
GST_DEBUG (GST_CAT_PADS, "de-activating pad %s:%s",
GST_CAT_DEBUG (GST_CAT_PADS, "de-activating pad %s:%s",
GST_DEBUG_PAD_NAME (realpad));
GST_FLAG_SET (realpad, GST_PAD_DISABLED);
}
@ -474,7 +473,7 @@ gst_pad_set_chain_function (GstPad *pad, GstPadChainFunction chain)
g_return_if_fail (GST_IS_REAL_PAD (pad));
GST_RPAD_CHAINFUNC (pad) = chain;
GST_DEBUG (GST_CAT_PADS, "chainfunc for %s:%s set to %s",
GST_CAT_DEBUG (GST_CAT_PADS, "chainfunc for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (chain));
}
@ -494,7 +493,7 @@ gst_pad_set_get_function (GstPad *pad,
GST_RPAD_GETFUNC (pad) = get;
GST_DEBUG (GST_CAT_PADS, "getfunc for %s:%s set to %s",
GST_CAT_DEBUG (GST_CAT_PADS, "getfunc for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (get));
}
@ -513,7 +512,7 @@ gst_pad_set_event_function (GstPad *pad,
GST_RPAD_EVENTFUNC (pad) = event;
GST_DEBUG (GST_CAT_PADS, "eventfunc for %s:%s set to %s",
GST_CAT_DEBUG (GST_CAT_PADS, "eventfunc for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (event));
}
@ -532,7 +531,7 @@ gst_pad_set_event_mask_function (GstPad *pad,
GST_RPAD_EVENTMASKFUNC (pad) = mask_func;
GST_DEBUG (GST_CAT_PADS, "eventmaskfunc for %s:%s set to %s",
GST_CAT_DEBUG (GST_CAT_PADS, "eventmaskfunc for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (mask_func));
}
@ -607,7 +606,7 @@ gst_pad_set_convert_function (GstPad *pad,
GST_RPAD_CONVERTFUNC (pad) = convert;
GST_DEBUG (GST_CAT_PADS, "convertfunc for %s:%s set to %s",
GST_CAT_DEBUG (GST_CAT_PADS, "convertfunc for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (convert));
}
@ -626,7 +625,7 @@ gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query)
GST_RPAD_QUERYFUNC (pad) = query;
GST_DEBUG (GST_CAT_PADS, "queryfunc for %s:%s set to %s",
GST_CAT_DEBUG (GST_CAT_PADS, "queryfunc for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (query));
}
@ -645,7 +644,7 @@ gst_pad_set_query_type_function (GstPad *pad, GstPadQueryTypeFunction type_func)
GST_RPAD_QUERYTYPEFUNC (pad) = type_func;
GST_DEBUG (GST_CAT_PADS, "querytypefunc for %s:%s set to %s",
GST_CAT_DEBUG (GST_CAT_PADS, "querytypefunc for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (type_func));
}
@ -719,7 +718,7 @@ gst_pad_set_internal_link_function (GstPad *pad,
g_return_if_fail (GST_IS_REAL_PAD (pad));
GST_RPAD_INTLINKFUNC (pad) = intlink;
GST_DEBUG (GST_CAT_PADS, "internal link for %s:%s set to %s",
GST_CAT_DEBUG (GST_CAT_PADS, "internal link for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (intlink));
}
@ -737,7 +736,7 @@ gst_pad_set_formats_function (GstPad *pad, GstPadFormatsFunction formats)
g_return_if_fail (GST_IS_REAL_PAD (pad));
GST_RPAD_FORMATSFUNC (pad) = formats;
GST_DEBUG (GST_CAT_PADS, "formats function for %s:%s set to %s",
GST_CAT_DEBUG (GST_CAT_PADS, "formats function for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (formats));
}
@ -757,7 +756,7 @@ gst_pad_set_link_function (GstPad *pad,
g_return_if_fail (GST_IS_REAL_PAD (pad));
GST_RPAD_LINKFUNC (pad) = link;
GST_DEBUG (GST_CAT_PADS, "linkfunc for %s:%s set to %s",
GST_CAT_DEBUG (GST_CAT_PADS, "linkfunc for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (link));
}
@ -776,7 +775,7 @@ gst_pad_set_getcaps_function (GstPad *pad,
g_return_if_fail (GST_IS_REAL_PAD (pad));
GST_RPAD_GETCAPSFUNC (pad) = getcaps;
GST_DEBUG (GST_CAT_PADS, "getcapsfunc for %s:%s set to %s",
GST_CAT_DEBUG (GST_CAT_PADS, "getcapsfunc for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (getcaps));
}
/**
@ -796,7 +795,7 @@ gst_pad_set_bufferpool_function (GstPad *pad,
g_return_if_fail (GST_PAD_IS_SINK (pad));
GST_RPAD_BUFFERPOOLFUNC (pad) = bufpool;
GST_DEBUG (GST_CAT_PADS, "bufferpoolfunc for %s:%s set to %s",
GST_CAT_DEBUG (GST_CAT_PADS, "bufferpoolfunc for %s:%s set to %s",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_FUNCPTR_NAME (bufpool));
}
@ -820,7 +819,7 @@ gst_pad_unlink (GstPad *srcpad,
g_return_if_fail (sinkpad != NULL);
g_return_if_fail (GST_IS_PAD (sinkpad));
GST_INFO (GST_CAT_ELEMENT_PADS, "unlinking %s:%s(%p) and %s:%s(%p)",
GST_CAT_INFO (GST_CAT_ELEMENT_PADS, "unlinking %s:%s(%p) and %s:%s(%p)",
GST_DEBUG_PAD_NAME (srcpad), srcpad,
GST_DEBUG_PAD_NAME (sinkpad), sinkpad);
@ -874,7 +873,7 @@ gst_pad_unlink (GstPad *srcpad,
g_signal_emit (G_OBJECT (realsink), gst_real_pad_signals[REAL_UNLINKED],
0, realsrc);
GST_INFO (GST_CAT_ELEMENT_PADS, "unlinked %s:%s and %s:%s",
GST_CAT_INFO (GST_CAT_ELEMENT_PADS, "unlinked %s:%s and %s:%s",
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
gst_object_unref (GST_OBJECT (realsrc));
@ -988,7 +987,7 @@ gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps)
g_return_val_if_fail (sinkpad != NULL, FALSE);
g_return_val_if_fail (GST_IS_PAD (sinkpad), FALSE);
GST_INFO (GST_CAT_PADS, "trying to link %s:%s and %s:%s",
GST_CAT_INFO (GST_CAT_PADS, "trying to link %s:%s and %s:%s",
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
/* now we need to deal with the real/ghost stuff */
@ -996,27 +995,27 @@ gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps)
realsink = GST_PAD_REALIZE (sinkpad);
if ((GST_PAD (realsrc) != srcpad) || (GST_PAD (realsink) != sinkpad)) {
GST_INFO (GST_CAT_PADS, "*actually* linking %s:%s and %s:%s",
GST_CAT_INFO (GST_CAT_PADS, "*actually* linking %s:%s and %s:%s",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
}
/* FIXME: shouldn't we convert this to g_return_val_if_fail? */
if (GST_RPAD_PEER (realsrc) != NULL) {
GST_INFO (GST_CAT_PADS, "Real source pad %s:%s has a peer, failed",
GST_CAT_INFO (GST_CAT_PADS, "Real source pad %s:%s has a peer, failed",
GST_DEBUG_PAD_NAME (realsrc));
return FALSE;
}
if (GST_RPAD_PEER (realsink) != NULL) {
GST_INFO (GST_CAT_PADS, "Real sink pad %s:%s has a peer, failed",
GST_CAT_INFO (GST_CAT_PADS, "Real sink pad %s:%s has a peer, failed",
GST_DEBUG_PAD_NAME (realsink));
return FALSE;
}
if (GST_PAD_PARENT (realsrc) == NULL) {
GST_INFO (GST_CAT_PADS, "Real src pad %s:%s has no parent, failed",
GST_CAT_INFO (GST_CAT_PADS, "Real src pad %s:%s has no parent, failed",
GST_DEBUG_PAD_NAME (realsrc));
return FALSE;
}
if (GST_PAD_PARENT (realsink) == NULL) {
GST_INFO (GST_CAT_PADS, "Real sink pad %s:%s has no parent, failed",
GST_CAT_INFO (GST_CAT_PADS, "Real sink pad %s:%s has no parent, failed",
GST_DEBUG_PAD_NAME (realsrc));
return FALSE;
}
@ -1037,12 +1036,12 @@ gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps)
realsink = temppad;
}
if (GST_RPAD_DIRECTION (realsrc) != GST_PAD_SRC) {
GST_INFO (GST_CAT_PADS, "Real src pad %s:%s is not a source pad, failed",
GST_CAT_INFO (GST_CAT_PADS, "Real src pad %s:%s is not a source pad, failed",
GST_DEBUG_PAD_NAME (realsrc));
return FALSE;
}
if (GST_RPAD_DIRECTION (realsink) != GST_PAD_SINK) {
GST_INFO (GST_CAT_PADS, "Real sink pad %s:%s is not a sink pad, failed",
GST_CAT_INFO (GST_CAT_PADS, "Real sink pad %s:%s is not a sink pad, failed",
GST_DEBUG_PAD_NAME (realsink));
return FALSE;
}
@ -1053,7 +1052,7 @@ gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps)
/* try to negotiate the pads, we don't need to clear the caps here */
if (!gst_pad_try_relink_filtered_func (realsrc, realsink,
filtercaps, FALSE)) {
GST_DEBUG (GST_CAT_CAPS, "relink_filtered_func failed, can't link");
GST_CAT_DEBUG (GST_CAT_CAPS, "relink_filtered_func failed, can't link");
GST_RPAD_PEER (realsrc) = NULL;
GST_RPAD_PEER (realsink) = NULL;
@ -1077,12 +1076,12 @@ gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps)
GST_PAD_CAST (realsrc), GST_PAD_CAST (realsink));
}
else {
GST_INFO (GST_CAT_PADS, "not telling link to scheduler %s:%s and %s:%s, %p %p",
GST_CAT_INFO (GST_CAT_PADS, "not telling link to scheduler %s:%s and %s:%s, %p %p",
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad),
src_sched, sink_sched);
}
GST_INFO (GST_CAT_PADS, "linked %s:%s and %s:%s, successful",
GST_CAT_INFO (GST_CAT_PADS, "linked %s:%s and %s:%s, successful",
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
return TRUE;
@ -1305,12 +1304,12 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify)
* negotiation */
if (parent && GST_STATE (parent) < GST_STATE_READY)
{
GST_DEBUG (GST_CAT_CAPS, "parent %s of pad %s:%s is not READY",
GST_CAT_DEBUG (GST_CAT_CAPS, "parent %s of pad %s:%s is not READY",
GST_ELEMENT_NAME (parent), GST_DEBUG_PAD_NAME (pad));
return GST_PAD_LINK_DELAYED;
}
GST_INFO (GST_CAT_CAPS, "trying to set caps %p on pad %s:%s",
GST_CAT_INFO (GST_CAT_CAPS, "trying to set caps %p on pad %s:%s",
caps, GST_DEBUG_PAD_NAME (pad));
/* first see if we have to check against a filter, we ref the caps here as we're
@ -1331,7 +1330,7 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify)
/* oops, empty intersection, caps don"t have anything in common */
if (!intersection) {
GST_INFO (GST_CAT_CAPS, "caps did not intersect with %s:%s's allowed caps",
GST_CAT_INFO (GST_CAT_CAPS, "caps did not intersect with %s:%s's allowed caps",
GST_DEBUG_PAD_NAME (pad));
gst_caps_debug (caps, "caps themselves (attemped to set)");
gst_caps_debug (allowed,
@ -1352,7 +1351,7 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify)
gchar *debug_string;
gboolean negotiating;
GST_INFO (GST_CAT_CAPS, "calling link function on pad %s:%s",
GST_CAT_INFO (GST_CAT_CAPS, "calling link function on pad %s:%s",
GST_DEBUG_PAD_NAME (pad));
negotiating = GST_FLAG_IS_SET (pad, GST_PAD_NEGOTIATING);
@ -1387,18 +1386,18 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify)
return GST_PAD_LINK_REFUSED;
}
GST_INFO (GST_CAT_CAPS,
GST_CAT_INFO (GST_CAT_CAPS,
"got reply %s (%d) from link function on pad %s:%s",
debug_string, res, GST_DEBUG_PAD_NAME (pad));
/* done means the link function called another caps negotiate function
* on this pad that succeeded, we dont need to continue */
if (res == GST_PAD_LINK_DONE) {
GST_INFO (GST_CAT_CAPS, "pad %s:%s is done", GST_DEBUG_PAD_NAME (pad));
GST_CAT_INFO (GST_CAT_CAPS, "pad %s:%s is done", GST_DEBUG_PAD_NAME (pad));
return GST_PAD_LINK_DONE;
}
if (res == GST_PAD_LINK_REFUSED) {
GST_INFO (GST_CAT_CAPS, "pad %s:%s doesn't accept caps",
GST_CAT_INFO (GST_CAT_CAPS, "pad %s:%s doesn't accept caps",
GST_DEBUG_PAD_NAME (pad));
return GST_PAD_LINK_REFUSED;
}
@ -1406,7 +1405,7 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify)
/* we can only set caps on the pad if they are fixed */
if (GST_CAPS_IS_FIXED (caps)) {
GST_INFO (GST_CAT_CAPS, "setting caps on pad %s:%s",
GST_CAT_INFO (GST_CAT_CAPS, "setting caps on pad %s:%s",
GST_DEBUG_PAD_NAME (pad));
/* if we got this far all is ok, remove the old caps, set the new one */
gst_caps_replace_sink (&GST_PAD_CAPS (pad), caps);
@ -1414,7 +1413,7 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify)
g_object_notify (G_OBJECT (pad), "caps");
}
else {
GST_INFO (GST_CAT_CAPS,
GST_CAT_INFO (GST_CAT_CAPS,
"caps are not fixed on pad %s:%s, not setting them yet",
GST_DEBUG_PAD_NAME (pad));
@ -1443,7 +1442,7 @@ gst_pad_try_set_caps (GstPad *pad, GstCaps *caps)
realpad = GST_PAD_REALIZE (pad);
peer = GST_RPAD_PEER (realpad);
GST_INFO (GST_CAT_CAPS, "trying to set caps %p on pad %s:%s",
GST_CAT_INFO (GST_CAT_CAPS, "trying to set caps %p on pad %s:%s",
caps, GST_DEBUG_PAD_NAME (realpad));
gst_caps_debug (caps, "caps that we are trying to set");
@ -1454,7 +1453,7 @@ gst_pad_try_set_caps (GstPad *pad, GstCaps *caps)
/* setting non fixed caps on a pad is not allowed */
if (!GST_CAPS_IS_FIXED (caps)) {
GST_INFO (GST_CAT_CAPS,
GST_CAT_INFO (GST_CAT_CAPS,
"trying to set unfixed caps on pad %s:%s, not allowed",
GST_DEBUG_PAD_NAME (realpad));
g_warning ("trying to set non fixed caps on pad %s:%s, not allowed",
@ -1469,7 +1468,7 @@ gst_pad_try_set_caps (GstPad *pad, GstCaps *caps)
* if it has a link function */
if (peer && ((set_retval = gst_pad_try_set_caps_func (peer, caps, TRUE)) <= 0))
{
GST_INFO (GST_CAT_CAPS, "tried to set caps on peerpad %s:%s but couldn't, return value %d",
GST_CAT_INFO (GST_CAT_CAPS, "tried to set caps on peerpad %s:%s but couldn't, return value %d",
GST_DEBUG_PAD_NAME (peer), set_retval);
goto done;
}
@ -1477,11 +1476,11 @@ gst_pad_try_set_caps (GstPad *pad, GstCaps *caps)
/* then try to set our own caps, we don't need to be notified */
if ((set_retval = gst_pad_try_set_caps_func (realpad, caps, FALSE)) <= 0)
{
GST_INFO (GST_CAT_CAPS, "tried to set own caps on pad %s:%s but couldn't, return value %d",
GST_CAT_INFO (GST_CAT_CAPS, "tried to set own caps on pad %s:%s but couldn't, return value %d",
GST_DEBUG_PAD_NAME (realpad), set_retval);
goto done;
}
GST_INFO (GST_CAT_CAPS, "succeeded setting caps %p on pad %s:%s, return value %d",
GST_CAT_INFO (GST_CAT_CAPS, "succeeded setting caps %p on pad %s:%s, return value %d",
caps, GST_DEBUG_PAD_NAME (realpad), set_retval);
g_assert (GST_PAD_CAPS (pad));
@ -1517,7 +1516,7 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
/* optinally clear the caps */
if (clear) {
GST_INFO (GST_CAT_PADS,
GST_CAT_INFO (GST_CAT_PADS,
"start relink filtered %s:%s and %s:%s, clearing caps",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
@ -1527,16 +1526,16 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
gst_caps_replace (&GST_RPAD_FILTER (realsink), NULL);
}
else {
GST_INFO (GST_CAT_PADS, "start relink filtered %s:%s and %s:%s",
GST_CAT_INFO (GST_CAT_PADS, "start relink filtered %s:%s and %s:%s",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
}
srccaps = gst_pad_get_caps (GST_PAD (realsrc));
GST_DEBUG (GST_CAT_PADS, "dumping caps of pad %s:%s",
GST_CAT_DEBUG (GST_CAT_PADS, "dumping caps of pad %s:%s",
GST_DEBUG_PAD_NAME (realsrc));
gst_caps_debug (srccaps, "caps of src pad (pre-relink)");
sinkcaps = gst_pad_get_caps (GST_PAD (realsink));
GST_DEBUG (GST_CAT_PADS, "dumping caps of pad %s:%s",
GST_CAT_DEBUG (GST_CAT_PADS, "dumping caps of pad %s:%s",
GST_DEBUG_PAD_NAME (realsink));
gst_caps_debug (sinkcaps, "caps of sink pad (pre-relink)");
@ -1548,14 +1547,14 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
if (!intersection && (srccaps || sinkcaps)) {
/* the intersection is NULL but the pad caps were not both NULL,
* this means they have no common format */
GST_INFO (GST_CAT_PADS, "pads %s:%s and %s:%s have no common type",
GST_CAT_INFO (GST_CAT_PADS, "pads %s:%s and %s:%s have no common type",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
/* make sure any floating caps from gst_pad_get_caps are freed here */
gst_caps_sink (srccaps);
gst_caps_sink (sinkcaps);
return FALSE;
} else {
GST_INFO (GST_CAT_PADS, "pads %s:%s and %s:%s intersected to %s caps",
GST_CAT_INFO (GST_CAT_PADS, "pads %s:%s and %s:%s intersected to %s caps",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink),
(intersection ?
(GST_CAPS_IS_FIXED (intersection) ? "fixed" : "variable") :
@ -1575,7 +1574,7 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
gst_caps_sink (intersection);
if (!filtered_intersection) {
GST_INFO (GST_CAT_PADS,
GST_CAT_INFO (GST_CAT_PADS,
"filtered link between pads %s:%s and %s:%s is empty",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
return FALSE;
@ -1587,7 +1586,7 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
gst_caps_replace_sink (&GST_RPAD_APPFILTER (realsrc), filtercaps);
}
}
GST_DEBUG (GST_CAT_CAPS, "setting filter for link to:");
GST_CAT_DEBUG (GST_CAT_CAPS, "setting filter for link to:");
gst_caps_debug (intersection, "filter for link");
/* both the app filter and the filter, while stored on both peer pads,
@ -1630,35 +1629,35 @@ gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad)
/* shortcut negotiation */
parent = GST_PAD_PARENT (realsrc);
if (parent && GST_STATE (parent) < GST_STATE_READY) {
GST_DEBUG (GST_CAT_CAPS, "parent %s of pad %s:%s is not READY",
GST_CAT_DEBUG (GST_CAT_CAPS, "parent %s of pad %s:%s is not READY",
GST_ELEMENT_NAME (parent), GST_DEBUG_PAD_NAME (realsrc));
return TRUE;
}
parent = GST_PAD_PARENT (realsink);
if (parent && GST_STATE (parent) < GST_STATE_READY) {
GST_DEBUG (GST_CAT_CAPS, "parent %s of pad %s:%s is not READY",
GST_CAT_DEBUG (GST_CAT_CAPS, "parent %s of pad %s:%s is not READY",
GST_ELEMENT_NAME (parent), GST_DEBUG_PAD_NAME (realsink));
return TRUE;
}
GST_INFO (GST_CAT_PADS, "perform negotiate for link %s:%s-%s:%s",
GST_CAT_INFO (GST_CAT_PADS, "perform negotiate for link %s:%s-%s:%s",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
filter = GST_RPAD_APPFILTER (realsrc);
if (filter) {
GST_INFO (GST_CAT_PADS, "dumping filter for link %s:%s-%s:%s",
GST_CAT_INFO (GST_CAT_PADS, "dumping filter for link %s:%s-%s:%s",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
gst_caps_debug (filter, "link filter caps");
}
/* calculate the new caps here */
srccaps = gst_pad_get_caps (GST_PAD (realsrc));
GST_DEBUG (GST_CAT_PADS, "dumping caps of pad %s:%s",
GST_CAT_DEBUG (GST_CAT_PADS, "dumping caps of pad %s:%s",
GST_DEBUG_PAD_NAME (realsrc));
gst_caps_debug (srccaps,
"src caps, awaiting negotiation, after applying filter");
sinkcaps = gst_pad_get_caps (GST_PAD (realsink));
GST_DEBUG (GST_CAT_PADS, "dumping caps of pad %s:%s",
GST_CAT_DEBUG (GST_CAT_PADS, "dumping caps of pad %s:%s",
GST_DEBUG_PAD_NAME (realsink));
gst_caps_debug (sinkcaps,
"sink caps, awaiting negotiation, after applying filter");
@ -1783,7 +1782,7 @@ gst_pad_proxy_link (GstPad *pad, GstCaps *caps)
peer = GST_RPAD_PEER (realpad);
GST_INFO (GST_CAT_CAPS, "proxy link to pad %s:%s",
GST_CAT_INFO (GST_CAT_CAPS, "proxy link to pad %s:%s",
GST_DEBUG_PAD_NAME (realpad));
if (peer && gst_pad_try_set_caps_func (peer, caps, TRUE) < 0)
@ -1794,7 +1793,7 @@ gst_pad_proxy_link (GstPad *pad, GstCaps *caps)
if (peer) {
gst_caps_debug (caps, "proxy link filter");
GST_INFO (GST_CAT_CAPS, "setting filter on %s:%s and %s:%s",
GST_CAT_INFO (GST_CAT_CAPS, "setting filter on %s:%s and %s:%s",
GST_DEBUG_PAD_NAME (peer), GST_DEBUG_PAD_NAME (realpad));
gst_caps_replace_sink (&GST_RPAD_FILTER (peer), caps);
@ -1824,26 +1823,26 @@ gst_pad_get_caps (GstPad *pad)
realpad = GST_PAD_REALIZE (pad);
GST_DEBUG (GST_CAT_CAPS, "get pad caps of %s:%s (%p)",
GST_CAT_DEBUG (GST_CAT_CAPS, "get pad caps of %s:%s (%p)",
GST_DEBUG_PAD_NAME (realpad), realpad);
/* note that we will not _ref the caps here as this function might be
* called recursively */
if (GST_PAD_CAPS (realpad)) {
GST_DEBUG (GST_CAT_CAPS, "using pad real caps %p", GST_PAD_CAPS (realpad));
GST_CAT_DEBUG (GST_CAT_CAPS, "using pad real caps %p", GST_PAD_CAPS (realpad));
return GST_PAD_CAPS (realpad);
}
else if GST_RPAD_GETCAPSFUNC (realpad) {
GST_DEBUG (GST_CAT_CAPS, "using pad get function");
GST_CAT_DEBUG (GST_CAT_CAPS, "using pad get function");
return GST_RPAD_GETCAPSFUNC (realpad) (GST_PAD_CAST (realpad), NULL);
}
else if (GST_PAD_PAD_TEMPLATE (realpad)) {
GstPadTemplate *templ = GST_PAD_PAD_TEMPLATE (realpad);
GST_DEBUG (GST_CAT_CAPS, "using pad template %p with caps %p",
GST_CAT_DEBUG (GST_CAT_CAPS, "using pad template %p with caps %p",
templ, GST_PAD_TEMPLATE_CAPS (templ));
return GST_PAD_TEMPLATE_CAPS (templ);
}
GST_DEBUG (GST_CAT_CAPS, "pad has no caps");
GST_CAT_DEBUG (GST_CAT_CAPS, "pad has no caps");
return NULL;
}
@ -1921,7 +1920,7 @@ gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad)
}
}
else {
GST_DEBUG (GST_CAT_PADS,
GST_CAT_DEBUG (GST_CAT_PADS,
"could not check capabilities of pads (%s:%s) and (%s:%s) %p %p",
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad),
GST_PAD_CAPS (srcpad), GST_PAD_CAPS (sinkpad));
@ -1967,7 +1966,7 @@ gst_pad_get_allowed_caps (GstPad *pad)
realpad = GST_PAD_REALIZE (pad);
GST_DEBUG (GST_CAT_PROPERTIES, "get allowed caps of %s:%s",
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "get allowed caps of %s:%s",
GST_DEBUG_PAD_NAME (pad));
caps = gst_caps_ref (GST_RPAD_FILTER (realpad));
@ -1993,7 +1992,7 @@ gst_pad_recalc_allowed_caps (GstPad *pad)
g_return_val_if_fail (pad != NULL, FALSE);
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
GST_DEBUG (GST_CAT_PROPERTIES, "set allowed caps of %s:%s",
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "set allowed caps of %s:%s",
GST_DEBUG_PAD_NAME (pad));
@ -2072,16 +2071,16 @@ gst_pad_get_bufferpool (GstPad *pad)
if (!peer)
return NULL;
GST_DEBUG_ENTER ("(%s:%s)", GST_DEBUG_PAD_NAME (pad));
GST_CAT_DEBUG (GST_CAT_BUFFER, "(%s:%s): getting bufferpool", GST_DEBUG_PAD_NAME (pad));
if (peer->bufferpoolfunc) {
GST_DEBUG (GST_CAT_PADS,
GST_CAT_DEBUG (GST_CAT_PADS,
"calling bufferpoolfunc &%s (@%p) of peer pad %s:%s",
GST_DEBUG_FUNCPTR_NAME (peer->bufferpoolfunc),
&peer->bufferpoolfunc, GST_DEBUG_PAD_NAME (((GstPad*) peer)));
return (peer->bufferpoolfunc) (((GstPad*) peer));
} else {
GST_DEBUG (GST_CAT_PADS, "no bufferpoolfunc for peer pad %s:%s at %p",
GST_CAT_DEBUG (GST_CAT_PADS, "no bufferpoolfunc for peer pad %s:%s at %p",
GST_DEBUG_PAD_NAME (((GstPad*) peer)), &peer->bufferpoolfunc);
return NULL;
}
@ -2097,7 +2096,7 @@ gst_real_pad_dispose (GObject *object)
* and a parent would hold a reference */
g_assert (GST_PAD_PEER (pad) == NULL);
GST_DEBUG (GST_CAT_REFCOUNTING, "dispose %s:%s", GST_DEBUG_PAD_NAME(pad));
GST_CAT_DEBUG (GST_CAT_REFCOUNTING, "dispose %s:%s", GST_DEBUG_PAD_NAME(pad));
/* we destroy the ghostpads, because they are nothing without the real pad */
if (GST_REAL_PAD (pad)->ghostpads) {
@ -2109,7 +2108,7 @@ gst_real_pad_dispose (GObject *object)
GstPad *ghostpad = GST_PAD (ghostpads->data);
if (GST_IS_ELEMENT (GST_OBJECT_PARENT (ghostpad))){
GST_DEBUG (GST_CAT_REFCOUNTING, "removing ghost pad from element '%s'",
GST_CAT_DEBUG (GST_CAT_REFCOUNTING, "removing ghost pad from element '%s'",
GST_OBJECT_NAME (GST_OBJECT_PARENT (ghostpad)));
gst_element_remove_ghost_pad (GST_ELEMENT (GST_OBJECT_PARENT (ghostpad)), GST_PAD (ghostpad));
@ -2124,7 +2123,7 @@ gst_real_pad_dispose (GObject *object)
gst_caps_replace (&GST_RPAD_APPFILTER (pad), NULL);
if (GST_IS_ELEMENT (GST_OBJECT_PARENT (pad))) {
GST_DEBUG (GST_CAT_REFCOUNTING, "removing pad from element '%s'",
GST_CAT_DEBUG (GST_CAT_REFCOUNTING, "removing pad from element '%s'",
GST_OBJECT_NAME (GST_OBJECT (GST_ELEMENT (GST_OBJECT_PARENT (pad)))));
gst_element_remove_pad (GST_ELEMENT (GST_OBJECT_PARENT (pad)), pad);
@ -2171,7 +2170,7 @@ gst_pad_load_and_link (xmlNodePtr self, GstObject *parent)
split = g_strsplit (peer, ".", 2);
if (split[0] == NULL || split[1] == NULL) {
GST_DEBUG (GST_CAT_XML,
GST_CAT_DEBUG (GST_CAT_XML,
"Could not parse peer '%s' for pad %s:%s, leaving unlinked",
peer, GST_DEBUG_PAD_NAME (pad));
return;
@ -2279,7 +2278,7 @@ gst_pad_push (GstPad *pad, GstBuffer *buf)
GstData *data = GST_DATA(buf);
g_assert (GST_IS_PAD (pad));
GST_DEBUG_ENTER ("(%s:%s)", GST_DEBUG_PAD_NAME (pad));
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, pad, "pushing");
g_return_if_fail (GST_PAD_DIRECTION (pad) == GST_PAD_SRC);
@ -2301,7 +2300,7 @@ gst_pad_push (GstPad *pad, GstBuffer *buf)
if (peer->chainhandler) {
if (data) {
GST_DEBUG (GST_CAT_DATAFLOW,
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, pad,
"calling chainhandler &%s of peer pad %s:%s",
GST_DEBUG_FUNCPTR_NAME (peer->chainhandler),
GST_DEBUG_PAD_NAME (GST_PAD (peer)));
@ -2339,7 +2338,7 @@ gst_pad_pull (GstPad *pad)
{
GstRealPad *peer;
GST_DEBUG_ENTER("(%s:%s)",GST_DEBUG_PAD_NAME(pad));
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, pad, "pulling");
g_return_val_if_fail (GST_PAD_DIRECTION (pad) == GST_PAD_SINK,
GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT)));
@ -2357,9 +2356,10 @@ restart:
if (peer->gethandler) {
GstData *data;
GST_DEBUG (GST_CAT_DATAFLOW, "calling gethandler %s of peer pad %s:%s",
GST_DEBUG_FUNCPTR_NAME (peer->gethandler),
GST_DEBUG_PAD_NAME (peer));
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, pad,
"calling gethandler %s of peer pad %s:%s",
GST_DEBUG_FUNCPTR_NAME (peer->gethandler),
GST_DEBUG_PAD_NAME (peer));
data = GST_DATA((peer->gethandler) (GST_PAD_CAST (peer)));
@ -2372,14 +2372,13 @@ restart:
/* no null buffers allowed */
gst_element_error (GST_PAD_PARENT (pad),
"NULL buffer during pull on %s:%s",
GST_DEBUG_PAD_NAME (pad), NULL);
GST_DEBUG_PAD_NAME (pad));
} else {
gst_element_error (GST_PAD_PARENT (pad),
"internal error: pull on pad %s:%s "
"but the peer pad %s:%s has no gethandler",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_PAD_NAME (peer),
NULL);
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_PAD_NAME (peer));
}
}
return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT));
@ -2765,7 +2764,7 @@ gst_ghost_pad_new (const gchar *name,
/* FIXME need to ref the real pad here... ? */
GST_DEBUG (GST_CAT_PADS, "created ghost pad \"%s\"",
GST_CAT_DEBUG (GST_CAT_PADS, "created ghost pad \"%s\"",
gst_pad_get_name (GST_PAD (ghostpad)));
return GST_PAD (ghostpad);
@ -2980,13 +2979,13 @@ gst_pad_send_event (GstPad *pad, GstEvent *event)
if (GST_EVENT_SRC (event) == NULL)
GST_EVENT_SRC (event) = gst_object_ref (GST_OBJECT (rpad));
GST_DEBUG (GST_CAT_EVENT, "have event %d on pad %s:%s",
GST_CAT_DEBUG (GST_CAT_EVENT, "have event %d on pad %s:%s",
GST_EVENT_TYPE (event), GST_DEBUG_PAD_NAME (rpad));
if (GST_RPAD_EVENTHANDLER (rpad))
success = GST_RPAD_EVENTHANDLER (rpad) (GST_PAD_CAST (rpad), event);
else {
GST_DEBUG (GST_CAT_EVENT, "there's no event function for pad %s:%s",
GST_CAT_DEBUG (GST_CAT_EVENT, "there's no event function for pad %s:%s",
GST_DEBUG_PAD_NAME (rpad));
gst_event_unref (event);
}

View file

@ -23,9 +23,10 @@
#include <string.h>
#include "gst_private.h"
#include "gstparse.h"
#include "gstinfo.h"
#include "gstlog.h"
extern GstElement *_gst_parse_launch (const gchar *, GError **);
@ -118,7 +119,7 @@ gst_parse_launch (const gchar * pipeline_description, GError **error)
g_return_val_if_fail (pipeline_description != NULL, NULL);
GST_INFO (GST_CAT_PIPELINE, "parsing pipeline description %s",
GST_CAT_INFO (GST_CAT_PIPELINE, "parsing pipeline description %s",
pipeline_description);
/* the need for the mutex will go away with flex 2.5.6 */

View file

@ -23,7 +23,7 @@
#include "gst_private.h"
#include "gstpipeline.h"
#include "gstlog.h"
#include "gstinfo.h"
#include "gstscheduler.h"
GstElementDetails gst_pipeline_details = {

View file

@ -26,10 +26,11 @@
#include <unistd.h>
#include "gst_private.h"
#include "gstplugin.h"
#include "gstversion.h"
#include "gstregistrypool.h"
#include "gstlog.h"
#include "gstinfo.h"
#include "config.h"
#include "gstfilter.h"
@ -98,7 +99,7 @@ static GstPlugin*
gst_plugin_register_func (GstPluginDesc *desc, GstPlugin *plugin, GModule *module)
{
if (!gst_plugin_check_version (desc->major_version, desc->minor_version)) {
GST_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" has incompatible version, not loading",
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" has incompatible version, not loading",
plugin->filename);
return NULL;
}
@ -107,11 +108,11 @@ gst_plugin_register_func (GstPluginDesc *desc, GstPlugin *plugin, GModule *modul
plugin->name = g_strdup(desc->name);
if (!((desc->plugin_init) (module, plugin))) {
GST_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" failed to initialise",
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" failed to initialise",
plugin->filename);
return NULL;
}
GST_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" initialised", GST_STR_NULL (plugin->filename));
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" initialised", GST_STR_NULL (plugin->filename));
return plugin;
}
@ -157,7 +158,7 @@ gst_plugin_load_plugin (GstPlugin *plugin, GError **error)
filename = plugin->filename;
GST_DEBUG (GST_CAT_PLUGIN_LOADING, "attempt to load plugin \"%s\"", filename);
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "attempt to load plugin \"%s\"", filename);
if (g_module_supported () == FALSE) {
g_set_error (error,
@ -184,13 +185,13 @@ gst_plugin_load_plugin (GstPlugin *plugin, GError **error)
if (g_module_symbol (module, "plugin_desc", &ptr)) {
desc = (GstPluginDesc *)ptr;
GST_DEBUG (GST_CAT_PLUGIN_LOADING, "plugin \"%s\" loaded, called entry function...", filename);
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "plugin \"%s\" loaded, called entry function...", filename);
plugin->filename = g_strdup (filename);
plugin = gst_plugin_register_func (desc, plugin, module);
if (plugin != NULL) {
GST_INFO (GST_CAT_PLUGIN_LOADING, "plugin \"%s\" loaded", plugin->filename);
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING, "plugin \"%s\" loaded", plugin->filename);
plugin->module = module;
return TRUE;
}
@ -242,11 +243,11 @@ gst_plugin_unload_plugin (GstPlugin *plugin)
if (g_module_close (plugin->module)) {
plugin->module = NULL;
GST_INFO (GST_CAT_PLUGIN_LOADING, "plugin \"%s\" unloaded", plugin->filename);
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING, "plugin \"%s\" unloaded", plugin->filename);
return TRUE;
}
else {
GST_INFO (GST_CAT_PLUGIN_LOADING, "failed to unload plugin \"%s\"", plugin->filename);
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING, "failed to unload plugin \"%s\"", plugin->filename);
return FALSE;
}
}
@ -537,14 +538,14 @@ gst_plugin_load (const gchar *name)
if (plugin) {
gboolean result = gst_plugin_load_plugin (plugin, &error);
if (error) {
GST_DEBUG (GST_CAT_PLUGIN_LOADING, "load_plugin error: %s\n",
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "load_plugin error: %s\n",
error->message);
g_error_free (error);
}
return result;
}
GST_DEBUG (GST_CAT_PLUGIN_LOADING, "Could not find %s in registry pool",
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "Could not find %s in registry pool",
name);
return FALSE;

View file

@ -21,10 +21,11 @@
*/
#include "gst_private.h"
#include "gstpluginfeature.h"
#include "gstplugin.h"
#include "gstregistry.h"
#include "gstlog.h"
#include "gstinfo.h"
static void gst_plugin_feature_class_init (GstPluginFeatureClass *klass);
static void gst_plugin_feature_init (GstPluginFeature *feature);
@ -94,7 +95,7 @@ gst_plugin_feature_ensure_loaded (GstPluginFeature *feature)
if (plugin && !gst_plugin_is_loaded (plugin)) {
#ifndef GST_DISABLE_REGISTRY
if (GST_IS_REGISTRY (plugin->manager)) {
GST_DEBUG (GST_CAT_PLUGIN_LOADING,
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING,
"loading plugin %s for feature", plugin->name);
if (gst_registry_load_plugin (GST_REGISTRY (plugin->manager), plugin) != GST_REGISTRY_OK)
@ -135,4 +136,3 @@ gst_plugin_feature_type_name_filter (GstPluginFeature *feature,
return ((data->type == 0 || data->type == G_OBJECT_TYPE (feature)) &&
(data->name == NULL || !strcmp (data->name, GST_PLUGIN_FEATURE_NAME (feature))));
}

View file

@ -22,7 +22,7 @@
#include "gst_private.h"
#include "gstlog.h"
#include "gstinfo.h"
#include "gstprops.h"
#include "gstmemchunk.h"
@ -589,38 +589,39 @@ _gst_props_initialize (void)
static void
gst_props_debug_entry (GstPropsEntry *entry)
{
const gchar *name = g_quark_to_string (entry->propid);
/* unused when debugging is disabled */
G_GNUC_UNUSED const gchar *name = g_quark_to_string (entry->propid);
switch (entry->propstype) {
case GST_PROPS_INT_TYPE:
GST_DEBUG (GST_CAT_PROPERTIES, "%p: %s: int %d", entry, name, entry->data.int_data);
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "%p: %s: int %d", entry, name, entry->data.int_data);
break;
case GST_PROPS_FLOAT_TYPE:
GST_DEBUG (GST_CAT_PROPERTIES, "%p: %s: float %f", entry, name, entry->data.float_data);
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "%p: %s: float %f", entry, name, entry->data.float_data);
break;
case GST_PROPS_FOURCC_TYPE:
GST_DEBUG (GST_CAT_PROPERTIES, "%p: %s: fourcc %c%c%c%c", entry, name,
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "%p: %s: fourcc %c%c%c%c", entry, name,
(entry->data.fourcc_data>>0)&0xff,
(entry->data.fourcc_data>>8)&0xff,
(entry->data.fourcc_data>>16)&0xff,
(entry->data.fourcc_data>>24)&0xff);
break;
case GST_PROPS_BOOLEAN_TYPE:
GST_DEBUG (GST_CAT_PROPERTIES, "%p: %s: bool %d", entry, name, entry->data.bool_data);
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "%p: %s: bool %d", entry, name, entry->data.bool_data);
break;
case GST_PROPS_STRING_TYPE:
GST_DEBUG (GST_CAT_PROPERTIES, "%p: %s: string \"%s\"", entry, name, entry->data.string_data.string);
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "%p: %s: string \"%s\"", entry, name, entry->data.string_data.string);
break;
case GST_PROPS_INT_RANGE_TYPE:
GST_DEBUG (GST_CAT_PROPERTIES, "%p: %s: int range %d-%d", entry, name, entry->data.int_range_data.min,
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "%p: %s: int range %d-%d", entry, name, entry->data.int_range_data.min,
entry->data.int_range_data.max);
break;
case GST_PROPS_FLOAT_RANGE_TYPE:
GST_DEBUG (GST_CAT_PROPERTIES, "%p: %s: float range %f-%f", entry, name, entry->data.float_range_data.min,
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "%p: %s: float range %f-%f", entry, name, entry->data.float_range_data.min,
entry->data.float_range_data.max);
break;
case GST_PROPS_LIST_TYPE:
GST_DEBUG (GST_CAT_PROPERTIES, "%p: [list]", entry);
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "%p: [list]", entry);
g_list_foreach (entry->data.list_data.entries, (GFunc) gst_props_debug_entry, NULL);
break;
default:
@ -746,7 +747,7 @@ gst_props_alloc_entry (void)
gst_alloc_trace_new (_entries_trace, entry);
#endif
GST_DEBUG (GST_CAT_PROPERTIES, "new entry %p", entry);
GST_CAT_LOG (GST_CAT_PROPERTIES, "new entry %p", entry);
return entry;
}
@ -776,7 +777,7 @@ gst_props_entry_clean (GstPropsEntry *entry)
void
gst_props_entry_destroy (GstPropsEntry *entry)
{
GST_DEBUG (GST_CAT_PROPERTIES, "destroy entry %p", entry);
GST_CAT_LOG (GST_CAT_PROPERTIES, "destroy entry %p", entry);
gst_props_entry_clean (entry);
@ -809,7 +810,7 @@ gst_props_empty_new (void)
gst_alloc_trace_new (_props_trace, props);
#endif
GST_DEBUG (GST_CAT_PROPERTIES, "new %p", props);
GST_CAT_LOG (GST_CAT_PROPERTIES, "new %p", props);
props->properties = NULL;
props->refcount = 1;
@ -972,11 +973,11 @@ void
gst_props_debug (GstProps *props)
{
if (!props) {
GST_DEBUG (GST_CAT_PROPERTIES, "props (null)");
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "props (null)");
return;
}
GST_DEBUG (GST_CAT_PROPERTIES, "props %p, refcount %d, flags %d",
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "props %p, refcount %d, flags %d",
props, props->refcount, props->flags);
g_list_foreach (props->properties, (GFunc) gst_props_debug_entry, NULL);
@ -1350,7 +1351,7 @@ gst_props_unref (GstProps *props)
g_return_val_if_fail (props->refcount > 0, NULL);
GST_DEBUG (GST_CAT_PROPERTIES, "unref %p (%d->%d)", props, props->refcount, props->refcount-1);
GST_CAT_LOG (GST_CAT_PROPERTIES, "unref %p (%d->%d)", props, props->refcount, props->refcount-1);
props->refcount--;
if (props->refcount == 0) {
@ -1377,7 +1378,7 @@ gst_props_ref (GstProps *props)
g_return_val_if_fail (props->refcount > 0, NULL);
GST_DEBUG (GST_CAT_PROPERTIES, "ref %p (%d->%d)", props, props->refcount, props->refcount+1);
GST_CAT_LOG (GST_CAT_PROPERTIES, "ref %p (%d->%d)", props, props->refcount, props->refcount+1);
props->refcount++;
@ -1397,7 +1398,7 @@ gst_props_sink (GstProps *props)
if (props == NULL)
return;
GST_DEBUG (GST_CAT_PROPERTIES, "sink %p", props);
GST_CAT_LOG (GST_CAT_PROPERTIES, "sink %p", props);
if (GST_PROPS_IS_FLOATING (props)) {
GST_PROPS_FLAG_UNSET (props, GST_PROPS_FLOATING);
@ -1958,7 +1959,7 @@ gst_props_entry_check_list_compatibility (GstPropsEntry *entry1, GstPropsEntry *
static gboolean
gst_props_entry_check_compatibility (GstPropsEntry *entry1, GstPropsEntry *entry2)
{
GST_DEBUG (GST_CAT_PROPERTIES,"compare: %s %s", g_quark_to_string (entry1->propid), g_quark_to_string (entry2->propid));
GST_CAT_DEBUG (GST_CAT_PROPERTIES,"compare: %s %s", g_quark_to_string (entry1->propid), g_quark_to_string (entry2->propid));
if (entry2->propstype == GST_PROPS_LIST_TYPE && entry1->propstype != GST_PROPS_LIST_TYPE) {
return gst_props_entry_check_list_compatibility (entry1, entry2);
@ -2004,7 +2005,7 @@ gst_props_entry_check_compatibility (GstPropsEntry *entry1, GstPropsEntry *entry
switch (entry2->propstype) {
/* b <---> a */
case GST_PROPS_FOURCC_TYPE:
GST_DEBUG(GST_CAT_PROPERTIES,"\"%c%c%c%c\" <--> \"%c%c%c%c\" ?",
GST_CAT_DEBUG (GST_CAT_PROPERTIES,"\"%c%c%c%c\" <--> \"%c%c%c%c\" ?",
(entry2->data.fourcc_data>>0)&0xff,
(entry2->data.fourcc_data>>8)&0xff,
(entry2->data.fourcc_data>>16)&0xff,
@ -2022,13 +2023,13 @@ gst_props_entry_check_compatibility (GstPropsEntry *entry1, GstPropsEntry *entry
switch (entry2->propstype) {
/* b <---> a - d */
case GST_PROPS_INT_RANGE_TYPE:
GST_DEBUG(GST_CAT_PROPERTIES,"%d <= %d <= %d ?",entry2->data.int_range_data.min,
GST_CAT_DEBUG (GST_CAT_PROPERTIES,"%d <= %d <= %d ?",entry2->data.int_range_data.min,
entry1->data.int_data,entry2->data.int_range_data.max);
return (entry2->data.int_range_data.min <= entry1->data.int_data &&
entry2->data.int_range_data.max >= entry1->data.int_data);
/* b <---> a */
case GST_PROPS_INT_TYPE:
GST_DEBUG(GST_CAT_PROPERTIES,"%d == %d ?",entry1->data.int_data,entry2->data.int_data);
GST_CAT_DEBUG (GST_CAT_PROPERTIES,"%d == %d ?",entry1->data.int_data,entry2->data.int_data);
return (entry2->data.int_data == entry1->data.int_data);
default:
break;
@ -2059,7 +2060,7 @@ gst_props_entry_check_compatibility (GstPropsEntry *entry1, GstPropsEntry *entry
switch (entry2->propstype) {
/* t <---> t */
case GST_PROPS_STRING_TYPE:
GST_DEBUG(GST_CAT_PROPERTIES,"\"%s\" <--> \"%s\" ?",
GST_CAT_DEBUG (GST_CAT_PROPERTIES,"\"%s\" <--> \"%s\" ?",
entry2->data.string_data.string, entry1->data.string_data.string);
return (!strcmp (entry2->data.string_data.string, entry1->data.string_data.string));
default:
@ -2118,7 +2119,7 @@ gst_props_check_compatibility (GstProps *fromprops, GstProps *toprops)
if (!gst_props_entry_check_compatibility (entry1, entry2)) {
compatible = FALSE;
GST_DEBUG (GST_CAT_PROPERTIES, "%s are not compatible: ",
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "%s are not compatible: ",
g_quark_to_string (entry1->propid));
}

View file

@ -21,23 +21,13 @@
* Boston, MA 02111-1307, USA.
*/
/* #define DEBUG_ENABLED */
/* #define STATUS_ENABLED */
#ifdef STATUS_ENABLED
#define STATUS(A) GST_DEBUG(GST_CAT_DATAFLOW, A, GST_ELEMENT_NAME(queue))
#else
#define STATUS(A)
#endif
#include "config.h"
#include "gst_private.h"
#include "gstqueue.h"
#include "gstscheduler.h"
#include "gstevent.h"
#include "gstlog.h"
#include "gstinfo.h"
GstElementDetails gst_queue_details = {
"Queue",
@ -253,7 +243,7 @@ gst_queue_init (GstQueue *queue)
queue->not_full = g_cond_new ();
queue->events = g_async_queue_new();
queue->queue = g_queue_new ();
GST_DEBUG_ELEMENT (GST_CAT_THREAD, queue, "initialized queue's not_empty & not_full conditions");
GST_CAT_DEBUG_OBJECT (GST_CAT_THREAD, queue, "initialized queue's not_empty & not_full conditions");
}
static void
@ -286,7 +276,7 @@ gst_queue_get_bufferpool (GstPad *pad)
static void
gst_queue_cleanup_data (gpointer data, const gpointer user_data)
{
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, user_data, "cleaning buffer %p", data);
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, user_data, "cleaning buffer %p", data);
gst_data_unref (GST_DATA (data));
}
@ -324,17 +314,17 @@ gst_queue_chain (GstPad *pad, GstBuffer *buf)
g_async_queue_lock(queue->events);
while (g_async_queue_length_unlocked(queue->events) > 0){
GstEvent *event = (GstEvent*)g_async_queue_pop_unlocked(queue->events);
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "sending event upstream\n");
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "sending event upstream\n");
gst_pad_event_default (pad, event);
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "event sent\n");
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "event sent\n");
}
g_async_queue_unlock(queue->events);
restart:
/* we have to lock the queue since we span threads */
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locking t:%p", g_thread_self ());
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "locking t:%p", g_thread_self ());
g_mutex_lock (queue->qlock);
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locked t:%p", g_thread_self ());
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "locked t:%p", g_thread_self ());
/* assume don't need to flush this buffer when the queue is filled */
queue->flush = FALSE;
@ -342,11 +332,11 @@ restart:
if (GST_IS_EVENT (buf)) {
switch (GST_EVENT_TYPE (buf)) {
case GST_EVENT_FLUSH:
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "FLUSH event, flushing queue\n");
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "FLUSH event, flushing queue\n");
gst_queue_locked_flush (queue);
break;
case GST_EVENT_EOS:
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "eos in on %s %d\n",
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "eos in on %s %d\n",
GST_ELEMENT_NAME (queue), queue->level_buffers);
break;
default:
@ -355,7 +345,7 @@ restart:
}
}
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "adding buffer %p of size %d",buf,GST_BUFFER_SIZE(buf));
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "adding buffer %p of size %d",buf,GST_BUFFER_SIZE(buf));
if (queue->level_buffers == queue->size_buffers) {
g_mutex_unlock (queue->qlock);
@ -367,7 +357,7 @@ restart:
/* FIXME don't want to leak events! */
/* if we leak on the upstream side, drop the current buffer */
if (queue->leaky == GST_QUEUE_LEAK_UPSTREAM) {
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on upstream end");
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on upstream end");
if (GST_IS_EVENT (buf))
fprintf(stderr, "Error: queue [%s] leaked an event, type:%d\n",
GST_ELEMENT_NAME(GST_ELEMENT(queue)),
@ -381,7 +371,7 @@ restart:
gpointer front;
GstBuffer *leakbuf;
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on downstream end");
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on downstream end");
front = g_queue_pop_head (queue->queue);
leakbuf = (GstBuffer *)(front);
@ -397,24 +387,24 @@ restart:
}
}
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "pre full wait, level:%d/%d buffers, %d bytes",
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "pre full wait, level:%d/%d buffers, %d bytes",
queue->level_buffers, queue->size_buffers, queue->level_bytes);
while (queue->level_buffers == queue->size_buffers) {
/* if there's a pending state change for this queue or its manager, switch */
/* back to iterator so bottom half of state change executes */
if (queue->interrupt) {
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "interrupted!!");
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "interrupted!!");
g_mutex_unlock (queue->qlock);
if (gst_scheduler_interrupt (gst_pad_get_scheduler (queue->sinkpad), GST_ELEMENT (queue)))
goto out_unref;
/* if we got here because we were unlocked after a flush, we don't need
* to add the buffer to the queue again */
if (queue->flush) {
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "not adding pending buffer after flush");
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "not adding pending buffer after flush");
goto out_unref;
}
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "adding pending buffer after interrupt");
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "adding pending buffer after interrupt");
goto restart;
}
if (GST_STATE (queue) != GST_STATE_PLAYING) {
@ -432,12 +422,12 @@ restart:
}
}
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "waiting for not_full, level:%d/%d buffers, %d bytes",
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "waiting for not_full, level:%d/%d buffers, %d bytes",
queue->level_buffers, queue->size_buffers, queue->level_bytes);
g_cond_wait (queue->not_full, queue->qlock);
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "got not_full signal");
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "got not_full signal");
}
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "post full wait, level:%d/%d buffers, %d bytes",
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "post full wait, level:%d/%d buffers, %d bytes",
queue->level_buffers, queue->size_buffers, queue->level_bytes);
}
@ -450,11 +440,11 @@ restart:
/* this assertion _has_ to hold */
g_assert (queue->queue->length == queue->level_buffers);
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "(%s:%s)+ level:%d/%d buffers, %d bytes",
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "(%s:%s)+ level:%d/%d buffers, %d bytes",
GST_DEBUG_PAD_NAME(pad),
queue->level_buffers, queue->size_buffers, queue->level_bytes);
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "signalling not_empty");
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "signalling not_empty");
g_cond_signal (queue->not_empty);
g_mutex_unlock (queue->qlock);
@ -481,11 +471,11 @@ gst_queue_get (GstPad *pad)
restart:
/* have to lock for thread-safety */
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locking t:%p", g_thread_self ());
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "locking t:%p", g_thread_self ());
g_mutex_lock (queue->qlock);
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locked t:%p %p", g_thread_self (), queue->not_empty);
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "locked t:%p %p", g_thread_self (), queue->not_empty);
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "pre empty wait, level:%d/%d buffers, %d bytes",
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "pre empty wait, level:%d/%d buffers, %d bytes",
queue->level_buffers, queue->size_buffers, queue->level_bytes);
while (queue->level_buffers == 0) {
/* if there's a pending state change for this queue or its manager, switch
@ -493,7 +483,7 @@ restart:
*/
//while (GST_STATE_PENDING (queue) != GST_STATE_VOID_PENDING) {
if (queue->interrupt) {
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "interrupted!!");
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "interrupted!!");
g_mutex_unlock (queue->qlock);
if (gst_scheduler_interrupt (gst_pad_get_scheduler (queue->srcpad), GST_ELEMENT (queue)))
return GST_BUFFER (gst_event_new (GST_EVENT_INTERRUPT));
@ -511,7 +501,7 @@ restart:
}
}
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "waiting for not_empty, level:%d/%d buffers, %d bytes",
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "waiting for not_empty, level:%d/%d buffers, %d bytes",
queue->level_buffers, queue->size_buffers, queue->level_bytes);
/* if (queue->block_timeout > -1){ */
@ -528,26 +518,26 @@ restart:
else {
g_cond_wait (queue->not_empty, queue->qlock);
}
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "got not_empty signal");
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "got not_empty signal");
}
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "post empty wait, level:%d/%d buffers, %d bytes",
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "post empty wait, level:%d/%d buffers, %d bytes",
queue->level_buffers, queue->size_buffers, queue->level_bytes);
front = g_queue_pop_head (queue->queue);
buf = (GstBuffer *)(front);
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "retrieved buffer %p from queue", buf);
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "retrieved buffer %p from queue", buf);
queue->level_buffers--;
queue->level_bytes -= GST_BUFFER_SIZE(buf);
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "(%s:%s)- level:%d/%d buffers, %d bytes",
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "(%s:%s)- level:%d/%d buffers, %d bytes",
GST_DEBUG_PAD_NAME(pad),
queue->level_buffers, queue->size_buffers, queue->level_bytes);
/* this assertion _has_ to hold */
g_assert (queue->queue->length == queue->level_buffers);
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "signalling not_full");
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "signalling not_full");
g_cond_signal (queue->not_full);
g_mutex_unlock (queue->qlock);
@ -557,7 +547,7 @@ restart:
GstEvent *event = GST_EVENT(buf);
switch (GST_EVENT_TYPE(event)) {
case GST_EVENT_EOS:
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue \"%s\" eos", GST_ELEMENT_NAME (queue));
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "queue \"%s\" eos", GST_ELEMENT_NAME (queue));
gst_element_set_eos (GST_ELEMENT (queue));
break;
default:
@ -599,7 +589,7 @@ gst_queue_handle_src_event (GstPad *pad, GstEvent *event)
switch (event_type) {
case GST_EVENT_FLUSH:
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "FLUSH event, flushing queue\n");
GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "FLUSH event, flushing queue\n");
gst_queue_locked_flush (queue);
break;
case GST_EVENT_SEEK:
@ -641,7 +631,7 @@ gst_queue_change_state (GstElement *element)
queue = GST_QUEUE (element);
GST_DEBUG_ENTER("('%s')", GST_ELEMENT_NAME (element));
GST_CAT_LOG_OBJECT (GST_CAT_STATES, element, "starting state change");
/* lock the queue so another thread (not in sync with this thread's state)
* can't call this queue's _get (or whatever)
@ -656,7 +646,7 @@ gst_queue_change_state (GstElement *element)
break;
case GST_STATE_PAUSED_TO_PLAYING:
if (!GST_PAD_IS_LINKED (queue->sinkpad)) {
GST_DEBUG_ELEMENT (GST_CAT_STATES, queue, "queue %s is not linked", GST_ELEMENT_NAME (queue));
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, queue, "queue %s is not linked", GST_ELEMENT_NAME (queue));
/* FIXME can this be? */
g_cond_signal (queue->not_empty);
@ -670,7 +660,7 @@ gst_queue_change_state (GstElement *element)
sink_sched = gst_pad_get_scheduler (GST_PAD_CAST (queue->sinkpad));
if (src_sched == sink_sched) {
GST_DEBUG_ELEMENT (GST_CAT_STATES, queue, "queue %s does not connect different schedulers",
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, queue, "queue %s does not connect different schedulers",
GST_ELEMENT_NAME (queue));
g_warning ("queue %s does not connect different schedulers",
@ -696,7 +686,7 @@ gst_queue_change_state (GstElement *element)
error:
g_mutex_unlock (queue->qlock);
GST_DEBUG_LEAVE("('%s')", GST_ELEMENT_NAME (element));
GST_CAT_LOG_OBJECT (GST_CAT_STATES, element, "done with state change");
return ret;
}

View file

@ -28,6 +28,8 @@
#include <stdio.h>
#include <string.h>
#include "gst_private.h"
#include "gstinfo.h"
#include "gstregistry.h"
#include "gstlog.h"
@ -487,4 +489,3 @@ gst_registry_update_plugin (GstRegistry *registry, GstPlugin *plugin)
return GST_REGISTRY_PLUGIN_LOAD_ERROR;
}

View file

@ -22,6 +22,8 @@
#include <string.h>
#include "gst_private.h"
#include "gstinfo.h"
#include "gstregistrypool.h"
#include "gstlog.h"
@ -326,4 +328,3 @@ gst_registry_pool_get_prefered (GstRegistryFlags flags)
#endif /* GST_DISABLE_REGISTRY */
return NULL;
}

View file

@ -24,7 +24,7 @@
#include "gstsystemclock.h"
#include "gstscheduler.h"
#include "gstlog.h"
#include "gstinfo.h"
#include "gstregistrypool.h"
static void gst_scheduler_class_init (GstSchedulerClass *klass);
@ -90,7 +90,7 @@ gst_scheduler_dispose (GObject *object)
GstScheduler *sched = GST_SCHEDULER (object);
/* thse lists should all be NULL */
GST_DEBUG (0, "scheduler %p dispose %p %p %p",
GST_DEBUG ( "scheduler %p dispose %p %p %p",
object,
sched->clock_providers,
sched->clock_receivers,
@ -228,7 +228,7 @@ gst_scheduler_add_element (GstScheduler *sched, GstElement *element)
/* if it's already in this scheduler, don't bother doing anything */
if (GST_ELEMENT_SCHED (element) == sched) {
GST_DEBUG (GST_CAT_SCHEDULING, "element %s already in scheduler %p",
GST_CAT_DEBUG (GST_CAT_SCHEDULING, "element %s already in scheduler %p",
GST_ELEMENT_NAME (element), sched);
return;
}
@ -238,11 +238,11 @@ gst_scheduler_add_element (GstScheduler *sched, GstElement *element)
if (gst_element_provides_clock (element)) {
sched->clock_providers = g_list_prepend (sched->clock_providers, element);
GST_DEBUG (GST_CAT_CLOCK, "added clock provider %s", GST_ELEMENT_NAME (element));
GST_CAT_DEBUG (GST_CAT_CLOCK, "added clock provider %s", GST_ELEMENT_NAME (element));
}
if (gst_element_requires_clock (element)) {
sched->clock_receivers = g_list_prepend (sched->clock_receivers, element);
GST_DEBUG (GST_CAT_CLOCK, "added clock receiver %s", GST_ELEMENT_NAME (element));
GST_CAT_DEBUG (GST_CAT_CLOCK, "added clock receiver %s", GST_ELEMENT_NAME (element));
}
gst_element_set_scheduler (element, sched);
@ -307,7 +307,7 @@ gst_scheduler_state_transition (GstScheduler *sched, GstElement *element, gint t
if (clock)
gst_clock_reset (clock);
GST_DEBUG (GST_CAT_CLOCK, "scheduler READY to PAUSED clock is %p (%s)", clock,
GST_CAT_DEBUG (GST_CAT_CLOCK, "scheduler READY to PAUSED clock is %p (%s)", clock,
(clock ? GST_OBJECT_NAME (clock) : "nil"));
gst_object_replace ((GstObject **)&sched->current_clock, (GstObject *)clock);
@ -317,12 +317,12 @@ gst_scheduler_state_transition (GstScheduler *sched, GstElement *element, gint t
{
GstClock *clock = gst_scheduler_get_clock (sched);
GST_DEBUG (GST_CAT_CLOCK, "scheduler PAUSED to PLAYING clock is %p (%s)", clock,
GST_CAT_DEBUG (GST_CAT_CLOCK, "scheduler PAUSED to PLAYING clock is %p (%s)", clock,
(clock ? GST_OBJECT_NAME (clock) : "nil"));
gst_scheduler_set_clock (sched, clock);
if (clock) {
GST_DEBUG (GST_CAT_CLOCK, "enabling clock %p (%s)", clock,
GST_CAT_DEBUG (GST_CAT_CLOCK, "enabling clock %p (%s)", clock,
GST_OBJECT_NAME (clock));
gst_clock_set_active (clock, TRUE);
}
@ -330,7 +330,7 @@ gst_scheduler_state_transition (GstScheduler *sched, GstElement *element, gint t
}
case GST_STATE_PLAYING_TO_PAUSED:
if (sched->current_clock) {
GST_DEBUG (GST_CAT_CLOCK, "disabling clock %p (%s)", sched->current_clock,
GST_CAT_DEBUG (GST_CAT_CLOCK, "disabling clock %p (%s)", sched->current_clock,
GST_OBJECT_NAME (sched->current_clock));
gst_clock_set_active (sched->current_clock, FALSE);
}
@ -385,7 +385,7 @@ gst_scheduler_add_scheduler (GstScheduler *sched, GstScheduler *sched2)
g_return_if_fail (GST_IS_SCHEDULER (sched2));
g_return_if_fail (sched2->parent_sched == NULL);
GST_DEBUG (0,"gstscheduler: %p add scheduler %p", sched, sched2);
GST_DEBUG ("gstscheduler: %p add scheduler %p", sched, sched2);
gst_object_ref (GST_OBJECT (sched2));
gst_object_ref (GST_OBJECT (sched));
@ -415,7 +415,7 @@ gst_scheduler_remove_scheduler (GstScheduler *sched, GstScheduler *sched2)
g_return_if_fail (GST_IS_SCHEDULER (sched2));
g_return_if_fail (sched2->parent_sched == sched);
GST_DEBUG (0,"gstscheduler: %p remove scheduler %p", sched, sched2);
GST_DEBUG ("gstscheduler: %p remove scheduler %p", sched, sched2);
sclass = GST_SCHEDULER_GET_CLASS (sched);
@ -561,7 +561,7 @@ gst_scheduler_get_clock (GstScheduler *sched)
if (GST_FLAG_IS_SET (sched, GST_SCHEDULER_FLAG_FIXED_CLOCK)) {
clock = sched->clock;
GST_DEBUG (GST_CAT_CLOCK, "scheduler using fixed clock %p (%s)", clock,
GST_CAT_DEBUG (GST_CAT_CLOCK, "scheduler using fixed clock %p (%s)", clock,
(clock ? GST_OBJECT_NAME (clock) : "nil"));
}
else {
@ -589,8 +589,8 @@ gst_scheduler_get_clock (GstScheduler *sched)
clock = gst_system_clock_obtain ();
}
}
GST_DEBUG (GST_CAT_CLOCK, "scheduler selected clock %p (%s)", clock,
(clock ? GST_OBJECT_NAME (clock) : "nil"));
GST_CAT_LOG_OBJECT (GST_CAT_CLOCK, sched, "scheduler selected clock %p (%s)", clock,
clock ? GST_STR_NULL (GST_OBJECT_NAME (clock)) : "-");
return clock;
}
@ -614,7 +614,7 @@ gst_scheduler_use_clock (GstScheduler *sched, GstClock *clock)
gst_object_replace ((GstObject **)&sched->clock, (GstObject *)clock);
GST_DEBUG (GST_CAT_CLOCK, "scheduler using fixed clock %p (%s)", clock,
GST_CAT_DEBUG (GST_CAT_CLOCK, "scheduler using fixed clock %p (%s)", clock,
(clock ? GST_OBJECT_NAME (clock) : "nil"));
}
@ -643,7 +643,7 @@ gst_scheduler_set_clock (GstScheduler *sched, GstClock *clock)
while (receivers) {
GstElement *element = GST_ELEMENT (receivers->data);
GST_DEBUG (GST_CAT_CLOCK, "scheduler setting clock %p (%s) on element %s", clock,
GST_CAT_DEBUG (GST_CAT_CLOCK, "scheduler setting clock %p (%s) on element %s", clock,
(clock ? GST_OBJECT_NAME (clock) : "nil"), GST_ELEMENT_NAME (element));
gst_element_set_clock (element, clock);
@ -652,7 +652,7 @@ gst_scheduler_set_clock (GstScheduler *sched, GstClock *clock)
while (schedulers) {
GstScheduler *scheduler = GST_SCHEDULER (schedulers->data);
GST_DEBUG (GST_CAT_CLOCK, "scheduler setting clock %p (%s) on scheduler %p", clock,
GST_CAT_DEBUG (GST_CAT_CLOCK, "scheduler setting clock %p (%s) on scheduler %p", clock,
(clock ? GST_OBJECT_NAME (clock) : "nil"), scheduler);
gst_scheduler_set_clock (scheduler, clock);
schedulers = g_list_next (schedulers);
@ -675,7 +675,7 @@ gst_scheduler_auto_clock (GstScheduler *sched)
gst_object_replace ((GstObject **)&sched->clock, NULL);
GST_DEBUG (GST_CAT_CLOCK, "scheduler using automatic clock");
GST_CAT_DEBUG (GST_CAT_CLOCK, "scheduler using automatic clock");
}
/**
@ -871,7 +871,7 @@ gst_scheduler_factory_find (const gchar *name)
g_return_val_if_fail (name != NULL, NULL);
GST_DEBUG (0,"gstscheduler: find \"%s\"", name);
GST_DEBUG ("gstscheduler: find \"%s\"", name);
feature = gst_registry_pool_find_feature (name, GST_TYPE_SCHEDULER_FACTORY);

View file

@ -23,7 +23,7 @@
#include <sys/time.h>
#include "gst_private.h"
#include "gstlog.h"
#include "gstinfo.h"
#include "gstsystemclock.h"
@ -178,15 +178,15 @@ gst_system_clock_wait (GstClock *clock, GstClockEntry *entry)
current = gst_clock_get_time (clock);
diff = GST_CLOCK_ENTRY_TIME (entry) - current;
if (ABS (diff) > clock->max_diff) {
g_warning ("abnormal clock request diff: ABS(%" G_GINT64_FORMAT
") > %" G_GINT64_FORMAT, diff, clock->max_diff);
if (diff + clock->max_diff < 0) {
g_warning ("clock is way behind: %" G_GINT64_FORMAT
"s (max allowed is %" G_GINT64_FORMAT "s", -diff, clock->max_diff);
return GST_CLOCK_ENTRY_EARLY;
}
target = gst_system_clock_get_internal_time (clock) + diff;
GST_DEBUG (GST_CAT_CLOCK, "real_target %" G_GUINT64_FORMAT
GST_CAT_DEBUG (GST_CAT_CLOCK, "real_target %" G_GUINT64_FORMAT
" target %" G_GUINT64_FORMAT
" now %" G_GUINT64_FORMAT,
target, GST_CLOCK_ENTRY_TIME (entry), current);

View file

@ -21,6 +21,8 @@
* Boston, MA 02111-1307, USA.
*/
#include "gst_private.h"
#include "gstthread.h"
#include "gstscheduler.h"
#include "gstinfo.h"
@ -175,7 +177,7 @@ gst_thread_init (GstThread *thread)
{
GstScheduler *scheduler;
GST_DEBUG (GST_CAT_THREAD, "initializing thread");
GST_CAT_DEBUG (GST_CAT_THREAD, "initializing thread");
/* threads are managing bins and iterate themselves */
/* CR1: the GstBin code checks these flags */
@ -197,7 +199,7 @@ gst_thread_dispose (GObject *object)
{
GstThread *thread = GST_THREAD (object);
GST_DEBUG (GST_CAT_REFCOUNTING, "GstThread: dispose");
GST_CAT_DEBUG (GST_CAT_REFCOUNTING, "GstThread: dispose");
G_OBJECT_CLASS (parent_class)->dispose (object);
@ -299,7 +301,7 @@ gst_thread_release_children_locks (GstThread *thread)
GList *pads;
g_assert (element);
GST_DEBUG (GST_CAT_THREAD, "waking element \"%s\"", GST_ELEMENT_NAME (element));
GST_CAT_DEBUG (GST_CAT_THREAD, "waking element \"%s\"", GST_ELEMENT_NAME (element));
elements = g_list_next (elements);
if (!gst_element_release_locks (element))
@ -324,8 +326,8 @@ gst_thread_release_children_locks (GstThread *thread)
continue; /* FIXME: deal with case where there's no peer */
if (GST_ELEMENT_SCHED (peerelement) != GST_ELEMENT_SCHED (thread)) {
GST_DEBUG (GST_CAT_THREAD, "element \"%s\" has pad cross sched boundary", GST_ELEMENT_NAME (element));
GST_DEBUG (GST_CAT_THREAD, "waking element \"%s\"", GST_ELEMENT_NAME (peerelement));
GST_CAT_DEBUG (GST_CAT_THREAD, "element \"%s\" has pad cross sched boundary", GST_ELEMENT_NAME (element));
GST_CAT_DEBUG (GST_CAT_THREAD, "waking element \"%s\"", GST_ELEMENT_NAME (peerelement));
if (!gst_element_release_locks (peerelement))
g_warning ("element %s could not release locks", GST_ELEMENT_NAME (peerelement));
}
@ -343,7 +345,7 @@ gst_thread_catch (GstThread *thread)
g_mutex_lock (thread->lock);
GST_FLAG_SET (thread, GST_THREAD_MUTEX_LOCKED);
}
GST_DEBUG (GST_CAT_THREAD, "%s is catching itself", GST_ELEMENT_NAME (thread));
GST_CAT_DEBUG (GST_CAT_THREAD, "%s is catching itself", GST_ELEMENT_NAME (thread));
GST_FLAG_UNSET (thread, GST_THREAD_STATE_SPINNING);
} else {
/* another thread is trying to catch us */
@ -351,7 +353,7 @@ gst_thread_catch (GstThread *thread)
wait = !GST_FLAG_IS_SET (thread, GST_THREAD_STATE_SPINNING);
while (!wait) {
GTimeVal tv;
GST_DEBUG (GST_CAT_THREAD, "catching %s...", GST_ELEMENT_NAME (thread));
GST_CAT_DEBUG (GST_CAT_THREAD, "catching %s...", GST_ELEMENT_NAME (thread));
GST_FLAG_UNSET (thread, GST_THREAD_STATE_SPINNING);
g_cond_signal (thread->cond);
gst_thread_release_children_locks (thread);
@ -359,7 +361,7 @@ gst_thread_catch (GstThread *thread)
g_time_val_add (&tv, 1000); /* wait a millisecond to catch the thread */
wait = g_cond_timed_wait (thread->cond, thread->lock, &tv);
}
GST_DEBUG (GST_CAT_THREAD, "caught %s", GST_ELEMENT_NAME (thread));
GST_CAT_DEBUG (GST_CAT_THREAD, "caught %s", GST_ELEMENT_NAME (thread));
}
g_assert (!GST_FLAG_IS_SET (thread, GST_THREAD_STATE_SPINNING));
}
@ -385,7 +387,7 @@ gst_thread_change_state (GstElement *element)
thread = GST_THREAD (element);
GST_DEBUG (GST_CAT_STATES, "%s is changing state from %s to %s",
GST_CAT_DEBUG (GST_CAT_STATES, "%s is changing state from %s to %s",
GST_ELEMENT_NAME (element), gst_element_state_get_name (GST_STATE (element)),
gst_element_state_get_name (GST_STATE_PENDING (element)));
@ -406,10 +408,10 @@ gst_thread_change_state (GstElement *element)
thread, STACK_SIZE, FALSE, TRUE, thread->priority,
NULL);
if (!thread->thread_id){
GST_DEBUG (GST_CAT_THREAD, "g_thread_create_full for %sfailed", GST_ELEMENT_NAME (element));
GST_CAT_DEBUG (GST_CAT_THREAD, "g_thread_create_full for %sfailed", GST_ELEMENT_NAME (element));
goto error_out;
}
GST_DEBUG (GST_CAT_THREAD, "GThread created");
GST_CAT_DEBUG (GST_CAT_THREAD, "GThread created");
/* wait for it to 'spin up' */
g_cond_wait (thread->cond, thread->lock);
@ -443,7 +445,7 @@ gst_thread_change_state (GstElement *element)
case GST_STATE_READY_TO_NULL:
/* we can't join the threads here, because this could have been triggered
by ourself (ouch) */
GST_DEBUG (GST_CAT_THREAD, "destroying GThread %p", thread->thread_id);
GST_CAT_DEBUG (GST_CAT_THREAD, "destroying GThread %p", thread->thread_id);
GST_FLAG_SET (thread, GST_THREAD_STATE_REAPING);
thread->thread_id = NULL;
if (thread == gst_thread_get_current()) {
@ -454,7 +456,7 @@ gst_thread_change_state (GstElement *element)
/* unlock and signal - we are out */
gst_thread_release (thread);
GST_INFO (GST_CAT_THREAD, "gstthread: thread \"%s\" is stopped",
GST_CAT_INFO (GST_CAT_THREAD, "gstthread: thread \"%s\" is stopped",
GST_ELEMENT_NAME (thread));
g_signal_emit (G_OBJECT (thread), gst_thread_signals[SHUTDOWN], 0);
@ -467,8 +469,8 @@ gst_thread_change_state (GstElement *element)
/* it should be dead now */
break;
default:
GST_DEBUG_ELEMENT (GST_CAT_THREAD, element, "UNHANDLED STATE CHANGE! %x",
GST_STATE_TRANSITION (element));
GST_CAT_DEBUG (GST_CAT_THREAD, "[%s]: UNHANDLED STATE CHANGE! %x",
GST_ELEMENT_NAME (element), GST_STATE_TRANSITION (element));
g_assert_not_reached ();
break;
}
@ -483,7 +485,7 @@ gst_thread_change_state (GstElement *element)
return ret;
error_out:
GST_DEBUG (GST_CAT_STATES, "changing state from %s to %s failed for %s",
GST_CAT_DEBUG (GST_CAT_STATES, "changing state from %s to %s failed for %s",
gst_element_state_get_name (GST_STATE (element)),
gst_element_state_get_name (GST_STATE_PENDING (element)),
GST_ELEMENT_NAME (element));
@ -498,7 +500,7 @@ static void
gst_thread_child_state_change (GstBin *bin, GstElementState oldstate,
GstElementState newstate, GstElement *element)
{
GST_DEBUG (GST_CAT_THREAD, "%s (from thread %s) child %s changed state from %s to %s",
GST_CAT_DEBUG (GST_CAT_THREAD, "%s (from thread %s) child %s changed state from %s to %s",
GST_ELEMENT_NAME (bin),
gst_thread_get_current() ? GST_ELEMENT_NAME (gst_thread_get_current()) : "(none)",
GST_ELEMENT_NAME (element), gst_element_state_get_name (oldstate),
@ -526,7 +528,7 @@ gst_thread_main_loop (void *arg)
thread = GST_THREAD (arg);
g_mutex_lock (thread->lock);
GST_DEBUG (GST_CAT_THREAD, "Thread %s started main loop", GST_ELEMENT_NAME (thread));
GST_CAT_DEBUG (GST_CAT_THREAD, "Thread %s started main loop", GST_ELEMENT_NAME (thread));
/* initialize gst_thread_current */
g_private_set (gst_thread_current, thread);
@ -540,7 +542,7 @@ gst_thread_main_loop (void *arg)
if (GST_STATE (thread) == GST_STATE_PLAYING) {
GST_FLAG_SET (thread, GST_THREAD_STATE_SPINNING);
status = TRUE;
GST_DEBUG (GST_CAT_THREAD, "%s starts iterating", GST_ELEMENT_NAME (thread));
GST_CAT_DEBUG (GST_CAT_THREAD, "%s starts iterating", GST_ELEMENT_NAME (thread));
while (status && GST_FLAG_IS_SET (thread, GST_THREAD_STATE_SPINNING)) {
g_mutex_unlock (thread->lock);
status = gst_bin_iterate (GST_BIN (thread));
@ -554,7 +556,7 @@ gst_thread_main_loop (void *arg)
}
if (GST_FLAG_IS_SET (thread, GST_THREAD_STATE_REAPING))
break;
GST_DEBUG (GST_CAT_THREAD, "%s was caught", GST_ELEMENT_NAME (thread));
GST_CAT_DEBUG (GST_CAT_THREAD, "%s was caught", GST_ELEMENT_NAME (thread));
g_cond_signal (thread->cond);
g_cond_wait (thread->cond, thread->lock);
}
@ -570,7 +572,7 @@ gst_thread_main_loop (void *arg)
g_cond_signal (thread->cond);
g_mutex_unlock (thread->lock);
GST_INFO (GST_CAT_THREAD, "gstthread: thread \"%s\" is stopped",
GST_CAT_INFO (GST_CAT_THREAD, "gstthread: thread \"%s\" is stopped",
GST_ELEMENT_NAME (thread));
return NULL;
@ -590,7 +592,7 @@ static void
gst_thread_restore_thyself (GstObject *object,
xmlNodePtr self)
{
GST_DEBUG (GST_CAT_THREAD,"gstthread: restore");
GST_CAT_DEBUG (GST_CAT_THREAD,"gstthread: restore");
if (GST_OBJECT_CLASS (parent_class)->restore_thyself)
GST_OBJECT_CLASS (parent_class)->restore_thyself (object, self);

View file

@ -32,7 +32,7 @@
#include "gsttype.h"
#include "gstregistrypool.h"
#include "gstobject.h"
#include "gstlog.h"
#include "gstinfo.h"
/* global list of registered types */
@ -146,7 +146,7 @@ gst_type_register (GstTypeFactory *factory)
g_return_val_if_fail (factory != NULL, 0);
/* GST_INFO (GST_CAT_TYPES,"type register %s", factory->mime); */
/* GST_CAT_INFO (GST_CAT_TYPES,"type register %s", factory->mime); */
id = gst_type_find_by_mime (factory->mime);
if (!id) {
@ -168,7 +168,7 @@ gst_type_register (GstTypeFactory *factory)
/* if there is no existing typefind function, try to use new one */
}
GST_DEBUG (GST_CAT_TYPES,"gsttype: %s(%p) gave new mime type '%s', id %d",
GST_CAT_DEBUG (GST_CAT_TYPES,"gsttype: %s(%p) gave new mime type '%s', id %d",
GST_OBJECT_NAME (factory), factory, type->mime, type->id);
type->factories = g_slist_prepend (type->factories, factory);
@ -186,12 +186,12 @@ gst_type_find_by_mime_func (const gchar *mime)
g_return_val_if_fail (mime != NULL, 0);
walk = _gst_types;
/* GST_DEBUG (GST_CAT_TYPES,"searching for '%s'",mime); */
/* GST_CAT_DEBUG (GST_CAT_TYPES,"searching for '%s'",mime); */
mimelen = strlen (mime);
while (walk) {
type = (GstType *)walk->data;
search = type->mime;
/* GST_DEBUG (GST_CAT_TYPES,"checking against '%s'",search); */
/* GST_CAT_DEBUG (GST_CAT_TYPES,"checking against '%s'",search); */
typelen = strlen (search);
while ((search - type->mime) < typelen) {
found = strstr (search, mime);
@ -321,7 +321,7 @@ gst_type_type_find_dummy (GstBuffer *buffer, gpointer priv)
GstCaps *res = NULL;
GstTypeFactory *factory = (GstTypeFactory *)priv;
GST_DEBUG (GST_CAT_TYPES,"gsttype: need to load typefind function for %s", factory->mime);
GST_CAT_DEBUG (GST_CAT_TYPES,"gsttype: need to load typefind function for %s", factory->mime);
if (gst_plugin_feature_ensure_loaded (GST_PLUGIN_FEATURE (factory))) {
if (factory->typefindfunc == gst_type_type_find_dummy) {

View file

@ -23,7 +23,7 @@
#include "gst_private.h"
#include "gsttype.h"
#include "gstlog.h"
#include "gstinfo.h"
#include "gsttypefind.h"
#define DEFAULT_MAX_BUFFERS 1
@ -190,7 +190,7 @@ gst_type_find_chain (GstPad *pad, GstBuffer *buf)
typefind = GST_TYPE_FIND (GST_OBJECT_PARENT (pad));
GST_DEBUG (0,"got buffer of %d bytes in '%s'",
GST_DEBUG ("got buffer of %d bytes in '%s'",
GST_BUFFER_SIZE (buf), GST_OBJECT_NAME (typefind));
type_list = gst_type_get_list ();
@ -206,10 +206,10 @@ gst_type_find_chain (GstPad *pad, GstBuffer *buf)
GstTypeFindFunc typefindfunc = (GstTypeFindFunc)factory->typefindfunc;
GstCaps *caps;
GST_DEBUG (GST_CAT_TYPES, "try type (%p) :%d \"%s\" %p",
GST_CAT_DEBUG (GST_CAT_TYPES, "try type (%p) :%d \"%s\" %p",
factory, type->id, type->mime, typefindfunc);
if (typefindfunc && (caps = typefindfunc (buf, factory))) {
GST_DEBUG (GST_CAT_TYPES, "found type: %d \"%s\" \"%s\"",
GST_CAT_DEBUG (GST_CAT_TYPES, "found type: %d \"%s\" \"%s\"",
caps->id, type->mime, gst_caps_get_name (caps));
typefind->caps = caps;

View file

@ -24,7 +24,7 @@
#include "gsturi.h"
#include "gstregistrypool.h"
#include "gstlog.h"
#include "gstinfo.h"
static void gst_uri_handler_class_init (GstURIHandlerClass *klass);
static void gst_uri_handler_init (GstURIHandler *factory);

View file

@ -23,7 +23,7 @@
#include "gst_private.h"
#include "gsturi.h"
#include "gstlog.h"
#include "gstinfo.h"
GType
gst_uri_get_uri_type (void)

View file

@ -27,7 +27,7 @@
#include "gst_private.h"
#include "gstutils.h"
#include "gsturitype.h"
#include "gstlog.h"
#include "gstinfo.h"
/**
* gst_util_dump_mem:
@ -82,7 +82,7 @@ gst_util_set_value_from_string(GValue *value, const gchar *value_str)
g_return_if_fail(value != NULL);
g_return_if_fail(value_str != NULL);
GST_DEBUG(GST_CAT_PARAMS, "parsing '%s' to type %s", value_str, g_type_name(G_VALUE_TYPE(value)));
GST_CAT_DEBUG (GST_CAT_PARAMS, "parsing '%s' to type %s", value_str, g_type_name(G_VALUE_TYPE(value)));
switch (G_VALUE_TYPE(value)) {
case G_TYPE_STRING:
@ -169,7 +169,7 @@ gst_util_set_object_arg (GObject * object, const gchar * name, const gchar * val
return;
}
GST_DEBUG (0, "paramspec->flags is %d, paramspec->value_type is %d",
GST_DEBUG ( "paramspec->flags is %d, paramspec->value_type is %d",
paramspec->flags, (gint) paramspec->value_type);
if (paramspec->flags & G_PARAM_WRITABLE) {

View file

@ -24,9 +24,15 @@
#ifndef __GST_VERSION_H__
#define __GST_VERSION_H__
#define GST_VERSION_MAJOR @GST_VERSION_MAJOR@
#define GST_VERSION_MINOR @GST_VERSION_MINOR@
#define GST_VERSION_MICRO @GST_VERSION_MICRO@
/**
* Use these only when you want to know what GStreamer version your stuff was
* compiled against.
* Use the #gst_version function if you want to know which versiuon of
* GStreamer you are currently linked against.
*/
#define GST_VERSION_MAJOR (@GST_VERSION_MAJOR@)
#define GST_VERSION_MINOR (@GST_VERSION_MINOR@)
#define GST_VERSION_MICRO (@GST_VERSION_MICRO@)
void gst_version (guint *major, guint *minor, guint *micro);

View file

@ -23,7 +23,7 @@
#include "gst_private.h"
#include "gstxml.h"
#include "gstlog.h"
#include "gstinfo.h"
#include "gstbin.h"
enum {
@ -346,14 +346,14 @@ gst_xml_get_element (GstXML *xml, const guchar *name)
g_return_val_if_fail(xml != NULL, NULL);
g_return_val_if_fail(name != NULL, NULL);
GST_DEBUG (0,"gstxml: getting element \"%s\"", name);
GST_DEBUG ("gstxml: getting element \"%s\"", name);
topelements = gst_xml_get_topelements (xml);
while (topelements) {
GstElement *top = GST_ELEMENT (topelements->data);
GST_DEBUG (0,"gstxml: getting element \"%s\"", name);
GST_DEBUG ("gstxml: getting element \"%s\"", name);
if (!strcmp (GST_ELEMENT_NAME (top), name)) {
return top;
}
@ -399,7 +399,7 @@ gst_xml_make_element (xmlNodePtr cur, GstObject *parent)
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (type != NULL, NULL);
GST_INFO (GST_CAT_XML,"loading \"%s\" of type \"%s\"", name, type);
GST_CAT_INFO (GST_CAT_XML,"loading \"%s\" of type \"%s\"", name, type);
element = gst_element_factory_make (type, name);

View file

@ -17,16 +17,14 @@
* Boston, MA 02111-1307, USA.
*/
#include <gst/gst_private.h>
#include <gst/gstversion.h>
#include <gst/gstplugin.h>
#include <gst/gstindex.h>
#include <gst/gst.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#define GST_TYPE_FILE_INDEX \
(gst_file_index_get_type ())
@ -193,7 +191,7 @@ gst_file_index_class_init (GstFileIndexClass *klass)
static void
gst_file_index_init (GstFileIndex *index)
{
GST_DEBUG(0, "created new file index");
GST_DEBUG ( "created new file index");
index->id_index = g_hash_table_new (g_int_hash, g_int_equal);
}
@ -789,11 +787,7 @@ show_entry (GstIndexEntry *entry)
static void
gst_file_index_add_entry (GstIndex *index, GstIndexEntry *entry)
{
GstFileIndex *fileindex = GST_FILE_INDEX (index);
GST_DEBUG (0, "adding entry %p\n", fileindex);
//show_entry (entry);
GST_LOG_OBJECT (index, "adding this entry");
switch (entry->type){
case GST_INDEX_ENTRY_ID:

View file

@ -17,10 +17,7 @@
* Boston, MA 02111-1307, USA.
*/
#include <gst/gst_private.h>
#include <gst/gstversion.h>
#include <gst/gstplugin.h>
#include <gst/gstindex.h>
#include <gst/gst.h>
#define GST_TYPE_MEM_INDEX \
(gst_index_get_type ())
@ -158,7 +155,7 @@ gst_mem_index_class_init (GstMemIndexClass *klass)
static void
gst_mem_index_init (GstMemIndex *index)
{
GST_DEBUG(0, "created new mem index");
GST_DEBUG ( "created new mem index");
index->associations = NULL;
index->id_index = g_hash_table_new (g_int_hash, g_int_equal);
@ -260,9 +257,7 @@ gst_mem_index_add_format (GstIndex *index, GstIndexEntry *entry)
static void
gst_mem_index_add_entry (GstIndex *index, GstIndexEntry *entry)
{
GstMemIndex *memindex = GST_MEM_INDEX (index);
GST_DEBUG (0, "adding entry %p\n", memindex);
GST_LOG_OBJECT (index, "added this entry");
switch (entry->type){
case GST_INDEX_ENTRY_ID:

View file

@ -4,14 +4,13 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "../gst_private.h"
#include "../gstparse.h"
#include "../gstinfo.h"
#include "types.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#define YYERROR_VERBOSE 1
#define YYPARSE_PARAM graph
@ -102,11 +101,11 @@ typedef struct {
# define YYDEBUG 1
/* bison 1.35 calls this macro with side effects, we need to make sure the
side effects work - crappy bison
# define YYFPRINTF(a, ...) GST_DEBUG (GST_CAT_PIPELINE, __VA_ARGS__)
# define YYFPRINTF(a, ...) GST_CAT_DEBUG (GST_CAT_PIPELINE, __VA_ARGS__)
*/
# define YYFPRINTF(a, ...) G_STMT_START{ \
gchar *temp = g_strdup_printf (__VA_ARGS__); \
GST_DEBUG (GST_CAT_PIPELINE, temp); \
GST_CAT_DEBUG (GST_CAT_PIPELINE, temp); \
g_free (temp); \
}G_STMT_END
#endif
@ -127,11 +126,11 @@ typedef struct {
# define YYDEBUG 1
/* bison 1.35 calls this macro with side effects, we need to make sure the
side effects work - crappy bison
# define YYFPRINTF(a, args...) GST_DEBUG (GST_CAT_PIPELINE, ## args )
# define YYFPRINTF(a, args...) GST_CAT_DEBUG (GST_CAT_PIPELINE, ## args )
*/
# define YYFPRINTF(a, args...) G_STMT_START{ \
gchar *temp = g_strdup_printf ( ## args ); \
GST_DEBUG (GST_CAT_PIPELINE, temp); \
GST_CAT_DEBUG (GST_CAT_PIPELINE, temp); \
g_free (temp); \
}G_STMT_END
#endif
@ -400,15 +399,15 @@ gst_parse_found_pad (GstElement *src, GstPad *pad, gpointer data)
{
DelayedLink *link = (DelayedLink *) data;
GST_INFO (GST_CAT_PIPELINE, "trying delayed linking %s:%s to %s:%s",
GST_ELEMENT_NAME (src), link->src_pad,
GST_ELEMENT_NAME (link->sink), link->sink_pad);
GST_CAT_INFO (GST_CAT_PIPELINE, "trying delayed linking %s:%s to %s:%s",
GST_ELEMENT_NAME (src), link->src_pad,
GST_ELEMENT_NAME (link->sink), link->sink_pad);
if (gst_element_link_pads_filtered (src, link->src_pad, link->sink, link->sink_pad, link->caps)) {
/* do this here, we don't want to get any problems later on when unlocking states */
GST_DEBUG (GST_CAT_PIPELINE, "delayed linking %s:%s to %s:%s worked",
GST_ELEMENT_NAME (src), link->src_pad,
GST_ELEMENT_NAME (link->sink), link->sink_pad);
GST_CAT_DEBUG (GST_CAT_PIPELINE, "delayed linking %s:%s to %s:%s worked",
GST_ELEMENT_NAME (src), link->src_pad,
GST_ELEMENT_NAME (link->sink), link->sink_pad);
g_signal_handler_disconnect (src, link->signal_id);
g_free (link->src_pad);
g_free (link->sink_pad);
@ -433,8 +432,8 @@ gst_parse_perform_delayed_link (GstElement *src, const gchar *src_pad,
/* TODO: maybe we should check if src_pad matches this template's names */
GST_DEBUG (GST_CAT_PIPELINE, "trying delayed link %s:%s to %s:%s",
GST_ELEMENT_NAME (src), src_pad, GST_ELEMENT_NAME (sink), sink_pad);
GST_CAT_DEBUG (GST_CAT_PIPELINE, "trying delayed link %s:%s to %s:%s",
GST_ELEMENT_NAME (src), src_pad, GST_ELEMENT_NAME (sink), sink_pad);
data->src_pad = g_strdup (src_pad);
data->sink = sink;
@ -464,10 +463,10 @@ gst_parse_perform_link (link_t *link, graph_t *graph)
g_assert (GST_IS_ELEMENT (src));
g_assert (GST_IS_ELEMENT (sink));
GST_INFO (GST_CAT_PIPELINE, "linking %s(%s):%u to %s(%s):%u with caps \"%s\"",
GST_ELEMENT_NAME (src), link->src_name ? link->src_name : "---", g_slist_length (srcs),
GST_ELEMENT_NAME (sink), link->sink_name ? link->sink_name : "---", g_slist_length (sinks),
link->caps ? gst_caps_to_string (link->caps) : "-");
GST_CAT_INFO (GST_CAT_PIPELINE, "linking %s(%s):%u to %s(%s):%u with caps \"%s\"",
GST_ELEMENT_NAME (src), link->src_name ? link->src_name : "---", g_slist_length (srcs),
GST_ELEMENT_NAME (sink), link->sink_name ? link->sink_name : "---", g_slist_length (sinks),
link->caps ? gst_caps_to_string (link->caps) : "-");
if (!srcs || !sinks) {
if (gst_element_link_pads_filtered (src, srcs ? (const gchar *) srcs->data : NULL,
@ -777,7 +776,7 @@ _gst_parse_launch (const gchar *str, GError **error)
g.error = error;
#ifdef __GST_PARSE_TRACE
GST_DEBUG (GST_CAT_PIPELINE, "TRACE: tracing enabled");
GST_CAT_DEBUG (GST_CAT_PIPELINE, "TRACE: tracing enabled");
__strings = __chains = __links = 0;
#endif /* __GST_PARSE_TRACE */
@ -795,7 +794,7 @@ _gst_parse_launch (const gchar *str, GError **error)
}
g_free (dstr);
GST_INFO (GST_CAT_PIPELINE, "got %u elements and %u links", g.chain ? g_slist_length (g.chain->elements) : 0, g_slist_length (g.links));
GST_CAT_INFO (GST_CAT_PIPELINE, "got %u elements and %u links", g.chain ? g_slist_length (g.chain->elements) : 0, g_slist_length (g.links));
if (!g.chain) {
ret = NULL;
@ -860,7 +859,7 @@ _gst_parse_launch (const gchar *str, GError **error)
out:
#ifdef __GST_PARSE_TRACE
GST_DEBUG (GST_CAT_PIPELINE, "TRACE: %u strings, %u chains and %u links left", __strings, __chains, __links);
GST_CAT_DEBUG (GST_CAT_PIPELINE, "TRACE: %u strings, %u chains and %u links left", __strings, __chains, __links);
if (__strings || __chains || __links) {
g_warning ("TRACE: %u strings, %u chains and %u links left", __strings, __chains, __links);
}

View file

@ -2,18 +2,17 @@
#include <math.h>
#include <ctype.h>
#include <string.h>
#include "../gst_private.h"
#include "types.h"
#include "../gstinfo.h"
#include "grammar.tab.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef G_HAVE_ISO_VARARGS
#define PRINT(...) GST_DEBUG (GST_CAT_PIPELINE, "flex: "__VA_ARGS__)
#define PRINT(...) GST_CAT_DEBUG (GST_CAT_PIPELINE, "flex: "__VA_ARGS__)
#elif defined(G_HAVE_GNUC_VARARGS)
#define PRINT(args...) GST_DEBUG (GST_CAT_PIPELINE, "flex: "##args)
#define PRINT(args...) GST_CAT_DEBUG (GST_CAT_PIPELINE, "flex: "##args)
#else
#define PRINT(args...)
#endif

View file

@ -20,7 +20,10 @@
* Boston, MA 02111-1307, USA.
*/
/* #define DEBUG_ENABLED */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
@ -35,6 +38,7 @@
#include <gst/gstscheduler.h>
#include <gst/gstautoplug.h>
#include <gst/gsturi.h>
#include <gst/gstinfo.h>
#include "gstxmlregistry.h"
@ -422,7 +426,7 @@ plugin_times_older_than_recurse(gchar *path, time_t regtime)
time_t pathtime = get_time(path);
if (pathtime > regtime) {
GST_INFO (GST_CAT_PLUGIN_LOADING,
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING,
"time for %s was %ld; more recent than registry time of %ld\n",
path, (long)pathtime, (long)regtime);
return FALSE;
@ -455,7 +459,7 @@ plugin_times_older_than(GList *paths, time_t regtime)
*/
while (paths) {
GST_DEBUG (GST_CAT_PLUGIN_LOADING,
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING,
"comparing plugin times from %s with %ld\n",
(gchar *)paths->data, (long) regtime);
if(!plugin_times_older_than_recurse(paths->data, regtime))
@ -485,10 +489,10 @@ gst_xml_registry_open_func (GstXMLRegistry *registry, GstXMLRegistryMode mode)
/* if it's not writable, then don't bother */
if (!(gst_registry->flags & GST_REGISTRY_WRITABLE))
{
GST_INFO (GST_CAT_GST_INIT, "Registry isn't writable");
GST_CAT_INFO (GST_CAT_GST_INIT, "Registry isn't writable");
return FALSE;
}
GST_INFO (GST_CAT_GST_INIT, "Registry doesn't exist, trying to build...");
GST_CAT_INFO (GST_CAT_GST_INIT, "Registry doesn't exist, trying to build...");
gst_registry_rebuild (gst_registry);
gst_registry_save (gst_registry);
/* FIXME: verify that the flags actually get updated ! */
@ -502,18 +506,18 @@ gst_xml_registry_open_func (GstXMLRegistry *registry, GstXMLRegistryMode mode)
if (!plugin_times_older_than (paths, get_time (registry->location))) {
if (gst_registry->flags & GST_REGISTRY_WRITABLE) {
GST_INFO (GST_CAT_GST_INIT, "Registry out of date, rebuilding...");
GST_CAT_INFO (GST_CAT_GST_INIT, "Registry out of date, rebuilding...");
gst_registry_rebuild (gst_registry);
gst_registry_save (gst_registry);
if (!plugin_times_older_than (paths, get_time (registry->location))) {
GST_INFO (GST_CAT_GST_INIT, "Registry still out of date, something is wrong...");
GST_CAT_INFO (GST_CAT_GST_INIT, "Registry still out of date, something is wrong...");
return FALSE;
}
} else {
GST_INFO (GST_CAT_PLUGIN_LOADING, "Can't write to this registry and it's out of date, ignoring it");
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING, "Can't write to this registry and it's out of date, ignoring it");
return FALSE;
}
}
@ -613,7 +617,7 @@ gst_xml_registry_load (GstRegistry *registry)
seconds = g_timer_elapsed (timer, NULL);
g_timer_destroy (timer);
GST_INFO (0, "registry: loaded %s in %f seconds\n (%s)",
GST_INFO ( "registry: loaded %s in %f seconds\n (%s)",
registry->name, seconds, xmlregistry->location);
CLASS (xmlregistry)->close_func (xmlregistry);
@ -698,7 +702,7 @@ gst_type_type_find_dummy (GstBuffer *buffer, gpointer priv)
{
GstTypeFactory *factory = (GstTypeFactory *)priv;
GST_DEBUG (GST_CAT_TYPES,"gsttype: need to load typefind function for %s", factory->mime);
GST_CAT_DEBUG (GST_CAT_TYPES,"gsttype: need to load typefind function for %s", factory->mime);
if (gst_plugin_feature_ensure_loaded (GST_PLUGIN_FEATURE (factory))) {
if (factory->typefindfunc) {
@ -1613,7 +1617,7 @@ gst_xml_registry_rebuild (GstRegistry *registry)
while (walk) {
gchar *path = (gchar *) walk->data;
GST_INFO (GST_CAT_PLUGIN_LOADING,
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING,
"Rebuilding registry %p in directory %s...", registry, path);
plugins = g_list_concat (plugins,
@ -1654,7 +1658,7 @@ gst_xml_registry_rebuild (GstRegistry *registry)
g_warning ("Bizarre behavior: plugin %s actually loaded",
((GstPlugin *) walk->data)->filename);
} else {
GST_INFO (GST_CAT_PLUGIN_LOADING, "Plugin %s failed to load: %s",
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING, "Plugin %s failed to load: %s",
((GstPlugin *) walk->data)->filename, error->message);
g_print ("Plugin %s failed to load\n",
((GstPlugin *) walk->data)->filename);

Some files were not shown because too many files have changed in this diff Show more