2002-04-23 20:47:14 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
*
|
2002-04-24 19:50:00 +00:00
|
|
|
* EffecTV:
|
|
|
|
* Copyright (C) 2001 FUKUCHI Kentarou
|
2002-04-23 20:47:14 +00:00
|
|
|
*
|
2002-08-14 21:01:38 +00:00
|
|
|
* EffecTV is free software. 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.
|
2002-04-23 20:47:14 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <gst/gst.h>
|
2003-07-06 20:49:52 +00:00
|
|
|
#include <gst/video/video.h>
|
2002-04-23 22:17:01 +00:00
|
|
|
#include "gsteffectv.h"
|
2002-04-23 20:47:14 +00:00
|
|
|
|
|
|
|
|
2002-04-23 22:17:01 +00:00
|
|
|
struct _elements_entry {
|
|
|
|
gchar *name;
|
|
|
|
GType (*type) (void);
|
|
|
|
GstElementDetails *details;
|
|
|
|
gboolean (*factoryinit) (GstElementFactory *factory);
|
2002-04-23 20:47:14 +00:00
|
|
|
};
|
|
|
|
|
2002-04-23 22:17:01 +00:00
|
|
|
static struct _elements_entry _elements[] = {
|
2002-04-24 22:24:57 +00:00
|
|
|
{ "edgeTV", gst_edgetv_get_type, &gst_edgetv_details, NULL },
|
|
|
|
{ "agingTV", gst_agingtv_get_type, &gst_agingtv_details, NULL },
|
|
|
|
{ "diceTV", gst_dicetv_get_type, &gst_dicetv_details, NULL },
|
|
|
|
{ "warpTV", gst_warptv_get_type, &gst_warptv_details, NULL },
|
|
|
|
{ "shagadelicTV", gst_shagadelictv_get_type, &gst_shagadelictv_details, NULL },
|
2002-04-24 23:09:13 +00:00
|
|
|
{ "vertigoTV", gst_vertigotv_get_type, &gst_vertigotv_details, NULL },
|
2002-04-24 23:44:02 +00:00
|
|
|
{ "revTV", gst_revtv_get_type, &gst_revtv_details, NULL },
|
2002-05-05 15:29:14 +00:00
|
|
|
{ "quarkTV", gst_quarktv_get_type, &gst_quarktv_details, NULL },
|
2002-04-23 22:17:01 +00:00
|
|
|
{ NULL, 0 },
|
2002-04-23 20:47:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-04-23 22:17:01 +00:00
|
|
|
GstPadTemplate*
|
|
|
|
gst_effectv_src_factory (void)
|
2002-04-23 20:47:14 +00:00
|
|
|
{
|
2002-04-23 22:17:01 +00:00
|
|
|
static GstPadTemplate *templ = NULL;
|
|
|
|
if (!templ) {
|
|
|
|
templ = GST_PAD_TEMPLATE_NEW (
|
|
|
|
"src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
2003-07-06 20:49:52 +00:00
|
|
|
gst_caps_new (
|
2002-04-23 22:17:01 +00:00
|
|
|
"effectv_src",
|
2003-07-06 20:49:52 +00:00
|
|
|
"video/x-raw-rgb",
|
|
|
|
GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_32
|
2002-04-23 22:17:01 +00:00
|
|
|
)
|
|
|
|
);
|
2002-04-23 20:47:14 +00:00
|
|
|
}
|
2002-04-23 22:17:01 +00:00
|
|
|
return templ;
|
2002-04-23 20:47:14 +00:00
|
|
|
}
|
|
|
|
|
2002-04-23 22:17:01 +00:00
|
|
|
GstPadTemplate*
|
|
|
|
gst_effectv_sink_factory (void)
|
2002-04-23 20:47:14 +00:00
|
|
|
{
|
2002-04-23 22:17:01 +00:00
|
|
|
static GstPadTemplate *templ = NULL;
|
|
|
|
if (!templ) {
|
|
|
|
templ = GST_PAD_TEMPLATE_NEW (
|
|
|
|
"sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
2003-07-06 20:49:52 +00:00
|
|
|
gst_caps_new (
|
2002-04-23 22:17:01 +00:00
|
|
|
"effectv_sink",
|
2003-07-06 20:49:52 +00:00
|
|
|
"video/x-raw-rgb",
|
|
|
|
GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_32
|
2002-04-23 22:17:01 +00:00
|
|
|
)
|
|
|
|
);
|
2002-04-23 20:47:14 +00:00
|
|
|
}
|
2002-04-23 22:17:01 +00:00
|
|
|
return templ;
|
2002-04-23 20:47:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
plugin_init (GModule * module, GstPlugin * plugin)
|
|
|
|
{
|
|
|
|
GstElementFactory *factory;
|
2002-04-23 22:17:01 +00:00
|
|
|
gint i = 0;
|
2002-04-23 20:47:14 +00:00
|
|
|
|
2002-04-23 22:17:01 +00:00
|
|
|
while (_elements[i].name) {
|
|
|
|
factory = gst_element_factory_new (_elements[i].name,
|
|
|
|
(_elements[i].type) (),
|
|
|
|
_elements[i].details);
|
2002-04-23 20:47:14 +00:00
|
|
|
|
2002-04-23 22:17:01 +00:00
|
|
|
if (!factory) {
|
|
|
|
g_warning ("gst_effecttv_new failed for `%s'",
|
|
|
|
_elements[i].name);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
gst_element_factory_add_pad_template (factory, gst_effectv_src_factory ());
|
|
|
|
gst_element_factory_add_pad_template (factory, gst_effectv_sink_factory ());
|
2002-04-23 20:47:14 +00:00
|
|
|
|
2002-04-23 22:17:01 +00:00
|
|
|
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
|
|
|
|
if (_elements[i].factoryinit) {
|
|
|
|
_elements[i].factoryinit (factory);
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
2002-04-23 20:47:14 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
GstPluginDesc plugin_desc = {
|
|
|
|
GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
|
|
|
"effectv",
|
|
|
|
plugin_init
|
|
|
|
};
|