gst-indent
[platform/upstream/gst-plugins-good.git] / ext / dv / gstdvdec.h
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 #ifndef __GST_DVDEC_H__
22 #define __GST_DVDEC_H__
23
24 #include <gst/gst.h>
25
26 #ifdef __cplusplus
27 extern "C"
28 {
29 #endif                          /* __cplusplus */
30
31
32 #include <libdv/dv.h>
33 #include <gst/bytestream/bytestream.h>
34
35
36 /* This is the definition of the element's object structure. */
37   typedef struct _GstDVDec GstDVDec;
38
39 /* The structure itself is derived from GstElement, as can be seen by the
40  * fact that there's a complete instance of the GstElement structure at
41  * the beginning of the object.  This allows the element to be cast to
42  * an Element or even an Object.
43  */
44   struct _GstDVDec
45   {
46     GstElement element;
47
48     /* We need to keep track of our pads, so we do so here. */
49     GstPad *sinkpad, *videosrcpad, *audiosrcpad;
50
51     dv_decoder_t *decoder;
52     gboolean clamp_luma;
53     gboolean clamp_chroma;
54     gint quality;
55
56     GstByteStream *bs;
57     dv_color_space_t space;
58     gint bpp;
59     gboolean PAL;
60     gdouble framerate;
61     gint height;
62     gint frequency;
63     gint channels;
64
65     gint length;
66     guint64 next_ts;
67     guint64 end_position;
68     gboolean need_discont;
69     gboolean loop;
70
71     gboolean found_header;
72
73     gint16 *audio_buffers[4];
74   };
75
76 /* The other half of the object is its class.  The class also derives from
77  * the same parent, though it must be the class structure this time.
78  * Function pointers for polymophic methods and signals are placed in this
79  * structure. */
80   typedef struct _GstDVDecClass GstDVDecClass;
81
82   struct _GstDVDecClass
83   {
84     GstElementClass parent_class;
85   };
86
87 /* Five standard preprocessing macros are used in the Gtk+ object system.
88  * The first uses the object's _get_type function to return the GType
89  * of the object.
90  */
91 #define GST_TYPE_DVDEC \
92   (gst_dvdec_get_type())
93 /* The second is a checking cast to the correct type.  If the object passed
94  * is not the right type, a warning will be generated on stderr.
95  */
96 #define GST_DVDEC(obj) \
97   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DVDEC,GstDVDec))
98 /* The third is a checking cast of the class instead of the object. */
99 #define GST_DVDEC_CLASS(klass) \
100   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DVDEC,GstDVDec))
101 /* The last two simply check to see if the passed pointer is an object or
102  * class of the correct type. */
103 #define GST_IS_DVDEC(obj) \
104   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DVDEC))
105 #define GST_IS_DVDEC_CLASS(obj) \
106   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DVDEC))
107
108 /* This is the only prototype needed, because it is used in the above
109  * GST_TYPE_DVDEC macro.
110  */
111   GType gst_dvdec_get_type (void);
112
113
114 #ifdef __cplusplus
115 }
116 #endif                          /* __cplusplus */
117
118
119 #endif                          /* __GST_DVDEC_H__ */