mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
base: update for new bufferpool API
This commit is contained in:
parent
cfea7a74fd
commit
5a85e1d75f
7 changed files with 28 additions and 16 deletions
|
@ -45,6 +45,7 @@
|
|||
#include <gst/tag/tag.h>
|
||||
#include <gst/video/video.h>
|
||||
#include <gst/video/gstmetavideo.h>
|
||||
#include <gst/video/gstvideopool.h>
|
||||
|
||||
#define GST_CAT_DEFAULT theoradec_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||
|
@ -826,10 +827,10 @@ theora_negotiate_pool (GstTheoraDec * dec, GstCaps * caps, GstVideoInfo * info)
|
|||
|
||||
config = gst_buffer_pool_get_config (pool);
|
||||
gst_buffer_pool_config_set (config, caps, size, min, max, prefix, alignment);
|
||||
/* just set the metadata, 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
|
||||
* metadata and only activate it then. */
|
||||
gst_buffer_pool_config_add_meta (config, GST_META_API_VIDEO);
|
||||
* option and only activate it then. */
|
||||
gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_META_VIDEO);
|
||||
|
||||
/* check if downstream supports cropping */
|
||||
dec->use_cropping =
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "gstvideoconvert.h"
|
||||
#include <gst/video/video.h>
|
||||
#include <gst/video/gstmetavideo.h>
|
||||
#include <gst/video/gstvideopool.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
@ -172,7 +173,8 @@ gst_video_convert_setup_allocation (GstBaseTransform * trans, GstQuery * query)
|
|||
GstStructure *config;
|
||||
|
||||
config = gst_buffer_pool_get_config (pool);
|
||||
gst_buffer_pool_config_add_meta (config, GST_META_API_VIDEO);
|
||||
gst_buffer_pool_config_add_option (config,
|
||||
GST_BUFFER_POOL_OPTION_META_VIDEO);
|
||||
gst_buffer_pool_set_config (pool, config);
|
||||
}
|
||||
return TRUE;
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
#include <math.h>
|
||||
|
||||
#include <gst/video/gstmetavideo.h>
|
||||
#include <gst/video/gstvideopool.h>
|
||||
|
||||
#include "gstvideoscale.h"
|
||||
#include "gstvideoscaleorc.h"
|
||||
|
@ -364,7 +365,8 @@ gst_video_scale_setup_allocation (GstBaseTransform * trans, GstQuery * query)
|
|||
GstStructure *config;
|
||||
|
||||
config = gst_buffer_pool_get_config (pool);
|
||||
gst_buffer_pool_config_add_meta (config, GST_META_API_VIDEO);
|
||||
gst_buffer_pool_config_add_option (config,
|
||||
GST_BUFFER_POOL_OPTION_META_VIDEO);
|
||||
gst_buffer_pool_set_config (pool, config);
|
||||
}
|
||||
return TRUE;
|
||||
|
|
|
@ -665,7 +665,8 @@ gst_video_test_src_setup_allocation (GstBaseSrc * bsrc, GstQuery * query)
|
|||
GstStructure *config;
|
||||
|
||||
config = gst_buffer_pool_get_config (pool);
|
||||
gst_buffer_pool_config_add_meta (config, GST_META_API_VIDEO);
|
||||
gst_buffer_pool_config_add_option (config,
|
||||
GST_BUFFER_POOL_OPTION_META_VIDEO);
|
||||
gst_buffer_pool_set_config (pool, config);
|
||||
}
|
||||
gst_query_set_allocation_params (query, size, min, max, prefix,
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <gst/base/gstpushsrc.h>
|
||||
|
||||
#include <gst/video/gstmetavideo.h>
|
||||
#include <gst/video/gstvideopool.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
/* Helper functions */
|
||||
#include <gst/video/video.h>
|
||||
#include <gst/video/gstmetavideo.h>
|
||||
#include <gst/video/gstvideopool.h>
|
||||
|
||||
GST_DEBUG_CATEGORY_EXTERN (gst_debug_ximagepool);
|
||||
#define GST_CAT_DEFAULT gst_debug_ximagepool
|
||||
|
@ -442,11 +443,11 @@ G_DEFINE_TYPE (GstXImageBufferPool, gst_ximage_buffer_pool,
|
|||
GST_TYPE_BUFFER_POOL);
|
||||
|
||||
static const gchar **
|
||||
ximage_buffer_pool_get_metas (GstBufferPool * pool)
|
||||
ximage_buffer_pool_get_options (GstBufferPool * pool)
|
||||
{
|
||||
static const gchar *metas[] = { "GstMetaVideo", NULL };
|
||||
static const gchar *options[] = { GST_BUFFER_POOL_OPTION_META_VIDEO, NULL };
|
||||
|
||||
return metas;
|
||||
return options;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -479,7 +480,8 @@ ximage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
|
|||
|
||||
/* check for the configured metadata */
|
||||
priv->add_metavideo =
|
||||
gst_buffer_pool_config_has_meta (config, GST_META_API_VIDEO);
|
||||
gst_buffer_pool_config_has_option (config,
|
||||
GST_BUFFER_POOL_OPTION_META_VIDEO);
|
||||
|
||||
return GST_BUFFER_POOL_CLASS (parent_class)->set_config (pool, config);
|
||||
|
||||
|
@ -572,7 +574,7 @@ gst_ximage_buffer_pool_class_init (GstXImageBufferPoolClass * klass)
|
|||
|
||||
gobject_class->finalize = gst_ximage_buffer_pool_finalize;
|
||||
|
||||
gstbufferpool_class->get_metas = ximage_buffer_pool_get_metas;
|
||||
gstbufferpool_class->get_options = ximage_buffer_pool_get_options;
|
||||
gstbufferpool_class->set_config = ximage_buffer_pool_set_config;
|
||||
gstbufferpool_class->alloc_buffer = ximage_buffer_pool_alloc;
|
||||
gstbufferpool_class->free_buffer = ximage_buffer_pool_free;
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
/* Helper functions */
|
||||
#include <gst/video/video.h>
|
||||
#include <gst/video/gstmetavideo.h>
|
||||
#include <gst/video/gstvideopool.h>
|
||||
|
||||
|
||||
GST_DEBUG_CATEGORY_EXTERN (gst_debug_xvimagepool);
|
||||
#define GST_CAT_DEFAULT gst_debug_xvimagepool
|
||||
|
@ -475,11 +477,11 @@ G_DEFINE_TYPE (GstXvImageBufferPool, gst_xvimage_buffer_pool,
|
|||
GST_TYPE_BUFFER_POOL);
|
||||
|
||||
static const gchar **
|
||||
xvimage_buffer_pool_get_metas (GstBufferPool * pool)
|
||||
xvimage_buffer_pool_get_options (GstBufferPool * pool)
|
||||
{
|
||||
static const gchar *metas[] = { "GstMetaVideo", NULL };
|
||||
static const gchar *options[] = { GST_BUFFER_POOL_OPTION_META_VIDEO, NULL };
|
||||
|
||||
return metas;
|
||||
return options;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -514,7 +516,8 @@ xvimage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
|
|||
|
||||
/* enable metadata based on config of the pool */
|
||||
priv->add_metavideo =
|
||||
gst_buffer_pool_config_has_meta (config, GST_META_API_VIDEO);
|
||||
gst_buffer_pool_config_has_option (config,
|
||||
GST_BUFFER_POOL_OPTION_META_VIDEO);
|
||||
|
||||
if (priv->im_format == -1)
|
||||
goto unknown_format;
|
||||
|
@ -622,7 +625,7 @@ gst_xvimage_buffer_pool_class_init (GstXvImageBufferPoolClass * klass)
|
|||
|
||||
gobject_class->finalize = gst_xvimage_buffer_pool_finalize;
|
||||
|
||||
gstbufferpool_class->get_metas = xvimage_buffer_pool_get_metas;
|
||||
gstbufferpool_class->get_options = xvimage_buffer_pool_get_options;
|
||||
gstbufferpool_class->set_config = xvimage_buffer_pool_set_config;
|
||||
gstbufferpool_class->alloc_buffer = xvimage_buffer_pool_alloc;
|
||||
gstbufferpool_class->free_buffer = xvimage_buffer_pool_free;
|
||||
|
|
Loading…
Reference in a new issue