From 59ac993a912dbafb5d973ab35cc5393c5b2296c9 Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Sun, 15 Mar 2020 19:11:52 +0100 Subject: [PATCH] raw1394: Use G_DECLARE_FINAL_TYPE --- ext/raw1394/gst1394clock.h | 24 ++++-------------------- ext/raw1394/gstdv1394src.c | 3 +-- ext/raw1394/gstdv1394src.h | 24 ++---------------------- ext/raw1394/gsthdv1394src.h | 22 +++------------------- 4 files changed, 10 insertions(+), 63 deletions(-) diff --git a/ext/raw1394/gst1394clock.h b/ext/raw1394/gst1394clock.h index 411251e2d6..3e4912bf1c 100644 --- a/ext/raw1394/gst1394clock.h +++ b/ext/raw1394/gst1394clock.h @@ -31,21 +31,10 @@ G_BEGIN_DECLS -#define GST_TYPE_1394_CLOCK \ - (gst_1394_clock_get_type()) -#define GST_1394_CLOCK(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_1394_CLOCK,Gst1394Clock)) -#define GST_1394_CLOCK_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_1394_CLOCK,Gst1394ClockClass)) -#define GST_IS_1394_CLOCK(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_1394_CLOCK)) -#define GST_IS_1394_CLOCK_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_1394_CLOCK)) -#define GST_1394_CLOCK_CAST(obj) \ - ((Gst1394Clock*)(obj)) - -typedef struct _Gst1394Clock Gst1394Clock; -typedef struct _Gst1394ClockClass Gst1394ClockClass; +#define GST_TYPE_1394_CLOCK (gst_1394_clock_get_type()) +G_DECLARE_FINAL_TYPE (Gst1394Clock, gst_1394_clock, GST, 1394_CLOCK, + GstSystemClock) +#define GST_1394_CLOCK_CAST(obj) ((Gst1394Clock*)(obj)) /** * Gst1394Clock: @@ -62,11 +51,6 @@ struct _Gst1394Clock { guint32 cycle_timer_hi; }; -struct _Gst1394ClockClass { - GstSystemClockClass parent_class; -}; - -GType gst_1394_clock_get_type (void); Gst1394Clock* gst_1394_clock_new (const gchar *name); void gst_1394_clock_set_handle (Gst1394Clock *clock, raw1394handle_t handle); diff --git a/ext/raw1394/gstdv1394src.c b/ext/raw1394/gstdv1394src.c index 7ca9cd978a..2c0e8d6035 100644 --- a/ext/raw1394/gstdv1394src.c +++ b/ext/raw1394/gstdv1394src.c @@ -171,8 +171,7 @@ gst_dv1394src_class_init (GstDV1394SrcClass * klass) gst_dv1394src_signals[SIGNAL_FRAME_DROPPED] = g_signal_new ("frame-dropped", G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstDV1394SrcClass, frame_dropped), - NULL, NULL, NULL, G_TYPE_NONE, 0); + G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_PORT, g_param_spec_int ("port", "Port", "Port number (-1 automatic)", diff --git a/ext/raw1394/gstdv1394src.h b/ext/raw1394/gstdv1394src.h index 14a0178442..891d1fff74 100644 --- a/ext/raw1394/gstdv1394src.h +++ b/ext/raw1394/gstdv1394src.h @@ -33,19 +33,8 @@ G_BEGIN_DECLS -#define GST_TYPE_DV1394SRC \ - (gst_dv1394src_get_type()) -#define GST_DV1394SRC(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DV1394SRC,GstDV1394Src)) -#define GST_DV1394SRC_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DV1394SRC,GstDV1394SrcClass)) -#define GST_IS_DV1394SRC(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DV1394SRC)) -#define GST_IS_DV1394SRC_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DV1394SRC)) - -typedef struct _GstDV1394Src GstDV1394Src; -typedef struct _GstDV1394SrcClass GstDV1394SrcClass; +#define GST_TYPE_DV1394SRC (gst_dv1394src_get_type()) +G_DECLARE_FINAL_TYPE (GstDV1394Src, gst_dv1394src, GST, DV1394SRC, GstPushSrc) struct _GstDV1394Src { GstPushSrc element; @@ -87,15 +76,6 @@ struct _GstDV1394Src { Gst1394Clock *provided_clock; }; -struct _GstDV1394SrcClass { - GstPushSrcClass parent_class; - - /* signal */ - void (*frame_dropped) (GstElement *elem); -}; - -GType gst_dv1394src_get_type(void); - G_END_DECLS #endif /* __GST_GST1394_H__ */ diff --git a/ext/raw1394/gsthdv1394src.h b/ext/raw1394/gsthdv1394src.h index 6ae863c899..46dd0e6c09 100644 --- a/ext/raw1394/gsthdv1394src.h +++ b/ext/raw1394/gsthdv1394src.h @@ -32,19 +32,9 @@ G_BEGIN_DECLS -#define GST_TYPE_HDV1394SRC \ - (gst_hdv1394src_get_type()) -#define GST_HDV1394SRC(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_HDV1394SRC,GstHDV1394Src)) -#define GST_HDV1394SRC_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_HDV1394SRC,GstHDV1394SrcClass)) -#define GST_IS_HDV1394SRC(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_HDV1394SRC)) -#define GST_IS_HDV1394SRC_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_HDV1394SRC)) - -typedef struct _GstHDV1394Src GstHDV1394Src; -typedef struct _GstHDV1394SrcClass GstHDV1394SrcClass; +#define GST_TYPE_HDV1394SRC (gst_hdv1394src_get_type()) +G_DECLARE_FINAL_TYPE (GstHDV1394Src, gst_hdv1394src, GST, HDV1394SRC, + GstPushSrc) struct _GstHDV1394Src { GstPushSrc element; @@ -74,12 +64,6 @@ struct _GstHDV1394Src { iec61883_mpeg2_t iec61883mpeg2; }; -struct _GstHDV1394SrcClass { - GstPushSrcClass parent_class; -}; - -GType gst_hdv1394src_get_type(void); - G_END_DECLS #endif /* __GST_GST1394_H__ */