gstphysmemory: Use G_DECLARE_INTERFACE
authorNiels De Graef <nielsdegraef@gmail.com>
Tue, 17 Mar 2020 16:51:36 +0000 (17:51 +0100)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 20 Mar 2020 06:20:43 +0000 (06:20 +0000)
gst-libs/gst/allocators/gstphysmemory.c
gst-libs/gst/allocators/gstphysmemory.h

index db74391..e2a8788 100644 (file)
@@ -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);
index f0db437..d0a9d07 100644 (file)
 
 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:
@@ -55,9 +52,6 @@ struct _GstPhysMemoryAllocatorInterface
 };
 
 GST_ALLOCATORS_API
-GType gst_phys_memory_allocator_get_type (void);
-
-GST_ALLOCATORS_API
 gboolean gst_is_phys_memory (GstMemory *mem);
 
 GST_ALLOCATORS_API