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),
(_gst_buffer_copy), (gst_buffer_is_metadata_writable),
(gst_subbuffer_finalize), (gst_buffer_create_sub),
typedef struct
{
- gint ret;
- gchar *name;
+ const gint ret;
+ const gchar *name;
GQuark quark;
} GstFlowQuarks;
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;
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);
}
/**
+ * 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.
goto not_negotiated;
}
- ret = gst_pad_chain (peer, buffer);
+ ret = gst_pad_chain_unchecked (peer, buffer);
gst_object_unref (peer);