From 221d46f43836c382713ce75e111d21888a07a754 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 11 Sep 2012 19:49:58 +0100 Subject: [PATCH] pad: expose gst_pad_mode_get_name() and use it in baseparse --- docs/gst/gstreamer-sections.txt | 5 +++-- gst/gstpad.c | 12 +++++++++--- gst/gstpad.h | 2 ++ libs/gst/base/gstbaseparse.c | 3 ++- win32/common/libgstreamer.def | 1 + 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index 5cc4b9c..fa80173 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -1620,7 +1620,10 @@ GST_PAD_LINK_FAILED GST_PAD_LINK_SUCCESSFUL GstPadLinkCheck GstFlowReturn +gst_flow_get_name +gst_flow_to_quark GstPadMode +gst_pad_mode_get_name gst_pad_get_name @@ -2932,8 +2935,6 @@ GFLOAT_TO_BE GFLOAT_TO_LE -gst_flow_get_name -gst_flow_to_quark gst_guint64_to_gdouble gst_gdouble_to_guint64 gst_util_dump_mem diff --git a/gst/gstpad.c b/gst/gstpad.c index 971f84b..b07fc4b 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -808,8 +808,15 @@ gst_pad_activate_default (GstPad * pad, GstObject * parent) return gst_pad_activate_mode (pad, GST_PAD_MODE_PUSH, TRUE); } -#ifndef GST_DISABLE_GST_DEBUG -static const gchar * +/** + * gst_pad_mode_get_name: + * @mode: the pad mode + * + * Return the name of a pad mode, for use in debug messages mostly. + * + * Returns: short mnemonic for pad mode @mode + */ +const gchar * gst_pad_mode_get_name (GstPadMode mode) { switch (mode) { @@ -824,7 +831,6 @@ gst_pad_mode_get_name (GstPadMode mode) } return "unknown"; } -#endif static void pre_activate (GstPad * pad, GstPadMode new_mode) diff --git a/gst/gstpad.h b/gst/gstpad.h index 2fd7ff1..f14e7fe 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -979,6 +979,8 @@ gboolean gst_pad_query_default (GstPad *pad, GstObject *parent, gboolean gst_pad_forward (GstPad *pad, GstPadForwardFunction forward, gpointer user_data); +const gchar * gst_pad_mode_get_name (GstPadMode mode); + G_END_DECLS #endif /* __GST_PAD_H__ */ diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 6d2f24a..bcc8f75 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -3048,7 +3048,8 @@ gst_base_parse_sink_activate_mode (GstPad * pad, GstObject * parent, parse = GST_BASE_PARSE (parent); - GST_DEBUG_OBJECT (parse, "sink activate mode %d, %d", mode, active); + GST_DEBUG_OBJECT (parse, "sink %sactivate in %s mode", + (active) ? "" : "de", gst_pad_mode_get_name (mode)); if (!gst_base_parse_activate (parse, active)) goto activate_failed; diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index b30b962..403656a 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -691,6 +691,7 @@ EXPORTS gst_pad_link_full gst_pad_link_return_get_type gst_pad_mark_reconfigure + gst_pad_mode_get_name gst_pad_mode_get_type gst_pad_needs_reconfigure gst_pad_new -- 2.7.4