mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
Change Class to Iface. Fix casting macros.
Original commit message from CVS: Change Class to Iface. Fix casting macros.
This commit is contained in:
parent
d8c63eaf97
commit
2665c843bd
4 changed files with 28 additions and 36 deletions
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include <gst/navigation/navigation.h>
|
||||
|
||||
static void gst_navigation_class_init (GstNavigationClass *klass);
|
||||
static void gst_navigation_class_init (GstNavigationIface *iface);
|
||||
|
||||
GType
|
||||
gst_navigation_get_type (void)
|
||||
|
@ -34,7 +34,7 @@ gst_navigation_get_type (void)
|
|||
|
||||
if (!gst_navigation_type) {
|
||||
static const GTypeInfo gst_navigation_info = {
|
||||
sizeof (GstNavigationClass),
|
||||
sizeof (GstNavigationIface),
|
||||
(GBaseInitFunc) gst_navigation_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -54,19 +54,19 @@ gst_navigation_get_type (void)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_navigation_class_init (GstNavigationClass *klass)
|
||||
gst_navigation_class_init (GstNavigationIface *iface)
|
||||
{
|
||||
/* default virtual functions */
|
||||
klass->send_event = NULL;
|
||||
iface->send_event = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
gst_navigation_send_event (GstNavigation *navigation, GstCaps *caps)
|
||||
{
|
||||
GstNavigationClass *klass = GST_NAVIGATION_GET_CLASS (navigation);
|
||||
GstNavigationIface *iface = GST_NAVIGATION_GET_IFACE (navigation);
|
||||
|
||||
if (klass->send_event) {
|
||||
klass->send_event (navigation, caps);
|
||||
if (iface->send_event) {
|
||||
iface->send_event (navigation, caps);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,26 +30,22 @@ G_BEGIN_DECLS
|
|||
#define GST_TYPE_NAVIGATION \
|
||||
(gst_navigation_get_type ())
|
||||
#define GST_NAVIGATION(obj) \
|
||||
(G_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_NAVIGATION, GstNavigation))
|
||||
#define GST_NAVIGATION_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_NAVIGATION, GstNavigationClass))
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_NAVIGATION, GstNavigation))
|
||||
#define GST_IS_NAVIGATION(obj) \
|
||||
(G_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_NAVIGATION))
|
||||
#define GST_IS_NAVIGATION_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_NAVIGATION))
|
||||
#define GST_NAVIGATION_GET_CLASS(inst) \
|
||||
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_NAVIGATION, GstNavigationClass))
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_NAVIGATION))
|
||||
#define GST_NAVIGATION_GET_IFACE(obj) \
|
||||
(G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_NAVIGATION, GstNavigationIface))
|
||||
|
||||
typedef struct _GstNavigation GstNavigation;
|
||||
|
||||
typedef struct _GstNavigationClass {
|
||||
GTypeInterface klass;
|
||||
typedef struct _GstNavigationIface {
|
||||
GTypeInterface g_iface;
|
||||
|
||||
/* virtual functions */
|
||||
void (*send_event) (GstNavigation *navigation, GstCaps *caps);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
} GstNavigationClass;
|
||||
} GstNavigationIface;
|
||||
|
||||
GType gst_navigation_get_type (void);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include <gst/navigation/navigation.h>
|
||||
|
||||
static void gst_navigation_class_init (GstNavigationClass *klass);
|
||||
static void gst_navigation_class_init (GstNavigationIface *iface);
|
||||
|
||||
GType
|
||||
gst_navigation_get_type (void)
|
||||
|
@ -34,7 +34,7 @@ gst_navigation_get_type (void)
|
|||
|
||||
if (!gst_navigation_type) {
|
||||
static const GTypeInfo gst_navigation_info = {
|
||||
sizeof (GstNavigationClass),
|
||||
sizeof (GstNavigationIface),
|
||||
(GBaseInitFunc) gst_navigation_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -54,19 +54,19 @@ gst_navigation_get_type (void)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_navigation_class_init (GstNavigationClass *klass)
|
||||
gst_navigation_class_init (GstNavigationIface *iface)
|
||||
{
|
||||
/* default virtual functions */
|
||||
klass->send_event = NULL;
|
||||
iface->send_event = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
gst_navigation_send_event (GstNavigation *navigation, GstCaps *caps)
|
||||
{
|
||||
GstNavigationClass *klass = GST_NAVIGATION_GET_CLASS (navigation);
|
||||
GstNavigationIface *iface = GST_NAVIGATION_GET_IFACE (navigation);
|
||||
|
||||
if (klass->send_event) {
|
||||
klass->send_event (navigation, caps);
|
||||
if (iface->send_event) {
|
||||
iface->send_event (navigation, caps);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,26 +30,22 @@ G_BEGIN_DECLS
|
|||
#define GST_TYPE_NAVIGATION \
|
||||
(gst_navigation_get_type ())
|
||||
#define GST_NAVIGATION(obj) \
|
||||
(G_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_NAVIGATION, GstNavigation))
|
||||
#define GST_NAVIGATION_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_NAVIGATION, GstNavigationClass))
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_NAVIGATION, GstNavigation))
|
||||
#define GST_IS_NAVIGATION(obj) \
|
||||
(G_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_NAVIGATION))
|
||||
#define GST_IS_NAVIGATION_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_NAVIGATION))
|
||||
#define GST_NAVIGATION_GET_CLASS(inst) \
|
||||
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_NAVIGATION, GstNavigationClass))
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_NAVIGATION))
|
||||
#define GST_NAVIGATION_GET_IFACE(obj) \
|
||||
(G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_NAVIGATION, GstNavigationIface))
|
||||
|
||||
typedef struct _GstNavigation GstNavigation;
|
||||
|
||||
typedef struct _GstNavigationClass {
|
||||
GTypeInterface klass;
|
||||
typedef struct _GstNavigationIface {
|
||||
GTypeInterface g_iface;
|
||||
|
||||
/* virtual functions */
|
||||
void (*send_event) (GstNavigation *navigation, GstCaps *caps);
|
||||
|
||||
GST_CLASS_PADDING
|
||||
} GstNavigationClass;
|
||||
} GstNavigationIface;
|
||||
|
||||
GType gst_navigation_get_type (void);
|
||||
|
||||
|
|
Loading…
Reference in a new issue