compatibility fix for new GST_DEBUG stuff.
[platform/upstream/gstreamer.git] / gst / rtjpeg / gstrtjpegdec.c
1 /* GStreamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  *
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.
8  *
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.
13  *
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.
18  */
19
20
21 #ifdef HAVE_CONFIG_H
22 #include "config.h"
23 #endif
24 #include <gstrtjpegdec.h>
25
26
27
28 /* elementfactory information */
29 GstElementDetails gst_rtjpegdec_details = {
30   "RTjpeg decoder",
31   "Codec/Video/Decoder",
32   "LGPL",
33   "Decodes video in RTjpeg format",
34   VERSION,
35   "Erik Walthinsen <omega@cse.ogi.edu>",
36   "(C) 1999",
37 };
38
39 /* GstRTJpegDec signals and args */
40 enum {
41   /* FILL ME */
42   LAST_SIGNAL
43 };
44
45 enum {
46   ARG_0,
47   ARG_QUALITY,
48 };
49
50
51 static void     gst_rtjpegdec_class_init        (GstRTJpegDecClass *klass);
52 static void     gst_rtjpegdec_init              (GstRTJpegDec *rtjpegdec);
53
54 static void     gst_rtjpegdec_chain             (GstPad *pad, GstBuffer *buf);
55
56 static GstElementClass *parent_class = NULL;
57 /*static guint gst_rtjpegdec_signals[LAST_SIGNAL] = { 0 }; */
58
59 GType
60 gst_rtjpegdec_get_type (void)
61 {
62   static GType rtjpegdec_type = 0;
63
64   if (!rtjpegdec_type) {
65     static const GTypeInfo rtjpegdec_info = {
66       sizeof(GstRTJpegDecClass),      NULL,
67       NULL,
68       (GClassInitFunc)gst_rtjpegdec_class_init,
69       NULL,
70       NULL,
71       sizeof(GstRTJpegDec),
72       0,
73       (GInstanceInitFunc)gst_rtjpegdec_init,
74     };
75     rtjpegdec_type = g_type_register_static(GST_TYPE_ELEMENT, "GstRTJpegDec", &rtjpegdec_info, 0);
76   }
77   return rtjpegdec_type;
78 }
79
80 static void
81 gst_rtjpegdec_class_init (GstRTJpegDecClass *klass)
82 {
83   GstElementClass *gstelement_class;
84
85   gstelement_class = (GstElementClass*)klass;
86
87   parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
88 }
89
90 static void
91 gst_rtjpegdec_init (GstRTJpegDec *rtjpegdec)
92 {
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);
98 }
99
100 static void
101 gst_rtjpegdec_chain (GstPad *pad, GstBuffer *buf)
102 {
103   GstRTJpegDec *rtjpegdec;
104   guchar *data;
105   gulong size;
106
107   g_return_if_fail (pad != NULL);
108   g_return_if_fail (GST_IS_PAD (pad));
109   g_return_if_fail (buf != NULL);
110
111   rtjpegdec = GST_RTJPEGDEC (GST_OBJECT_PARENT (pad));
112   data = GST_BUFFER_DATA(buf);
113   size = GST_BUFFER_SIZE(buf);
114
115   gst_info("would be encoding frame here\n");
116
117   gst_pad_push(rtjpegdec->srcpad,buf);
118 }