upload tizen1.0 source
[framework/multimedia/gst-plugins-good0.10.git] / gst / deinterlace / gstdeinterlace.h
1 /*
2  * GStreamer
3  * Copyright (C) 2005 Martin Eikermann <meiker@upb.de>
4  * Copyright (C) 2008-2010 Sebastian Dröge <slomo@collabora.co.uk>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22 #ifndef __GST_DEINTERLACE_H__
23 #define __GST_DEINTERLACE_H__
24
25 #include <gst/gst.h>
26 #include <gst/video/video.h>
27
28 #include "gstdeinterlacemethod.h"
29
30 G_BEGIN_DECLS
31
32 #define GST_TYPE_DEINTERLACE \
33   (gst_deinterlace_get_type())
34 #define GST_DEINTERLACE(obj) \
35   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DEINTERLACE,GstDeinterlace))
36 #define GST_DEINTERLACE_CLASS(klass) \
37   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DEINTERLACE,GstDeinterlace))
38 #define GST_IS_DEINTERLACE(obj) \
39   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DEINTERLACE))
40 #define GST_IS_DEINTERLACE_CLASS(obj) \
41   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DEINTERLACE))
42
43 typedef struct _GstDeinterlace GstDeinterlace;
44 typedef struct _GstDeinterlaceClass GstDeinterlaceClass;
45
46 #define GST_DEINTERLACE_MAX_FIELD_HISTORY 10
47
48 typedef enum
49 {
50   GST_DEINTERLACE_TOMSMOCOMP,
51   GST_DEINTERLACE_GREEDY_H,
52   GST_DEINTERLACE_GREEDY_L,
53   GST_DEINTERLACE_VFIR,
54   GST_DEINTERLACE_LINEAR,
55   GST_DEINTERLACE_LINEAR_BLEND,
56   GST_DEINTERLACE_SCALER_BOB,
57   GST_DEINTERLACE_WEAVE,
58   GST_DEINTERLACE_WEAVE_TFF,
59   GST_DEINTERLACE_WEAVE_BFF
60 } GstDeinterlaceMethods;
61
62 typedef enum
63 {
64   GST_DEINTERLACE_ALL,         /* All (missing data is interp.) */
65   GST_DEINTERLACE_TF,          /* Top Fields Only */
66   GST_DEINTERLACE_BF           /* Bottom Fields Only */
67 } GstDeinterlaceFields;
68
69 typedef enum
70 {
71   GST_DEINTERLACE_LAYOUT_AUTO,
72   GST_DEINTERLACE_LAYOUT_TFF,
73   GST_DEINTERLACE_LAYOUT_BFF
74 } GstDeinterlaceFieldLayout;
75
76 typedef enum {
77   GST_DEINTERLACE_MODE_AUTO,
78   GST_DEINTERLACE_MODE_INTERLACED,
79   GST_DEINTERLACE_MODE_DISABLED
80 } GstDeinterlaceMode;
81
82 struct _GstDeinterlace
83 {
84   GstElement parent;
85
86   GstPad *srcpad, *sinkpad;
87
88   /* <private> */
89   GstDeinterlaceMode mode;
90
91   GstDeinterlaceFieldLayout field_layout;
92
93   GstDeinterlaceFields fields;
94
95   GstDeinterlaceMethods method_id; /* current state (differs when flushing) */
96   GstDeinterlaceMethods user_set_method_id; /* property value */
97   GstDeinterlaceMethod *method;
98
99   GstVideoFormat format;
100   gint width, height; /* frame width & height */
101   guint frame_size; /* frame size in bytes */
102   gint fps_n, fps_d; /* frame rate */
103   gboolean interlaced; /* is input interlaced? */
104
105   gboolean passthrough;
106
107   GstClockTime field_duration; /* Duration of one field */
108
109   /* The most recent pictures 
110      PictureHistory[0] is always the most recent.
111      Pointers are NULL if the picture in question isn't valid, e.g. because
112      the program just started or a picture was skipped.
113    */
114   GstDeinterlaceField field_history[GST_DEINTERLACE_MAX_FIELD_HISTORY];
115   guint history_count;
116
117   /* Set to TRUE if we're in still frame mode,
118      i.e. just forward all buffers
119    */
120   gboolean still_frame_mode;
121
122   /* Last buffer that was pushed in */
123   GstBuffer *last_buffer;
124
125   /* Current segment */
126   GstSegment segment;
127
128   /* QoS stuff */
129   gdouble proportion;
130   GstClockTime earliest_time;
131
132   GstCaps *request_caps;
133
134   gboolean reconfigure;
135   GstDeinterlaceMode new_mode;
136   GstDeinterlaceFields new_fields;
137 };
138
139 struct _GstDeinterlaceClass
140 {
141   GstElementClass parent_class;
142 };
143
144 GType gst_deinterlace_get_type (void);
145
146 G_END_DECLS
147
148 #endif /* __GST_DEINTERLACE_H__ */