From 9d888e2d0031daf41ff614a74891c5e146f8646a Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 2 Nov 2003 20:53:30 +0000 Subject: Again one more done Original commit message from CVS: Again one more done --- gst/mpeg1sys/gstmpeg1systemencode.c | 52 +++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 23 deletions(-) (limited to 'gst/mpeg1sys') diff --git a/gst/mpeg1sys/gstmpeg1systemencode.c b/gst/mpeg1sys/gstmpeg1systemencode.c index c713cde6..40eb41cb 100644 --- a/gst/mpeg1sys/gstmpeg1systemencode.c +++ b/gst/mpeg1sys/gstmpeg1systemencode.c @@ -34,11 +34,8 @@ static GstElementDetails system_encode_details = { "MPEG1 Multiplexer", "Codec/Muxer", - "GPL", "Multiplexes MPEG-1 Streams", - VERSION, - "Wim Taymans ", - "(C) 2000", + "Wim Taymans " }; /* GstMPEG1SystemEncode signals and args */ @@ -87,6 +84,7 @@ GST_PAD_TEMPLATE_FACTORY (audio_sink_factory, ) static void gst_system_encode_class_init (GstMPEG1SystemEncodeClass *klass); +static void gst_system_encode_base_init (GstMPEG1SystemEncodeClass *klass); static void gst_system_encode_init (GstMPEG1SystemEncode *system_encode); static GstPad* gst_system_encode_request_new_pad (GstElement *element, GstPadTemplate *templ, @@ -109,7 +107,7 @@ gst_mpeg1_system_encode_get_type (void) if (!system_encode_type) { static const GTypeInfo system_encode_info = { sizeof(GstMPEG1SystemEncodeClass), - NULL, + (GBaseInitFunc)gst_system_encode_base_init, NULL, (GClassInitFunc)gst_system_encode_class_init, NULL, @@ -124,6 +122,20 @@ gst_mpeg1_system_encode_get_type (void) return system_encode_type; } +static void +gst_system_encode_base_init (GstMPEG1SystemEncodeClass *klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (src_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (audio_sink_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (video_sink_factory)); + gst_element_class_set_details (element_class, &system_encode_details); +} + static void gst_system_encode_class_init (GstMPEG1SystemEncodeClass *klass) { @@ -545,31 +557,25 @@ gst_system_encode_get_property (GObject *object, guint prop_id, GValue *value, G } static gboolean -plugin_init (GModule *module, GstPlugin *plugin) +plugin_init (GstPlugin *plugin) { - GstElementFactory *factory; - /* this filter needs the getbits functions */ if (!gst_library_load ("gstgetbits")) return FALSE; - /* create an elementfactory for the system_encode element */ - factory = gst_element_factory_new ("system_encode", GST_TYPE_SYSTEM_ENCODE, - &system_encode_details); - g_return_val_if_fail(factory != NULL, FALSE); - - gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (src_factory)); - gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (audio_sink_factory)); - gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (video_sink_factory)); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); - - return TRUE; + return gst_element_register (plugin, "system_encode", + GST_RANK_NONE, GST_TYPE_SYSTEM_ENCODE); } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "system_encode", - plugin_init -}; + "MPEG-1 system stream encoder", + plugin_init, + VERSION, + "GPL", + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +) -- cgit v1.2.1