update for metadata API changes

This commit is contained in:
Wim Taymans 2012-02-29 17:26:28 +01:00
parent 1fb46f00ae
commit ea4a0d1c2d
3 changed files with 19 additions and 5 deletions

View file

@ -2075,7 +2075,7 @@ gst_base_video_decoder_set_src_caps (GstBaseVideoDecoder * base_video_decoder)
/* check if downstream supports cropping */
base_video_decoder->use_cropping =
gst_query_has_allocation_meta (query, GST_VIDEO_CROP_META_API);
gst_query_has_allocation_meta (query, GST_VIDEO_CROP_META_API_TYPE);
gst_buffer_pool_set_config (pool, config);
/* and activate */

View file

@ -44,18 +44,29 @@
* </note>
*/
GType
gst_surface_meta_api_get_type (void)
{
static volatile GType type;
static const gchar *tags[] = { "memory", NULL };
if (g_once_init_enter (&type)) {
GType _type = gst_meta_api_type_register ("GstSurfaceMetaAPI", tags);
g_once_init_leave (&type, _type);
}
return type;
}
const GstMetaInfo *
gst_surface_meta_get_info (void)
{
static const GstMetaInfo *meta_info = NULL;
static const gchar *tags[] = { "memory" };
if (meta_info == NULL) {
meta_info = gst_meta_register ("GstSurfaceMeta", "GstSurfaceMeta",
meta_info = gst_meta_register (GST_SURFACE_META_API_TYPE, "GstSurfaceMeta",
sizeof (GstSurfaceMeta),
(GstMetaInitFunction) NULL,
(GstMetaFreeFunction) NULL, (GstMetaTransformFunction) NULL, tags);
(GstMetaFreeFunction) NULL, (GstMetaTransformFunction) NULL);
}
return meta_info;
}

View file

@ -48,11 +48,14 @@ struct _GstSurfaceMeta {
GValue *dest);
};
GType gst_surface_meta_api_get_type (void);
#define GST_SURFACE_META_API_TYPE (gst_surface_meta_api_get_type())
const GstMetaInfo *gst_surface_meta_get_info (void);
#define GST_SURFACE_META_INFO (gst_surface_meta_get_info())
#define gst_buffer_get_surface_meta(b) \
((GstSurfaceMeta*)gst_buffer_get_meta((b),GST_SURFACE_META_INFO))
((GstSurfaceMeta*)gst_buffer_get_meta((b),GST_SURFACE_META_API_TYPE))
#define gst_buffer_add_surface_meta(b) \
((GstSurfaceMeta*)gst_buffer_add_meta((b),GST_SURFACE_META_INFO,NULL))