videofilter: allow per feature registration

Split plugin into features including
dynamic types which can be indiviually
registered during a static build.

More details here:

https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/876>
This commit is contained in:
Stéphane Cerveau 2021-02-16 15:05:43 +01:00
parent 8f1384c977
commit 7cd54ccfc1
9 changed files with 23 additions and 7 deletions

View file

@ -102,6 +102,7 @@ static void gst_gamma_before_transform (GstBaseTransform * transform,
static void gst_gamma_calculate_tables (GstGamma * gamma);
G_DEFINE_TYPE (GstGamma, gst_gamma, GST_TYPE_VIDEO_FILTER);
GST_ELEMENT_REGISTER_DEFINE (gamma, "gamma", GST_RANK_NONE, GST_TYPE_GAMMA);
static void
gst_gamma_class_init (GstGammaClass * g_class)

View file

@ -70,6 +70,8 @@ struct _GstGammaClass
GType gst_gamma_get_type(void);
GST_ELEMENT_REGISTER_DECLARE (gamma);
G_END_DECLS
#endif /* __GST_VIDEO_GAMMA_H__ */

View file

@ -101,6 +101,8 @@ G_DEFINE_TYPE_WITH_CODE (GstVideoBalance, gst_video_balance,
GST_TYPE_VIDEO_FILTER,
G_IMPLEMENT_INTERFACE (GST_TYPE_COLOR_BALANCE,
gst_video_balance_colorbalance_init));
GST_ELEMENT_REGISTER_DEFINE (videobalance, "videobalance",
GST_RANK_NONE, GST_TYPE_VIDEO_BALANCE);
/*
* look-up tables (LUT).

View file

@ -74,6 +74,8 @@ struct _GstVideoBalanceClass {
GType gst_video_balance_get_type(void);
GST_ELEMENT_REGISTER_DECLARE (videobalance);
G_END_DECLS
#endif /* __GST_VIDEO_BALANCE_H__ */

View file

@ -124,6 +124,8 @@ gst_video_flip_video_direction_interface_init (GstVideoDirectionInterface *
G_DEFINE_TYPE_WITH_CODE (GstVideoFlip, gst_video_flip, GST_TYPE_VIDEO_FILTER,
G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_DIRECTION,
gst_video_flip_video_direction_interface_init));
GST_ELEMENT_REGISTER_DEFINE (videoflip, "videoflip", GST_RANK_NONE,
GST_TYPE_VIDEO_FLIP);
static GstCaps *
gst_video_flip_transform_caps (GstBaseTransform * trans,

View file

@ -92,6 +92,8 @@ struct _GstVideoFlipClass {
GType gst_video_flip_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (videoflip);
G_END_DECLS
#endif /* __GST_VIDEO_FLIP_H__ */

View file

@ -76,6 +76,8 @@ gst_video_median_size_get_type (void)
#define gst_video_median_parent_class parent_class
G_DEFINE_TYPE (GstVideoMedian, gst_video_median, GST_TYPE_VIDEO_FILTER);
GST_ELEMENT_REGISTER_DEFINE (videomedian, "videomedian",
GST_RANK_NONE, GST_TYPE_VIDEO_MEDIAN);
static GstFlowReturn gst_video_median_transform_frame (GstVideoFilter * filter,
GstVideoFrame * in_frame, GstVideoFrame * out_frame);

View file

@ -61,6 +61,8 @@ struct _GstVideoMedianClass {
GType gst_video_median_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (videomedian);
G_END_DECLS
#endif /* __GST_VIDEO_MEDIAN_H__ */

View file

@ -31,13 +31,14 @@
static gboolean
plugin_init (GstPlugin * plugin)
{
return (gst_element_register (plugin, "gamma", GST_RANK_NONE, GST_TYPE_GAMMA)
&& gst_element_register (plugin, "videobalance", GST_RANK_NONE,
GST_TYPE_VIDEO_BALANCE)
&& gst_element_register (plugin, "videoflip", GST_RANK_NONE,
GST_TYPE_VIDEO_FLIP)
&& gst_element_register (plugin, "videomedian", GST_RANK_NONE,
GST_TYPE_VIDEO_MEDIAN));
gboolean ret = FALSE;
ret |= GST_ELEMENT_REGISTER (gamma, plugin);
ret |= GST_ELEMENT_REGISTER (videobalance, plugin);
ret |= GST_ELEMENT_REGISTER (videoflip, plugin);
ret |= GST_ELEMENT_REGISTER (videomedian, plugin);
return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,