mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
videofilter: Move all elements into a single plugin
Having all these small elements in a separate plugin is not very memory effective...
This commit is contained in:
parent
92cedb0510
commit
1584d16b1c
6 changed files with 66 additions and 79 deletions
|
@ -65,7 +65,10 @@ include $(top_srcdir)/common/coverage/lcov.mak
|
||||||
|
|
||||||
CRUFT_FILES = \
|
CRUFT_FILES = \
|
||||||
$(top_builddir)/common/shave \
|
$(top_builddir)/common/shave \
|
||||||
$(top_builddir)/common/shave-libtool
|
$(top_builddir)/common/shave-libtool \
|
||||||
|
$(top_builddir)/gst/videofilter/.libs/*videoflip.{so,dll,DLL,dylib} \
|
||||||
|
$(top_builddir)/gst/videofilter/.libs/*videobalance.{so,dll,DLL,dylib} \
|
||||||
|
$(top_builddir)/gst/videofilter/.libs/*gamma.{so,dll,DLL,dylib}
|
||||||
|
|
||||||
include $(top_srcdir)/common/cruft.mak
|
include $(top_srcdir)/common/cruft.mak
|
||||||
|
|
||||||
|
|
|
@ -1,46 +1,24 @@
|
||||||
# noinst_LTLIBRARIES = libgstvideoexample.la
|
plugin_LTLIBRARIES = libgstvideofilter.la
|
||||||
plugin_LTLIBRARIES = libgstvideoflip.la libgstvideobalance.la libgstgamma.la
|
|
||||||
|
|
||||||
noinst_HEADERS = gstvideoflip.h gstvideobalance.h gstgamma.h
|
noinst_HEADERS = gstvideoflip.h gstvideobalance.h gstgamma.h
|
||||||
|
|
||||||
EXTRA_DIST = gstvideotemplate.c make_filter
|
EXTRA_DIST = gstvideotemplate.c make_filter
|
||||||
CLEANFILES = gstvideoexample.c
|
CLEANFILES = gstvideoexample.c
|
||||||
|
|
||||||
# libgstvideoexample_la_SOURCES = gstvideoexample.c
|
libgstvideofilter_la_SOURCES = plugin.c \
|
||||||
# libgstvideoexample_la_CFLAGS = $(GST_CFLAGS)
|
gstvideoflip.c \
|
||||||
# libgstvideoexample_la_LIBADD = libgstvideofilter-@GST_MAJORMINOR@.la $(GST_LIBS)
|
gstvideobalance.c \
|
||||||
# libgstvideoexample_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
gstgamma.c
|
||||||
# libgstvideoexample_la_LIBTOOLFLAGS = --tag=disable-static
|
libgstvideofilter_la_CFLAGS = $(GST_CFLAGS) $(GST_CONTROLLER_CFLAGS) \
|
||||||
|
|
||||||
libgstvideoflip_la_SOURCES = gstvideoflip.c
|
|
||||||
libgstvideoflip_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
|
|
||||||
$(GST_PLUGINS_BASE_CFLAGS)
|
|
||||||
libgstvideoflip_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstvideo-@GST_MAJORMINOR@ $(GST_BASE_LIBS) $(GST_LIBS)
|
|
||||||
libgstvideoflip_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
|
||||||
libgstvideoflip_la_LIBTOOLFLAGS = --tag=disable-static
|
|
||||||
|
|
||||||
libgstvideobalance_la_SOURCES = gstvideobalance.c
|
|
||||||
libgstvideobalance_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
|
|
||||||
$(GST_PLUGINS_BASE_CFLAGS)
|
|
||||||
libgstvideobalance_la_LIBADD = \
|
|
||||||
$(GST_PLUGINS_BASE_LIBS) \
|
|
||||||
-lgstvideo-@GST_MAJORMINOR@ \
|
|
||||||
-lgstinterfaces-@GST_MAJORMINOR@ \
|
|
||||||
$(GST_BASE_LIBS) \
|
|
||||||
$(GST_LIBS) \
|
|
||||||
$(LIBM)
|
|
||||||
libgstvideobalance_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
|
||||||
libgstvideobalance_la_LIBTOOLFLAGS = --tag=disable-static
|
|
||||||
|
|
||||||
libgstgamma_la_SOURCES = gstgamma.c
|
|
||||||
libgstgamma_la_CFLAGS = $(GST_CFLAGS) $(GST_CONTROLLER_CFLAGS) \
|
|
||||||
$(GST_BASE_CFLAGS) \
|
$(GST_BASE_CFLAGS) \
|
||||||
$(GST_PLUGINS_BASE_CFLAGS)
|
$(GST_PLUGINS_BASE_CFLAGS)
|
||||||
libgstgamma_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstvideo-@GST_MAJORMINOR@ \
|
libgstvideofilter_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \
|
||||||
|
-lgstvideo-@GST_MAJORMINOR@ \
|
||||||
|
-lgstinterfaces-@GST_MAJORMINOR@ \
|
||||||
$(GST_CONTROLLER_LIBS) \
|
$(GST_CONTROLLER_LIBS) \
|
||||||
$(GST_BASE_LIBS) $(GST_LIBS)
|
$(GST_BASE_LIBS) $(GST_LIBS)
|
||||||
libgstgamma_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(LIBM)
|
libgstvideofilter_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(LIBM)
|
||||||
libgstgamma_la_LIBTOOLFLAGS = --tag=disable-static
|
libgstvideofilter_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
|
|
||||||
gstvideoexample.c: $(srcdir)/make_filter $(srcdir)/gstvideotemplate.c
|
gstvideoexample.c: $(srcdir)/make_filter $(srcdir)/gstvideotemplate.c
|
||||||
$(srcdir)/make_filter Videoexample $(srcdir)/gstvideotemplate.c
|
$(srcdir)/make_filter Videoexample $(srcdir)/gstvideotemplate.c
|
||||||
|
|
|
@ -131,6 +131,8 @@ gst_gamma_class_init (GstGammaClass * g_class)
|
||||||
GObjectClass *gobject_class = (GObjectClass *) g_class;
|
GObjectClass *gobject_class = (GObjectClass *) g_class;
|
||||||
GstBaseTransformClass *trans_class = (GstBaseTransformClass *) g_class;
|
GstBaseTransformClass *trans_class = (GstBaseTransformClass *) g_class;
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY_INIT (gamma_debug, "gamma", 0, "gamma");
|
||||||
|
|
||||||
gobject_class->set_property = gst_gamma_set_property;
|
gobject_class->set_property = gst_gamma_set_property;
|
||||||
gobject_class->get_property = gst_gamma_get_property;
|
gobject_class->get_property = gst_gamma_get_property;
|
||||||
|
|
||||||
|
@ -436,19 +438,3 @@ not_negotiated:
|
||||||
return GST_FLOW_NOT_NEGOTIATED;
|
return GST_FLOW_NOT_NEGOTIATED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
plugin_init (GstPlugin * plugin)
|
|
||||||
{
|
|
||||||
GST_DEBUG_CATEGORY_INIT (gamma_debug, "gamma", 0, "gamma");
|
|
||||||
|
|
||||||
gst_controller_init (NULL, NULL);
|
|
||||||
|
|
||||||
return gst_element_register (plugin, "gamma", GST_RANK_NONE, GST_TYPE_GAMMA);
|
|
||||||
}
|
|
||||||
|
|
||||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
||||||
GST_VERSION_MINOR,
|
|
||||||
"gamma",
|
|
||||||
"Changes gamma on video images",
|
|
||||||
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
|
|
||||||
|
|
|
@ -610,17 +610,3 @@ gst_video_balance_get_type (void)
|
||||||
}
|
}
|
||||||
return video_balance_type;
|
return video_balance_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
plugin_init (GstPlugin * plugin)
|
|
||||||
{
|
|
||||||
return gst_element_register (plugin, "videobalance", GST_RANK_NONE,
|
|
||||||
GST_TYPE_VIDEO_BALANCE);
|
|
||||||
}
|
|
||||||
|
|
||||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
||||||
GST_VERSION_MINOR,
|
|
||||||
"videobalance",
|
|
||||||
"Changes hue, saturation, brightness etc. on video images",
|
|
||||||
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
|
|
||||||
|
|
|
@ -625,6 +625,8 @@ gst_video_flip_class_init (gpointer klass, gpointer class_data)
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
GstBaseTransformClass *trans_class;
|
GstBaseTransformClass *trans_class;
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY_INIT (video_flip_debug, "videoflip", 0, "videoflip");
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
trans_class = (GstBaseTransformClass *) klass;
|
trans_class = (GstBaseTransformClass *) klass;
|
||||||
|
|
||||||
|
@ -659,15 +661,6 @@ gst_video_flip_init (GTypeInstance * instance, gpointer g_class)
|
||||||
GST_DEBUG_FUNCPTR (gst_video_flip_handle_src_event));
|
GST_DEBUG_FUNCPTR (gst_video_flip_handle_src_event));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
plugin_init (GstPlugin * plugin)
|
|
||||||
{
|
|
||||||
GST_DEBUG_CATEGORY_INIT (video_flip_debug, "videoflip", 0, "videoflip");
|
|
||||||
|
|
||||||
return gst_element_register (plugin, "videoflip", GST_RANK_NONE,
|
|
||||||
GST_TYPE_VIDEO_FLIP);
|
|
||||||
}
|
|
||||||
|
|
||||||
GType
|
GType
|
||||||
gst_video_flip_get_type (void)
|
gst_video_flip_get_type (void)
|
||||||
{
|
{
|
||||||
|
@ -691,9 +684,3 @@ gst_video_flip_get_type (void)
|
||||||
}
|
}
|
||||||
return video_flip_type;
|
return video_flip_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
||||||
GST_VERSION_MINOR,
|
|
||||||
"videoflip",
|
|
||||||
"Flips and rotates video",
|
|
||||||
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
|
|
||||||
|
|
47
gst/videofilter/plugin.c
Normal file
47
gst/videofilter/plugin.c
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
/* GStreamer
|
||||||
|
* Copyright (C) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
* Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <gst/gst.h>
|
||||||
|
#include <gst/controller/gstcontroller.h>
|
||||||
|
|
||||||
|
#include "gstgamma.h"
|
||||||
|
#include "gstvideoflip.h"
|
||||||
|
#include "gstvideobalance.h"
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
plugin_init (GstPlugin * plugin)
|
||||||
|
{
|
||||||
|
gst_controller_init (NULL, NULL);
|
||||||
|
|
||||||
|
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_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||||
|
GST_VERSION_MINOR,
|
||||||
|
"videofilter",
|
||||||
|
"Video filters plugin",
|
||||||
|
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
|
Loading…
Reference in a new issue