From: Stefan Kost Date: Mon, 12 Jun 2006 09:28:35 +0000 (+0000) Subject: gst/: constify quark registration strings. Fixes #344115 X-Git-Tag: RELEASE-0_10_9~93 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb006ba6452d84b7fc68e76fec08366acb663989;p=platform%2Fupstream%2Fgstreamer.git gst/: constify quark registration strings. Fixes #344115 Original commit message from CVS: Patch by: Stefan Kost * gst/gstevent.c: (gst_event_get_type): * gst/gstmessage.c: * gst/gstpad.c: (gst_pad_chain_unchecked), (gst_pad_chain), (gst_pad_push): constify quark registration strings. Fixes #344115 Avoid unneeded type checking is _pad_push() by internally calling gst_pad_chain_unchecked(). --- diff --git a/ChangeLog b/ChangeLog index 727c7c3..049925a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2006-06-12 Wim Taymans + Patch by: Stefan Kost + + * gst/gstevent.c: (gst_event_get_type): + * gst/gstmessage.c: + * gst/gstpad.c: (gst_pad_chain_unchecked), (gst_pad_chain), + (gst_pad_push): + constify quark registration strings. Fixes #344115 + Avoid unneeded type checking is _pad_push() by internally + calling gst_pad_chain_unchecked(). + +2006-06-12 Wim Taymans + * gst/gstbuffer.c: (gst_buffer_get_type), (gst_buffer_finalize), (_gst_buffer_copy), (gst_buffer_is_metadata_writable), (gst_subbuffer_finalize), (gst_buffer_create_sub), diff --git a/gst/gstevent.c b/gst/gstevent.c index d1ff909..a7df269 100644 --- a/gst/gstevent.c +++ b/gst/gstevent.c @@ -99,8 +99,8 @@ _gst_event_initialize (void) typedef struct { - gint type; - gchar *name; + const gint type; + const gchar *name; GQuark quark; } GstEventQuarks; @@ -185,7 +185,7 @@ gst_event_type_get_flags (GstEventType type) GType gst_event_get_type (void) { - static GType _gst_event_type; + static GType _gst_event_type = 0; int i; if (G_UNLIKELY (_gst_event_type == 0)) { diff --git a/gst/gstmessage.c b/gst/gstmessage.c index bc4c7f4..85941d7 100644 --- a/gst/gstmessage.c +++ b/gst/gstmessage.c @@ -82,8 +82,8 @@ _gst_message_initialize (void) typedef struct { - gint type; - gchar *name; + const gint type; + const gchar *name; GQuark quark; } GstMessageQuarks; diff --git a/gst/gstpad.c b/gst/gstpad.c index 3b6dcd1..eca4098 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -124,8 +124,8 @@ static GQuark event_quark; typedef struct { - gint ret; - gchar *name; + const gint ret; + const gchar *name; GQuark quark; } GstFlowQuarks; @@ -3165,19 +3165,8 @@ gst_pad_emit_have_data_signal (GstPad * pad, GstMiniObject * obj) return res; } -/** - * gst_pad_chain: - * @pad: a sink #GstPad. - * @buffer: the #GstBuffer to send. - * - * Chain a buffer to @pad. - * - * Returns: a #GstFlowReturn from the pad. - * - * MT safe. - */ -GstFlowReturn -gst_pad_chain (GstPad * pad, GstBuffer * buffer) +static inline GstFlowReturn +gst_pad_chain_unchecked (GstPad * pad, GstBuffer * buffer) { GstCaps *caps; gboolean caps_changed; @@ -3185,12 +3174,6 @@ gst_pad_chain (GstPad * pad, GstBuffer * buffer) GstFlowReturn ret; gboolean emit_signal; - g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR); - g_return_val_if_fail (GST_PAD_DIRECTION (pad) == GST_PAD_SINK, - GST_FLOW_ERROR); - g_return_val_if_fail (buffer != NULL, GST_FLOW_ERROR); - g_return_val_if_fail (GST_IS_BUFFER (buffer), GST_FLOW_ERROR); - GST_PAD_STREAM_LOCK (pad); GST_OBJECT_LOCK (pad); @@ -3279,6 +3262,29 @@ no_function: } /** + * gst_pad_chain: + * @pad: a sink #GstPad. + * @buffer: the #GstBuffer to send. + * + * Chain a buffer to @pad. + * + * Returns: a #GstFlowReturn from the pad. + * + * MT safe. + */ +GstFlowReturn +gst_pad_chain (GstPad * pad, GstBuffer * buffer) +{ + g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR); + g_return_val_if_fail (GST_PAD_DIRECTION (pad) == GST_PAD_SINK, + GST_FLOW_ERROR); + g_return_val_if_fail (buffer != NULL, GST_FLOW_ERROR); + g_return_val_if_fail (GST_IS_BUFFER (buffer), GST_FLOW_ERROR); + + return gst_pad_chain_unchecked (pad, buffer); +} + +/** * gst_pad_push: * @pad: a source #GstPad. * @buffer: the #GstBuffer to push. @@ -3345,7 +3351,7 @@ gst_pad_push (GstPad * pad, GstBuffer * buffer) goto not_negotiated; } - ret = gst_pad_chain (peer, buffer); + ret = gst_pad_chain_unchecked (peer, buffer); gst_object_unref (peer);