gst/: constify quark registration strings. Fixes #344115

Original commit message from CVS:
Patch by: Stefan Kost <ensonic at sonicpulse dot de>
* 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().
This commit is contained in:
Stefan Kost 2006-06-12 09:28:35 +00:00 committed by Wim Taymans
parent 0dc1fb9c67
commit eb006ba645
4 changed files with 45 additions and 27 deletions

View file

@ -1,3 +1,15 @@
2006-06-12 Wim Taymans <wim@fluendo.com>
Patch by: Stefan Kost <ensonic at sonicpulse dot de>
* 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 <wim@fluendo.com>
* gst/gstbuffer.c: (gst_buffer_get_type), (gst_buffer_finalize),

View file

@ -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)) {

View file

@ -82,8 +82,8 @@ _gst_message_initialize (void)
typedef struct
{
gint type;
gchar *name;
const gint type;
const gchar *name;
GQuark quark;
} GstMessageQuarks;

View file

@ -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);
@ -3278,6 +3261,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.
@ -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);