&GST_BUFFER_MEM_PTR (buffer, end), (len - end) * sizeof (gpointer));
}
GST_BUFFER_MEM_LEN (buffer) = len - length;
- GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_TAG_MEMORY);
+ GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_TAG_MEMORY);
}
static inline void
GST_BUFFER_MEM_PTR (buffer, idx) = mem;
GST_BUFFER_MEM_LEN (buffer) = len + 1;
- GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_TAG_MEMORY);
+ GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_TAG_MEMORY);
}
GST_DEFINE_MINI_OBJECT_TYPE (GstBuffer, gst_buffer);
if (!gst_buffer_copy_into (copy, buffer, GST_BUFFER_COPY_ALL, 0, -1))
gst_buffer_replace (©, NULL);
- GST_BUFFER_FLAG_SET (copy, GST_BUFFER_FLAG_TAG_MEMORY);
+ GST_BUFFER_FLAG_UNSET (copy, GST_BUFFER_FLAG_TAG_MEMORY);
return copy;
}
if (size > 0)
_memory_add (newbuf, -1, gst_memory_ref (mem), TRUE);
#endif
- GST_BUFFER_FLAG_SET (newbuf, GST_BUFFER_FLAG_TAG_MEMORY);
+ GST_BUFFER_FLAG_UNSET (newbuf, GST_BUFFER_FLAG_TAG_MEMORY);
return newbuf;
gst_memory_new_wrapped (flags, data, maxsize, offset, size, user_data,
notify);
_memory_add (newbuf, -1, mem, TRUE);
- GST_BUFFER_FLAG_SET (newbuf, GST_BUFFER_FLAG_TAG_MEMORY);
+ GST_BUFFER_FLAG_UNSET (newbuf, GST_BUFFER_FLAG_TAG_MEMORY);
return newbuf;
}
GST_BUFFER_MEM_PTR (buffer, idx) = mapped;
/* unlock old memory */
gst_memory_unlock (mem, GST_LOCK_FLAG_EXCLUSIVE);
- GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_TAG_MEMORY);
+ GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_TAG_MEMORY);
}
gst_memory_unref (mem);
gst_memory_unref (mem);
}
- GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_TAG_MEMORY);
+ GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_TAG_MEMORY);
}
offset = noffs;
}
GST_BUFFER_MEM_LEN (buf2) = 0;
- GST_BUFFER_FLAG_UNSET (buf2, GST_BUFFER_FLAG_TAG_MEMORY);
+ GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_FLAG_TAG_MEMORY);
gst_buffer_unref (buf2);
return buf1;
* @GST_BUFFER_FLAG_DROPPABLE: the buffer can be dropped without breaking the
* stream, for example to reduce bandwidth.
* @GST_BUFFER_FLAG_DELTA_UNIT: this unit cannot be decoded independently.
- * @GST_BUFFER_FLAG_TAG_MEMORY: this flag is cleared when the memory of the buffer
+ * @GST_BUFFER_FLAG_TAG_MEMORY: this flag is set when memory of the buffer
* is added/removed
* @GST_BUFFER_FLAG_LAST: additional media specific flags can be added starting from
* this flag.
* the buffer and we want to remove any other metadata that gets added
* later */
gst_buffer_foreach_meta (*buffer, mark_meta_pooled, pool);
- /* tag memory, this is how we expect the buffer when it is
+
+ /* un-tag memory, this is how we expect the buffer when it is
* released again */
- GST_BUFFER_FLAG_SET (*buffer, GST_BUFFER_FLAG_TAG_MEMORY);
+ GST_BUFFER_FLAG_UNSET (*buffer, GST_BUFFER_FLAG_TAG_MEMORY);
GST_LOG_OBJECT (pool, "allocated buffer %d/%d, %p", cur_buffers,
max_buffers, buffer);
GST_MINI_OBJECT_FLAGS (buffer));
/* memory should be untouched */
- if (!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_TAG_MEMORY))
+ if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_TAG_MEMORY))
goto discard;
/* all memory should be exclusive to this buffer (and thus be writable) */
* buffers from the configured memory allocator and with the configured
* parameters. All metadata that is present on the allocated buffer will
* be marked as #GST_META_FLAG_POOLED and #GST_META_FLAG_LOCKED and will
- * not be removed from the buffer in @reset_buffer. Memory will be marked
- * with GST_BUFFER_FLAG_TAG_MEMORY.
+ * not be removed from the buffer in @reset_buffer. The buffer should
+ * have the GST_BUFFER_FLAG_TAG_MEMORY cleared.
* @reset_buffer: reset the buffer to its state when it was freshly allocated.
* The default implementation will clear the flags, timestamps and
* will remove the metadata without the #GST_META_FLAG_POOLED flag (even
* the metadata with #GST_META_FLAG_LOCKED). If the
- * #GST_BUFFER_FLAG_TAG_MEMORY was removed, this function can also try to
- * restore the memory and set the #GST_BUFFER_FLAG_TAG_MEMORY again.
+ * #GST_BUFFER_FLAG_TAG_MEMORY was set, this function can also try to
+ * restore the memory and clear the #GST_BUFFER_FLAG_TAG_MEMORY again.
* @release_buffer: release a buffer back in the pool. The default
* implementation will put the buffer back in the queue and notify any
* blocking acquire_buffer calls when the #GST_BUFFER_FLAG_TAG_MEMORY
- * is set on the buffer. If #GST_BUFFER_FLAG_TAG_MEMORY is not set, the
+ * is not set on the buffer. If #GST_BUFFER_FLAG_TAG_MEMORY is set, the
* buffer will be freed with @free_buffer.
* @free_buffer: free a buffer. The default implementation unrefs the buffer.
*