mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 23:18:52 +00:00
protection: implement meta transform function
Copy the GstMeta contents over to the new buffer. https://bugzilla.gnome.org/show_bug.cgi?id=749590
This commit is contained in:
parent
6d78d32d51
commit
ee40730558
1 changed files with 23 additions and 2 deletions
|
@ -84,6 +84,28 @@ gst_protection_meta_free (GstMeta * meta, GstBuffer * buffer)
|
||||||
gst_structure_free (protection_meta->info);
|
gst_structure_free (protection_meta->info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gst_protection_meta_transform (GstBuffer * transbuf, GstMeta * meta,
|
||||||
|
GstBuffer * buffer, GQuark type, gpointer data)
|
||||||
|
{
|
||||||
|
GstProtectionMeta *protection_meta = (GstProtectionMeta *) meta;
|
||||||
|
|
||||||
|
if (GST_META_TRANSFORM_IS_COPY (type)) {
|
||||||
|
GstMetaTransformCopy *copy = data;
|
||||||
|
if (!copy->region) {
|
||||||
|
/* only copy if the complete data is copied as well */
|
||||||
|
gst_buffer_add_protection_meta (transbuf,
|
||||||
|
gst_structure_copy (protection_meta->info));
|
||||||
|
} else {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* transform type not supported */
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
const GstMetaInfo *
|
const GstMetaInfo *
|
||||||
gst_protection_meta_get_info (void)
|
gst_protection_meta_get_info (void)
|
||||||
{
|
{
|
||||||
|
@ -93,8 +115,7 @@ gst_protection_meta_get_info (void)
|
||||||
const GstMetaInfo *meta =
|
const GstMetaInfo *meta =
|
||||||
gst_meta_register (GST_PROTECTION_META_API_TYPE, "GstProtectionMeta",
|
gst_meta_register (GST_PROTECTION_META_API_TYPE, "GstProtectionMeta",
|
||||||
sizeof (GstProtectionMeta), gst_protection_meta_init,
|
sizeof (GstProtectionMeta), gst_protection_meta_init,
|
||||||
gst_protection_meta_free,
|
gst_protection_meta_free, gst_protection_meta_transform);
|
||||||
(GstMetaTransformFunction) NULL);
|
|
||||||
|
|
||||||
g_once_init_leave (&protection_meta_info, meta);
|
g_once_init_leave (&protection_meta_info, meta);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue