4dffd96f7cb7ab18a362f6366bd81dd1e336f89d
[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 #endif /* __cplusplus */
29
30
31 #include <libdv/dv.h>
32 #include <gst/bytestream/bytestream.h>
33
34
35 /* This is the definition of the element's object structure. */
36 typedef struct _GstDVDec GstDVDec;
37
38 /* The structure itself is derived from GstElement, as can be seen by the
39  * fact that there's a complete instance of the GstElement structure at
40  * the beginning of the object.  This allows the element to be cast to
41  * an Element or even an Object.
42  */
43 struct _GstDVDec {
44   GstElement     element;
45
46   /* We need to keep track of our pads, so we do so here. */
47   GstPad        *sinkpad,
48                 *videosrcpad,
49                   *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   GstElementClass parent_class;
84 };
85
86 /* Five standard preprocessing macros are used in the Gtk+ object system.
87  * The first uses the object's _get_type function to return the GType
88  * of the object.
89  */
90 #define GST_TYPE_DVDEC \
91   (gst_dvdec_get_type())
92 /* The second is a checking cast to the correct type.  If the object passed
93  * is not the right type, a warning will be generated on stderr.
94  */
95 #define GST_DVDEC(obj) \
96   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DVDEC,GstDVDec))
97 /* The third is a checking cast of the class instead of the object. */
98 #define GST_DVDEC_CLASS(klass) \
99   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DVDEC,GstDVDec))
100 /* The last two simply check to see if the passed pointer is an object or
101  * class of the correct type. */
102 #define GST_IS_DVDEC(obj) \
103   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DVDEC))
104 #define GST_IS_DVDEC_CLASS(obj) \
105   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DVDEC))
106
107 /* This is the only prototype needed, because it is used in the above
108  * GST_TYPE_DVDEC macro.
109  */
110 GType gst_dvdec_get_type(void);
111
112
113 #ifdef __cplusplus
114 }
115 #endif /* __cplusplus */
116
117
118 #endif /* __GST_DVDEC_H__ */