mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
gstbuffer: add additional checking for writability
Check for metadata writability when setting caps on buffer or when copying metadata flags. Only enable these extra assertions in git versions. This should help us find bad elements.
This commit is contained in:
parent
06cc1d1d58
commit
aa33db85cc
1 changed files with 9 additions and 0 deletions
|
@ -197,6 +197,11 @@ gst_buffer_copy_metadata (GstBuffer * dest, const GstBuffer * src,
|
|||
if (G_UNLIKELY (dest == src))
|
||||
return;
|
||||
|
||||
#if GST_VERSION_NANO == 1
|
||||
/* we enable this extra debugging in git versions only for now */
|
||||
g_return_if_fail (gst_buffer_is_metadata_writable (dest));
|
||||
#endif
|
||||
|
||||
GST_CAT_LOG (GST_CAT_BUFFER, "copy %p to %p", src, dest);
|
||||
|
||||
if (flags & GST_BUFFER_COPY_FLAGS) {
|
||||
|
@ -395,6 +400,10 @@ void
|
|||
gst_buffer_set_caps (GstBuffer * buffer, GstCaps * caps)
|
||||
{
|
||||
g_return_if_fail (buffer != NULL);
|
||||
#if GST_VERSION_NANO == 1
|
||||
/* we enable this extra debugging in git versions only for now */
|
||||
g_return_if_fail (gst_buffer_is_metadata_writable (buffer));
|
||||
#endif
|
||||
|
||||
gst_caps_replace (&GST_BUFFER_CAPS (buffer), caps);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue