mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-25 10:04:19 +00:00
applemedia: update coremediabuffer after buffer meta API change
This commit is contained in:
parent
10387bd629
commit
13334dfa8f
2 changed files with 19 additions and 2 deletions
|
@ -31,13 +31,26 @@ gst_core_media_meta_free (GstCoreMediaMeta * meta, GstBuffer * buf)
|
||||||
g_object_unref (meta->ctx);
|
g_object_unref (meta->ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
gst_core_media_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 ("GstCoreMediaMetaAPI", tags);
|
||||||
|
g_once_init_leave (&type, _type);
|
||||||
|
}
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
static const GstMetaInfo *
|
static const GstMetaInfo *
|
||||||
gst_core_media_meta_get_info (void)
|
gst_core_media_meta_get_info (void)
|
||||||
{
|
{
|
||||||
static const GstMetaInfo *core_media_meta_info = NULL;
|
static const GstMetaInfo *core_media_meta_info = NULL;
|
||||||
|
|
||||||
if (core_media_meta_info == NULL) {
|
if (core_media_meta_info == NULL) {
|
||||||
core_media_meta_info = gst_meta_register ("GstCoreMediaeMeta",
|
core_media_meta_info = gst_meta_register (GST_CORE_MEDIA_META_API_TYPE,
|
||||||
"GstCoreMediaMeta", sizeof (GstCoreMediaMeta),
|
"GstCoreMediaMeta", sizeof (GstCoreMediaMeta),
|
||||||
(GstMetaInitFunction) NULL,
|
(GstMetaInitFunction) NULL,
|
||||||
(GstMetaFreeFunction) gst_core_media_meta_free,
|
(GstMetaFreeFunction) gst_core_media_meta_free,
|
||||||
|
@ -122,7 +135,7 @@ CVPixelBufferRef
|
||||||
gst_core_media_buffer_get_pixel_buffer (GstBuffer * buf)
|
gst_core_media_buffer_get_pixel_buffer (GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstCoreMediaMeta *meta = (GstCoreMediaMeta *) gst_buffer_get_meta (buf,
|
GstCoreMediaMeta *meta = (GstCoreMediaMeta *) gst_buffer_get_meta (buf,
|
||||||
gst_core_media_meta_get_info ());
|
GST_CORE_MEDIA_META_API_TYPE);
|
||||||
g_return_val_if_fail (meta != NULL, NULL);
|
g_return_val_if_fail (meta != NULL, NULL);
|
||||||
|
|
||||||
return meta->ctx->cv->CVPixelBufferRetain (meta->pixel_buf);
|
return meta->ctx->cv->CVPixelBufferRetain (meta->pixel_buf);
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
#include "coremediactx.h"
|
#include "coremediactx.h"
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
#define GST_CORE_MEDIA_META_API_TYPE (gst_core_media_meta_api_get_type())
|
||||||
|
#define gst_buffer_get_core_media_meta(b) \
|
||||||
|
((GstCoreVideoMeta*)gst_buffer_get_meta((b),GST_CORE_MEDIA_META_API_TYPE))
|
||||||
|
|
||||||
typedef struct _GstCoreMediaMeta
|
typedef struct _GstCoreMediaMeta
|
||||||
{
|
{
|
||||||
|
@ -42,6 +45,7 @@ GstBuffer * gst_core_media_buffer_new (GstCoreMediaCtx * ctx,
|
||||||
CMSampleBufferRef sample_buf);
|
CMSampleBufferRef sample_buf);
|
||||||
CVPixelBufferRef gst_core_media_buffer_get_pixel_buffer
|
CVPixelBufferRef gst_core_media_buffer_get_pixel_buffer
|
||||||
(GstBuffer * buf);
|
(GstBuffer * buf);
|
||||||
|
GType gst_core_media_meta_api_get_type (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue