const GstMetaInfo *info = (*meta)->info;
gboolean do_copy = FALSE;
- if (gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory)) {
+ if (gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory)
+ || gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory_reference)) {
/* never call the transform_meta with memory specific metadata */
GST_DEBUG_OBJECT (decoder, "not copying memory specific metadata %s",
g_type_name (info->api));
const GstMetaInfo *info = (*meta)->info;
gboolean do_copy = FALSE;
- if (gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory)) {
+ if (gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory)
+ || gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory_reference)) {
/* never call the transform_meta with memory specific metadata */
GST_DEBUG_OBJECT (encoder, "not copying memory specific metadata %s",
g_type_name (info->api));
const GstMetaInfo *info = (*meta)->info;
gboolean do_copy = FALSE;
- if (gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory)) {
+ if (gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory)
+ || gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory_reference)) {
/* never call the transform_meta with memory specific metadata */
GST_DEBUG_OBJECT (decoder, "not copying memory specific metadata %s",
g_type_name (info->api));
const GstMetaInfo *info = (*meta)->info;
gboolean do_copy = FALSE;
- if (gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory)) {
+ if (gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory)
+ || gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory_reference)) {
/* never call the transform_meta with memory specific metadata */
GST_DEBUG_OBJECT (encoder, "not copying memory specific metadata %s",
g_type_name (info->api));
#include "gstbuffer.h"
#include "gstbufferpool.h"
#include "gstinfo.h"
+#include "gstmeta.h"
#include "gstutils.h"
#include "gstversion.h"
}
if (flags & GST_BUFFER_COPY_META) {
+ gboolean deep;
+
+ deep = (flags & GST_BUFFER_COPY_DEEP) != 0;
+
/* NOTE: GstGLSyncMeta copying relies on the meta
* being copied now, after the buffer data,
* so this has to happen last */
GST_CAT_DEBUG (GST_CAT_BUFFER,
"don't copy memory meta %p of API type %s", meta,
g_type_name (info->api));
+ } else if (deep && gst_meta_api_type_has_tag (info->api,
+ _gst_meta_tag_memory_reference)) {
+ GST_CAT_DEBUG (GST_CAT_BUFFER,
+ "don't copy meta with memory references %" GST_PTR_FORMAT, meta);
} else if (info->transform_func) {
GstMetaTransformCopy copy_data;
gst_parent_buffer_meta_api_get_type (void)
{
static GType type = 0;
- static const gchar *tags[] = { NULL };
+ static const gchar *tags[] = { GST_META_TAG_MEMORY_REFERENCE_STR, NULL };
if (g_once_init_enter (&type)) {
GType _type = gst_meta_api_type_register ("GstParentBufferMetaAPI", tags);
GQuark _gst_meta_transform_copy;
GQuark _gst_meta_tag_memory;
+GQuark _gst_meta_tag_memory_reference;
typedef struct
{
_gst_meta_transform_copy = g_quark_from_static_string ("gst-copy");
_gst_meta_tag_memory = g_quark_from_static_string ("memory");
+ _gst_meta_tag_memory_reference =
+ g_quark_from_static_string ("memory-reference");
}
static gboolean
* GST_META_TAG_MEMORY_STR:
*
* This metadata stays relevant as long as memory layout is unchanged.
+ * In hindsight, this tag should have been called "memory-layout".
*
* Since: 1.2
*/
#define GST_META_TAG_MEMORY_STR "memory"
/**
+ * GST_META_TAG_MEMORY_REFERENCE_STR:
+ *
+ * This metadata stays relevant until a deep copy is made.
+ *
+ * Since: 1.20.4
+ */
+#define GST_META_TAG_MEMORY_REFERENCE_STR "memory-reference"
+
+/**
* GstMeta:
* @flags: extra flags for the metadata
* @info: pointer to the #GstMetaInfo
/* some default tags */
GST_API GQuark _gst_meta_tag_memory;
+GST_API GQuark _gst_meta_tag_memory_reference;
/**
* GST_META_TAG_MEMORY:
const GstMetaInfo *info = (*meta)->info;
gboolean do_copy = FALSE;
- if (gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory)) {
+ if (gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory)
+ || gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory_reference)) {
/* never call the transform_meta with memory specific metadata */
GST_DEBUG ("not copying memory specific metadata %s",
g_type_name (info->api));
/* by default we remove all metadata, subclasses should implement a
* filter_meta function */
- if (gst_meta_api_type_has_tag (api, _gst_meta_tag_memory)) {
+ if (gst_meta_api_type_has_tag (api, _gst_meta_tag_memory)
+ || gst_meta_api_type_has_tag (api, _gst_meta_tag_memory_reference)) {
/* remove all memory dependent metadata because we are going to have to
* allocate different memory for input and output. */
GST_LOG_OBJECT (trans, "removing memory specific metadata %s",
klass = GST_BASE_TRANSFORM_GET_CLASS (trans);
- if (gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory)) {
+ if (gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory)
+ || gst_meta_api_type_has_tag (info->api, _gst_meta_tag_memory_reference)) {
/* never call the transform_meta with memory specific metadata */
GST_DEBUG_OBJECT (trans, "not copying memory specific metadata %s",
g_type_name (info->api));