Added gst-plugins-base-subtitles0.10-0.10.34 for Meego Harmattan 1.2
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / gst / videotestsrc / gstvideotestsrc.h
1 /* GStreamer
2  * Copyright (C) <2002> David A. Schleef <ds@schleef.org>
3  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __GST_VIDEO_TEST_SRC_H__
22 #define __GST_VIDEO_TEST_SRC_H__
23
24 #include <gst/gst.h>
25 #include <gst/base/gstpushsrc.h>
26
27 G_BEGIN_DECLS
28
29 #define GST_TYPE_VIDEO_TEST_SRC \
30   (gst_video_test_src_get_type())
31 #define GST_VIDEO_TEST_SRC(obj) \
32   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_TEST_SRC,GstVideoTestSrc))
33 #define GST_VIDEO_TEST_SRC_CLASS(klass) \
34   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_TEST_SRC,GstVideoTestSrcClass))
35 #define GST_IS_VIDEO_TEST_SRC(obj) \
36   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEO_TEST_SRC))
37 #define GST_IS_VIDEO_TEST_SRC_CLASS(klass) \
38   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_TEST_SRC))
39
40 /**
41  * GstVideoTestSrcPattern:
42  * @GST_VIDEO_TEST_SRC_SMPTE: A standard SMPTE test pattern
43  * @GST_VIDEO_TEST_SRC_SNOW: Random noise
44  * @GST_VIDEO_TEST_SRC_BLACK: A black image
45  * @GST_VIDEO_TEST_SRC_WHITE: A white image
46  * @GST_VIDEO_TEST_SRC_RED: A red image
47  * @GST_VIDEO_TEST_SRC_GREEN: A green image
48  * @GST_VIDEO_TEST_SRC_BLUE: A blue image
49  * @GST_VIDEO_TEST_SRC_CHECKERS1: Checkers pattern (1px)
50  * @GST_VIDEO_TEST_SRC_CHECKERS2: Checkers pattern (2px)
51  * @GST_VIDEO_TEST_SRC_CHECKERS4: Checkers pattern (4px)
52  * @GST_VIDEO_TEST_SRC_CHECKERS8: Checkers pattern (8px)
53  * @GST_VIDEO_TEST_SRC_CIRCULAR: Circular pattern
54  * @GST_VIDEO_TEST_SRC_BLINK: Alternate between black and white
55  * @GST_VIDEO_TEST_SRC_SMPTE75: SMPTE test pattern (75% color bars)
56  * @GST_VIDEO_TEST_SRC_ZONE_PLATE: Zone plate
57  * @GST_VIDEO_TEST_SRC_GAMUT: Gamut checking pattern
58  * @GST_VIDEO_TEST_SRC_CHROMA_ZONE_PLATE: Chroma zone plate
59  * @GST_VIDEO_TEST_SRC_BALL: Moving ball
60  * @GST_VIDEO_TEST_SRC_SMPTE100: SMPTE test pattern (100% color bars)
61  * @GST_VIDEO_TEST_SRC_BAR: Bar with foreground color
62  *
63  * The test pattern to produce.
64  *
65  * The Gamut pattern creates a checkerboard pattern of colors at the
66  * edge of the YCbCr gamut and nearby colors that are out of gamut.
67  * The pattern is divided into 4 regions: black, white, red, and blue.
68  * After conversion to RGB, the out-of-gamut colors should be converted
69  * to the same value as their in-gamut neighbors.  If the checkerboard
70  * pattern is still visible after conversion, this indicates a faulty
71  * conversion.  Image manipulation, such as adjusting contrast or
72  * brightness, can also cause the pattern to be visible.
73  *
74  * The Zone Plate pattern is based on BBC R&D Report 1978/23, and can
75  * be used to test spatial frequency response of a system.  This
76  * pattern generator is controlled by the xoffset and yoffset parameters
77  * and also by all the parameters starting with 'k'.  The default
78  * parameters produce a grey pattern.  Try 'videotestsrc
79  * pattern=zone-plate kx2=20 ky2=20 kt=1' to produce something
80  * interesting.
81  */
82 typedef enum {
83   GST_VIDEO_TEST_SRC_SMPTE,
84   GST_VIDEO_TEST_SRC_SNOW,
85   GST_VIDEO_TEST_SRC_BLACK,
86   GST_VIDEO_TEST_SRC_WHITE,
87   GST_VIDEO_TEST_SRC_RED,
88   GST_VIDEO_TEST_SRC_GREEN,
89   GST_VIDEO_TEST_SRC_BLUE,
90   GST_VIDEO_TEST_SRC_CHECKERS1,
91   GST_VIDEO_TEST_SRC_CHECKERS2,
92   GST_VIDEO_TEST_SRC_CHECKERS4,
93   GST_VIDEO_TEST_SRC_CHECKERS8,
94   GST_VIDEO_TEST_SRC_CIRCULAR,
95   GST_VIDEO_TEST_SRC_BLINK,
96   GST_VIDEO_TEST_SRC_SMPTE75,
97   GST_VIDEO_TEST_SRC_ZONE_PLATE,
98   GST_VIDEO_TEST_SRC_GAMUT,
99   GST_VIDEO_TEST_SRC_CHROMA_ZONE_PLATE,
100   GST_VIDEO_TEST_SRC_SOLID,
101   GST_VIDEO_TEST_SRC_BALL,
102   GST_VIDEO_TEST_SRC_SMPTE100,
103   GST_VIDEO_TEST_SRC_BAR
104 } GstVideoTestSrcPattern;
105
106 /**
107  * GstVideoTestSrcColorSpec:
108  * @GST_VIDEO_TEST_SRC_BT601: ITU-R Rec. BT.601/BT.470 (SD)
109  * @GST_VIDEO_TEST_SRC_BT709: ITU-R Rec. BT.709 (HD)
110  *
111  * The color specification to use.
112  */
113 typedef enum {
114   GST_VIDEO_TEST_SRC_BT601,
115   GST_VIDEO_TEST_SRC_BT709
116 } GstVideoTestSrcColorSpec;
117
118 typedef struct _GstVideoTestSrc GstVideoTestSrc;
119 typedef struct _GstVideoTestSrcClass GstVideoTestSrcClass;
120
121 /**
122  * GstVideoTestSrc:
123  *
124  * Opaque data structure.
125  */
126 struct _GstVideoTestSrc {
127   GstPushSrc element;
128
129   /*< private >*/
130
131   /* type of output */
132   GstVideoTestSrcPattern pattern_type;
133
134   /* Color spec of output */
135   GstVideoTestSrcColorSpec color_spec;
136
137   /* video state */
138   char *format_name;
139   gint width;
140   gint height;
141   struct fourcc_list_struct *fourcc;
142   gint bpp;
143   gint rate_numerator;
144   gint rate_denominator;
145
146   /* private */
147   gint64 timestamp_offset;              /* base offset */
148   GstClockTime running_time;            /* total running time */
149   gint64 n_frames;                      /* total frames sent */
150   gboolean peer_alloc;
151
152   /* zoneplate */
153   gint k0;
154   gint kx;
155   gint ky;
156   gint kt;
157   gint kxt;
158   gint kyt;
159   gint kxy;
160   gint kx2;
161   gint ky2;
162   gint kt2;
163   gint xoffset;
164   gint yoffset;
165
166   /* solid color */
167   guint foreground_color;
168   guint background_color;
169
170   /* moving color bars */
171   gint horizontal_offset;
172   gint horizontal_speed;
173
174   void (*make_image) (GstVideoTestSrc *v, unsigned char *dest, int w, int h);
175
176   /* temporary AYUV/ARGB scanline */
177   guint8 *tmpline_u8;
178   guint8 *tmpline;
179   guint8 *tmpline2;
180 };
181
182 struct _GstVideoTestSrcClass {
183   GstPushSrcClass parent_class;
184 };
185
186 GType gst_video_test_src_get_type (void);
187
188 G_END_DECLS
189
190 #endif /* __GST_VIDEO_TEST_SRC_H__ */