2011-04-28 17:20:58 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <2011> Wim Taymans <wim.taymans@gmail.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2011-10-31 01:23:21 +00:00
|
|
|
#include "gstvideometa.h"
|
2011-04-28 17:20:58 +00:00
|
|
|
|
2012-02-28 15:18:30 +00:00
|
|
|
static gboolean
|
2012-02-24 09:26:04 +00:00
|
|
|
gst_video_meta_transform (GstBuffer * dest, GstMeta * meta,
|
|
|
|
GstBuffer * buffer, GQuark type, gpointer data)
|
2011-12-01 14:45:28 +00:00
|
|
|
{
|
|
|
|
GstVideoMeta *dmeta, *smeta;
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
smeta = (GstVideoMeta *) meta;
|
|
|
|
|
2012-02-24 09:26:04 +00:00
|
|
|
if (GST_META_TRANSFORM_IS_COPY (type)) {
|
2012-03-02 12:04:26 +00:00
|
|
|
GstMetaTransformCopy *copy = data;
|
|
|
|
|
|
|
|
if (!copy->region) {
|
|
|
|
/* only copy if the complete data is copied as well */
|
|
|
|
dmeta =
|
|
|
|
(GstVideoMeta *) gst_buffer_add_meta (dest, GST_VIDEO_META_INFO,
|
|
|
|
NULL);
|
|
|
|
dmeta->buffer = dest;
|
|
|
|
|
|
|
|
GST_DEBUG ("copy video metadata");
|
2012-04-19 12:14:35 +00:00
|
|
|
dmeta->flags = smeta->flags;
|
2012-03-02 12:04:26 +00:00
|
|
|
dmeta->format = smeta->format;
|
2012-03-13 19:17:55 +00:00
|
|
|
dmeta->id = smeta->id;
|
2012-03-02 12:04:26 +00:00
|
|
|
dmeta->width = smeta->width;
|
|
|
|
dmeta->height = smeta->height;
|
|
|
|
|
|
|
|
dmeta->n_planes = smeta->n_planes;
|
|
|
|
for (i = 0; i < dmeta->n_planes; i++) {
|
|
|
|
dmeta->offset[i] = smeta->offset[i];
|
|
|
|
dmeta->stride[i] = smeta->stride[i];
|
|
|
|
}
|
2012-03-13 19:17:55 +00:00
|
|
|
dmeta->map = smeta->map;
|
|
|
|
dmeta->unmap = smeta->unmap;
|
2012-02-24 09:26:04 +00:00
|
|
|
}
|
2011-12-01 14:45:28 +00:00
|
|
|
}
|
2012-02-28 15:18:30 +00:00
|
|
|
return TRUE;
|
2011-12-01 14:45:28 +00:00
|
|
|
}
|
|
|
|
|
2012-02-29 16:25:10 +00:00
|
|
|
GType
|
|
|
|
gst_video_meta_api_get_type (void)
|
|
|
|
{
|
|
|
|
static volatile GType type = 0;
|
|
|
|
static const gchar *tags[] = { "memory", "colorspace", "size", NULL };
|
|
|
|
|
|
|
|
if (g_once_init_enter (&type)) {
|
|
|
|
GType _type = gst_meta_api_type_register ("GstVideoMetaAPI", tags);
|
|
|
|
g_once_init_leave (&type, _type);
|
|
|
|
}
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
2011-04-28 17:20:58 +00:00
|
|
|
/* video metadata */
|
|
|
|
const GstMetaInfo *
|
2011-10-31 01:23:21 +00:00
|
|
|
gst_video_meta_get_info (void)
|
2011-04-28 17:20:58 +00:00
|
|
|
{
|
2011-10-31 01:23:21 +00:00
|
|
|
static const GstMetaInfo *video_meta_info = NULL;
|
2011-04-28 17:20:58 +00:00
|
|
|
|
2012-10-03 17:44:59 +00:00
|
|
|
if (g_once_init_enter (&video_meta_info)) {
|
|
|
|
const GstMetaInfo *meta =
|
2012-02-29 16:25:10 +00:00
|
|
|
gst_meta_register (GST_VIDEO_META_API_TYPE, "GstVideoMeta",
|
|
|
|
sizeof (GstVideoMeta), (GstMetaInitFunction) NULL,
|
|
|
|
(GstMetaFreeFunction) NULL, gst_video_meta_transform);
|
2012-10-03 17:44:59 +00:00
|
|
|
g_once_init_leave (&video_meta_info, meta);
|
2011-04-28 17:20:58 +00:00
|
|
|
}
|
2011-10-31 01:23:21 +00:00
|
|
|
return video_meta_info;
|
2011-04-28 17:20:58 +00:00
|
|
|
}
|
|
|
|
|
2011-08-24 11:52:20 +00:00
|
|
|
/**
|
2011-10-31 01:23:21 +00:00
|
|
|
* gst_buffer_get_video_meta_id:
|
2011-08-24 11:52:20 +00:00
|
|
|
* @buffer: a #GstBuffer
|
|
|
|
* @id: a metadata id
|
|
|
|
*
|
2011-10-31 01:23:21 +00:00
|
|
|
* Find the #GstVideoMeta on @buffer with the given @id.
|
2011-08-24 11:52:20 +00:00
|
|
|
*
|
2011-10-31 01:23:21 +00:00
|
|
|
* Buffers can contain multiple #GstVideoMeta metadata items when dealing with
|
2011-08-24 11:52:20 +00:00
|
|
|
* multiview buffers.
|
|
|
|
*
|
2011-10-31 01:23:21 +00:00
|
|
|
* Returns: the #GstVideoMeta with @id or %NULL when there is no such metadata
|
2011-08-24 11:52:20 +00:00
|
|
|
* on @buffer.
|
|
|
|
*/
|
2011-10-31 01:23:21 +00:00
|
|
|
GstVideoMeta *
|
|
|
|
gst_buffer_get_video_meta_id (GstBuffer * buffer, gint id)
|
2011-08-24 11:52:20 +00:00
|
|
|
{
|
|
|
|
gpointer state = NULL;
|
|
|
|
GstMeta *meta;
|
2011-10-31 01:23:21 +00:00
|
|
|
const GstMetaInfo *info = GST_VIDEO_META_INFO;
|
2011-08-24 11:52:20 +00:00
|
|
|
|
|
|
|
while ((meta = gst_buffer_iterate_meta (buffer, &state))) {
|
|
|
|
if (meta->info->api == info->api) {
|
2011-10-31 01:23:21 +00:00
|
|
|
GstVideoMeta *vmeta = (GstVideoMeta *) meta;
|
2011-08-24 11:52:20 +00:00
|
|
|
if (vmeta->id == id)
|
|
|
|
return vmeta;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-02-23 15:28:29 +00:00
|
|
|
static gboolean
|
|
|
|
default_map (GstVideoMeta * meta, guint plane, GstMapInfo * info,
|
|
|
|
gpointer * data, gint * stride, GstMapFlags flags)
|
|
|
|
{
|
2012-06-26 09:09:50 +00:00
|
|
|
guint idx, length;
|
|
|
|
gsize offset, skip;
|
2012-02-23 15:28:29 +00:00
|
|
|
GstBuffer *buffer = meta->buffer;
|
|
|
|
|
|
|
|
offset = meta->offset[plane];
|
|
|
|
|
2012-04-01 16:04:10 +00:00
|
|
|
/* find the memory block for this plane, this is the memory block containing
|
|
|
|
* the plane offset. FIXME use plane size */
|
|
|
|
if (!gst_buffer_find_memory (buffer, offset, 1, &idx, &length, &skip))
|
|
|
|
goto no_memory;
|
2012-02-23 15:28:29 +00:00
|
|
|
|
2012-04-01 16:04:10 +00:00
|
|
|
if (!gst_buffer_map_range (buffer, idx, length, info, flags))
|
|
|
|
goto cannot_map;
|
2012-02-23 15:28:29 +00:00
|
|
|
|
2012-04-01 16:04:10 +00:00
|
|
|
*stride = meta->stride[plane];
|
|
|
|
*data = (guint8 *) info->data + skip;
|
2012-02-23 15:28:29 +00:00
|
|
|
|
2012-04-01 16:04:10 +00:00
|
|
|
return TRUE;
|
2012-02-23 15:28:29 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
no_memory:
|
|
|
|
{
|
2012-06-26 09:09:50 +00:00
|
|
|
GST_DEBUG ("plane %u, no memory at offset %" G_GSIZE_FORMAT, plane, offset);
|
2012-02-23 15:28:29 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
cannot_map:
|
|
|
|
{
|
2012-06-26 09:09:50 +00:00
|
|
|
GST_DEBUG ("cannot map memory range %u-%u", idx, length);
|
2012-02-23 15:28:29 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
default_unmap (GstVideoMeta * meta, guint plane, GstMapInfo * info)
|
|
|
|
{
|
2012-04-01 16:04:10 +00:00
|
|
|
GstBuffer *buffer = meta->buffer;
|
|
|
|
|
|
|
|
gst_buffer_unmap (buffer, info);
|
2012-02-23 15:28:29 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-06-23 07:55:27 +00:00
|
|
|
/**
|
2011-10-31 01:23:21 +00:00
|
|
|
* gst_buffer_add_video_meta:
|
2011-06-23 07:55:27 +00:00
|
|
|
* @buffer: a #GstBuffer
|
2012-04-19 12:14:35 +00:00
|
|
|
* @flags: #GstVideoFrameFlags
|
2011-06-23 07:55:27 +00:00
|
|
|
* @format: a #GstVideoFormat
|
|
|
|
* @width: the width
|
|
|
|
* @height: the height
|
|
|
|
*
|
|
|
|
* Attaches GstVideoMeta metadata to @buffer with the given parameters and the
|
|
|
|
* default offsets and strides for @format and @width x @height.
|
|
|
|
*
|
|
|
|
* This function calculates the default offsets and strides and then calls
|
2011-10-31 01:23:21 +00:00
|
|
|
* gst_buffer_add_video_meta_full() with them.
|
2011-06-23 07:55:27 +00:00
|
|
|
*
|
2011-10-31 01:23:21 +00:00
|
|
|
* Returns: the #GstVideoMeta on @buffer.
|
2011-06-23 07:55:27 +00:00
|
|
|
*/
|
2011-10-31 01:23:21 +00:00
|
|
|
GstVideoMeta *
|
2012-04-19 10:03:19 +00:00
|
|
|
gst_buffer_add_video_meta (GstBuffer * buffer,
|
2012-04-19 12:14:35 +00:00
|
|
|
GstVideoFrameFlags flags, GstVideoFormat format, guint width, guint height)
|
2011-04-28 17:20:58 +00:00
|
|
|
{
|
2011-10-31 01:23:21 +00:00
|
|
|
GstVideoMeta *meta;
|
2011-06-17 07:21:27 +00:00
|
|
|
GstVideoInfo info;
|
2011-04-28 17:20:58 +00:00
|
|
|
|
2011-06-17 07:21:27 +00:00
|
|
|
gst_video_info_set_format (&info, format, width, height);
|
2011-04-28 17:20:58 +00:00
|
|
|
|
2012-04-19 10:03:19 +00:00
|
|
|
meta =
|
2012-04-19 12:14:35 +00:00
|
|
|
gst_buffer_add_video_meta_full (buffer, flags, format, width,
|
2012-04-19 10:03:19 +00:00
|
|
|
height, info.finfo->n_planes, info.offset, info.stride);
|
2011-04-28 17:20:58 +00:00
|
|
|
|
|
|
|
return meta;
|
|
|
|
}
|
|
|
|
|
2011-06-23 07:55:27 +00:00
|
|
|
/**
|
2011-10-31 01:23:21 +00:00
|
|
|
* gst_buffer_add_video_meta_full:
|
2011-06-23 07:55:27 +00:00
|
|
|
* @buffer: a #GstBuffer
|
2012-04-19 12:14:35 +00:00
|
|
|
* @flags: #GstVideoFrameFlags
|
2011-06-23 07:55:27 +00:00
|
|
|
* @format: a #GstVideoFormat
|
|
|
|
* @width: the width
|
|
|
|
* @height: the height
|
|
|
|
* @n_planes: number of planes
|
|
|
|
* @offset: offset of each plane
|
|
|
|
* @stride: stride of each plane
|
|
|
|
*
|
|
|
|
* Attaches GstVideoMeta metadata to @buffer with the given parameters.
|
|
|
|
*
|
2011-10-31 01:23:21 +00:00
|
|
|
* Returns: the #GstVideoMeta on @buffer.
|
2011-06-23 07:55:27 +00:00
|
|
|
*/
|
2011-10-31 01:23:21 +00:00
|
|
|
GstVideoMeta *
|
2012-04-19 10:03:19 +00:00
|
|
|
gst_buffer_add_video_meta_full (GstBuffer * buffer,
|
2012-04-19 12:14:35 +00:00
|
|
|
GstVideoFrameFlags flags, GstVideoFormat format, guint width,
|
2012-04-19 10:03:19 +00:00
|
|
|
guint height, guint n_planes, gsize offset[GST_VIDEO_MAX_PLANES],
|
2011-06-20 09:25:58 +00:00
|
|
|
gint stride[GST_VIDEO_MAX_PLANES])
|
2011-04-28 17:20:58 +00:00
|
|
|
{
|
2011-10-31 01:23:21 +00:00
|
|
|
GstVideoMeta *meta;
|
2011-04-28 17:20:58 +00:00
|
|
|
guint i;
|
|
|
|
|
|
|
|
meta =
|
2011-10-31 01:23:21 +00:00
|
|
|
(GstVideoMeta *) gst_buffer_add_meta (buffer, GST_VIDEO_META_INFO, NULL);
|
2011-04-28 17:20:58 +00:00
|
|
|
|
2012-04-19 12:14:35 +00:00
|
|
|
meta->flags = flags;
|
2011-04-28 17:20:58 +00:00
|
|
|
meta->format = format;
|
2011-08-24 11:52:20 +00:00
|
|
|
meta->id = 0;
|
2011-04-28 17:20:58 +00:00
|
|
|
meta->width = width;
|
|
|
|
meta->height = height;
|
2011-06-17 15:44:56 +00:00
|
|
|
meta->buffer = buffer;
|
2011-04-28 17:20:58 +00:00
|
|
|
|
|
|
|
meta->n_planes = n_planes;
|
2011-06-20 09:25:58 +00:00
|
|
|
for (i = 0; i < n_planes; i++) {
|
|
|
|
meta->offset[i] = offset[i];
|
|
|
|
meta->stride[i] = stride[i];
|
2012-08-20 14:14:07 +00:00
|
|
|
GST_LOG ("plane %d, offset %u, stride %d", i, offset[i], stride[i]);
|
2011-06-20 09:25:58 +00:00
|
|
|
}
|
2012-02-23 15:28:29 +00:00
|
|
|
meta->map = default_map;
|
|
|
|
meta->unmap = default_unmap;
|
2012-02-13 16:07:25 +00:00
|
|
|
|
2012-02-23 15:28:29 +00:00
|
|
|
return meta;
|
2011-04-28 17:20:58 +00:00
|
|
|
}
|
|
|
|
|
2011-06-23 07:55:27 +00:00
|
|
|
/**
|
2011-10-31 01:23:21 +00:00
|
|
|
* gst_video_meta_map:
|
2011-06-23 07:55:27 +00:00
|
|
|
* @meta: a #GstVideoMeta
|
|
|
|
* @plane: a plane
|
2012-01-20 15:11:54 +00:00
|
|
|
* @info: a #GstMapInfo
|
2012-02-23 15:55:11 +00:00
|
|
|
* @data: the data of @plane
|
|
|
|
* @stride: the stride of @plane
|
2011-06-23 07:55:27 +00:00
|
|
|
* @flags: @GstMapFlags
|
|
|
|
*
|
|
|
|
* Map the video plane with index @plane in @meta and return a pointer to the
|
|
|
|
* first byte of the plane and the stride of the plane.
|
|
|
|
*
|
2012-02-23 15:55:11 +00:00
|
|
|
* Returns: TRUE if the map operation was successful.
|
2011-06-23 07:55:27 +00:00
|
|
|
*/
|
2012-01-20 15:11:54 +00:00
|
|
|
gboolean
|
|
|
|
gst_video_meta_map (GstVideoMeta * meta, guint plane, GstMapInfo * info,
|
2012-02-23 15:28:29 +00:00
|
|
|
gpointer * data, gint * stride, GstMapFlags flags)
|
2011-04-28 17:20:58 +00:00
|
|
|
{
|
2012-01-20 15:11:54 +00:00
|
|
|
g_return_val_if_fail (meta != NULL, FALSE);
|
2012-02-23 15:28:29 +00:00
|
|
|
g_return_val_if_fail (meta->map != NULL, FALSE);
|
2012-01-20 15:11:54 +00:00
|
|
|
g_return_val_if_fail (plane < meta->n_planes, FALSE);
|
|
|
|
g_return_val_if_fail (info != NULL, FALSE);
|
2012-02-23 15:28:29 +00:00
|
|
|
g_return_val_if_fail (data != NULL, FALSE);
|
2012-01-20 15:11:54 +00:00
|
|
|
g_return_val_if_fail (stride != NULL, FALSE);
|
2012-02-23 15:28:29 +00:00
|
|
|
g_return_val_if_fail (meta->buffer != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (!(flags & GST_MAP_WRITE)
|
|
|
|
|| gst_buffer_is_writable (meta->buffer), FALSE);
|
2011-04-28 17:20:58 +00:00
|
|
|
|
2012-02-23 15:28:29 +00:00
|
|
|
return meta->map (meta, plane, info, data, stride, flags);
|
2011-04-28 17:20:58 +00:00
|
|
|
}
|
|
|
|
|
2011-06-23 07:55:27 +00:00
|
|
|
/**
|
2011-10-31 01:23:21 +00:00
|
|
|
* gst_video_meta_unmap:
|
2011-06-23 07:55:27 +00:00
|
|
|
* @meta: a #GstVideoMeta
|
|
|
|
* @plane: a plane
|
2012-01-20 15:11:54 +00:00
|
|
|
* @info: a #GstMapInfo
|
2011-06-23 07:55:27 +00:00
|
|
|
*
|
2012-01-19 08:17:07 +00:00
|
|
|
* Unmap a previously mapped plane with gst_video_meta_map().
|
2011-06-23 07:55:27 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE if the memory was successfully unmapped.
|
|
|
|
*/
|
2011-04-28 17:20:58 +00:00
|
|
|
gboolean
|
2012-01-20 15:11:54 +00:00
|
|
|
gst_video_meta_unmap (GstVideoMeta * meta, guint plane, GstMapInfo * info)
|
2011-04-28 17:20:58 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (meta != NULL, FALSE);
|
2012-02-23 15:28:29 +00:00
|
|
|
g_return_val_if_fail (meta->unmap != NULL, FALSE);
|
2011-04-28 17:20:58 +00:00
|
|
|
g_return_val_if_fail (plane < meta->n_planes, FALSE);
|
2012-01-20 15:11:54 +00:00
|
|
|
g_return_val_if_fail (info != NULL, FALSE);
|
2011-04-28 17:20:58 +00:00
|
|
|
|
2012-02-23 15:28:29 +00:00
|
|
|
return meta->unmap (meta, plane, info);
|
2011-04-28 17:20:58 +00:00
|
|
|
}
|
2011-06-23 07:30:19 +00:00
|
|
|
|
2012-02-28 15:18:30 +00:00
|
|
|
static gboolean
|
2012-02-24 09:26:04 +00:00
|
|
|
gst_video_crop_meta_transform (GstBuffer * dest, GstMeta * meta,
|
|
|
|
GstBuffer * buffer, GQuark type, gpointer data)
|
2011-12-01 14:45:28 +00:00
|
|
|
{
|
|
|
|
GstVideoCropMeta *dmeta, *smeta;
|
|
|
|
|
2012-02-24 09:26:04 +00:00
|
|
|
if (GST_META_TRANSFORM_IS_COPY (type)) {
|
|
|
|
smeta = (GstVideoCropMeta *) meta;
|
|
|
|
dmeta = gst_buffer_add_video_crop_meta (dest);
|
2011-12-01 14:45:28 +00:00
|
|
|
|
2012-03-02 12:04:26 +00:00
|
|
|
GST_DEBUG ("copy crop metadata");
|
2012-02-24 09:26:04 +00:00
|
|
|
dmeta->x = smeta->x;
|
|
|
|
dmeta->y = smeta->y;
|
|
|
|
dmeta->width = smeta->width;
|
|
|
|
dmeta->height = smeta->height;
|
2012-03-02 12:04:26 +00:00
|
|
|
} else if (GST_VIDEO_META_TRANSFORM_IS_SCALE (type)) {
|
2012-03-06 11:52:01 +00:00
|
|
|
GstVideoMetaTransform *trans = data;
|
|
|
|
gint ow, oh, nw, nh;
|
|
|
|
|
|
|
|
smeta = (GstVideoCropMeta *) meta;
|
|
|
|
dmeta = gst_buffer_add_video_crop_meta (dest);
|
|
|
|
|
|
|
|
ow = GST_VIDEO_INFO_WIDTH (trans->in_info);
|
|
|
|
nw = GST_VIDEO_INFO_WIDTH (trans->out_info);
|
|
|
|
oh = GST_VIDEO_INFO_HEIGHT (trans->in_info);
|
|
|
|
nh = GST_VIDEO_INFO_HEIGHT (trans->out_info);
|
|
|
|
|
|
|
|
GST_DEBUG ("scaling crop metadata %dx%d -> %dx%d", ow, oh, nw, nh);
|
|
|
|
dmeta->x = (smeta->x * nw) / ow;
|
|
|
|
dmeta->y = (smeta->y * nh) / oh;
|
|
|
|
dmeta->width = (smeta->width * nw) / ow;
|
|
|
|
dmeta->height = (smeta->height * nh) / oh;
|
|
|
|
GST_DEBUG ("crop offset %dx%d -> %dx%d", smeta->x, smeta->y, dmeta->x,
|
|
|
|
dmeta->y);
|
|
|
|
GST_DEBUG ("crop size %dx%d -> %dx%d", smeta->width, smeta->height,
|
|
|
|
dmeta->width, dmeta->height);
|
2012-02-24 09:26:04 +00:00
|
|
|
}
|
2012-02-28 15:18:30 +00:00
|
|
|
return TRUE;
|
2011-12-01 14:45:28 +00:00
|
|
|
}
|
|
|
|
|
2012-02-29 16:25:10 +00:00
|
|
|
GType
|
|
|
|
gst_video_crop_meta_api_get_type (void)
|
|
|
|
{
|
|
|
|
static volatile GType type = 0;
|
|
|
|
static const gchar *tags[] = { "size", "orientation", NULL };
|
|
|
|
|
|
|
|
if (g_once_init_enter (&type)) {
|
|
|
|
GType _type = gst_meta_api_type_register ("GstVideoCropMetaAPI", tags);
|
|
|
|
g_once_init_leave (&type, _type);
|
|
|
|
}
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
2011-06-23 07:30:19 +00:00
|
|
|
const GstMetaInfo *
|
2011-10-31 01:23:21 +00:00
|
|
|
gst_video_crop_meta_get_info (void)
|
2011-06-23 07:30:19 +00:00
|
|
|
{
|
2011-10-31 01:23:21 +00:00
|
|
|
static const GstMetaInfo *video_crop_meta_info = NULL;
|
2011-06-23 07:30:19 +00:00
|
|
|
|
2012-10-03 17:44:59 +00:00
|
|
|
if (g_once_init_enter (&video_crop_meta_info)) {
|
|
|
|
const GstMetaInfo *meta =
|
2012-02-29 16:25:10 +00:00
|
|
|
gst_meta_register (GST_VIDEO_CROP_META_API_TYPE, "GstVideoCropMeta",
|
2011-10-31 01:23:21 +00:00
|
|
|
sizeof (GstVideoCropMeta), (GstMetaInitFunction) NULL,
|
2012-02-29 16:25:10 +00:00
|
|
|
(GstMetaFreeFunction) NULL, gst_video_crop_meta_transform);
|
2012-10-03 17:44:59 +00:00
|
|
|
g_once_init_leave (&video_crop_meta_info, meta);
|
2011-06-23 07:30:19 +00:00
|
|
|
}
|
2011-10-31 01:23:21 +00:00
|
|
|
return video_crop_meta_info;
|
2011-06-23 07:30:19 +00:00
|
|
|
}
|
2012-03-02 12:04:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_video_meta_transform_scale_get_quark:
|
|
|
|
*
|
|
|
|
* Get the #GQuark for the "gst-video-scale" metadata transform operation.
|
|
|
|
*
|
|
|
|
* Returns: a #GQuark
|
|
|
|
*/
|
|
|
|
GQuark
|
|
|
|
gst_video_meta_transform_scale_get_quark (void)
|
|
|
|
{
|
|
|
|
static GQuark _value = 0;
|
|
|
|
|
|
|
|
if (_value == 0) {
|
|
|
|
_value = g_quark_from_static_string ("gst-video-scale");
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|