mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +00:00
update for meta api change
This commit is contained in:
parent
0560ab53c0
commit
b1ef7e8a86
7 changed files with 30 additions and 30 deletions
|
@ -54,7 +54,7 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "gstwarp.h"
|
#include "gstwarp.h"
|
||||||
#include <gst/video/gstmetavideo.h>
|
#include <gst/video/gstvideometa.h>
|
||||||
#include <gst/video/gstvideopool.h>
|
#include <gst/video/gstvideopool.h>
|
||||||
|
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
|
@ -256,7 +256,7 @@ gst_wraptv_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;
|
||||||
|
|
|
@ -151,7 +151,7 @@ gst_rtp_vraw_depay_negotiate_pool (GstRtpVRawDepay * depay, GstCaps * caps,
|
||||||
/* just set the metadata, if the pool can support it we will transparently use
|
/* just set the metadata, 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
|
||||||
* metadata and only activate it then. */
|
* metadata 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);
|
||||||
|
|
||||||
gst_buffer_pool_set_config (pool, config);
|
gst_buffer_pool_set_config (pool, config);
|
||||||
/* and activate */
|
/* and activate */
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.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 <gst/rtp/gstbasertpdepayload.h>
|
#include <gst/rtp/gstbasertpdepayload.h>
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.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 <gstv4l2bufferpool.h>
|
#include <gstv4l2bufferpool.h>
|
||||||
|
@ -57,14 +57,14 @@ GST_DEBUG_CATEGORY_EXTERN (v4l2_debug);
|
||||||
* GstV4l2Buffer:
|
* GstV4l2Buffer:
|
||||||
*/
|
*/
|
||||||
const GstMetaInfo *
|
const GstMetaInfo *
|
||||||
gst_meta_v4l2_get_info (void)
|
gst_v4l2_meta_get_info (void)
|
||||||
{
|
{
|
||||||
static const GstMetaInfo *meta_info = NULL;
|
static const GstMetaInfo *meta_info = NULL;
|
||||||
|
|
||||||
if (meta_info == NULL) {
|
if (meta_info == NULL) {
|
||||||
meta_info =
|
meta_info =
|
||||||
gst_meta_register ("GstMetaV4l2", "GstMetaV4l2",
|
gst_meta_register ("GstV4l2Meta", "GstV4l2Meta",
|
||||||
sizeof (GstMetaV4l2), (GstMetaInitFunction) NULL,
|
sizeof (GstV4l2Meta), (GstMetaInitFunction) NULL,
|
||||||
(GstMetaFreeFunction) NULL, (GstMetaCopyFunction) NULL,
|
(GstMetaFreeFunction) NULL, (GstMetaCopyFunction) NULL,
|
||||||
(GstMetaTransformFunction) NULL);
|
(GstMetaTransformFunction) NULL);
|
||||||
}
|
}
|
||||||
|
@ -93,10 +93,10 @@ gst_v4l2_buffer_pool_free_buffer (GstBufferPool * bpool, GstBuffer * buffer)
|
||||||
break;
|
break;
|
||||||
case GST_V4L2_IO_MMAP:
|
case GST_V4L2_IO_MMAP:
|
||||||
{
|
{
|
||||||
GstMetaV4l2 *meta;
|
GstV4l2Meta *meta;
|
||||||
gint index;
|
gint index;
|
||||||
|
|
||||||
meta = GST_META_V4L2_GET (buffer);
|
meta = GST_V4L2_META_GET (buffer);
|
||||||
g_assert (meta != NULL);
|
g_assert (meta != NULL);
|
||||||
|
|
||||||
index = meta->vbuffer.index;
|
index = meta->vbuffer.index;
|
||||||
|
@ -122,7 +122,7 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
|
||||||
{
|
{
|
||||||
GstV4l2BufferPool *pool = GST_V4L2_BUFFER_POOL (bpool);
|
GstV4l2BufferPool *pool = GST_V4L2_BUFFER_POOL (bpool);
|
||||||
GstBuffer *newbuf;
|
GstBuffer *newbuf;
|
||||||
GstMetaV4l2 *meta;
|
GstV4l2Meta *meta;
|
||||||
GstV4l2Object *obj;
|
GstV4l2Object *obj;
|
||||||
GstVideoInfo *info;
|
GstVideoInfo *info;
|
||||||
guint index;
|
guint index;
|
||||||
|
@ -140,7 +140,7 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
|
||||||
case GST_V4L2_IO_MMAP:
|
case GST_V4L2_IO_MMAP:
|
||||||
{
|
{
|
||||||
newbuf = gst_buffer_new ();
|
newbuf = gst_buffer_new ();
|
||||||
meta = GST_META_V4L2_ADD (newbuf);
|
meta = GST_V4L2_META_ADD (newbuf);
|
||||||
|
|
||||||
index = pool->num_allocated;
|
index = pool->num_allocated;
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
|
||||||
stride[0] = obj->bytesperline;
|
stride[0] = obj->bytesperline;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (pool, "adding video meta, stride %d", stride[0]);
|
GST_DEBUG_OBJECT (pool, "adding video meta, stride %d", stride[0]);
|
||||||
gst_buffer_add_meta_video_full (newbuf, info->flags,
|
gst_buffer_add_video_meta_full (newbuf, info->flags,
|
||||||
GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info),
|
GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info),
|
||||||
GST_VIDEO_INFO_HEIGHT (info), GST_VIDEO_INFO_N_PLANES (info),
|
GST_VIDEO_INFO_HEIGHT (info), GST_VIDEO_INFO_N_PLANES (info),
|
||||||
offset, stride);
|
offset, stride);
|
||||||
|
@ -236,7 +236,7 @@ gst_v4l2_buffer_pool_set_config (GstBufferPool * bpool, GstStructure * config)
|
||||||
|
|
||||||
pool->add_videometa =
|
pool->add_videometa =
|
||||||
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);
|
||||||
|
|
||||||
if (!pool->add_videometa) {
|
if (!pool->add_videometa) {
|
||||||
gint stride;
|
gint stride;
|
||||||
|
@ -513,10 +513,10 @@ select_error:
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_v4l2_buffer_pool_qbuf (GstV4l2BufferPool * pool, GstBuffer * buf)
|
gst_v4l2_buffer_pool_qbuf (GstV4l2BufferPool * pool, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstMetaV4l2 *meta;
|
GstV4l2Meta *meta;
|
||||||
gint index;
|
gint index;
|
||||||
|
|
||||||
meta = GST_META_V4L2_GET (buf);
|
meta = GST_V4L2_META_GET (buf);
|
||||||
g_assert (meta != NULL);
|
g_assert (meta != NULL);
|
||||||
|
|
||||||
index = meta->vbuffer.index;
|
index = meta->vbuffer.index;
|
||||||
|
@ -779,9 +779,9 @@ gst_v4l2_buffer_pool_release_buffer (GstBufferPool * bpool, GstBuffer * buffer)
|
||||||
|
|
||||||
case GST_V4L2_IO_MMAP:
|
case GST_V4L2_IO_MMAP:
|
||||||
{
|
{
|
||||||
GstMetaV4l2 *meta;
|
GstV4l2Meta *meta;
|
||||||
|
|
||||||
meta = GST_META_V4L2_GET (buffer);
|
meta = GST_V4L2_META_GET (buffer);
|
||||||
g_assert (meta != NULL);
|
g_assert (meta != NULL);
|
||||||
|
|
||||||
if (pool->buffers[meta->vbuffer.index] == NULL) {
|
if (pool->buffers[meta->vbuffer.index] == NULL) {
|
||||||
|
@ -1024,7 +1024,7 @@ gst_v4l2_buffer_pool_process (GstV4l2BufferPool * pool, GstBuffer * buf)
|
||||||
|
|
||||||
config = gst_buffer_pool_get_config (bpool);
|
config = gst_buffer_pool_get_config (bpool);
|
||||||
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 (bpool, config);
|
gst_buffer_pool_set_config (bpool, config);
|
||||||
|
|
||||||
if (!gst_buffer_pool_set_active (bpool, TRUE))
|
if (!gst_buffer_pool_set_active (bpool, TRUE))
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
typedef struct _GstV4l2BufferPool GstV4l2BufferPool;
|
typedef struct _GstV4l2BufferPool GstV4l2BufferPool;
|
||||||
typedef struct _GstV4l2BufferPoolClass GstV4l2BufferPoolClass;
|
typedef struct _GstV4l2BufferPoolClass GstV4l2BufferPoolClass;
|
||||||
typedef struct _GstMetaV4l2 GstMetaV4l2;
|
typedef struct _GstV4l2Meta GstV4l2Meta;
|
||||||
|
|
||||||
#include "gstv4l2object.h"
|
#include "gstv4l2object.h"
|
||||||
//#include "v4l2_calls.h"
|
//#include "v4l2_calls.h"
|
||||||
|
@ -72,16 +72,16 @@ struct _GstV4l2BufferPoolClass
|
||||||
GstBufferPoolClass parent_class;
|
GstBufferPoolClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstMetaV4l2 {
|
struct _GstV4l2Meta {
|
||||||
GstMeta meta;
|
GstMeta meta;
|
||||||
|
|
||||||
gpointer mem;
|
gpointer mem;
|
||||||
struct v4l2_buffer vbuffer;
|
struct v4l2_buffer vbuffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
const GstMetaInfo * gst_meta_v4l2_get_info (void);
|
const GstMetaInfo * gst_v4l2_meta_get_info (void);
|
||||||
#define GST_META_V4L2_GET(buf) ((GstMetaV4l2 *)gst_buffer_get_meta(buf,gst_meta_v4l2_get_info()))
|
#define GST_V4L2_META_GET(buf) ((GstV4l2Meta *)gst_buffer_get_meta(buf,gst_v4l2_meta_get_info()))
|
||||||
#define GST_META_V4L2_ADD(buf) ((GstMetaV4l2 *)gst_buffer_add_meta(buf,gst_meta_v4l2_get_info(),NULL))
|
#define GST_V4L2_META_ADD(buf) ((GstV4l2Meta *)gst_buffer_add_meta(buf,gst_v4l2_meta_get_info(),NULL))
|
||||||
|
|
||||||
GType gst_v4l2_buffer_pool_get_type (void);
|
GType gst_v4l2_buffer_pool_get_type (void);
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gst/video/gstmetavideo.h"
|
#include "gst/video/gstvideometa.h"
|
||||||
|
|
||||||
#include "gstv4l2colorbalance.h"
|
#include "gstv4l2colorbalance.h"
|
||||||
#include "gstv4l2tuner.h"
|
#include "gstv4l2tuner.h"
|
||||||
|
@ -656,8 +656,8 @@ gst_v4l2sink_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);
|
||||||
|
|
||||||
if (pool)
|
if (pool)
|
||||||
gst_object_unref (pool);
|
gst_object_unref (pool);
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "gst/video/gstmetavideo.h"
|
#include "gst/video/gstvideometa.h"
|
||||||
#include "gst/video/gstvideopool.h"
|
#include "gst/video/gstvideopool.h"
|
||||||
|
|
||||||
#include "gstv4l2src.h"
|
#include "gstv4l2src.h"
|
||||||
|
@ -573,9 +573,9 @@ gst_v4l2src_decide_allocation (GstBaseSrc * bsrc, GstQuery * query)
|
||||||
alignment);
|
alignment);
|
||||||
|
|
||||||
/* if downstream supports video metadata, add this to the pool config */
|
/* if downstream supports video metadata, add this to the pool config */
|
||||||
if (gst_query_has_allocation_meta (query, GST_META_API_VIDEO))
|
if (gst_query_has_allocation_meta (query, GST_VIDEO_META_API))
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue