2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
24 #include <gstrtjpegdec.h>
28 /* elementfactory information */
29 GstElementDetails gst_rtjpegdec_details = {
31 "Codec/Video/Decoder",
33 "Decodes video in RTjpeg format",
35 "Erik Walthinsen <omega@cse.ogi.edu>",
39 /* GstRTJpegDec signals and args */
51 static void gst_rtjpegdec_class_init (GstRTJpegDecClass *klass);
52 static void gst_rtjpegdec_init (GstRTJpegDec *rtjpegdec);
54 static void gst_rtjpegdec_chain (GstPad *pad, GstBuffer *buf);
56 static GstElementClass *parent_class = NULL;
57 /*static guint gst_rtjpegdec_signals[LAST_SIGNAL] = { 0 }; */
60 gst_rtjpegdec_get_type (void)
62 static GType rtjpegdec_type = 0;
64 if (!rtjpegdec_type) {
65 static const GTypeInfo rtjpegdec_info = {
66 sizeof(GstRTJpegDecClass), NULL,
68 (GClassInitFunc)gst_rtjpegdec_class_init,
73 (GInstanceInitFunc)gst_rtjpegdec_init,
75 rtjpegdec_type = g_type_register_static(GST_TYPE_ELEMENT, "GstRTJpegDec", &rtjpegdec_info, 0);
77 return rtjpegdec_type;
81 gst_rtjpegdec_class_init (GstRTJpegDecClass *klass)
83 GstElementClass *gstelement_class;
85 gstelement_class = (GstElementClass*)klass;
87 parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
91 gst_rtjpegdec_init (GstRTJpegDec *rtjpegdec)
93 rtjpegdec->sinkpad = gst_pad_new("sink",GST_PAD_SINK);
94 gst_element_add_pad(GST_ELEMENT(rtjpegdec),rtjpegdec->sinkpad);
95 gst_pad_set_chain_function(rtjpegdec->sinkpad,gst_rtjpegdec_chain);
96 rtjpegdec->srcpad = gst_pad_new("src",GST_PAD_SRC);
97 gst_element_add_pad(GST_ELEMENT(rtjpegdec),rtjpegdec->srcpad);
101 gst_rtjpegdec_chain (GstPad *pad, GstBuffer *buf)
103 GstRTJpegDec *rtjpegdec;
107 g_return_if_fail (pad != NULL);
108 g_return_if_fail (GST_IS_PAD (pad));
109 g_return_if_fail (buf != NULL);
111 rtjpegdec = GST_RTJPEGDEC (GST_OBJECT_PARENT (pad));
112 data = GST_BUFFER_DATA(buf);
113 size = GST_BUFFER_SIZE(buf);
115 gst_info("would be encoding frame here\n");
117 gst_pad_push(rtjpegdec->srcpad,buf);