mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 02:15:31 +00:00
[503/906] Rename GST_BOILERPLATE_* to G_DEFINE_TYPE_* and move _base_init into _class_init
This commit is contained in:
parent
6f2acb94c6
commit
d66bd69b36
22 changed files with 264 additions and 340 deletions
|
@ -49,10 +49,10 @@
|
|||
GST_DEBUG_CATEGORY_STATIC (gst_gl_display_debug);
|
||||
#define GST_CAT_DEFAULT gst_gl_display_debug
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_display_debug, "gldisplay", 0, "opengl display");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLDisplay, gst_gl_display, GObject, G_TYPE_OBJECT,
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLDisplay, gst_gl_display, G_TYPE_OBJECT,
|
||||
DEBUG_INIT);
|
||||
static void gst_gl_display_finalize (GObject * object);
|
||||
|
||||
|
@ -102,12 +102,6 @@ void gst_gl_display_thread_do_download_draw_yuv (GstGLDisplay * display);
|
|||
//------------------------------------------------------------
|
||||
//---------------------- For klass GstGLDisplay ---------------
|
||||
//------------------------------------------------------------
|
||||
|
||||
static void
|
||||
gst_gl_display_base_init (gpointer g_class)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_display_class_init (GstGLDisplayClass * klass)
|
||||
{
|
||||
|
@ -118,7 +112,7 @@ gst_gl_display_class_init (GstGLDisplayClass * klass)
|
|||
|
||||
|
||||
static void
|
||||
gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
|
||||
gst_gl_display_init (GstGLDisplay * display)
|
||||
{
|
||||
//thread safe
|
||||
display->mutex = g_mutex_new ();
|
||||
|
|
|
@ -51,11 +51,11 @@ enum
|
|||
PROP_EXTERNAL_OPENGL_CONTEXT
|
||||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_filter_debug, "glfilter", 0, "glfilter element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLFilter, gst_gl_filter, GstBaseTransform,
|
||||
GST_TYPE_BASE_TRANSFORM, DEBUG_INIT);
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLFilter, gst_gl_filter, GST_TYPE_BASE_TRANSFORM,
|
||||
DEBUG_INIT);
|
||||
|
||||
static void gst_gl_filter_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec);
|
||||
|
@ -83,25 +83,16 @@ static gboolean gst_gl_filter_do_transform (GstGLFilter * filter,
|
|||
static void gst_gl_filter_start_gl (GstGLDisplay * display, gpointer data);
|
||||
static void gst_gl_filter_stop_gl (GstGLDisplay * display, gpointer data);
|
||||
|
||||
|
||||
static void
|
||||
gst_gl_filter_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_filter_src_pad_template));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_filter_sink_pad_template));
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_class_init (GstGLFilterClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gobject_class->set_property = gst_gl_filter_set_property;
|
||||
element_class = GST_ELEMENT_CLASS (klass)
|
||||
|
||||
gobject_class->set_property = gst_gl_filter_set_property;
|
||||
gobject_class->get_property = gst_gl_filter_get_property;
|
||||
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->transform_caps =
|
||||
|
@ -120,6 +111,11 @@ gst_gl_filter_class_init (GstGLFilterClass * klass)
|
|||
"Give an external OpenGL context with which to share textures",
|
||||
0, G_MAXULONG, 0, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_filter_src_pad_template));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_filter_sink_pad_template));
|
||||
|
||||
klass->set_caps = NULL;
|
||||
klass->filter = NULL;
|
||||
klass->display_init_cb = NULL;
|
||||
|
@ -131,7 +127,7 @@ gst_gl_filter_class_init (GstGLFilterClass * klass)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_init (GstGLFilter * filter, GstGLFilterClass * klass)
|
||||
gst_gl_filter_init (GstGLFilter * filter)
|
||||
{
|
||||
GstBaseTransform *base_trans = GST_BASE_TRANSFORM (filter);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/base/gstcollectpads.h>
|
||||
#include <gst/controller/gstcontroller.h>
|
||||
//#include <gst/controller/gstcontroller.h>
|
||||
#include <gst/video/video.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
|
@ -227,8 +227,9 @@ static void gst_gl_mixer_child_proxy_init (gpointer g_iface,
|
|||
gpointer iface_data);
|
||||
static void _do_init (GType object_type);
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLMixer, gst_gl_mixer, GstElement,
|
||||
GST_TYPE_ELEMENT, _do_init);
|
||||
#define gst_gl_mixer_parent_class parent_class
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLMixer, gst_gl_mixer, GST_TYPE_ELEMENT, _do_init);
|
||||
static void gst_gl_mixer_finalize (GObject * object);
|
||||
|
||||
static void
|
||||
_do_init (GType object_type)
|
||||
|
@ -282,33 +283,29 @@ gst_gl_mixer_child_proxy_init (gpointer g_iface, gpointer iface_data)
|
|||
iface->get_children_count = gst_gl_mixer_child_proxy_get_children_count;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_mixer_base_init (gpointer g_class)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&src_factory));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&sink_factory));
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_mixer_class_init (GstGLMixerClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class = (GObjectClass *) klass;
|
||||
GstElementClass *gstelement_class = (GstElementClass *) klass;
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_gl_mixer_finalize);
|
||||
|
||||
gobject_class->get_property = gst_gl_mixer_get_property;
|
||||
gobject_class->set_property = gst_gl_mixer_set_property;
|
||||
|
||||
gstelement_class->request_new_pad =
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&src_factory));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&sink_factory));
|
||||
|
||||
element_class->request_new_pad =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_mixer_request_new_pad);
|
||||
gstelement_class->release_pad = GST_DEBUG_FUNCPTR (gst_gl_mixer_release_pad);
|
||||
gstelement_class->change_state =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_mixer_change_state);
|
||||
element_class->release_pad = GST_DEBUG_FUNCPTR (gst_gl_mixer_release_pad);
|
||||
element_class->change_state = GST_DEBUG_FUNCPTR (gst_gl_mixer_change_state);
|
||||
|
||||
/* Register the pad class */
|
||||
(void) (GST_TYPE_GL_MIXER_PAD);
|
||||
|
@ -354,7 +351,7 @@ gst_gl_mixer_reset (GstGLMixer * mix)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_mixer_init (GstGLMixer * mix, GstGLMixerClass * g_class)
|
||||
gst_gl_mixer_init (GstGLMixer * mix)
|
||||
{
|
||||
GstElementClass *klass = GST_ELEMENT_GET_CLASS (mix);
|
||||
|
||||
|
|
|
@ -55,11 +55,11 @@ enum
|
|||
PROP_LOCATION
|
||||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_bumper_debug, "glbumper", 0, "glbumper element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLBumper, gst_gl_bumper, GstGLFilter,
|
||||
GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLBumper, gst_gl_bumper, GST_TYPE_GL_FILTER,
|
||||
DEBUG_INIT);
|
||||
|
||||
static void gst_gl_bumper_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec);
|
||||
|
@ -263,23 +263,14 @@ gst_gl_bumper_reset_resources (GstGLFilter * filter)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_bumper_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "OpenGL bumper filter",
|
||||
"Filter/Effect", "Bump mapping filter",
|
||||
"Cyril Comparon <cyril.comparon@gmail.com>, "
|
||||
"Julien Isorce <julien.isorce@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_bumper_class_init (GstGLBumperClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
gobject_class->set_property = gst_gl_bumper_set_property;
|
||||
gobject_class->get_property = gst_gl_bumper_get_property;
|
||||
|
||||
|
@ -294,10 +285,15 @@ gst_gl_bumper_class_init (GstGLBumperClass * klass)
|
|||
"Normal map location",
|
||||
"Normal map location", NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "OpenGL bumper filter",
|
||||
"Filter/Effect", "Bump mapping filter",
|
||||
"Cyril Comparon <cyril.comparon@gmail.com>, "
|
||||
"Julien Isorce <julien.isorce@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_bumper_init (GstGLBumper * bumper, GstGLBumperClass * klass)
|
||||
gst_gl_bumper_init (GstGLBumper * bumper)
|
||||
{
|
||||
bumper->shader = NULL;
|
||||
bumper->bumpmap = 0;
|
||||
|
|
|
@ -83,10 +83,10 @@ enum
|
|||
PROP_0
|
||||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_colorscale_debug, "glcolorscale", 0, "glcolorscale element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLColorscale, gst_gl_colorscale, GstBaseTransform,
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLColorscale, gst_gl_colorscale,
|
||||
GST_TYPE_BASE_TRANSFORM, DEBUG_INIT);
|
||||
|
||||
static void gst_gl_colorscale_set_property (GObject * object, guint prop_id,
|
||||
|
@ -112,7 +112,19 @@ static gboolean gst_gl_colorscale_get_unit_size (GstBaseTransform * trans,
|
|||
static void
|
||||
gst_gl_colorscale_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_colorscale_class_init (GstGLColorscaleClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_colorscale_set_property;
|
||||
gobject_class->get_property = gst_gl_colorscale_get_property;
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "OpenGL color scale",
|
||||
"Filter/Effect", "Colorspace converter and video scaler",
|
||||
|
@ -122,16 +134,6 @@ gst_gl_colorscale_base_init (gpointer klass)
|
|||
gst_static_pad_template_get (&gst_gl_colorscale_src_pad_template));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_colorscale_sink_pad_template));
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_colorscale_class_init (GstGLColorscaleClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gobject_class->set_property = gst_gl_colorscale_set_property;
|
||||
gobject_class->get_property = gst_gl_colorscale_get_property;
|
||||
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->transform_caps =
|
||||
gst_gl_colorscale_transform_caps;
|
||||
|
@ -145,8 +147,7 @@ gst_gl_colorscale_class_init (GstGLColorscaleClass * klass)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_colorscale_init (GstGLColorscale * colorscale,
|
||||
GstGLColorscaleClass * klass)
|
||||
gst_gl_colorscale_init (GstGLColorscale * colorscale)
|
||||
{
|
||||
gst_gl_colorscale_reset (colorscale);
|
||||
}
|
||||
|
|
|
@ -46,11 +46,11 @@ enum
|
|||
PROP_0
|
||||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_deinterlace_debug, "gldeinterlace", 0, "gldeinterlace element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLDeinterlace, gst_gl_deinterlace,
|
||||
GstGLFilter, GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLDeinterlace, gst_gl_deinterlace,
|
||||
GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
|
||||
static void gst_gl_deinterlace_set_property (GObject * object,
|
||||
guint prop_id, const GValue * value, GParamSpec * pspec);
|
||||
|
@ -74,24 +74,21 @@ static const gchar *greedyh_fragment_source = "#extension GL_ARB_texture_rectang
|
|||
"" " gl_FragColor = vec4(last, 1.0);\n" " }\n" "}\n";
|
||||
|
||||
static void
|
||||
gst_gl_deinterlace_base_init (gpointer klass)
|
||||
gst_gl_deinterlace_class_init (GstGLDeinterlaceClass * klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_deinterlace_set_property;
|
||||
gobject_class->get_property = gst_gl_deinterlace_get_property;
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"OpenGL deinterlacing filter", "Deinterlace",
|
||||
"Deinterlacing based on fragment shaders",
|
||||
"Julien Isorce <julien.isorce@mail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_deinterlace_class_init (GstGLDeinterlaceClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gobject_class->set_property = gst_gl_deinterlace_set_property;
|
||||
gobject_class->get_property = gst_gl_deinterlace_get_property;
|
||||
|
||||
GST_GL_FILTER_CLASS (klass)->filter = gst_gl_deinterlace_filter;
|
||||
GST_GL_FILTER_CLASS (klass)->onInitFBO = gst_gl_deinterlace_init_shader;
|
||||
|
@ -99,8 +96,7 @@ gst_gl_deinterlace_class_init (GstGLDeinterlaceClass * klass)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_deinterlace_init (GstGLDeinterlace * filter,
|
||||
GstGLDeinterlaceClass * klass)
|
||||
gst_gl_deinterlace_init (GstGLDeinterlace * filter)
|
||||
{
|
||||
filter->shader = NULL;
|
||||
filter->gl_buffer_prev = NULL;
|
||||
|
|
|
@ -49,10 +49,10 @@
|
|||
#define GST_CAT_DEFAULT gst_gl_differencematte_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_differencematte_debug, "gldifferencematte", 0, "gldifferencematte element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLDifferenceMatte, gst_gl_differencematte, GstGLFilter,
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLDifferenceMatte, gst_gl_differencematte,
|
||||
GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
|
||||
static void gst_gl_differencematte_set_property (GObject * object,
|
||||
|
@ -160,23 +160,14 @@ gst_gl_differencematte_reset_gl_resources (GstGLFilter * filter)
|
|||
differencematte->bg_has_changed = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_differencematte_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"Gstreamer OpenGL DifferenceMatte", "Filter/Effect",
|
||||
"Saves a background frame and replace it with a pixbuf",
|
||||
"Filippo Argiolas <filippo.argiolas@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_differencematte_class_init (GstGLDifferenceMatteClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
gobject_class->set_property = gst_gl_differencematte_set_property;
|
||||
gobject_class->get_property = gst_gl_differencematte_get_property;
|
||||
|
||||
|
@ -194,6 +185,11 @@ gst_gl_differencematte_class_init (GstGLDifferenceMatteClass * klass)
|
|||
"Background image location",
|
||||
"Background image location", NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"Gstreamer OpenGL DifferenceMatte", "Filter/Effect",
|
||||
"Saves a background frame and replace it with a pixbuf",
|
||||
"Filippo Argiolas <filippo.argiolas@gmail.com>");
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -221,8 +217,7 @@ gst_gl_differencematte_draw_texture (GstGLDifferenceMatte * differencematte,
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_differencematte_init (GstGLDifferenceMatte * differencematte,
|
||||
GstGLDifferenceMatteClass * klass)
|
||||
gst_gl_differencematte_init (GstGLDifferenceMatte * differencematte)
|
||||
{
|
||||
differencematte->shader[0] = NULL;
|
||||
differencematte->shader[1] = NULL;
|
||||
|
|
|
@ -115,10 +115,10 @@ enum
|
|||
PROP_0
|
||||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_download_debug, "gldownload", 0, "gldownload element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLDownload, gst_gl_download, GstBaseTransform,
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLDownload, gst_gl_download,
|
||||
GST_TYPE_BASE_TRANSFORM, DEBUG_INIT);
|
||||
|
||||
static void gst_gl_download_set_property (GObject * object, guint prop_id,
|
||||
|
@ -142,9 +142,16 @@ static gboolean gst_gl_download_get_unit_size (GstBaseTransform * trans,
|
|||
|
||||
|
||||
static void
|
||||
gst_gl_download_base_init (gpointer klass)
|
||||
gst_gl_download_class_init (GstGLDownloadClass * klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_download_set_property;
|
||||
gobject_class->get_property = gst_gl_download_get_property;
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "OpenGL video maker",
|
||||
"Filter/Effect", "A from GL to video flow filter",
|
||||
|
@ -154,17 +161,6 @@ gst_gl_download_base_init (gpointer klass)
|
|||
gst_static_pad_template_get (&gst_gl_download_src_pad_template));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_download_sink_pad_template));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gst_gl_download_class_init (GstGLDownloadClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gobject_class->set_property = gst_gl_download_set_property;
|
||||
gobject_class->get_property = gst_gl_download_get_property;
|
||||
|
||||
GST_BASE_TRANSFORM_CLASS (klass)->transform_caps =
|
||||
gst_gl_download_transform_caps;
|
||||
|
@ -178,7 +174,7 @@ gst_gl_download_class_init (GstGLDownloadClass * klass)
|
|||
|
||||
|
||||
static void
|
||||
gst_gl_download_init (GstGLDownload * download, GstGLDownloadClass * klass)
|
||||
gst_gl_download_init (GstGLDownload * download)
|
||||
{
|
||||
GstBaseTransform *base_trans = GST_BASE_TRANSFORM (download);
|
||||
|
||||
|
|
|
@ -44,11 +44,11 @@
|
|||
#define GST_CAT_DEFAULT gst_gl_effects_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_effects_debug, "gleffects", 0, "gleffects element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLEffects, gst_gl_effects, GstGLFilter,
|
||||
GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLEffects, gst_gl_effects, GST_TYPE_GL_FILTER,
|
||||
DEBUG_INIT);
|
||||
|
||||
static void gst_gl_effects_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec);
|
||||
|
@ -223,23 +223,15 @@ gst_gl_effects_reset_gl_resources (GstGLFilter * filter)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_effects_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"Gstreamer OpenGL Effects", "Filter/Effect",
|
||||
"GL Shading Language effects",
|
||||
"Filippo Argiolas <filippo.argiolas@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_effects_class_init (GstGLEffectsClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_effects_set_property;
|
||||
gobject_class->get_property = gst_gl_effects_get_property;
|
||||
|
||||
|
@ -265,6 +257,11 @@ gst_gl_effects_class_init (GstGLEffectsClass * klass)
|
|||
"Horizontal Swap",
|
||||
"Switch video texture left to right, useful with webcams",
|
||||
FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"Gstreamer OpenGL Effects", "Filter/Effect",
|
||||
"GL Shading Language effects",
|
||||
"Filippo Argiolas <filippo.argiolas@gmail.com>");
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -341,7 +338,7 @@ set_horizontal_swap (GstGLDisplay * display, gpointer data)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_effects_init (GstGLEffects * effects, GstGLEffectsClass * klass)
|
||||
gst_gl_effects_init (GstGLEffects * effects)
|
||||
{
|
||||
effects->effect = gst_gl_effects_identity;
|
||||
effects->horizontal_swap = FALSE;
|
||||
|
|
|
@ -53,10 +53,10 @@ enum
|
|||
PROP_CLIENT_DATA
|
||||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_filter_app_debug, "glfilterapp", 0, "glfilterapp element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLFilterApp, gst_gl_filter_app, GstGLFilter,
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLFilterApp, gst_gl_filter_app,
|
||||
GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
|
||||
static void gst_gl_filter_app_set_property (GObject * object, guint prop_id,
|
||||
|
@ -72,23 +72,15 @@ static void gst_gl_filter_app_callback (gint width, gint height, guint texture,
|
|||
gpointer stuff);
|
||||
|
||||
|
||||
static void
|
||||
gst_gl_filter_app_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"OpenGL application filter", "Filter/Effect",
|
||||
"Use client callbacks to define the scene",
|
||||
"Julien Isorce <julien.isorce@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_app_class_init (GstGLFilterAppClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_filter_app_set_property;
|
||||
gobject_class->get_property = gst_gl_filter_app_get_property;
|
||||
|
||||
|
@ -110,10 +102,15 @@ gst_gl_filter_app_class_init (GstGLFilterAppClass * klass)
|
|||
g_param_spec_pointer ("client-data", "Client data",
|
||||
"Pass data to the draw and reshape callbacks",
|
||||
G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"OpenGL application filter", "Filter/Effect",
|
||||
"Use client callbacks to define the scene",
|
||||
"Julien Isorce <julien.isorce@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_app_init (GstGLFilterApp * filter, GstGLFilterAppClass * klass)
|
||||
gst_gl_filter_app_init (GstGLFilterApp * filter)
|
||||
{
|
||||
filter->clientReshapeCallback = NULL;
|
||||
filter->clientDrawCallback = NULL;
|
||||
|
|
|
@ -42,10 +42,10 @@
|
|||
#define GST_CAT_DEFAULT gst_gl_filterblur_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_filterblur_debug, "glfilterblur", 0, "glfilterblur element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLFilterBlur, gst_gl_filterblur, GstGLFilter,
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLFilterBlur, gst_gl_filterblur,
|
||||
GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
|
||||
static void gst_gl_filterblur_set_property (GObject * object, guint prop_id,
|
||||
|
@ -89,23 +89,20 @@ gst_gl_filterblur_reset_resources (GstGLFilter * filter)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_filterblur_base_init (gpointer klass)
|
||||
gst_gl_filterblur_class_init (GstGLFilterBlurClass * klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_filterblur_set_property;
|
||||
gobject_class->get_property = gst_gl_filterblur_get_property;
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "Gstreamer OpenGL Blur",
|
||||
"Filter/Effect", "Blur with 9x9 separable convolution",
|
||||
"Filippo Argiolas <filippo.argiolas@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filterblur_class_init (GstGLFilterBlurClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gobject_class->set_property = gst_gl_filterblur_set_property;
|
||||
gobject_class->get_property = gst_gl_filterblur_get_property;
|
||||
|
||||
GST_GL_FILTER_CLASS (klass)->filter = gst_gl_filterblur_filter;
|
||||
GST_GL_FILTER_CLASS (klass)->display_init_cb =
|
||||
|
@ -117,8 +114,7 @@ gst_gl_filterblur_class_init (GstGLFilterBlurClass * klass)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_filterblur_init (GstGLFilterBlur * filterblur,
|
||||
GstGLFilterBlurClass * klass)
|
||||
gst_gl_filterblur_init (GstGLFilterBlur * filterblur)
|
||||
{
|
||||
filterblur->shader0 = NULL;
|
||||
filterblur->shader1 = NULL;
|
||||
|
|
|
@ -61,10 +61,10 @@ enum
|
|||
PROP_ZFAR
|
||||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_filter_cube_debug, "glfiltercube", 0, "glfiltercube element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLFilterCube, gst_gl_filter_cube, GstGLFilter,
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLFilterCube, gst_gl_filter_cube,
|
||||
GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
|
||||
static void gst_gl_filter_cube_set_property (GObject * object, guint prop_id,
|
||||
|
@ -127,22 +127,15 @@ static const gchar *cube_f_src =
|
|||
"} \n";
|
||||
#endif
|
||||
|
||||
static void
|
||||
gst_gl_filter_cube_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "OpenGL cube filter",
|
||||
"Filter/Effect", "Map input texture on the 6 cube faces",
|
||||
"Julien Isorce <julien.isorce@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_cube_class_init (GstGLFilterCubeClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_filter_cube_set_property;
|
||||
gobject_class->get_property = gst_gl_filter_cube_get_property;
|
||||
|
||||
|
@ -183,10 +176,14 @@ gst_gl_filter_cube_class_init (GstGLFilterCubeClass * klass)
|
|||
g_param_spec_double ("zfar", "Zfar",
|
||||
"Specifies the distance from the viewer to the far clipping plane",
|
||||
0.0, 1000.0, 100.0, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "OpenGL cube filter",
|
||||
"Filter/Effect", "Map input texture on the 6 cube faces",
|
||||
"Julien Isorce <julien.isorce@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_cube_init (GstGLFilterCube * filter, GstGLFilterCubeClass * klass)
|
||||
gst_gl_filter_cube_init (GstGLFilterCube * filter)
|
||||
{
|
||||
#ifdef OPENGL_ES
|
||||
filter->shader = NULL;
|
||||
|
|
|
@ -51,10 +51,10 @@ enum
|
|||
PROP_0
|
||||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_filter_glass_debug, "glfilterglass", 0, "glfilterglass element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLFilterGlass, gst_gl_filter_glass, GstGLFilter,
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLFilterGlass, gst_gl_filter_glass,
|
||||
GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
|
||||
static void gst_gl_filter_glass_set_property (GObject * object, guint prop_id,
|
||||
|
@ -100,23 +100,20 @@ static const gchar *glass_fragment_source =
|
|||
" gl_FragColor = vec4(color.rgb, gl_Color.a * w);" "}";
|
||||
|
||||
static void
|
||||
gst_gl_filter_glass_base_init (gpointer klass)
|
||||
gst_gl_filter_glass_class_init (GstGLFilterGlassClass * klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_filter_glass_set_property;
|
||||
gobject_class->get_property = gst_gl_filter_glass_get_property;
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "OpenGL glass filter",
|
||||
"Filter/Effect", "Glass Filter",
|
||||
"Julien Isorce <julien.isorce@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_glass_class_init (GstGLFilterGlassClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gobject_class->set_property = gst_gl_filter_glass_set_property;
|
||||
gobject_class->get_property = gst_gl_filter_glass_get_property;
|
||||
|
||||
GST_GL_FILTER_CLASS (klass)->filter = gst_gl_filter_glass_filter;
|
||||
GST_GL_FILTER_CLASS (klass)->onInitFBO = gst_gl_filter_glass_init_shader;
|
||||
|
@ -124,8 +121,7 @@ gst_gl_filter_glass_class_init (GstGLFilterGlassClass * klass)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_glass_init (GstGLFilterGlass * filter,
|
||||
GstGLFilterGlassClass * klass)
|
||||
gst_gl_filter_glass_init (GstGLFilterGlass * filter)
|
||||
{
|
||||
filter->shader = NULL;
|
||||
filter->timestamp = 0;
|
||||
|
|
|
@ -46,11 +46,11 @@ enum
|
|||
PROP_0
|
||||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_filter_laplacian_debug, "glfilterlaplacian", 0, "glfilterlaplacian element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLFilterLaplacian, gst_gl_filter_laplacian,
|
||||
GstGLFilter, GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLFilterLaplacian, gst_gl_filter_laplacian,
|
||||
GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
|
||||
static void gst_gl_filter_laplacian_set_property (GObject * object,
|
||||
guint prop_id, const GValue * value, GParamSpec * pspec);
|
||||
|
@ -97,24 +97,21 @@ static const gchar *convolution_fragment_source =
|
|||
/* *INDENT-ON* */
|
||||
|
||||
static void
|
||||
gst_gl_filter_laplacian_base_init (gpointer klass)
|
||||
gst_gl_filter_laplacian_class_init (GstGLFilterLaplacianClass * klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_filter_laplacian_set_property;
|
||||
gobject_class->get_property = gst_gl_filter_laplacian_get_property;
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"OpenGL laplacian filter", "Filter/Effect",
|
||||
"Laplacian Convolution Demo Filter",
|
||||
"Filippo Argiolas <filippo.argiolas@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_laplacian_class_init (GstGLFilterLaplacianClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gobject_class->set_property = gst_gl_filter_laplacian_set_property;
|
||||
gobject_class->get_property = gst_gl_filter_laplacian_get_property;
|
||||
|
||||
GST_GL_FILTER_CLASS (klass)->filter = gst_gl_filter_laplacian_filter;
|
||||
GST_GL_FILTER_CLASS (klass)->onInitFBO = gst_gl_filter_laplacian_init_shader;
|
||||
|
@ -122,8 +119,7 @@ gst_gl_filter_laplacian_class_init (GstGLFilterLaplacianClass * klass)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_laplacian_init (GstGLFilterLaplacian * filter,
|
||||
GstGLFilterLaplacianClass * klass)
|
||||
gst_gl_filter_laplacian_init (GstGLFilterLaplacian * filter)
|
||||
{
|
||||
filter->shader = NULL;
|
||||
}
|
||||
|
|
|
@ -53,12 +53,11 @@ enum
|
|||
PROP_ZFAR
|
||||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_filter_reflected_screen_debug, "glfilterreflectedscreen", 0, "glfilterreflectedscreen element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLFilterReflectedScreen,
|
||||
gst_gl_filter_reflected_screen, GstGLFilter, GST_TYPE_GL_FILTER,
|
||||
DEBUG_INIT);
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLFilterReflectedScreen,
|
||||
gst_gl_filter_reflected_screen, GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
|
||||
static void gst_gl_filter_reflected_screen_set_property (GObject * object,
|
||||
guint prop_id, const GValue * value, GParamSpec * pspec);
|
||||
|
@ -82,23 +81,16 @@ static GLfloat LightPos[] = { 4.0f, -4.0f, 6.0f, 1.0f }; // Light Positio
|
|||
static GLfloat LightAmb[] = { 4.0f, 4.0f, 4.0f, 1.0f }; // Ambient Light
|
||||
static GLfloat LightDif[] = { 1.0f, 1.0f, 1.0f, 1.0f }; // Diffuse Light
|
||||
|
||||
static void
|
||||
gst_gl_filter_reflected_screen_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"OpenGL Reflected Screen filter", "Filter/Effect",
|
||||
"Reflected Screen Filter", "Pierre POUZOL <pierre.pouzol@hotmail.fr>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_reflected_screen_class_init (GstGLFilterReflectedScreenClass *
|
||||
klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_filter_reflected_screen_set_property;
|
||||
gobject_class->get_property = gst_gl_filter_reflected_screen_get_property;
|
||||
|
||||
|
@ -140,11 +132,14 @@ gst_gl_filter_reflected_screen_class_init (GstGLFilterReflectedScreenClass *
|
|||
g_param_spec_double ("zfar", "Zfar",
|
||||
"Specifies the distance from the viewer to the far clipping plane",
|
||||
0.0, 1000.0, 100.0, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"OpenGL Reflected Screen filter", "Filter/Effect",
|
||||
"Reflected Screen Filter", "Pierre POUZOL <pierre.pouzol@hotmail.fr>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filter_reflected_screen_init (GstGLFilterReflectedScreen * filter,
|
||||
GstGLFilterReflectedScreenClass * klass)
|
||||
gst_gl_filter_reflected_screen_init (GstGLFilterReflectedScreen * filter)
|
||||
{
|
||||
filter->active_graphic_mode = TRUE;
|
||||
filter->separated_screen = FALSE;
|
||||
|
|
|
@ -64,10 +64,10 @@ enum
|
|||
#define GST_CAT_DEFAULT gst_gl_filtershader_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_filtershader_debug, "glshader", 0, "glshader element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLFilterShader, gst_gl_filtershader, GstGLFilter,
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLFilterShader, gst_gl_filtershader,
|
||||
GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
|
||||
static void gst_gl_filtershader_set_property (GObject * object, guint prop_id,
|
||||
|
@ -104,25 +104,15 @@ gst_gl_filtershader_reset_resources (GstGLFilter * filter)
|
|||
//GstGLFilterShader *filtershader = GST_GL_FILTERSHADER (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filtershader_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"OpenGL fragment shader filter", "Filter/Effect",
|
||||
"Load GLSL fragment shader from file", "<luc.deschenaux@freesurf.ch>");
|
||||
/* initialize library */
|
||||
gst_controller_init (NULL, NULL);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filtershader_class_init (GstGLFilterShaderClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_filtershader_set_property;
|
||||
gobject_class->get_property = gst_gl_filtershader_get_property;
|
||||
|
||||
|
@ -141,6 +131,13 @@ gst_gl_filtershader_class_init (GstGLFilterShaderClass * klass)
|
|||
"Set the shader uniform variables", NULL,
|
||||
G_PARAM_WRITABLE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"OpenGL fragment shader filter", "Filter/Effect",
|
||||
"Load GLSL fragment shader from file", "<luc.deschenaux@freesurf.ch>");
|
||||
|
||||
/* initialize library */
|
||||
gst_controller_init (NULL, NULL);
|
||||
|
||||
GST_GL_FILTER_CLASS (klass)->filter = gst_gl_filtershader_filter;
|
||||
GST_GL_FILTER_CLASS (klass)->display_init_cb =
|
||||
gst_gl_filtershader_init_resources;
|
||||
|
@ -151,8 +148,7 @@ gst_gl_filtershader_class_init (GstGLFilterShaderClass * klass)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_filtershader_init (GstGLFilterShader * filtershader,
|
||||
GstGLFilterShaderClass * klass)
|
||||
gst_gl_filtershader_init (GstGLFilterShader * filtershader)
|
||||
{
|
||||
filtershader->shader0 = NULL;
|
||||
}
|
||||
|
|
|
@ -48,10 +48,10 @@ enum
|
|||
#define GST_CAT_DEFAULT gst_gl_filtersobel_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_filtersobel_debug, "glfiltersobel", 0, "glfiltersobel element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLFilterSobel, gst_gl_filtersobel, GstGLFilter,
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLFilterSobel, gst_gl_filtersobel,
|
||||
GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
|
||||
static void gst_gl_filtersobel_set_property (GObject * object, guint prop_id,
|
||||
|
@ -100,22 +100,15 @@ gst_gl_filtersobel_reset_resources (GstGLFilter * filter)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filtersobel_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"Gstreamer OpenGL Sobel", "Filter/Effect", "Sobel edge detection",
|
||||
"Filippo Argiolas <filippo.argiolas@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filtersobel_class_init (GstGLFilterSobelClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_filtersobel_set_property;
|
||||
gobject_class->get_property = gst_gl_filtersobel_get_property;
|
||||
|
||||
|
@ -133,11 +126,14 @@ gst_gl_filtersobel_class_init (GstGLFilterSobelClass * klass)
|
|||
"Invert the colors",
|
||||
"Invert colors to get dark edges on bright background",
|
||||
FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"Gstreamer OpenGL Sobel", "Filter/Effect", "Sobel edge detection",
|
||||
"Filippo Argiolas <filippo.argiolas@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_filtersobel_init (GstGLFilterSobel * filtersobel,
|
||||
GstGLFilterSobelClass * klass)
|
||||
gst_gl_filtersobel_init (GstGLFilterSobel * filtersobel)
|
||||
{
|
||||
int i;
|
||||
filtersobel->hconv = NULL;
|
||||
|
|
|
@ -155,7 +155,7 @@ enum
|
|||
PROP_PIXEL_ASPECT_RATIO
|
||||
};
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLImageSink, gst_glimage_sink, GstVideoSink,
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLImageSink, gst_glimage_sink,
|
||||
GST_TYPE_VIDEO_SINK, gst_glimage_sink_init_interfaces);
|
||||
|
||||
static void
|
||||
|
@ -183,29 +183,18 @@ gst_glimage_sink_init_interfaces (GType type)
|
|||
"OpenGL Video Sink");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_glimage_sink_base_init (gpointer g_class)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "OpenGL video sink",
|
||||
"Sink/Video", "A videosink based on OpenGL",
|
||||
"Julien Isorce <julien.isorce@gmail.com>");
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_glimage_sink_template));
|
||||
}
|
||||
|
||||
static void
|
||||
gst_glimage_sink_class_init (GstGLImageSinkClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *gstelement_class;
|
||||
GstBaseSinkClass *gstbasesink_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gstelement_class = (GstElementClass *) klass;
|
||||
gstbasesink_class = (GstBaseSinkClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (g_class);
|
||||
|
||||
gobject_class->set_property = gst_glimage_sink_set_property;
|
||||
gobject_class->get_property = gst_glimage_sink_get_property;
|
||||
|
@ -241,6 +230,13 @@ gst_glimage_sink_class_init (GstGLImageSinkClass * klass)
|
|||
"The pixel aspect ratio of the device", "1/1",
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "OpenGL video sink",
|
||||
"Sink/Video", "A videosink based on OpenGL",
|
||||
"Julien Isorce <julien.isorce@gmail.com>");
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_glimage_sink_template));
|
||||
|
||||
gobject_class->finalize = gst_glimage_sink_finalize;
|
||||
|
||||
gstelement_class->change_state = gst_glimage_sink_change_state;
|
||||
|
@ -253,8 +249,7 @@ gst_glimage_sink_class_init (GstGLImageSinkClass * klass)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_glimage_sink_init (GstGLImageSink * glimage_sink,
|
||||
GstGLImageSinkClass * glimage_sink_class)
|
||||
gst_glimage_sink_init (GstGLImageSink * glimage_sink)
|
||||
{
|
||||
glimage_sink->display_name = NULL;
|
||||
glimage_sink->window_id = 0;
|
||||
|
|
|
@ -49,11 +49,11 @@ enum
|
|||
PROP_0,
|
||||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_mosaic_debug, "glmosaic", 0, "glmosaic element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLMosaic, gst_gl_mosaic, GstGLMixer,
|
||||
GST_TYPE_GL_MIXER, DEBUG_INIT);
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLMosaic, gst_gl_mosaic, GST_TYPE_GL_MIXER,
|
||||
DEBUG_INIT);
|
||||
|
||||
static void gst_gl_mosaic_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec);
|
||||
|
@ -113,23 +113,20 @@ static const gchar *mosaic_f_src =
|
|||
"} \n";
|
||||
|
||||
static void
|
||||
gst_gl_mosaic_base_init (gpointer klass)
|
||||
gst_gl_mosaic_class_init (GstGLMosaicClass * klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_mosaic_set_property;
|
||||
gobject_class->get_property = gst_gl_mosaic_get_property;
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "OpenGL mosaic",
|
||||
"Filter/Effect", "OpenGL mosaic",
|
||||
"Julien Isorce <julien.isorce@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_mosaic_class_init (GstGLMosaicClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gobject_class->set_property = gst_gl_mosaic_set_property;
|
||||
gobject_class->get_property = gst_gl_mosaic_get_property;
|
||||
|
||||
GST_GL_MIXER_CLASS (klass)->set_caps = gst_gl_mosaic_init_shader;
|
||||
GST_GL_MIXER_CLASS (klass)->reset = gst_gl_mosaic_reset;
|
||||
|
@ -137,7 +134,7 @@ gst_gl_mosaic_class_init (GstGLMosaicClass * klass)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_mosaic_init (GstGLMosaic * mosaic, GstGLMosaicClass * klass)
|
||||
gst_gl_mosaic_init (GstGLMosaic * mosaic)
|
||||
{
|
||||
mosaic->shader = NULL;
|
||||
mosaic->input_gl_buffers = NULL;
|
||||
|
|
|
@ -51,11 +51,11 @@
|
|||
#define GST_CAT_DEFAULT gst_gl_overlay_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_overlay_debug, "gloverlay", 0, "gloverlay element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLOverlay, gst_gl_overlay, GstGLFilter,
|
||||
GST_TYPE_GL_FILTER, DEBUG_INIT);
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLOverlay, gst_gl_overlay, GST_TYPE_GL_FILTER,
|
||||
DEBUG_INIT);
|
||||
|
||||
static gboolean gst_gl_overlay_set_caps (GstGLFilter * filter,
|
||||
GstCaps * incaps, GstCaps * outcaps);
|
||||
|
@ -109,23 +109,15 @@ gst_gl_overlay_reset_gl_resources (GstGLFilter * filter)
|
|||
glDeleteTextures (1, &overlay->pbuftexture);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_overlay_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"Gstreamer OpenGL Overlay", "Filter/Effect",
|
||||
"Overlay GL video texture with a PNG image",
|
||||
"Filippo Argiolas <filippo.argiolas@gmail.com>");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_overlay_class_init (GstGLOverlayClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_overlay_set_property;
|
||||
gobject_class->get_property = gst_gl_overlay_get_property;
|
||||
|
||||
|
@ -228,6 +220,11 @@ gst_gl_overlay_class_init (GstGLOverlayClass * klass)
|
|||
"choose ratio video between 0 and 3\n \t\t\t0 : Default ratio\n\t\t\t1 : 4 / 3\n\t\t\t2 : 16 / 9\n\t\t\t3 : 16 / 10",
|
||||
0, 3, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"Gstreamer OpenGL Overlay", "Filter/Effect",
|
||||
"Overlay GL video texture with a PNG image",
|
||||
"Filippo Argiolas <filippo.argiolas@gmail.com>");
|
||||
|
||||
/*
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_STRETCH,
|
||||
|
@ -361,7 +358,7 @@ gst_gl_overlay_load_texture (GstGLOverlay * o, GLuint tex, int flag)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_overlay_init (GstGLOverlay * overlay, GstGLOverlayClass * klass)
|
||||
gst_gl_overlay_init (GstGLOverlay * overlay)
|
||||
{
|
||||
overlay->location = NULL;
|
||||
overlay->pixbuf = NULL;
|
||||
|
|
|
@ -61,7 +61,7 @@ enum
|
|||
/* FILL ME */
|
||||
};
|
||||
|
||||
GST_BOILERPLATE (GstGLTestSrc, gst_gl_test_src, GstPushSrc, GST_TYPE_PUSH_SRC);
|
||||
G_DEFINE_TYPE (GstGLTestSrc, gst_gl_test_src, GST_TYPE_PUSH_SRC);
|
||||
|
||||
static void gst_gl_test_src_set_pattern (GstGLTestSrc * gltestsrc,
|
||||
int pattern_type);
|
||||
|
@ -119,26 +119,13 @@ gst_gl_test_src_pattern_get_type (void)
|
|||
return gl_test_src_pattern_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_test_src_base_init (gpointer g_class)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "Video test source",
|
||||
"Source/Video", "Creates a test video stream",
|
||||
"David A. Schleef <ds@schleef.org>");
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
||||
gst_caps_from_string (GST_GL_VIDEO_CAPS)));
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_test_src_class_init (GstGLTestSrcClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstBaseSrcClass *gstbasesrc_class;
|
||||
GstPushSrcClass *gstpushsrc_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
GST_DEBUG_CATEGORY_INIT (gl_test_src_debug, "gltestsrc", 0,
|
||||
"Video Test Source");
|
||||
|
@ -146,6 +133,7 @@ gst_gl_test_src_class_init (GstGLTestSrcClass * klass)
|
|||
gobject_class = (GObjectClass *) klass;
|
||||
gstbasesrc_class = (GstBaseSrcClass *) klass;
|
||||
gstpushsrc_class = (GstPushSrcClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_test_src_set_property;
|
||||
gobject_class->get_property = gst_gl_test_src_get_property;
|
||||
|
@ -164,6 +152,14 @@ gst_gl_test_src_class_init (GstGLTestSrcClass * klass)
|
|||
"Whether to act as a live source", FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "Video test source",
|
||||
"Source/Video", "Creates a test video stream",
|
||||
"David A. Schleef <ds@schleef.org>");
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
|
||||
gst_caps_from_string (GST_GL_VIDEO_CAPS)));
|
||||
|
||||
gstbasesrc_class->set_caps = gst_gl_test_src_setcaps;
|
||||
gstbasesrc_class->is_seekable = gst_gl_test_src_is_seekable;
|
||||
gstbasesrc_class->do_seek = gst_gl_test_src_do_seek;
|
||||
|
@ -176,7 +172,7 @@ gst_gl_test_src_class_init (GstGLTestSrcClass * klass)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_gl_test_src_init (GstGLTestSrc * src, GstGLTestSrcClass * g_class)
|
||||
gst_gl_test_src_init (GstGLTestSrc * src)
|
||||
{
|
||||
GstPad *pad = GST_BASE_SRC_PAD (src);
|
||||
|
||||
|
|
|
@ -119,11 +119,11 @@ enum
|
|||
PROP_EXTERNAL_OPENGL_CONTEXT
|
||||
};
|
||||
|
||||
#define DEBUG_INIT(bla) \
|
||||
#define DEBUG_INIT \
|
||||
GST_DEBUG_CATEGORY_INIT (gst_gl_upload_debug, "glupload", 0, "glupload element");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstGLUpload, gst_gl_upload, GstBaseTransform,
|
||||
GST_TYPE_BASE_TRANSFORM, DEBUG_INIT);
|
||||
G_DEFINE_TYPE_WITH_CODE (GstGLUpload, gst_gl_upload, GST_TYPE_BASE_TRANSFORM,
|
||||
DEBUG_INIT);
|
||||
|
||||
static void gst_gl_upload_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec);
|
||||
|
@ -152,24 +152,17 @@ static gboolean gst_gl_upload_get_unit_size (GstBaseTransform * trans,
|
|||
static void
|
||||
gst_gl_upload_base_init (gpointer klass)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "OpenGL upload",
|
||||
"Filter/Effect", "A from video to GL flow filter",
|
||||
"Julien Isorce <julien.isorce@gmail.com>");
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_upload_src_pad_template));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_upload_sink_pad_template));
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_upload_class_init (GstGLUploadClass * klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *element_class;
|
||||
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = gst_gl_upload_set_property;
|
||||
gobject_class->get_property = gst_gl_upload_get_property;
|
||||
|
||||
|
@ -189,10 +182,19 @@ gst_gl_upload_class_init (GstGLUploadClass * klass)
|
|||
"External OpenGL context",
|
||||
"Give an external OpenGL context with which to share textures",
|
||||
0, G_MAXULONG, 0, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_set_details_simple (element_class, "OpenGL upload",
|
||||
"Filter/Effect", "A from video to GL flow filter",
|
||||
"Julien Isorce <julien.isorce@gmail.com>");
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_upload_src_pad_template));
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_static_pad_template_get (&gst_gl_upload_sink_pad_template));
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_upload_init (GstGLUpload * upload, GstGLUploadClass * klass)
|
||||
gst_gl_upload_init (GstGLUpload * upload)
|
||||
{
|
||||
GstBaseTransform *base_trans = GST_BASE_TRANSFORM (upload);
|
||||
|
||||
|
|
Loading…
Reference in a new issue