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.
21 #ifndef __GST_JPEG_DEC_H__
22 #define __GST_JPEG_DEC_H__
27 #include <gst/video/video.h>
28 #include <gst/base/gstadapter.h>
30 /* this is a hack hack hack to get around jpeglib header bugs... */
39 #define GST_TYPE_JPEG_DEC \
40 (gst_jpeg_dec_get_type())
41 #define GST_JPEG_DEC(obj) \
42 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_JPEG_DEC,GstJpegDec))
43 #define GST_JPEG_DEC_CLASS(klass) \
44 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_JPEG_DEC,GstJpegDecClass))
45 #define GST_IS_JPEG_DEC(obj) \
46 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_JPEG_DEC))
47 #define GST_IS_JPEG_DEC_CLASS(klass) \
48 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_JPEG_DEC))
50 typedef struct _GstJpegDec GstJpegDec;
51 typedef struct _GstJpegDecClass GstJpegDecClass;
53 struct GstJpegDecErrorMgr {
54 struct jpeg_error_mgr pub; /* public fields */
55 jmp_buf setjmp_buffer;
58 struct GstJpegDecSourceMgr {
59 struct jpeg_source_mgr pub; /* public fields */
63 /* Can't use GstBaseTransform, because GstBaseTransform
64 * doesn't handle the N buffers in, 1 buffer out case,
65 * but only the 1-in 1-out case */
77 /* TRUE if each input buffer contains a whole jpeg image */
80 /* the (expected) timestamp of the next frame */
85 /* TRUE if the next output buffer should have the DISCONT flag set */
88 /* QoS stuff *//* with LOCK */
90 GstClockTime earliest_time;
91 GstClockTime qos_duration;
94 gint framerate_numerator;
95 gint framerate_denominator;
97 /* negotiated state */
98 gint caps_framerate_numerator;
99 gint caps_framerate_denominator;
111 gint parse_entropy_len;
116 gint max_errors; /* ATOMIC */
118 /* current error (the message is the debug message) */
121 const gchar *error_func;
123 /* number of errors since start or last successfully decoded image */
126 /* number of successfully decoded images since start */
129 struct jpeg_decompress_struct cinfo;
130 struct GstJpegDecErrorMgr jerr;
131 struct GstJpegDecSourceMgr jsrc;
133 /* arrays for indirect decoding */
134 gboolean idr_width_allocated;
135 guchar *idr_y[16],*idr_u[16],*idr_v[16];
136 /* current (parsed) image size */
140 struct _GstJpegDecClass {
141 GstElementClass parent_class;
144 GType gst_jpeg_dec_get_type(void);
150 #endif /* __GST_JPEG_DEC_H__ */