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
static const GstElementDetails gst_rtjpegdec_details =
30
GST_ELEMENT_DETAILS ("RTjpeg video decoder",
31
"Codec/Decoder/Video",
32
"Decodes video in RTjpeg format",
33
"Erik Walthinsen <omega@cse.ogi.edu>");
35
/* GstRTJpegDec signals and args */
49
static void gst_rtjpegdec_class_init (GstRTJpegDecClass * klass);
50
static void gst_rtjpegdec_base_init (GstRTJpegDecClass * klass);
51
static void gst_rtjpegdec_init (GstRTJpegDec * rtjpegdec);
53
static void gst_rtjpegdec_chain (GstPad * pad, GstData * _data);
55
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),
67
(GBaseInitFunc) gst_rtjpegdec_base_init,
69
(GClassInitFunc) gst_rtjpegdec_class_init,
72
sizeof (GstRTJpegDec),
74
(GInstanceInitFunc) gst_rtjpegdec_init,
78
g_type_register_static (GST_TYPE_ELEMENT, "GstRTJpegDec",
81
return rtjpegdec_type;
85
gst_rtjpegdec_base_init (GstRTJpegDecClass * klass)
87
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
89
gst_element_class_set_details (element_class, &gst_rtjpegdec_details);
93
gst_rtjpegdec_class_init (GstRTJpegDecClass * klass)
95
GstElementClass *gstelement_class;
97
gstelement_class = (GstElementClass *) klass;
99
parent_class = g_type_class_peek_parent (klass);
103
gst_rtjpegdec_init (GstRTJpegDec * rtjpegdec)
105
rtjpegdec->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
106
gst_element_add_pad (GST_ELEMENT (rtjpegdec), rtjpegdec->sinkpad);
107
gst_pad_set_chain_function (rtjpegdec->sinkpad, gst_rtjpegdec_chain);
108
rtjpegdec->srcpad = gst_pad_new ("src", GST_PAD_SRC);
109
gst_element_add_pad (GST_ELEMENT (rtjpegdec), rtjpegdec->srcpad);
113
gst_rtjpegdec_chain (GstPad * pad, GstData * _data)
115
GstBuffer *buf = GST_BUFFER (_data);
116
GstRTJpegDec *rtjpegdec;
120
g_return_if_fail (pad != NULL);
121
g_return_if_fail (GST_IS_PAD (pad));
122
g_return_if_fail (buf != NULL);
124
rtjpegdec = GST_RTJPEGDEC (GST_OBJECT_PARENT (pad));
125
data = GST_BUFFER_DATA (buf);
126
size = GST_BUFFER_SIZE (buf);
128
g_warning ("would be encoding frame here\n");
130
gst_pad_push (rtjpegdec->srcpad, GST_DATA (buf));