rawparse: Use G_DECLARE_FINAL_TYPE
authorNiels De Graef <nielsdegraef@gmail.com>
Thu, 12 Mar 2020 12:20:51 +0000 (13:20 +0100)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 16 Mar 2020 15:47:58 +0000 (15:47 +0000)
gst/rawparse/gstrawaudioparse.h
gst/rawparse/gstrawbaseparse.h
gst/rawparse/gstrawvideoparse.h
gst/rawparse/gstunalignedaudioparse.c
gst/rawparse/gstunalignedaudioparse.h
gst/rawparse/gstunalignedvideoparse.c
gst/rawparse/gstunalignedvideoparse.h

index a5c8589..9538408 100644 (file)
 
 G_BEGIN_DECLS
 
-#define GST_TYPE_RAW_AUDIO_PARSE \
-  (gst_raw_audio_parse_get_type())
-#define GST_RAW_AUDIO_PARSE(obj) \
-  (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_RAW_AUDIO_PARSE, GstRawAudioParse))
-#define GST_RAW_AUDIO_PARSE_CAST(obj) \
-  ((GstRawAudioParse *)(obj))
-#define GST_RAW_AUDIO_PARSE_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_RAW_AUDIO_PARSE, GstRawAudioParseClass))
-#define GST_IS_RAW_AUDIO_PARSE(obj) \
-  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_RAW_AUDIO_PARSE))
-#define GST_IS_RAW_AUDIO_PARSE_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_RAW_AUDIO_PARSE))
+#define GST_TYPE_RAW_AUDIO_PARSE (gst_raw_audio_parse_get_type())
+#define GST_RAW_AUDIO_PARSE_CAST(obj) ((GstRawAudioParse *)(obj))
+G_DECLARE_FINAL_TYPE (GstRawAudioParse, gst_raw_audio_parse,
+    GST, RAW_AUDIO_PARSE, GstRawBaseParse)
 
 typedef enum _GstRawAudioParseFormat GstRawAudioParseFormat;
 
 typedef struct _GstRawAudioParseConfig GstRawAudioParseConfig;
-typedef struct _GstRawAudioParse GstRawAudioParse;
-typedef struct _GstRawAudioParseClass GstRawAudioParseClass;
 
 enum _GstRawAudioParseFormat
 {
@@ -111,12 +101,6 @@ struct _GstRawAudioParse
   GstRawAudioParseConfig *current_config;
 };
 
-struct _GstRawAudioParseClass
-{
-  GstRawBaseParseClass parent_class;
-};
-
-GType gst_raw_audio_parse_get_type (void);
 GType gst_raw_audio_parse_format_get_type (void);
 
 G_END_DECLS
index 6427cb6..9a6089a 100644 (file)
@@ -198,6 +198,8 @@ void gst_raw_base_parse_invalidate_src_caps (GstRawBaseParse * raw_base_parse);
 
 GType gst_raw_base_parse_get_type (void);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstRawBaseParse, gst_object_unref)
+
 G_END_DECLS
 
 #endif
index 3694dc2..2c8cb4e 100644 (file)
 
 G_BEGIN_DECLS
 
-#define GST_TYPE_RAW_VIDEO_PARSE \
-  (gst_raw_video_parse_get_type())
-#define GST_RAW_VIDEO_PARSE(obj) \
-  (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_RAW_VIDEO_PARSE, GstRawVideoParse))
-#define GST_RAW_VIDEO_PARSE_CAST(obj) \
-  ((GstRawVideoParse *)(obj))
-#define GST_RAW_VIDEO_PARSE_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_RAW_VIDEO_PARSE, GstRawVideoParseClass))
-#define GST_IS_RAW_VIDEO_PARSE(obj) \
-  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_RAW_VIDEO_PARSE))
-#define GST_IS_RAW_VIDEO_PARSE_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_RAW_VIDEO_PARSE))
+#define GST_TYPE_RAW_VIDEO_PARSE (gst_raw_video_parse_get_type())
+#define GST_RAW_VIDEO_PARSE_CAST(obj) ((GstRawVideoParse *)(obj))
+G_DECLARE_FINAL_TYPE (GstRawVideoParse, gst_raw_video_parse,
+    GST, RAW_VIDEO_PARSE, GstRawBaseParse)
 
 typedef struct _GstRawVideoParseConfig GstRawVideoParseConfig;
-typedef struct _GstRawVideoParse GstRawVideoParse;
-typedef struct _GstRawVideoParseClass GstRawVideoParseClass;
 
 /* Contains information about the video frame format. */
 struct _GstRawVideoParseConfig
