mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
rename meta* -> *meta
This commit is contained in:
parent
7cd83031a1
commit
e067e67923
16 changed files with 160 additions and 160 deletions
|
@ -44,7 +44,7 @@
|
||||||
#include "gsttheoradec.h"
|
#include "gsttheoradec.h"
|
||||||
#include <gst/tag/tag.h>
|
#include <gst/tag/tag.h>
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
#include <gst/video/gstmetavideo.h>
|
#include <gst/video/gstvideometa.h>
|
||||||
#include <gst/video/gstvideopool.h>
|
#include <gst/video/gstvideopool.h>
|
||||||
|
|
||||||
#define GST_CAT_DEFAULT theoradec_debug
|
#define GST_CAT_DEFAULT theoradec_debug
|
||||||
|
@ -830,11 +830,11 @@ theora_negotiate_pool (GstTheoraDec * dec, GstCaps * caps, GstVideoInfo * info)
|
||||||
/* just set the option, if the pool can support it we will transparently use
|
/* just set the option, if the pool can support it we will transparently use
|
||||||
* it through the video info API. We could also see if the pool support this
|
* it through the video info API. We could also see if the pool support this
|
||||||
* option and only activate it then. */
|
* option and only activate it then. */
|
||||||
gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_META_VIDEO);
|
gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META);
|
||||||
|
|
||||||
/* check if downstream supports cropping */
|
/* check if downstream supports cropping */
|
||||||
dec->use_cropping =
|
dec->use_cropping =
|
||||||
gst_query_has_allocation_meta (query, GST_META_API_VIDEO_CROP);
|
gst_query_has_allocation_meta (query, GST_VIDEO_CROP_META_API);
|
||||||
|
|
||||||
gst_buffer_pool_set_config (pool, config);
|
gst_buffer_pool_set_config (pool, config);
|
||||||
/* and activate */
|
/* and activate */
|
||||||
|
@ -1132,7 +1132,7 @@ theora_handle_image (GstTheoraDec * dec, th_ycbcr_buffer buf, GstBuffer ** out)
|
||||||
int i, comp;
|
int i, comp;
|
||||||
guint8 *dest, *src;
|
guint8 *dest, *src;
|
||||||
GstVideoFrame frame;
|
GstVideoFrame frame;
|
||||||
GstMetaVideoCrop *crop;
|
GstVideoCropMeta *crop;
|
||||||
gint offset_x, offset_y;
|
gint offset_x, offset_y;
|
||||||
|
|
||||||
if (gst_pad_check_reconfigure (dec->srcpad)) {
|
if (gst_pad_check_reconfigure (dec->srcpad)) {
|
||||||
|
@ -1171,7 +1171,7 @@ theora_handle_image (GstTheoraDec * dec, th_ycbcr_buffer buf, GstBuffer ** out)
|
||||||
pic_height = dec->info.frame_height;
|
pic_height = dec->info.frame_height;
|
||||||
|
|
||||||
if (dec->use_cropping) {
|
if (dec->use_cropping) {
|
||||||
crop = gst_buffer_add_meta_video_crop (*out);
|
crop = gst_buffer_add_video_crop_meta (*out);
|
||||||
/* we can do things slightly more efficient when we know that
|
/* we can do things slightly more efficient when we know that
|
||||||
* downstream understands clipping */
|
* downstream understands clipping */
|
||||||
crop->x = dec->info.pic_x;
|
crop->x = dec->info.pic_x;
|
||||||
|
|
|
@ -13,12 +13,12 @@ lib_LTLIBRARIES = libgstvideo-@GST_MAJORMINOR@.la
|
||||||
CLEANFILES = $(BUILT_SOURCES)
|
CLEANFILES = $(BUILT_SOURCES)
|
||||||
|
|
||||||
libgstvideo_@GST_MAJORMINOR@_la_SOURCES = \
|
libgstvideo_@GST_MAJORMINOR@_la_SOURCES = \
|
||||||
video.c gstvideosink.c gstvideofilter.c convertframe.c gstmetavideo.c gstvideopool.c
|
video.c gstvideosink.c gstvideofilter.c convertframe.c gstvideometa.c gstvideopool.c
|
||||||
nodist_libgstvideo_@GST_MAJORMINOR@_la_SOURCES = $(BUILT_SOURCES)
|
nodist_libgstvideo_@GST_MAJORMINOR@_la_SOURCES = $(BUILT_SOURCES)
|
||||||
|
|
||||||
libgstvideo_@GST_MAJORMINOR@includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/video
|
libgstvideo_@GST_MAJORMINOR@includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/video
|
||||||
libgstvideo_@GST_MAJORMINOR@include_HEADERS = \
|
libgstvideo_@GST_MAJORMINOR@include_HEADERS = \
|
||||||
video.h gstvideosink.h gstvideofilter.h gstmetavideo.h gstvideopool.h
|
video.h gstvideosink.h gstvideofilter.h gstvideometa.h gstvideopool.h
|
||||||
nodist_libgstvideo_@GST_MAJORMINOR@include_HEADERS = $(built_headers)
|
nodist_libgstvideo_@GST_MAJORMINOR@include_HEADERS = $(built_headers)
|
||||||
|
|
||||||
libgstvideo_@GST_MAJORMINOR@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
|
libgstvideo_@GST_MAJORMINOR@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
|
||||||
|
|
|
@ -17,47 +17,47 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gstmetavideo.h"
|
#include "gstvideometa.h"
|
||||||
|
|
||||||
/* video metadata */
|
/* video metadata */
|
||||||
const GstMetaInfo *
|
const GstMetaInfo *
|
||||||
gst_meta_video_get_info (void)
|
gst_video_meta_get_info (void)
|
||||||
{
|
{
|
||||||
static const GstMetaInfo *meta_video_info = NULL;
|
static const GstMetaInfo *video_meta_info = NULL;
|
||||||
|
|
||||||
if (meta_video_info == NULL) {
|
if (video_meta_info == NULL) {
|
||||||
meta_video_info = gst_meta_register (GST_META_API_VIDEO, "GstMetaVideo",
|
video_meta_info = gst_meta_register (GST_VIDEO_META_API, "GstVideoMeta",
|
||||||
sizeof (GstMetaVideo),
|
sizeof (GstVideoMeta),
|
||||||
(GstMetaInitFunction) NULL,
|
(GstMetaInitFunction) NULL,
|
||||||
(GstMetaFreeFunction) NULL,
|
(GstMetaFreeFunction) NULL,
|
||||||
(GstMetaCopyFunction) NULL, (GstMetaTransformFunction) NULL);
|
(GstMetaCopyFunction) NULL, (GstMetaTransformFunction) NULL);
|
||||||
}
|
}
|
||||||
return meta_video_info;
|
return video_meta_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_buffer_get_meta_video_id:
|
* gst_buffer_get_video_meta_id:
|
||||||
* @buffer: a #GstBuffer
|
* @buffer: a #GstBuffer
|
||||||
* @id: a metadata id
|
* @id: a metadata id
|
||||||
*
|
*
|
||||||
* Find the #GstMetaVideo on @buffer with the given @id.
|
* Find the #GstVideoMeta on @buffer with the given @id.
|
||||||
*
|
*
|
||||||
* Buffers can contain multiple #GstMetaVideo metadata items when dealing with
|
* Buffers can contain multiple #GstVideoMeta metadata items when dealing with
|
||||||
* multiview buffers.
|
* multiview buffers.
|
||||||
*
|
*
|
||||||
* Returns: the #GstMetaVideo with @id or %NULL when there is no such metadata
|
* Returns: the #GstVideoMeta with @id or %NULL when there is no such metadata
|
||||||
* on @buffer.
|
* on @buffer.
|
||||||
*/
|
*/
|
||||||
GstMetaVideo *
|
GstVideoMeta *
|
||||||
gst_buffer_get_meta_video_id (GstBuffer * buffer, gint id)
|
gst_buffer_get_video_meta_id (GstBuffer * buffer, gint id)
|
||||||
{
|
{
|
||||||
gpointer state = NULL;
|
gpointer state = NULL;
|
||||||
GstMeta *meta;
|
GstMeta *meta;
|
||||||
const GstMetaInfo *info = GST_META_INFO_VIDEO;
|
const GstMetaInfo *info = GST_VIDEO_META_INFO;
|
||||||
|
|
||||||
while ((meta = gst_buffer_iterate_meta (buffer, &state))) {
|
while ((meta = gst_buffer_iterate_meta (buffer, &state))) {
|
||||||
if (meta->info->api == info->api) {
|
if (meta->info->api == info->api) {
|
||||||
GstMetaVideo *vmeta = (GstMetaVideo *) meta;
|
GstVideoMeta *vmeta = (GstVideoMeta *) meta;
|
||||||
if (vmeta->id == id)
|
if (vmeta->id == id)
|
||||||
return vmeta;
|
return vmeta;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ gst_buffer_get_meta_video_id (GstBuffer * buffer, gint id)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_buffer_add_meta_video:
|
* gst_buffer_add_video_meta:
|
||||||
* @buffer: a #GstBuffer
|
* @buffer: a #GstBuffer
|
||||||
* @flags: #GstVideoFlags
|
* @flags: #GstVideoFlags
|
||||||
* @format: a #GstVideoFormat
|
* @format: a #GstVideoFormat
|
||||||
|
@ -77,27 +77,27 @@ gst_buffer_get_meta_video_id (GstBuffer * buffer, gint id)
|
||||||
* default offsets and strides for @format and @width x @height.
|
* default offsets and strides for @format and @width x @height.
|
||||||
*
|
*
|
||||||
* This function calculates the default offsets and strides and then calls
|
* This function calculates the default offsets and strides and then calls
|
||||||
* gst_buffer_add_meta_video_full() with them.
|
* gst_buffer_add_video_meta_full() with them.
|
||||||
*
|
*
|
||||||
* Returns: the #GstMetaVideo on @buffer.
|
* Returns: the #GstVideoMeta on @buffer.
|
||||||
*/
|
*/
|
||||||
GstMetaVideo *
|
GstVideoMeta *
|
||||||
gst_buffer_add_meta_video (GstBuffer * buffer, GstVideoFlags flags,
|
gst_buffer_add_video_meta (GstBuffer * buffer, GstVideoFlags flags,
|
||||||
GstVideoFormat format, guint width, guint height)
|
GstVideoFormat format, guint width, guint height)
|
||||||
{
|
{
|
||||||
GstMetaVideo *meta;
|
GstVideoMeta *meta;
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
|
|
||||||
gst_video_info_set_format (&info, format, width, height);
|
gst_video_info_set_format (&info, format, width, height);
|
||||||
|
|
||||||
meta = gst_buffer_add_meta_video_full (buffer, flags, format, width, height,
|
meta = gst_buffer_add_video_meta_full (buffer, flags, format, width, height,
|
||||||
info.finfo->n_planes, info.offset, info.stride);
|
info.finfo->n_planes, info.offset, info.stride);
|
||||||
|
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_buffer_add_meta_video_full:
|
* gst_buffer_add_video_meta_full:
|
||||||
* @buffer: a #GstBuffer
|
* @buffer: a #GstBuffer
|
||||||
* @flags: #GstVideoFlags
|
* @flags: #GstVideoFlags
|
||||||
* @format: a #GstVideoFormat
|
* @format: a #GstVideoFormat
|
||||||
|
@ -109,19 +109,19 @@ gst_buffer_add_meta_video (GstBuffer * buffer, GstVideoFlags flags,
|
||||||
*
|
*
|
||||||
* Attaches GstVideoMeta metadata to @buffer with the given parameters.
|
* Attaches GstVideoMeta metadata to @buffer with the given parameters.
|
||||||
*
|
*
|
||||||
* Returns: the #GstMetaVideo on @buffer.
|
* Returns: the #GstVideoMeta on @buffer.
|
||||||
*/
|
*/
|
||||||
GstMetaVideo *
|
GstVideoMeta *
|
||||||
gst_buffer_add_meta_video_full (GstBuffer * buffer, GstVideoFlags flags,
|
gst_buffer_add_video_meta_full (GstBuffer * buffer, GstVideoFlags flags,
|
||||||
GstVideoFormat format, guint width, guint height,
|
GstVideoFormat format, guint width, guint height,
|
||||||
guint n_planes, gsize offset[GST_VIDEO_MAX_PLANES],
|
guint n_planes, gsize offset[GST_VIDEO_MAX_PLANES],
|
||||||
gint stride[GST_VIDEO_MAX_PLANES])
|
gint stride[GST_VIDEO_MAX_PLANES])
|
||||||
{
|
{
|
||||||
GstMetaVideo *meta;
|
GstVideoMeta *meta;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
meta =
|
meta =
|
||||||
(GstMetaVideo *) gst_buffer_add_meta (buffer, GST_META_INFO_VIDEO, NULL);
|
(GstVideoMeta *) gst_buffer_add_meta (buffer, GST_VIDEO_META_INFO, NULL);
|
||||||
|
|
||||||
meta->flags = flags;
|
meta->flags = flags;
|
||||||
meta->format = format;
|
meta->format = format;
|
||||||
|
@ -162,7 +162,7 @@ find_mem_for_offset (GstBuffer * buffer, guint * offset, GstMapFlags flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_meta_video_map:
|
* gst_video_meta_map:
|
||||||
* @meta: a #GstVideoMeta
|
* @meta: a #GstVideoMeta
|
||||||
* @plane: a plane
|
* @plane: a plane
|
||||||
* @stride: result stride
|
* @stride: result stride
|
||||||
|
@ -174,7 +174,7 @@ find_mem_for_offset (GstBuffer * buffer, guint * offset, GstMapFlags flags)
|
||||||
* Returns: a pointer to the first byte of the plane data
|
* Returns: a pointer to the first byte of the plane data
|
||||||
*/
|
*/
|
||||||
gpointer
|
gpointer
|
||||||
gst_meta_video_map (GstMetaVideo * meta, guint plane, gint * stride,
|
gst_video_meta_map (GstVideoMeta * meta, guint plane, gint * stride,
|
||||||
GstMapFlags flags)
|
GstMapFlags flags)
|
||||||
{
|
{
|
||||||
guint offset;
|
guint offset;
|
||||||
|
@ -206,7 +206,7 @@ gst_meta_video_map (GstMetaVideo * meta, guint plane, gint * stride,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_meta_video_unmap:
|
* gst_video_meta_unmap:
|
||||||
* @meta: a #GstVideoMeta
|
* @meta: a #GstVideoMeta
|
||||||
* @plane: a plane
|
* @plane: a plane
|
||||||
* @data: the data to unmap
|
* @data: the data to unmap
|
||||||
|
@ -216,7 +216,7 @@ gst_meta_video_map (GstMetaVideo * meta, guint plane, gint * stride,
|
||||||
* Returns: TRUE if the memory was successfully unmapped.
|
* Returns: TRUE if the memory was successfully unmapped.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gst_meta_video_unmap (GstMetaVideo * meta, guint plane, gpointer data)
|
gst_video_meta_unmap (GstVideoMeta * meta, guint plane, gpointer data)
|
||||||
{
|
{
|
||||||
guint offset;
|
guint offset;
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
|
@ -239,16 +239,16 @@ gst_meta_video_unmap (GstMetaVideo * meta, guint plane, gpointer data)
|
||||||
}
|
}
|
||||||
|
|
||||||
const GstMetaInfo *
|
const GstMetaInfo *
|
||||||
gst_meta_video_crop_get_info (void)
|
gst_video_crop_meta_get_info (void)
|
||||||
{
|
{
|
||||||
static const GstMetaInfo *meta_video_crop_info = NULL;
|
static const GstMetaInfo *video_crop_meta_info = NULL;
|
||||||
|
|
||||||
if (meta_video_crop_info == NULL) {
|
if (video_crop_meta_info == NULL) {
|
||||||
meta_video_crop_info =
|
video_crop_meta_info =
|
||||||
gst_meta_register (GST_META_API_VIDEO_CROP, "GstMetaVideoCrop",
|
gst_meta_register (GST_VIDEO_CROP_META_API, "GstVideoCropMeta",
|
||||||
sizeof (GstMetaVideoCrop), (GstMetaInitFunction) NULL,
|
sizeof (GstVideoCropMeta), (GstMetaInitFunction) NULL,
|
||||||
(GstMetaFreeFunction) NULL, (GstMetaCopyFunction) NULL,
|
(GstMetaFreeFunction) NULL, (GstMetaCopyFunction) NULL,
|
||||||
(GstMetaTransformFunction) NULL);
|
(GstMetaTransformFunction) NULL);
|
||||||
}
|
}
|
||||||
return meta_video_crop_info;
|
return video_crop_meta_info;
|
||||||
}
|
}
|
|
@ -17,8 +17,8 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __GST_META_VIDEO_H__
|
#ifndef __GST_VIDEO_META_H__
|
||||||
#define __GST_META_VIDEO_H__
|
#define __GST_VIDEO_META_H__
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
@ -26,16 +26,16 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define GST_META_API_VIDEO "GstMetaVideo"
|
#define GST_VIDEO_META_API "GstVideoMeta"
|
||||||
#define GST_META_INFO_VIDEO (gst_meta_video_get_info())
|
#define GST_VIDEO_META_INFO (gst_video_meta_get_info())
|
||||||
typedef struct _GstMetaVideo GstMetaVideo;
|
typedef struct _GstVideoMeta GstVideoMeta;
|
||||||
|
|
||||||
#define GST_META_API_VIDEO_CROP "GstMetaVideoCrop"
|
#define GST_VIDEO_CROP_META_API "GstVideoCropMeta"
|
||||||
#define GST_META_INFO_VIDEO_CROP (gst_meta_video_crop_get_info())
|
#define GST_VIDEO_CROP_META_INFO (gst_video_crop_meta_get_info())
|
||||||
typedef struct _GstMetaVideoCrop GstMetaVideoCrop;
|
typedef struct _GstVideoCropMeta GstVideoCropMeta;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstMetaVideo:
|
* GstVideoMeta:
|
||||||
* @meta: parent #GstMeta
|
* @meta: parent #GstMeta
|
||||||
* @buffer: the buffer this metadata belongs to
|
* @buffer: the buffer this metadata belongs to
|
||||||
* @flags: additional video flags
|
* @flags: additional video flags
|
||||||
|
@ -51,7 +51,7 @@ typedef struct _GstMetaVideoCrop GstMetaVideoCrop;
|
||||||
*
|
*
|
||||||
* Extra buffer metadata describing image properties
|
* Extra buffer metadata describing image properties
|
||||||
*/
|
*/
|
||||||
struct _GstMetaVideo {
|
struct _GstVideoMeta {
|
||||||
GstMeta meta;
|
GstMeta meta;
|
||||||
|
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
|
@ -66,29 +66,29 @@ struct _GstMetaVideo {
|
||||||
gsize offset[GST_VIDEO_MAX_PLANES];
|
gsize offset[GST_VIDEO_MAX_PLANES];
|
||||||
gint stride[GST_VIDEO_MAX_PLANES];
|
gint stride[GST_VIDEO_MAX_PLANES];
|
||||||
|
|
||||||
gpointer (*map) (GstMetaVideo *meta, guint plane, gint *stride,
|
gpointer (*map) (GstVideoMeta *meta, guint plane, gint *stride,
|
||||||
GstMapFlags flags);
|
GstMapFlags flags);
|
||||||
gboolean (*unmap) (GstMetaVideo *meta, guint plane, gpointer data);
|
gboolean (*unmap) (GstVideoMeta *meta, guint plane, gpointer data);
|
||||||
};
|
};
|
||||||
|
|
||||||
const GstMetaInfo * gst_meta_video_get_info (void);
|
const GstMetaInfo * gst_video_meta_get_info (void);
|
||||||
|
|
||||||
#define gst_buffer_get_meta_video(b) ((GstMetaVideo*)gst_buffer_get_meta((b),GST_META_INFO_VIDEO))
|
#define gst_buffer_get_video_meta(b) ((GstVideoMeta*)gst_buffer_get_meta((b),GST_VIDEO_META_INFO))
|
||||||
GstMetaVideo * gst_buffer_get_meta_video_id (GstBuffer *buffer, gint id);
|
GstVideoMeta * gst_buffer_get_video_meta_id (GstBuffer *buffer, gint id);
|
||||||
|
|
||||||
GstMetaVideo * gst_buffer_add_meta_video (GstBuffer *buffer, GstVideoFlags flags,
|
GstVideoMeta * gst_buffer_add_video_meta (GstBuffer *buffer, GstVideoFlags flags,
|
||||||
GstVideoFormat format, guint width, guint height);
|
GstVideoFormat format, guint width, guint height);
|
||||||
GstMetaVideo * gst_buffer_add_meta_video_full (GstBuffer *buffer, GstVideoFlags flags,
|
GstVideoMeta * gst_buffer_add_video_meta_full (GstBuffer *buffer, GstVideoFlags flags,
|
||||||
GstVideoFormat format, guint width, guint height,
|
GstVideoFormat format, guint width, guint height,
|
||||||
guint n_planes, gsize offset[GST_VIDEO_MAX_PLANES],
|
guint n_planes, gsize offset[GST_VIDEO_MAX_PLANES],
|
||||||
gint stride[GST_VIDEO_MAX_PLANES]);
|
gint stride[GST_VIDEO_MAX_PLANES]);
|
||||||
|
|
||||||
gpointer gst_meta_video_map (GstMetaVideo *meta, guint plane, gint *stride,
|
gpointer gst_video_meta_map (GstVideoMeta *meta, guint plane, gint *stride,
|
||||||
GstMapFlags flags);
|
GstMapFlags flags);
|
||||||
gboolean gst_meta_video_unmap (GstMetaVideo *meta, guint plane, gpointer data);
|
gboolean gst_video_meta_unmap (GstVideoMeta *meta, guint plane, gpointer data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstMetaVideoCrop:
|
* GstVideoCropMeta:
|
||||||
* @meta: parent #GstMeta
|
* @meta: parent #GstMeta
|
||||||
* @x: the horizontal offset
|
* @x: the horizontal offset
|
||||||
* @y: the vertical offset
|
* @y: the vertical offset
|
||||||
|
@ -97,7 +97,7 @@ gboolean gst_meta_video_unmap (GstMetaVideo *meta, guint plane, gpoin
|
||||||
*
|
*
|
||||||
* Extra buffer metadata describing image cropping.
|
* Extra buffer metadata describing image cropping.
|
||||||
*/
|
*/
|
||||||
struct _GstMetaVideoCrop {
|
struct _GstVideoCropMeta {
|
||||||
GstMeta meta;
|
GstMeta meta;
|
||||||
|
|
||||||
guint x;
|
guint x;
|
||||||
|
@ -106,11 +106,11 @@ struct _GstMetaVideoCrop {
|
||||||
guint height;
|
guint height;
|
||||||
};
|
};
|
||||||
|
|
||||||
const GstMetaInfo * gst_meta_video_crop_get_info (void);
|
const GstMetaInfo * gst_video_crop_meta_get_info (void);
|
||||||
|
|
||||||
#define gst_buffer_get_meta_video_crop(b) ((GstMetaVideoCrop*)gst_buffer_get_meta((b),GST_META_INFO_VIDEO_CROP))
|
#define gst_buffer_get_video_crop_meta(b) ((GstVideoCropMeta*)gst_buffer_get_meta((b),GST_VIDEO_CROP_META_INFO))
|
||||||
#define gst_buffer_add_meta_video_crop(b) ((GstMetaVideoCrop*)gst_buffer_add_meta((b),GST_META_INFO_VIDEO_CROP, NULL))
|
#define gst_buffer_add_video_crop_meta(b) ((GstVideoCropMeta*)gst_buffer_add_meta((b),GST_VIDEO_CROP_META_INFO, NULL))
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GST_META_VIDEO_H__ */
|
#endif /* __GST_VIDEO_META_H__ */
|
|
@ -27,12 +27,12 @@
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GST_BUFFER_POOL_OPTION_META_VIDEO:
|
* GST_BUFFER_POOL_OPTION_VIDEO_META:
|
||||||
*
|
*
|
||||||
* An option that can be activated on bufferpool to request video metadata
|
* An option that can be activated on bufferpool to request video metadata
|
||||||
* on buffers from the pool.
|
* on buffers from the pool.
|
||||||
*/
|
*/
|
||||||
#define GST_BUFFER_POOL_OPTION_META_VIDEO "GstBufferPoolOptionMetaVideo"
|
#define GST_BUFFER_POOL_OPTION_VIDEO_META "GstBufferPoolOptionVideoMeta"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GST_BUFFER_POOL_OPTION_VIDEO_LAYOUT:
|
* GST_BUFFER_POOL_OPTION_VIDEO_LAYOUT:
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "gstmetavideo.h"
|
#include "gstvideometa.h"
|
||||||
|
|
||||||
static int fill_planes (GstVideoInfo * info);
|
static int fill_planes (GstVideoInfo * info);
|
||||||
|
|
||||||
|
@ -944,7 +944,7 @@ gst_video_info_to_caps (GstVideoInfo * info)
|
||||||
* information of frame @id.
|
* information of frame @id.
|
||||||
*
|
*
|
||||||
* When @id is -1, the default frame is mapped. When @id != -1, this function
|
* When @id is -1, the default frame is mapped. When @id != -1, this function
|
||||||
* will return %FALSE when there is no GstMetaVideo with that id.
|
* will return %FALSE when there is no GstVideoMeta with that id.
|
||||||
*
|
*
|
||||||
* All video planes of @buffer will be mapped and the pointers will be set in
|
* All video planes of @buffer will be mapped and the pointers will be set in
|
||||||
* @frame->data.
|
* @frame->data.
|
||||||
|
@ -955,7 +955,7 @@ gboolean
|
||||||
gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info,
|
gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info,
|
||||||
GstBuffer * buffer, gint id, GstMapFlags flags)
|
GstBuffer * buffer, gint id, GstMapFlags flags)
|
||||||
{
|
{
|
||||||
GstMetaVideo *meta;
|
GstVideoMeta *meta;
|
||||||
guint8 *data;
|
guint8 *data;
|
||||||
gsize size;
|
gsize size;
|
||||||
gint i;
|
gint i;
|
||||||
|
@ -965,9 +965,9 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info,
|
||||||
g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE);
|
g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE);
|
||||||
|
|
||||||
if (id == -1)
|
if (id == -1)
|
||||||
meta = gst_buffer_get_meta_video (buffer);
|
meta = gst_buffer_get_video_meta (buffer);
|
||||||
else
|
else
|
||||||
meta = gst_buffer_get_meta_video_id (buffer, id);
|
meta = gst_buffer_get_video_meta_id (buffer, id);
|
||||||
|
|
||||||
frame->buffer = buffer;
|
frame->buffer = buffer;
|
||||||
frame->meta = meta;
|
frame->meta = meta;
|
||||||
|
@ -981,7 +981,7 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info,
|
||||||
|
|
||||||
for (i = 0; i < info->finfo->n_planes; i++) {
|
for (i = 0; i < info->finfo->n_planes; i++) {
|
||||||
frame->data[i] =
|
frame->data[i] =
|
||||||
gst_meta_video_map (meta, i, &frame->info.stride[i], flags);
|
gst_video_meta_map (meta, i, &frame->info.stride[i], flags);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* no metadata, we really need to have the metadata when the id is
|
/* no metadata, we really need to have the metadata when the id is
|
||||||
|
@ -1009,7 +1009,7 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info,
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
no_metadata:
|
no_metadata:
|
||||||
{
|
{
|
||||||
GST_ERROR ("no GstMetaVideo for id", id);
|
GST_ERROR ("no GstVideoMeta for id", id);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
invalid_size:
|
invalid_size:
|
||||||
|
@ -1052,7 +1052,7 @@ void
|
||||||
gst_video_frame_unmap (GstVideoFrame * frame)
|
gst_video_frame_unmap (GstVideoFrame * frame)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstMetaVideo *meta;
|
GstVideoMeta *meta;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
g_return_if_fail (frame != NULL);
|
g_return_if_fail (frame != NULL);
|
||||||
|
@ -1062,7 +1062,7 @@ gst_video_frame_unmap (GstVideoFrame * frame)
|
||||||
|
|
||||||
if (meta) {
|
if (meta) {
|
||||||
for (i = 0; i < frame->info.finfo->n_planes; i++) {
|
for (i = 0; i < frame->info.finfo->n_planes; i++) {
|
||||||
gst_meta_video_unmap (meta, i, frame->data[i]);
|
gst_video_meta_unmap (meta, i, frame->data[i]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
guint8 *data;
|
guint8 *data;
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
#include "gstvideoconvert.h"
|
#include "gstvideoconvert.h"
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
#include <gst/video/gstmetavideo.h>
|
#include <gst/video/gstvideometa.h>
|
||||||
#include <gst/video/gstvideopool.h>
|
#include <gst/video/gstvideopool.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -174,7 +174,7 @@ gst_video_convert_decide_allocation (GstBaseTransform * trans, GstQuery * query)
|
||||||
|
|
||||||
config = gst_buffer_pool_get_config (pool);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
gst_buffer_pool_config_add_option (config,
|
gst_buffer_pool_config_add_option (config,
|
||||||
GST_BUFFER_POOL_OPTION_META_VIDEO);
|
GST_BUFFER_POOL_OPTION_VIDEO_META);
|
||||||
gst_buffer_pool_set_config (pool, config);
|
gst_buffer_pool_set_config (pool, config);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <gst/video/gstmetavideo.h>
|
#include <gst/video/gstvideometa.h>
|
||||||
#include <gst/video/gstvideopool.h>
|
#include <gst/video/gstvideopool.h>
|
||||||
|
|
||||||
#include "gstvideoscale.h"
|
#include "gstvideoscale.h"
|
||||||
|
@ -461,7 +461,7 @@ gst_video_scale_decide_allocation (GstBaseTransform * trans, GstQuery * query)
|
||||||
|
|
||||||
config = gst_buffer_pool_get_config (pool);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
gst_buffer_pool_config_add_option (config,
|
gst_buffer_pool_config_add_option (config,
|
||||||
GST_BUFFER_POOL_OPTION_META_VIDEO);
|
GST_BUFFER_POOL_OPTION_VIDEO_META);
|
||||||
gst_buffer_pool_set_config (pool, config);
|
gst_buffer_pool_set_config (pool, config);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -620,7 +620,7 @@ gst_video_test_src_decide_allocation (GstBaseSrc * bsrc, GstQuery * query)
|
||||||
|
|
||||||
config = gst_buffer_pool_get_config (pool);
|
config = gst_buffer_pool_get_config (pool);
|
||||||
gst_buffer_pool_config_add_option (config,
|
gst_buffer_pool_config_add_option (config,
|
||||||
GST_BUFFER_POOL_OPTION_META_VIDEO);
|
GST_BUFFER_POOL_OPTION_VIDEO_META);
|
||||||
gst_buffer_pool_set_config (pool, config);
|
gst_buffer_pool_set_config (pool, config);
|
||||||
}
|
}
|
||||||
gst_query_set_allocation_params (query, size, min, max, prefix,
|
gst_query_set_allocation_params (query, size, min, max, prefix,
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/base/gstpushsrc.h>
|
#include <gst/base/gstpushsrc.h>
|
||||||
|
|
||||||
#include <gst/video/gstmetavideo.h>
|
#include <gst/video/gstvideometa.h>
|
||||||
#include <gst/video/gstvideopool.h>
|
#include <gst/video/gstvideopool.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
/* Helper functions */
|
/* Helper functions */
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
#include <gst/video/gstmetavideo.h>
|
#include <gst/video/gstvideometa.h>
|
||||||
#include <gst/video/gstvideopool.h>
|
#include <gst/video/gstvideopool.h>
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_debug_ximagepool);
|
GST_DEBUG_CATEGORY_EXTERN (gst_debug_ximagepool);
|
||||||
|
@ -46,22 +46,22 @@ struct _GstXImageBufferPoolPrivate
|
||||||
gboolean need_alignment;
|
gboolean need_alignment;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void gst_meta_ximage_free (GstMetaXImage * meta, GstBuffer * buffer);
|
static void gst_ximage_meta_free (GstXImageMeta * meta, GstBuffer * buffer);
|
||||||
|
|
||||||
/* ximage metadata */
|
/* ximage metadata */
|
||||||
const GstMetaInfo *
|
const GstMetaInfo *
|
||||||
gst_meta_ximage_get_info (void)
|
gst_ximage_meta_get_info (void)
|
||||||
{
|
{
|
||||||
static const GstMetaInfo *meta_ximage_info = NULL;
|
static const GstMetaInfo *ximage_meta_info = NULL;
|
||||||
|
|
||||||
if (meta_ximage_info == NULL) {
|
if (ximage_meta_info == NULL) {
|
||||||
meta_ximage_info = gst_meta_register ("GstMetaXImage", "GstMetaXImage",
|
ximage_meta_info = gst_meta_register ("GstXImageMeta", "GstXImageMeta",
|
||||||
sizeof (GstMetaXImage),
|
sizeof (GstXImageMeta),
|
||||||
(GstMetaInitFunction) NULL,
|
(GstMetaInitFunction) NULL,
|
||||||
(GstMetaFreeFunction) gst_meta_ximage_free,
|
(GstMetaFreeFunction) gst_ximage_meta_free,
|
||||||
(GstMetaCopyFunction) NULL, (GstMetaTransformFunction) NULL);
|
(GstMetaCopyFunction) NULL, (GstMetaTransformFunction) NULL);
|
||||||
}
|
}
|
||||||
return meta_ximage_info;
|
return ximage_meta_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* X11 stuff */
|
/* X11 stuff */
|
||||||
|
@ -78,14 +78,14 @@ gst_ximagesink_handle_xerror (Display * display, XErrorEvent * xevent)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstMetaXImage *
|
static GstXImageMeta *
|
||||||
gst_buffer_add_meta_ximage (GstBuffer * buffer, GstXImageBufferPool * xpool)
|
gst_buffer_add_ximage_meta (GstBuffer * buffer, GstXImageBufferPool * xpool)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
int (*handler) (Display *, XErrorEvent *);
|
int (*handler) (Display *, XErrorEvent *);
|
||||||
gboolean success = FALSE;
|
gboolean success = FALSE;
|
||||||
GstXContext *xcontext;
|
GstXContext *xcontext;
|
||||||
GstMetaXImage *meta;
|
GstXImageMeta *meta;
|
||||||
gint width, height;
|
gint width, height;
|
||||||
GstXImageBufferPoolPrivate *priv;
|
GstXImageBufferPoolPrivate *priv;
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ gst_buffer_add_meta_ximage (GstBuffer * buffer, GstXImageBufferPool * xpool)
|
||||||
height = priv->padded_height;
|
height = priv->padded_height;
|
||||||
|
|
||||||
meta =
|
meta =
|
||||||
(GstMetaXImage *) gst_buffer_add_meta (buffer, GST_META_INFO_XIMAGE,
|
(GstXImageMeta *) gst_buffer_add_meta (buffer, GST_XIMAGE_META_INFO,
|
||||||
NULL);
|
NULL);
|
||||||
#ifdef HAVE_XSHM
|
#ifdef HAVE_XSHM
|
||||||
meta->SHMInfo.shmaddr = ((void *) -1);
|
meta->SHMInfo.shmaddr = ((void *) -1);
|
||||||
|
@ -279,7 +279,7 @@ xattach_failed:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_meta_ximage_free (GstMetaXImage * meta, GstBuffer * buffer)
|
gst_ximage_meta_free (GstXImageMeta * meta, GstBuffer * buffer)
|
||||||
{
|
{
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
|
|
||||||
|
@ -454,7 +454,7 @@ G_DEFINE_TYPE (GstXImageBufferPool, gst_ximage_buffer_pool,
|
||||||
static const gchar **
|
static const gchar **
|
||||||
ximage_buffer_pool_get_options (GstBufferPool * pool)
|
ximage_buffer_pool_get_options (GstBufferPool * pool)
|
||||||
{
|
{
|
||||||
static const gchar *options[] = { GST_BUFFER_POOL_OPTION_META_VIDEO,
|
static const gchar *options[] = { GST_BUFFER_POOL_OPTION_VIDEO_META,
|
||||||
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT, NULL
|
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT, NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ ximage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
|
||||||
/* check for the configured metadata */
|
/* check for the configured metadata */
|
||||||
priv->add_metavideo =
|
priv->add_metavideo =
|
||||||
gst_buffer_pool_config_has_option (config,
|
gst_buffer_pool_config_has_option (config,
|
||||||
GST_BUFFER_POOL_OPTION_META_VIDEO);
|
GST_BUFFER_POOL_OPTION_VIDEO_META);
|
||||||
|
|
||||||
/* parse extra alignment info */
|
/* parse extra alignment info */
|
||||||
priv->need_alignment = gst_buffer_pool_config_has_option (config,
|
priv->need_alignment = gst_buffer_pool_config_has_option (config,
|
||||||
|
@ -547,22 +547,22 @@ ximage_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
|
||||||
GstXImageBufferPoolPrivate *priv = xpool->priv;
|
GstXImageBufferPoolPrivate *priv = xpool->priv;
|
||||||
GstVideoInfo *info;
|
GstVideoInfo *info;
|
||||||
GstBuffer *ximage;
|
GstBuffer *ximage;
|
||||||
GstMetaXImage *meta;
|
GstXImageMeta *meta;
|
||||||
|
|
||||||
info = &priv->info;
|
info = &priv->info;
|
||||||
|
|
||||||
ximage = gst_buffer_new ();
|
ximage = gst_buffer_new ();
|
||||||
meta = gst_buffer_add_meta_ximage (ximage, xpool);
|
meta = gst_buffer_add_ximage_meta (ximage, xpool);
|
||||||
if (meta == NULL) {
|
if (meta == NULL) {
|
||||||
gst_buffer_unref (ximage);
|
gst_buffer_unref (ximage);
|
||||||
goto no_buffer;
|
goto no_buffer;
|
||||||
}
|
}
|
||||||
if (priv->add_metavideo) {
|
if (priv->add_metavideo) {
|
||||||
GstMetaVideo *meta;
|
GstVideoMeta *meta;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (pool, "adding GstMetaVideo");
|
GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
|
||||||
/* these are just the defaults for now */
|
/* these are just the defaults for now */
|
||||||
meta = gst_buffer_add_meta_video (ximage, 0, GST_VIDEO_INFO_FORMAT (info),
|
meta = gst_buffer_add_video_meta (ximage, 0, GST_VIDEO_INFO_FORMAT (info),
|
||||||
priv->padded_width, priv->padded_height);
|
priv->padded_width, priv->padded_height);
|
||||||
|
|
||||||
if (priv->need_alignment) {
|
if (priv->need_alignment) {
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
typedef struct _GstMetaXImage GstMetaXImage;
|
typedef struct _GstXImageMeta GstXImageMeta;
|
||||||
|
|
||||||
typedef struct _GstXImageBufferPool GstXImageBufferPool;
|
typedef struct _GstXImageBufferPool GstXImageBufferPool;
|
||||||
typedef struct _GstXImageBufferPoolClass GstXImageBufferPoolClass;
|
typedef struct _GstXImageBufferPoolClass GstXImageBufferPoolClass;
|
||||||
|
@ -47,13 +47,13 @@ typedef struct _GstXImageBufferPoolPrivate GstXImageBufferPoolPrivate;
|
||||||
|
|
||||||
#include "ximagesink.h"
|
#include "ximagesink.h"
|
||||||
|
|
||||||
const GstMetaInfo * gst_meta_ximage_get_info (void);
|
const GstMetaInfo * gst_ximage_meta_get_info (void);
|
||||||
#define GST_META_INFO_XIMAGE (gst_meta_ximage_get_info())
|
#define GST_XIMAGE_META_INFO (gst_ximage_meta_get_info())
|
||||||
|
|
||||||
#define gst_buffer_get_meta_ximage(b) ((GstMetaXImage*)gst_buffer_get_meta((b),GST_META_INFO_XIMAGE))
|
#define gst_buffer_get_ximage_meta(b) ((GstXImageMeta*)gst_buffer_get_meta((b),GST_XIMAGE_META_INFO))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstMetaXImage:
|
* GstXImageMeta:
|
||||||
* @simagesink: a reference to the our #GstXImageSink
|
* @simagesink: a reference to the our #GstXImageSink
|
||||||
* @ximage: the XImage of this buffer
|
* @ximage: the XImage of this buffer
|
||||||
* @width: the width in pixels of XImage @ximage
|
* @width: the width in pixels of XImage @ximage
|
||||||
|
@ -62,7 +62,7 @@ const GstMetaInfo * gst_meta_ximage_get_info (void);
|
||||||
*
|
*
|
||||||
* Subclass of #GstMeta containing additional information about an XImage.
|
* Subclass of #GstMeta containing additional information about an XImage.
|
||||||
*/
|
*/
|
||||||
struct _GstMetaXImage
|
struct _GstXImageMeta
|
||||||
{
|
{
|
||||||
GstMeta meta;
|
GstMeta meta;
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
#include <gst/interfaces/navigation.h>
|
#include <gst/interfaces/navigation.h>
|
||||||
#include <gst/interfaces/videooverlay.h>
|
#include <gst/interfaces/videooverlay.h>
|
||||||
|
|
||||||
#include <gst/video/gstmetavideo.h>
|
#include <gst/video/gstvideometa.h>
|
||||||
|
|
||||||
/* Object header */
|
/* Object header */
|
||||||
#include "ximagesink.h"
|
#include "ximagesink.h"
|
||||||
|
@ -225,8 +225,8 @@ gst_ximagesink_xwindow_draw_borders (GstXImageSink * ximagesink,
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstBuffer * ximage)
|
gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstBuffer * ximage)
|
||||||
{
|
{
|
||||||
GstMetaXImage *meta;
|
GstXImageMeta *meta;
|
||||||
GstMetaVideoCrop *crop;
|
GstVideoCropMeta *crop;
|
||||||
GstVideoRectangle src, dst, result;
|
GstVideoRectangle src, dst, result;
|
||||||
gboolean draw_border = FALSE;
|
gboolean draw_border = FALSE;
|
||||||
|
|
||||||
|
@ -266,8 +266,8 @@ gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstBuffer * ximage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
meta = gst_buffer_get_meta_ximage (ximage);
|
meta = gst_buffer_get_ximage_meta (ximage);
|
||||||
crop = gst_buffer_get_meta_video_crop (ximage);
|
crop = gst_buffer_get_video_crop_meta (ximage);
|
||||||
|
|
||||||
if (crop) {
|
if (crop) {
|
||||||
src.x = crop->x + meta->x;
|
src.x = crop->x + meta->x;
|
||||||
|
@ -1288,12 +1288,12 @@ gst_ximagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstFlowReturn res;
|
GstFlowReturn res;
|
||||||
GstXImageSink *ximagesink;
|
GstXImageSink *ximagesink;
|
||||||
GstMetaXImage *meta;
|
GstXImageMeta *meta;
|
||||||
GstBuffer *to_put = NULL;
|
GstBuffer *to_put = NULL;
|
||||||
|
|
||||||
ximagesink = GST_XIMAGESINK (vsink);
|
ximagesink = GST_XIMAGESINK (vsink);
|
||||||
|
|
||||||
meta = gst_buffer_get_meta_ximage (buf);
|
meta = gst_buffer_get_ximage_meta (buf);
|
||||||
|
|
||||||
if (meta && meta->sink == ximagesink) {
|
if (meta && meta->sink == ximagesink) {
|
||||||
/* If this buffer has been allocated using our buffer management we simply
|
/* If this buffer has been allocated using our buffer management we simply
|
||||||
|
@ -1483,8 +1483,8 @@ gst_ximagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
||||||
gst_query_set_allocation_params (query, size, 2, 0, 0, 0, pool);
|
gst_query_set_allocation_params (query, size, 2, 0, 0, 0, pool);
|
||||||
|
|
||||||
/* we also support various metadata */
|
/* we also support various metadata */
|
||||||
gst_query_add_allocation_meta (query, GST_META_API_VIDEO);
|
gst_query_add_allocation_meta (query, GST_VIDEO_META_API);
|
||||||
gst_query_add_allocation_meta (query, GST_META_API_VIDEO_CROP);
|
gst_query_add_allocation_meta (query, GST_VIDEO_CROP_META_API);
|
||||||
|
|
||||||
gst_object_unref (pool);
|
gst_object_unref (pool);
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
/* Helper functions */
|
/* Helper functions */
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
#include <gst/video/gstmetavideo.h>
|
#include <gst/video/gstvideometa.h>
|
||||||
#include <gst/video/gstvideopool.h>
|
#include <gst/video/gstvideopool.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,22 +49,22 @@ struct _GstXvImageBufferPoolPrivate
|
||||||
gboolean need_alignment;
|
gboolean need_alignment;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void gst_meta_xvimage_free (GstMetaXvImage * meta, GstBuffer * buffer);
|
static void gst_xvimage_meta_free (GstXvImageMeta * meta, GstBuffer * buffer);
|
||||||
|
|
||||||
/* xvimage metadata */
|
/* xvimage metadata */
|
||||||
const GstMetaInfo *
|
const GstMetaInfo *
|
||||||
gst_meta_xvimage_get_info (void)
|
gst_xvimage_meta_get_info (void)
|
||||||
{
|
{
|
||||||
static const GstMetaInfo *meta_xvimage_info = NULL;
|
static const GstMetaInfo *xvimage_meta_info = NULL;
|
||||||
|
|
||||||
if (meta_xvimage_info == NULL) {
|
if (xvimage_meta_info == NULL) {
|
||||||
meta_xvimage_info = gst_meta_register ("GstMetaXvImage", "GstMetaXvImage",
|
xvimage_meta_info = gst_meta_register ("GstXvImageMeta", "GstXvImageMeta",
|
||||||
sizeof (GstMetaXvImage),
|
sizeof (GstXvImageMeta),
|
||||||
(GstMetaInitFunction) NULL,
|
(GstMetaInitFunction) NULL,
|
||||||
(GstMetaFreeFunction) gst_meta_xvimage_free,
|
(GstMetaFreeFunction) gst_xvimage_meta_free,
|
||||||
(GstMetaCopyFunction) NULL, (GstMetaTransformFunction) NULL);
|
(GstMetaCopyFunction) NULL, (GstMetaTransformFunction) NULL);
|
||||||
}
|
}
|
||||||
return meta_xvimage_info;
|
return xvimage_meta_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* X11 stuff */
|
/* X11 stuff */
|
||||||
|
@ -81,14 +81,14 @@ gst_xvimagesink_handle_xerror (Display * display, XErrorEvent * xevent)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstMetaXvImage *
|
static GstXvImageMeta *
|
||||||
gst_buffer_add_meta_xvimage (GstBuffer * buffer, GstXvImageBufferPool * xvpool)
|
gst_buffer_add_xvimage_meta (GstBuffer * buffer, GstXvImageBufferPool * xvpool)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink;
|
GstXvImageSink *xvimagesink;
|
||||||
int (*handler) (Display *, XErrorEvent *);
|
int (*handler) (Display *, XErrorEvent *);
|
||||||
gboolean success = FALSE;
|
gboolean success = FALSE;
|
||||||
GstXContext *xcontext;
|
GstXContext *xcontext;
|
||||||
GstMetaXvImage *meta;
|
GstXvImageMeta *meta;
|
||||||
gint width, height, im_format;
|
gint width, height, im_format;
|
||||||
GstXvImageBufferPoolPrivate *priv;
|
GstXvImageBufferPoolPrivate *priv;
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ gst_buffer_add_meta_xvimage (GstBuffer * buffer, GstXvImageBufferPool * xvpool)
|
||||||
im_format = priv->im_format;
|
im_format = priv->im_format;
|
||||||
|
|
||||||
meta =
|
meta =
|
||||||
(GstMetaXvImage *) gst_buffer_add_meta (buffer, GST_META_INFO_XVIMAGE,
|
(GstXvImageMeta *) gst_buffer_add_meta (buffer, GST_XVIMAGE_META_INFO,
|
||||||
NULL);
|
NULL);
|
||||||
#ifdef HAVE_XSHM
|
#ifdef HAVE_XSHM
|
||||||
meta->SHMInfo.shmaddr = ((void *) -1);
|
meta->SHMInfo.shmaddr = ((void *) -1);
|
||||||
|
@ -313,7 +313,7 @@ xattach_failed:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_meta_xvimage_free (GstMetaXvImage * meta, GstBuffer * buffer)
|
gst_xvimage_meta_free (GstXvImageMeta * meta, GstBuffer * buffer)
|
||||||
{
|
{
|
||||||
GstXvImageSink *xvimagesink;
|
GstXvImageSink *xvimagesink;
|
||||||
|
|
||||||
|
@ -488,7 +488,7 @@ G_DEFINE_TYPE (GstXvImageBufferPool, gst_xvimage_buffer_pool,
|
||||||
static const gchar **
|
static const gchar **
|
||||||
xvimage_buffer_pool_get_options (GstBufferPool * pool)
|
xvimage_buffer_pool_get_options (GstBufferPool * pool)
|
||||||
{
|
{
|
||||||
static const gchar *options[] = { GST_BUFFER_POOL_OPTION_META_VIDEO,
|
static const gchar *options[] = { GST_BUFFER_POOL_OPTION_VIDEO_META,
|
||||||
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT, NULL
|
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT, NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -528,7 +528,7 @@ xvimage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
|
||||||
/* enable metadata based on config of the pool */
|
/* enable metadata based on config of the pool */
|
||||||
priv->add_metavideo =
|
priv->add_metavideo =
|
||||||
gst_buffer_pool_config_has_option (config,
|
gst_buffer_pool_config_has_option (config,
|
||||||
GST_BUFFER_POOL_OPTION_META_VIDEO);
|
GST_BUFFER_POOL_OPTION_VIDEO_META);
|
||||||
|
|
||||||
/* parse extra alignment info */
|
/* parse extra alignment info */
|
||||||
priv->need_alignment = gst_buffer_pool_config_has_option (config,
|
priv->need_alignment = gst_buffer_pool_config_has_option (config,
|
||||||
|
@ -592,25 +592,25 @@ xvimage_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
|
||||||
GstXvImageBufferPoolPrivate *priv = xvpool->priv;
|
GstXvImageBufferPoolPrivate *priv = xvpool->priv;
|
||||||
GstVideoInfo *info;
|
GstVideoInfo *info;
|
||||||
GstBuffer *xvimage;
|
GstBuffer *xvimage;
|
||||||
GstMetaXvImage *meta;
|
GstXvImageMeta *meta;
|
||||||
|
|
||||||
info = &priv->info;
|
info = &priv->info;
|
||||||
|
|
||||||
xvimage = gst_buffer_new ();
|
xvimage = gst_buffer_new ();
|
||||||
meta = gst_buffer_add_meta_xvimage (xvimage, xvpool);
|
meta = gst_buffer_add_xvimage_meta (xvimage, xvpool);
|
||||||
if (meta == NULL) {
|
if (meta == NULL) {
|
||||||
gst_buffer_unref (xvimage);
|
gst_buffer_unref (xvimage);
|
||||||
goto no_buffer;
|
goto no_buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->add_metavideo) {
|
if (priv->add_metavideo) {
|
||||||
GstMetaVideo *meta;
|
GstVideoMeta *meta;
|
||||||
const GstVideoFormatInfo *vinfo = info->finfo;
|
const GstVideoFormatInfo *vinfo = info->finfo;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (pool, "adding GstMetaVideo");
|
GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
|
||||||
/* these are just the defaults for now */
|
/* these are just the defaults for now */
|
||||||
meta = gst_buffer_add_meta_video (xvimage, 0, GST_VIDEO_INFO_FORMAT (info),
|
meta = gst_buffer_add_video_meta (xvimage, 0, GST_VIDEO_INFO_FORMAT (info),
|
||||||
priv->padded_width, priv->padded_height);
|
priv->padded_width, priv->padded_height);
|
||||||
|
|
||||||
if (priv->need_alignment) {
|
if (priv->need_alignment) {
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
typedef struct _GstMetaXvImage GstMetaXvImage;
|
typedef struct _GstXvImageMeta GstXvImageMeta;
|
||||||
|
|
||||||
typedef struct _GstXvImageBufferPool GstXvImageBufferPool;
|
typedef struct _GstXvImageBufferPool GstXvImageBufferPool;
|
||||||
typedef struct _GstXvImageBufferPoolClass GstXvImageBufferPoolClass;
|
typedef struct _GstXvImageBufferPoolClass GstXvImageBufferPoolClass;
|
||||||
|
@ -47,13 +47,13 @@ typedef struct _GstXvImageBufferPoolPrivate GstXvImageBufferPoolPrivate;
|
||||||
|
|
||||||
#include "xvimagesink.h"
|
#include "xvimagesink.h"
|
||||||
|
|
||||||
const GstMetaInfo * gst_meta_xvimage_get_info (void);
|
const GstMetaInfo * gst_xvimage_meta_get_info (void);
|
||||||
#define GST_META_INFO_XVIMAGE (gst_meta_xvimage_get_info())
|
#define GST_XVIMAGE_META_INFO (gst_xvimage_meta_get_info())
|
||||||
|
|
||||||
#define gst_buffer_get_meta_xvimage(b) ((GstMetaXvImage*)gst_buffer_get_meta((b),GST_META_INFO_XVIMAGE))
|
#define gst_buffer_get_xvimage_meta(b) ((GstXvImageMeta*)gst_buffer_get_meta((b),GST_XVIMAGE_META_INFO))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstMetaXvImage:
|
* GstXvImageMeta:
|
||||||
* @sink: a reference to the our #GstXvImageSink
|
* @sink: a reference to the our #GstXvImageSink
|
||||||
* @xvimage: the XvImage of this buffer
|
* @xvimage: the XvImage of this buffer
|
||||||
* @width: the width in pixels of XvImage @xvimage
|
* @width: the width in pixels of XvImage @xvimage
|
||||||
|
@ -63,7 +63,7 @@ const GstMetaInfo * gst_meta_xvimage_get_info (void);
|
||||||
*
|
*
|
||||||
* Subclass of #GstMeta containing additional information about an XvImage.
|
* Subclass of #GstMeta containing additional information about an XvImage.
|
||||||
*/
|
*/
|
||||||
struct _GstMetaXvImage
|
struct _GstXvImageMeta
|
||||||
{
|
{
|
||||||
GstMeta meta;
|
GstMeta meta;
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@
|
||||||
#include <gst/interfaces/colorbalance.h>
|
#include <gst/interfaces/colorbalance.h>
|
||||||
#include <gst/interfaces/propertyprobe.h>
|
#include <gst/interfaces/propertyprobe.h>
|
||||||
/* Helper functions */
|
/* Helper functions */
|
||||||
#include <gst/video/gstmetavideo.h>
|
#include <gst/video/gstvideometa.h>
|
||||||
|
|
||||||
/* Object header */
|
/* Object header */
|
||||||
#include "xvimagesink.h"
|
#include "xvimagesink.h"
|
||||||
|
@ -269,8 +269,8 @@ gst_xvimagesink_xwindow_draw_borders (GstXvImageSink * xvimagesink,
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink, GstBuffer * xvimage)
|
gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink, GstBuffer * xvimage)
|
||||||
{
|
{
|
||||||
GstMetaXvImage *meta;
|
GstXvImageMeta *meta;
|
||||||
GstMetaVideoCrop *crop;
|
GstVideoCropMeta *crop;
|
||||||
GstVideoRectangle result;
|
GstVideoRectangle result;
|
||||||
gboolean draw_border = FALSE;
|
gboolean draw_border = FALSE;
|
||||||
GstVideoRectangle src, dst;
|
GstVideoRectangle src, dst;
|
||||||
|
@ -311,9 +311,9 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink, GstBuffer * xvimage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
meta = gst_buffer_get_meta_xvimage (xvimage);
|
meta = gst_buffer_get_xvimage_meta (xvimage);
|
||||||
|
|
||||||
crop = gst_buffer_get_meta_video_crop (xvimage);
|
crop = gst_buffer_get_video_crop_meta (xvimage);
|
||||||
|
|
||||||
if (crop) {
|
if (crop) {
|
||||||
src.x = crop->x + meta->x;
|
src.x = crop->x + meta->x;
|
||||||
|
@ -1803,12 +1803,12 @@ gst_xvimagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstFlowReturn res;
|
GstFlowReturn res;
|
||||||
GstXvImageSink *xvimagesink;
|
GstXvImageSink *xvimagesink;
|
||||||
GstMetaXvImage *meta;
|
GstXvImageMeta *meta;
|
||||||
GstBuffer *to_put;
|
GstBuffer *to_put;
|
||||||
|
|
||||||
xvimagesink = GST_XVIMAGESINK (vsink);
|
xvimagesink = GST_XVIMAGESINK (vsink);
|
||||||
|
|
||||||
meta = gst_buffer_get_meta_xvimage (buf);
|
meta = gst_buffer_get_xvimage_meta (buf);
|
||||||
|
|
||||||
if (meta && meta->sink == xvimagesink) {
|
if (meta && meta->sink == xvimagesink) {
|
||||||
/* If this buffer has been allocated using our buffer management we simply
|
/* If this buffer has been allocated using our buffer management we simply
|
||||||
|
@ -1998,8 +1998,8 @@ gst_xvimagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
|
||||||
gst_query_set_allocation_params (query, size, 2, 0, 0, 0, pool);
|
gst_query_set_allocation_params (query, size, 2, 0, 0, 0, pool);
|
||||||
|
|
||||||
/* we also support various metadata */
|
/* we also support various metadata */
|
||||||
gst_query_add_allocation_meta (query, GST_META_API_VIDEO);
|
gst_query_add_allocation_meta (query, GST_VIDEO_META_API);
|
||||||
gst_query_add_allocation_meta (query, GST_META_API_VIDEO_CROP);
|
gst_query_add_allocation_meta (query, GST_VIDEO_CROP_META_API);
|
||||||
|
|
||||||
gst_object_unref (pool);
|
gst_object_unref (pool);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue