From 26f632e6309e9796d08ada0b490c0289913d5a98 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 2 Nov 2003 22:11:30 +0000 Subject: ... almost done now Original commit message from CVS: ... almost done now --- gst/rtjpeg/gstrtjpeg.c | 40 +++++++++++++++------------------------- gst/rtjpeg/gstrtjpegdec.c | 17 ++++++++++++----- gst/rtjpeg/gstrtjpegenc.c | 17 ++++++++++++----- 3 files changed, 39 insertions(+), 35 deletions(-) (limited to 'gst') diff --git a/gst/rtjpeg/gstrtjpeg.c b/gst/rtjpeg/gstrtjpeg.c index 4284b8dd..68e113b4 100644 --- a/gst/rtjpeg/gstrtjpeg.c +++ b/gst/rtjpeg/gstrtjpeg.c @@ -21,37 +21,27 @@ #include #include -/* elementfactory information */ -extern GstElementDetails gst_rtjpegenc_details; -extern GstElementDetails gst_rtjpegdec_details; - static gboolean -plugin_init (GModule *module, GstPlugin *plugin) +plugin_init (GstPlugin *plugin) { - GstElementFactory *enc, *dec; - - gst_plugin_set_longname(plugin,"Justin Schoeman's RTjpeg codec and \ -conversion utilities"); - - /* create an elementfactory for the rtjpegenc element */ - enc = gst_element_factory_new("rtjpegenc",GST_TYPE_RTJPEGENC, - &gst_rtjpegenc_details); - g_return_val_if_fail(enc != NULL, FALSE); - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (enc)); - - /* create an elementfactory for the rtjpegdec element */ - dec = gst_element_factory_new("rtjpegdec",GST_TYPE_RTJPEGDEC, - &gst_rtjpegdec_details); - g_return_val_if_fail(dec != NULL, FALSE); - gst_element_factory_set_rank (dec, GST_ELEMENT_RANK_PRIMARY); - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (dec)); + if (!gst_element_register (plugin, "rtjpegenc", + GST_RANK_NONE, GST_TYPE_RTJPEGENC) || + !gst_element_register (plugin, "rtjpegdec", + GST_RANK_NONE, GST_TYPE_RTJPEGDEC)) + return FALSE; return TRUE; } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "rtjpeg", - plugin_init -}; + "Justin Schoeman's RTjpeg codec", + plugin_init, + VERSION, + "GPL", + "(c) 2000 Justin Schoeman ", + GST_PACKAGE, + GST_ORIGIN +) diff --git a/gst/rtjpeg/gstrtjpegdec.c b/gst/rtjpeg/gstrtjpegdec.c index 6ffa8287..ab87a36e 100644 --- a/gst/rtjpeg/gstrtjpegdec.c +++ b/gst/rtjpeg/gstrtjpegdec.c @@ -29,11 +29,8 @@ GstElementDetails gst_rtjpegdec_details = { "RTjpeg decoder", "Codec/Video/Decoder", - "GPL", "Decodes video in RTjpeg format", - VERSION, - "Erik Walthinsen ", - "(C) 1999", + "Erik Walthinsen " }; /* GstRTJpegDec signals and args */ @@ -49,6 +46,7 @@ enum { static void gst_rtjpegdec_class_init (GstRTJpegDecClass *klass); +static void gst_rtjpegdec_base_init (GstRTJpegDecClass *klass); static void gst_rtjpegdec_init (GstRTJpegDec *rtjpegdec); static void gst_rtjpegdec_chain (GstPad *pad, GstData *_data); @@ -63,7 +61,8 @@ gst_rtjpegdec_get_type (void) if (!rtjpegdec_type) { static const GTypeInfo rtjpegdec_info = { - sizeof(GstRTJpegDecClass), NULL, + sizeof(GstRTJpegDecClass), + (GBaseInitFunc)gst_rtjpegdec_base_init, NULL, (GClassInitFunc)gst_rtjpegdec_class_init, NULL, @@ -77,6 +76,14 @@ gst_rtjpegdec_get_type (void) return rtjpegdec_type; } +static void +gst_rtjpegdec_base_init (GstRTJpegDecClass *klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_set_details (element_class, &gst_rtjpegdec_details); +} + static void gst_rtjpegdec_class_init (GstRTJpegDecClass *klass) { diff --git a/gst/rtjpeg/gstrtjpegenc.c b/gst/rtjpeg/gstrtjpegenc.c index 0aa90577..1ff510bc 100644 --- a/gst/rtjpeg/gstrtjpegenc.c +++ b/gst/rtjpeg/gstrtjpegenc.c @@ -27,11 +27,8 @@ GstElementDetails gst_rtjpegenc_details = { "RTjpeg encoder", "Codec/Video/Encoder", - "GPL", "Encodes video in RTjpeg format", - VERSION, - "Erik Walthinsen ", - "(C) 1999", + "Erik Walthinsen " }; /* GstRTJpegEnc signals and args */ @@ -47,6 +44,7 @@ enum { static void gst_rtjpegenc_class_init (GstRTJpegEncClass *klass); +static void gst_rtjpegenc_base_init (GstRTJpegEncClass *klass); static void gst_rtjpegenc_init (GstRTJpegEnc *rtjpegenc); static void gst_rtjpegenc_chain (GstPad *pad, GstData *_data); @@ -61,7 +59,8 @@ gst_rtjpegenc_get_type (void) if (!rtjpegenc_type) { static const GTypeInfo rtjpegenc_info = { - sizeof(GstRTJpegEncClass), NULL, + sizeof(GstRTJpegEncClass), + (GBaseInitFunc)gst_rtjpegenc_base_init, NULL, (GClassInitFunc)gst_rtjpegenc_class_init, NULL, @@ -75,6 +74,14 @@ gst_rtjpegenc_get_type (void) return rtjpegenc_type; } +static void +gst_rtjpegenc_base_init (GstRTJpegEncClass *klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_set_details (element_class, &gst_rtjpegenc_details); +} + static void gst_rtjpegenc_class_init (GstRTJpegEncClass *klass) { -- cgit v1.2.1