mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
buffer: Use an inline function instead of a macro for gst_buffer_replace()
This gives us type checks by the compiler and more useful compiler errors.
This commit is contained in:
parent
ef32fd0d15
commit
e8d3870214
1 changed files with 9 additions and 6 deletions
|
@ -460,12 +460,15 @@ GstBuffer* gst_buffer_make_metadata_writable (GstBuffer *buf);
|
|||
*
|
||||
* Either @nbuf or the #GstBuffer pointed to by @obuf may be NULL.
|
||||
*/
|
||||
#define gst_buffer_replace(obuf,nbuf) \
|
||||
G_STMT_START { \
|
||||
GstBuffer **___obufaddr = (GstBuffer **)(obuf); \
|
||||
gst_mini_object_replace ((GstMiniObject **)___obufaddr, \
|
||||
GST_MINI_OBJECT_CAST (nbuf)); \
|
||||
} G_STMT_END
|
||||
#ifdef _FOOL_GTK_DOC_
|
||||
G_INLINE_FUNC void gst_buffer_replace (GstBuffer **obuf, GstBuffer *nbuf);
|
||||
#endif
|
||||
|
||||
static inline void
|
||||
gst_buffer_replace (GstBuffer **obuf, GstBuffer *nbuf)
|
||||
{
|
||||
gst_mini_object_replace ((GstMiniObject **) obuf, (GstMiniObject *) nbuf);
|
||||
}
|
||||
|
||||
GstCaps* gst_buffer_get_caps (GstBuffer *buffer);
|
||||
void gst_buffer_set_caps (GstBuffer *buffer, GstCaps *caps);
|
||||
|
|
Loading…
Reference in a new issue