encoding: Use G_DECLARE_FINAL_TYPE

Note that we didn't do it for encodebin, as it has a class struct. We
_could_ techincally use `G_DECLARE_DERIVABLE_TYPE()` for that one, but
that would mean also using a private struct, which is even more work for
no gain.
This commit is contained in:
Niels De Graef 2020-03-12 07:55:52 +01:00 committed by GStreamer Merge Bot
parent b7d123f1bd
commit d297c4447d
4 changed files with 11 additions and 65 deletions

View file

@ -23,19 +23,9 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_SMART_ENCODER \ #define GST_TYPE_SMART_ENCODER (gst_smart_encoder_get_type())
(gst_smart_encoder_get_type()) G_DECLARE_FINAL_TYPE (GstSmartEncoder, gst_smart_encoder, GST, SMART_ENCODER,
#define GST_SMART_ENCODER(obj) \ GstElement)
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SMART_ENCODER,GstSmartEncoder))
#define GST_SMART_ENCODER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SMART_ENCODER,GstSmartEncoderClass))
#define GST_IS_SMART_ENCODER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SMART_ENCODER))
#define GST_IS_SMART_ENCODER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SMART_ENCODER))
typedef struct _GstSmartEncoder GstSmartEncoder;
typedef struct _GstSmartEncoderClass GstSmartEncoderClass;
struct _GstSmartEncoder { struct _GstSmartEncoder {
GstElement element; GstElement element;
@ -60,12 +50,6 @@ struct _GstSmartEncoder {
GstCaps *available_caps; GstCaps *available_caps;
}; };
struct _GstSmartEncoderClass {
GstElementClass parent_class;
};
GType gst_smart_encoder_get_type(void);
G_END_DECLS G_END_DECLS
#endif /* __SMART_ENCODER_H__ */ #endif /* __SMART_ENCODER_H__ */

View file

@ -24,13 +24,8 @@
#include <gst/gst.h> #include <gst/gst.h>
#define GST_TYPE_STREAM_COMBINER (gst_stream_combiner_get_type()) #define GST_TYPE_STREAM_COMBINER (gst_stream_combiner_get_type())
#define GST_STREAM_COMBINER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_STREAM_COMBINER,GstStreamCombiner)) G_DECLARE_FINAL_TYPE (GstStreamCombiner, gst_stream_combiner,
#define GST_STREAM_COMBINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_STREAM_COMBINER,GstStreamCombinerClass)) GST, STREAM_COMBINER, GstElement)
#define GST_IS_STREAM_COMBINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_STREAM_COMBINER))
#define GST_IS_STREAM_COMBINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_STREAM_COMBINER))
typedef struct _GstStreamCombiner GstStreamCombiner;
typedef struct _GstStreamCombinerClass GstStreamCombinerClass;
struct _GstStreamCombiner { struct _GstStreamCombiner {
GstElement parent; GstElement parent;
@ -49,12 +44,6 @@ struct _GstStreamCombiner {
}; };
struct _GstStreamCombinerClass {
GstElementClass parent;
};
GType gst_stream_combiner_get_type(void);
GstElement *gst_stream_combiner_new (gchar *name); GstElement *gst_stream_combiner_new (gchar *name);
#endif /* __GST_STREAMCOMBINER_H__ */ #endif /* __GST_STREAMCOMBINER_H__ */

View file

@ -28,17 +28,8 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_STREAM_COMBINER_PAD (gst_stream_combiner_pad_get_type()) #define GST_TYPE_STREAM_COMBINER_PAD (gst_stream_combiner_pad_get_type())
#define GST_STREAM_COMBINER_PAD(obj) \ G_DECLARE_FINAL_TYPE (GstStreamCombinerPad, gst_stream_combiner_pad,
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_STREAM_COMBINER_PAD, GstStreamCombinerPad)) GST, STREAM_COMBINER_PAD, GstPad)
#define GST_STREAM_COMBINER_PAD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_MIXER_PAD, GstStreamCombinerPadClass))
#define GST_IS_STREAM_COMBINER_PAD(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_STREAM_COMBINER_PAD))
#define GST_IS_STREAM_COMBINER_PAD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_STREAM_COMBINER_PAD))
typedef struct _GstStreamCombinerPad GstStreamCombinerPad;
typedef struct _GstStreamCombinerPadClass GstStreamCombinerPadClass;
/** /**
* GstStream_CombinerPad: * GstStream_CombinerPad:
@ -52,12 +43,5 @@ struct _GstStreamCombinerPad
gboolean is_eos; gboolean is_eos;
}; };
struct _GstStreamCombinerPadClass
{
GstPadClass parent_class;
};
GType gst_stream_combiner_pad_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __GST_STREAM_COMBINER_PAD_H__ */ #endif /* __GST_STREAM_COMBINER_PAD_H__ */

View file

@ -24,13 +24,8 @@
#include <gst/gst.h> #include <gst/gst.h>
#define GST_TYPE_STREAM_SPLITTER (gst_stream_splitter_get_type()) #define GST_TYPE_STREAM_SPLITTER (gst_stream_splitter_get_type())
#define GST_STREAM_SPLITTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_STREAM_SPLITTER,GstStreamSplitter)) G_DECLARE_FINAL_TYPE (GstStreamSplitter, gst_stream_splitter,
#define GST_STREAM_SPLITTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_STREAM_SPLITTER,GstStreamSplitterClass)) GST, STREAM_SPLITTER, GstElement)
#define GST_IS_STREAM_SPLITTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_STREAM_SPLITTER))
#define GST_IS_STREAM_SPLITTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_STREAM_SPLITTER))
typedef struct _GstStreamSplitter GstStreamSplitter;
typedef struct _GstStreamSplitterClass GstStreamSplitterClass;
struct _GstStreamSplitter { struct _GstStreamSplitter {
GstElement parent; GstElement parent;
@ -53,12 +48,6 @@ struct _GstStreamSplitter {
guint32 keyunit_seqnum; guint32 keyunit_seqnum;
}; };
struct _GstStreamSplitterClass {
GstElementClass parent;
};
GType gst_stream_splitter_get_type(void);
GstElement *gst_stream_splitter_new (gchar *name); GstElement *gst_stream_splitter_new (gchar *name);
#endif /* __GST_STREAMSPLITTER_H__ */ #endif /* __GST_STREAMSPLITTER_H__ */