@@ -101,13 +91,6 @@ struct _GstRawVideoParse
   GstRawVideoParseConfig *current_config;
 };
 
-struct _GstRawVideoParseClass
-{
-  GstRawBaseParseClass parent_class;
-};
-
-GType gst_raw_video_parse_get_type (void);
-
 G_END_DECLS
 
 #endif
index 38f387f..9c57232 100644 (file)
@@ -35,11 +35,6 @@ struct _GstUnalignedAudioParse
   GstElement *inner_parser;
 };
 
-struct _GstUnalignedAudioParseClass
-{
-  GstBinClass parent_class;
-};
-
 static GstStaticPadTemplate static_sink_template =
 GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
index a07bee7..42d7455 100644 (file)
 
 G_BEGIN_DECLS
 
-#define GST_TYPE_UNALIGNED_AUDIO_PARSE \
-  (gst_unaligned_audio_parse_get_type())
-#define GST_UNALIGNED_AUDIO_PARSE(obj) \
-  (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_UNALIGNED_AUDIO_PARSE, GstUnalignedAudioParse))
-#define GST_UNALIGNED_AUDIO_PARSE_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_UNALIGNED_AUDIO_PARSE, GstUnalignedAudioParseClass))
-#define GST_UNALIGNED_AUDIO_PARSE_CAST(obj) \
-  ((GstUnalignedAudioParse *)(obj))
-#define GST_IS_UNALIGNED_AUDIO_PARSE(obj) \
-  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_UNALIGNED_AUDIO_PARSE))
-#define GST_IS_UNALIGNED_AUDIO_PARSE_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_UNALIGNED_AUDIO_PARSE))
-
-typedef struct _GstUnalignedAudioParse GstUnalignedAudioParse;
-typedef struct _GstUnalignedAudioParseClass GstUnalignedAudioParseClass;
-
-GType gst_unaligned_audio_parse_get_type (void);
+#define GST_TYPE_UNALIGNED_AUDIO_PARSE (gst_unaligned_audio_parse_get_type())
+#define GST_UNALIGNED_AUDIO_PARSE_CAST(obj) ((GstRawAudioParse *)(obj))
+G_DECLARE_FINAL_TYPE (GstUnalignedAudioParse, gst_unaligned_audio_parse,
+    GST, UNALIGNED_AUDIO_PARSE, GstBin)
 
 G_END_DECLS
 
index 81ff3ea..7135f26 100644 (file)
@@ -35,11 +35,6 @@ struct _GstUnalignedVideoParse
   GstElement *inner_parser;
 };
 
-struct _GstUnalignedVideoParseClass
-{
-  GstBinClass parent_class;
-};
-
 static GstStaticPadTemplate static_sink_template =
 GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
index da40ac9..9863d0d 100644 (file)
 
 G_BEGIN_DECLS
 
-#define GST_TYPE_UNALIGNED_VIDEO_PARSE \
-  (gst_unaligned_video_parse_get_type())
-#define GST_UNALIGNED_VIDEO_PARSE(obj) \
-  (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_UNALIGNED_VIDEO_PARSE, GstUnalignedVideoParse))
-#define GST_UNALIGNED_VIDEO_PARSE_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_UNALIGNED_VIDEO_PARSE, GstUnalignedVideoParseClass))
-#define GST_UNALIGNED_VIDEO_PARSE_CAST(obj) \
-  ((GstUnalignedVideoParse *)(obj))
-#define GST_IS_UNALIGNED_VIDEO_PARSE(obj) \
-  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_UNALIGNED_VIDEO_PARSE))
-#define GST_IS_UNALIGNED_VIDEO_PARSE_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_UNALIGNED_VIDEO_PARSE))
-
-typedef struct _GstUnalignedVideoParse GstUnalignedVideoParse;
-typedef struct _GstUnalignedVideoParseClass GstUnalignedVideoParseClass;
-
-GType gst_unaligned_video_parse_get_type (void);
+#define GST_TYPE_UNALIGNED_VIDEO_PARSE (gst_unaligned_video_parse_get_type())
+#define GST_UNALIGNED_VIDEO_PARSE_CAST(obj) ((GstRawAudioParse *)(obj))
+G_DECLARE_FINAL_TYPE (GstUnalignedVideoParse, gst_unaligned_video_parse,
+    GST, UNALIGNED_VIDEO_PARSE, GstBin)
 
 G_END_DECLS