2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
5 * Copyright (C) 2000 Donald A. Graft
7 * This library is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Library General Public License for more details.
12 * You should have received a copy of the GNU Library General Public
13 * License along with this library; if not, write to the
14 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
15 * Boston, MA 02111-1307, USA.
22 #include "gstpngenc.h"
24 extern GstElementDetails gst_pngenc_details;
27 png_caps_factory (void)
29 return gst_caps_new ( "png_png", "video/png", NULL);
34 raw_caps_factory (void)
36 return gst_caps_new ( "png_raw",
39 "format", GST_PROPS_FOURCC (GST_STR_FOURCC ("RGB ")),
40 "bpp", GST_PROPS_INT (24),
41 "red_mask", GST_PROPS_INT (0xff),
42 "green_mask", GST_PROPS_INT (0xff00),
43 "blue_mask", GST_PROPS_INT (0xff0000),
44 "width", GST_PROPS_INT_RANGE (16, 4096),
45 "height", GST_PROPS_INT_RANGE (16, 4096),
51 plugin_init (GModule * module, GstPlugin * plugin)
53 GstElementFactory *png_enc;
54 GstCaps *raw_caps, *png_caps;
56 /* create an elementfactory for the jpegdec element */
57 png_enc = gst_element_factory_new("pngenc", GST_TYPE_PNGENC, &gst_pngenc_details);
58 g_return_val_if_fail(png_enc != NULL, FALSE);
60 raw_caps = raw_caps_factory ();
61 png_caps = png_caps_factory ();
63 /* register sink pads */
64 pngenc_sink_template = gst_pad_template_new ("sink", GST_PAD_SINK,
67 gst_element_factory_add_pad_template (png_enc, pngenc_sink_template);
70 /* register src pads */
71 pngenc_src_template = gst_pad_template_new ("src", GST_PAD_SRC,
74 gst_element_factory_add_pad_template (png_enc, pngenc_src_template);
76 gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (png_enc));
81 GstPluginDesc plugin_desc = {