diff options
author | Iain Holmes <iain@prettypeople.org> | 2003-11-02 00:21:14 +0000 |
---|---|---|
committer | Iain Holmes <iain@prettypeople.org> | 2003-11-02 00:21:14 +0000 |
commit | b509505b49d74330372632463a2c4d7b2e3980d8 (patch) | |
tree | 3d25c40adcb136b835a41d513040d967a9aef929 /ext/libpng/gstpng.c | |
parent | f57a2a9d543639018123aa801f20edb4b6acab90 (diff) |
pngenc fixed
Original commit message from CVS:
pngenc fixed
Diffstat (limited to 'ext/libpng/gstpng.c')
-rw-r--r-- | ext/libpng/gstpng.c | 66 |
1 files changed, 13 insertions, 53 deletions
diff --git a/ext/libpng/gstpng.c b/ext/libpng/gstpng.c index f3ac003c..54bcccbd 100644 --- a/ext/libpng/gstpng.c +++ b/ext/libpng/gstpng.c @@ -16,70 +16,30 @@ * */ +#include <config.h> + #include <string.h> #include <gst/gst.h> -#include <gst/video/video.h> #include "gstpngenc.h" -extern GstElementDetails gst_pngenc_details; - -static GstCaps* -png_caps_factory (void) -{ - return gst_caps_new ( "png_png", - "video/x-png", - gst_props_new ( - "width", GST_PROPS_INT_RANGE (16, 4096), - "height", GST_PROPS_INT_RANGE (16, 4096), - "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT), - NULL)); -} - - -static GstCaps* -raw_caps_factory (void) -{ - return gst_caps_new ( "png_raw", - "video/x-raw-rgb", - GST_VIDEO_RGB_PAD_TEMPLATE_PROPS_24 - ); -} - static gboolean -plugin_init (GModule * module, GstPlugin * plugin) +plugin_init (GstPlugin * plugin) { - GstElementFactory *png_enc; - GstCaps *raw_caps, *png_caps; - - /* create an elementfactory for the jpegdec element */ - png_enc = gst_element_factory_new("pngenc", GST_TYPE_PNGENC, &gst_pngenc_details); - g_return_val_if_fail(png_enc != NULL, FALSE); - - raw_caps = raw_caps_factory (); - png_caps = png_caps_factory (); - - /* register sink pads */ - pngenc_sink_template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, - raw_caps, NULL); - gst_element_factory_add_pad_template (png_enc, pngenc_sink_template); - + if (!gst_element_register (plugin, "pngenc", GST_RANK_NONE, GST_TYPE_PNGENC)) + return FALSE; - /* register src pads */ - pngenc_src_template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, - png_caps, NULL); - gst_element_factory_add_pad_template (png_enc, pngenc_src_template); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (png_enc)); - return TRUE; } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "png", - plugin_init -}; + "PNG plugin library", + plugin_init, + VERSION, + "LGPL", + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN) |