summaryrefslogtreecommitdiffstats
path: root/ext/divx
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-11-02 20:37:50 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-11-02 20:37:50 +0000
commitcb3a7cfe5d1ae9ae219025b83c480c5343cfa2e3 (patch)
treecc363cc6f783b1c59b6166d254040d51a106751e /ext/divx
parentc57df85cd90796847a96448b56ac4e94efc9c7aa (diff)
downloadgst-plugins-bad-cb3a7cfe5d1ae9ae219025b83c480c5343cfa2e3.tar.gz
gst-plugins-bad-cb3a7cfe5d1ae9ae219025b83c480c5343cfa2e3.tar.bz2
gst-plugins-bad-cb3a7cfe5d1ae9ae219025b83c480c5343cfa2e3.zip
More
Original commit message from CVS: More
Diffstat (limited to 'ext/divx')
-rw-r--r--ext/divx/gstdivxdec.c56
-rw-r--r--ext/divx/gstdivxenc.c59
2 files changed, 61 insertions, 54 deletions
diff --git a/ext/divx/gstdivxdec.c b/ext/divx/gstdivxdec.c
index 73e8e6a9..7ef30705 100644
--- a/ext/divx/gstdivxdec.c
+++ b/ext/divx/gstdivxdec.c
@@ -32,11 +32,8 @@
GstElementDetails gst_divxdec_details = {
"Divx decoder",
"Codec/Video/Decoder",
- "Commercial",
"Divx decoder based on divxdecore",
- VERSION,
- "Ronald Bultje <rbultje@ronald.bitfreak.net>",
- "(C) 2003",
+ "Ronald Bultje <rbultje@ronald.bitfreak.net>"
};
GST_PAD_TEMPLATE_FACTORY(sink_template,
@@ -94,6 +91,7 @@ enum {
};
+static void gst_divxdec_base_init (GstDivxDecClass *klass);
static void gst_divxdec_class_init (GstDivxDecClass *klass);
static void gst_divxdec_init (GstDivxDec *divxdec);
static void gst_divxdec_dispose (GObject *object);
@@ -145,7 +143,7 @@ gst_divxdec_get_type(void)
{
static const GTypeInfo divxdec_info = {
sizeof(GstDivxDecClass),
- NULL,
+ (GBaseInitFunc) gst_divxdec_base_init,
NULL,
(GClassInitFunc) gst_divxdec_class_init,
NULL,
@@ -163,6 +161,20 @@ gst_divxdec_get_type(void)
static void
+gst_divxdec_base_init (GstDivxDecClass *klass)
+{
+ GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
+
+ gst_element_class_add_pad_template (element_class,
+ GST_PAD_TEMPLATE_GET (sink_template));
+ gst_element_class_add_pad_template (element_class,
+ GST_PAD_TEMPLATE_GET (src_template));
+
+ gst_element_class_set_details (element_class, &gst_divxdec_details);
+}
+
+
+static void
gst_divxdec_class_init (GstDivxDecClass *klass)
{
GObjectClass *gobject_class = (GObjectClass *) klass;
@@ -444,10 +456,8 @@ gst_divxdec_connect (GstPad *pad,
static gboolean
-plugin_init (GModule *module,
- GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
- GstElementFactory *factory;
int lib_version;
lib_version = decore(NULL, DEC_OPT_VERSION, 0, 0);
@@ -455,30 +465,24 @@ plugin_init (GModule *module,
g_warning("Version mismatch! This plugin was compiled for "
"DivX version %d, while your library has version %d!",
DECORE_VERSION, lib_version);
+ return FALSE;
}
/* create an elementfactory for the v4lmjpegsrcparse element */
- factory = gst_element_factory_new("divxdec", GST_TYPE_DIVXDEC,
- &gst_divxdec_details);
- g_return_val_if_fail(factory != NULL, FALSE);
-
- /* add pad templates */
- gst_element_factory_add_pad_template(factory,
- GST_PAD_TEMPLATE_GET(sink_template));
- gst_element_factory_add_pad_template(factory,
- GST_PAD_TEMPLATE_GET(src_template));
-
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-
- gst_element_factory_set_rank(factory, GST_ELEMENT_RANK_PRIMARY);
-
- return TRUE;
+ return gst_element_register(plugin, "divxdec",
+ GST_RANK_PRIMARY, GST_TYPE_DIVXDEC);
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"divxdec",
- plugin_init
-};
+ "DivX decoder",
+ plugin_init,
+ "5.03",
+ GST_LICENSE_UNKNOWN,
+ "(c) 2002 DivX Networks",
+ "divx4linux",
+ "http://www.divx.com/"
+)
diff --git a/ext/divx/gstdivxenc.c b/ext/divx/gstdivxenc.c
index 5b43965c..1384a888 100644
--- a/ext/divx/gstdivxenc.c
+++ b/ext/divx/gstdivxenc.c
@@ -33,11 +33,8 @@
GstElementDetails gst_divxenc_details = {
"Divx encoder",
"Codec/Video/Encoder",
- "Commercial",
"Divx encoder based on divxencore",
- VERSION,
- "Ronald Bultje <rbultje@ronald.bitfreak.net>",
- "(C) 2003",
+ "Ronald Bultje <rbultje@ronald.bitfreak.net>"
};
GST_PAD_TEMPLATE_FACTORY(sink_template,
@@ -100,6 +97,7 @@ enum {
static void gst_divxenc_class_init (GstDivxEncClass *klass);
+static void gst_divxenc_base_init (GstDivxEncClass *klass);
static void gst_divxenc_init (GstDivxEnc *divxenc);
static void gst_divxenc_dispose (GObject *object);
static void gst_divxenc_chain (GstPad *pad,
@@ -163,7 +161,7 @@ gst_divxenc_get_type(void)
{
static const GTypeInfo divxenc_info = {
sizeof(GstDivxEncClass),
- NULL,
+ (GBaseInitFunc) gst_divxenc_base_init,
NULL,
(GClassInitFunc) gst_divxenc_class_init,
NULL,
@@ -181,6 +179,20 @@ gst_divxenc_get_type(void)
static void
+gst_divxenc_base_init (GstDivxEncClass *klass)
+{
+ GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
+
+ gst_element_class_add_pad_template (element_class,
+ GST_PAD_TEMPLATE_GET (sink_template));
+ gst_element_class_add_pad_template (element_class,
+ GST_PAD_TEMPLATE_GET (src_template));
+
+ gst_element_class_set_details (element_class, &gst_divxenc_details);
+}
+
+
+static void
gst_divxenc_class_init (GstDivxEncClass *klass)
{
GstElementClass *gstelement_class;
@@ -547,10 +559,8 @@ gst_divxenc_get_property (GObject *object,
static gboolean
-plugin_init (GModule *module,
- GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
- GstElementFactory *factory;
int lib_version;
lib_version = encore(NULL, ENC_OPT_VERSION, 0, 0);
@@ -558,31 +568,24 @@ plugin_init (GModule *module,
g_warning("Version mismatch! This plugin was compiled for "
"DivX version %d, while your library has version %d!",
ENCORE_VERSION, lib_version);
- }
-
- if (!gst_library_load("gstvideo"))
return FALSE;
+ }
- /* create an elementfactory for the element */
- factory = gst_element_factory_new("divxenc", GST_TYPE_DIVXENC,
- &gst_divxenc_details);
- g_return_val_if_fail(factory != NULL, FALSE);
-
- /* add pad templates */
- gst_element_factory_add_pad_template(factory,
- GST_PAD_TEMPLATE_GET(sink_template));
- gst_element_factory_add_pad_template(factory,
- GST_PAD_TEMPLATE_GET(src_template));
-
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-
- return TRUE;
+ /* create an elementfactory for the v4lmjpegsrcparse element */
+ return gst_element_register(plugin, "divxenc",
+ GST_RANK_PRIMARY, GST_TYPE_DIVXENC);
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"divxenc",
- plugin_init
-};
+ "DivX encoder",
+ plugin_init,
+ "5.03",
+ GST_LICENSE_UNKNOWN,
+ "(c) 2002 DivX Networks",
+ "divx4linux",
+ "http://www.divx.com/"
+)