From eae9d3fbd56d50e6ecc3b0a22cbbc4c79d63b3fa Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Tue, 17 Mar 2020 17:51:36 +0100 Subject: [PATCH] gstphysmemory: Use G_DECLARE_INTERFACE --- gst-libs/gst/allocators/gstphysmemory.c | 2 +- gst-libs/gst/allocators/gstphysmemory.h | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/gst-libs/gst/allocators/gstphysmemory.c b/gst-libs/gst/allocators/gstphysmemory.c index db743912dd..e2a87889b2 100644 --- a/gst-libs/gst/allocators/gstphysmemory.c +++ b/gst-libs/gst/allocators/gstphysmemory.c @@ -70,7 +70,7 @@ gst_phys_memory_get_phys_addr (GstMemory * mem) g_return_val_if_fail (gst_is_phys_memory (mem), 0); - iface = GST_PHYS_MEMORY_ALLOCATOR_GET_INTERFACE (mem->allocator); + iface = GST_PHYS_MEMORY_ALLOCATOR_GET_IFACE (mem->allocator); g_return_val_if_fail (iface->get_phys_addr != NULL, 0); return iface->get_phys_addr ((GstPhysMemoryAllocator *) mem->allocator, mem); diff --git a/gst-libs/gst/allocators/gstphysmemory.h b/gst-libs/gst/allocators/gstphysmemory.h index f0db437c6c..d0a9d07134 100644 --- a/gst-libs/gst/allocators/gstphysmemory.h +++ b/gst-libs/gst/allocators/gstphysmemory.h @@ -25,16 +25,13 @@ G_BEGIN_DECLS -typedef struct _GstPhysMemoryAllocator GstPhysMemoryAllocator; -typedef struct _GstPhysMemoryAllocatorInterface GstPhysMemoryAllocatorInterface; +#define GST_TYPE_PHYS_MEMORY_ALLOCATOR (gst_phys_memory_allocator_get_type()) +GST_ALLOCATORS_API +G_DECLARE_INTERFACE (GstPhysMemoryAllocator, gst_phys_memory_allocator, + GST, PHYS_MEMORY_ALLOCATOR, GstAllocator) -#define GST_TYPE_PHYS_MEMORY_ALLOCATOR (gst_phys_memory_allocator_get_type()) -#define GST_IS_PHYS_MEMORY_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PHYS_MEMORY_ALLOCATOR)) -#define GST_IS_PHYS_MEMORY_ALLOCATOR_INTERFACE(iface) (G_TYPE_CHECK_INTERFACE_TYPE ((iface), GST_TYPE_PHYS_MEMORY_ALLOCATOR)) -#define GST_PHYS_MEMORY_ALLOCATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_PHYS_MEMORY_ALLOCATOR, GstPhysMemoryAllocatorInterface)) -#define GST_PHYS_MEMORY_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PHYS_MEMORY_ALLOCATOR, GstPhysMemoryAllocator)) -#define GST_PHYS_MEMORY_ALLOCATOR_INTERFACE(iface) (G_TYPE_CHECK_INTERFACE_CAST ((iface), GST_TYPE_PHYS_MEMORY_ALLOCATOR, GstPhysMemoryAllocatorInterface)) -#define GST_PHYS_MEMORY_ALLOCATOR_CAST(obj) ((GstPhysMemoryAllocator *)(obj)) +#define GST_PHYS_MEMORY_ALLOCATOR_GET_INTERFACE(obj) (GST_PHYS_MEMORY_ALLOCATOR_GET_IFACE(obj)) +#define GST_PHYS_MEMORY_ALLOCATOR_CAST(obj) ((GstPhysMemoryAllocator *)(obj)) /** * GstPhysMemoryAllocatorInterface: @@ -54,9 +51,6 @@ struct _GstPhysMemoryAllocatorInterface guintptr (*get_phys_addr) (GstPhysMemoryAllocator * allocator, GstMemory * mem); }; -GST_ALLOCATORS_API -GType gst_phys_memory_allocator_get_type (void); - GST_ALLOCATORS_API gboolean gst_is_phys_memory (GstMemory *mem);