Tizen 2.0 Release
[framework/multimedia/gst-plugins-bad0.10.git] / tools / element-templates / pushsrc
1 /* vim: set filetype=c: */
2 % ClassName
3 GstPushSrc
4 % TYPE_CLASS_NAME
5 GST_TYPE_PUSH_SRC
6 % pads
7 srcpad-simple
8 % pkg-config
9 gstreamer-base-0.10
10 % includes
11 #include <gst/base/gstpushsrc.h>
12 % prototypes
13 static GstCaps *gst_replace_get_caps (GstBaseSrc * src);
14 static gboolean gst_replace_set_caps (GstBaseSrc * src, GstCaps * caps);
15 static gboolean gst_replace_negotiate (GstBaseSrc * src);
16 static gboolean gst_replace_newsegment (GstBaseSrc * src);
17 static gboolean gst_replace_start (GstBaseSrc * src);
18 static gboolean gst_replace_stop (GstBaseSrc * src);
19 static void
20 gst_replace_get_times (GstBaseSrc * src, GstBuffer * buffer,
21     GstClockTime * start, GstClockTime * end);
22 static gboolean gst_replace_get_size (GstBaseSrc * src, guint64 * size);
23 static gboolean gst_replace_is_seekable (GstBaseSrc * src);
24 static gboolean gst_replace_unlock (GstBaseSrc * src);
25 static gboolean gst_replace_event (GstBaseSrc * src, GstEvent * event);
26 static gboolean gst_replace_do_seek (GstBaseSrc * src, GstSegment * segment);
27 static gboolean gst_replace_query (GstBaseSrc * src, GstQuery * query);
28 static gboolean gst_replace_check_get_range (GstBaseSrc * src);
29 static void gst_replace_fixate (GstBaseSrc * src, GstCaps * caps);
30 static gboolean gst_replace_unlock_stop (GstBaseSrc * src);
31 static gboolean
32 gst_replace_prepare_seek_segment (GstBaseSrc * src, GstEvent * seek,
33     GstSegment * segment);
34 static GstFlowReturn gst_replace_create (GstPushSrc * src, GstBuffer ** buf);
35 % declare-class
36   GstBaseSrcClass *base_src_class = GST_BASE_SRC_CLASS (klass);
37   GstPushSrcClass *push_src_class = GST_PUSH_SRC_CLASS (klass);
38 % set-methods
39   base_src_class->get_caps = GST_DEBUG_FUNCPTR (gst_replace_get_caps);
40   base_src_class->set_caps = GST_DEBUG_FUNCPTR (gst_replace_set_caps);
41   base_src_class->negotiate = GST_DEBUG_FUNCPTR (gst_replace_negotiate);
42   base_src_class->newsegment = GST_DEBUG_FUNCPTR (gst_replace_newsegment);
43   base_src_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
44   base_src_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
45   base_src_class->get_times = GST_DEBUG_FUNCPTR (gst_replace_get_times);
46   base_src_class->get_size = GST_DEBUG_FUNCPTR (gst_replace_get_size);
47   base_src_class->is_seekable = GST_DEBUG_FUNCPTR (gst_replace_is_seekable);
48   base_src_class->unlock = GST_DEBUG_FUNCPTR (gst_replace_unlock);
49   base_src_class->event = GST_DEBUG_FUNCPTR (gst_replace_event);
50   base_src_class->do_seek = GST_DEBUG_FUNCPTR (gst_replace_do_seek);
51   base_src_class->query = GST_DEBUG_FUNCPTR (gst_replace_query);
52   base_src_class->check_get_range = GST_DEBUG_FUNCPTR (gst_replace_check_get_range);
53   base_src_class->fixate = GST_DEBUG_FUNCPTR (gst_replace_fixate);
54   base_src_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_replace_unlock_stop);
55   base_src_class->prepare_seek_segment = GST_DEBUG_FUNCPTR (gst_replace_prepare_seek_segment);
56
57   push_src_class->create = GST_DEBUG_FUNCPTR (gst_replace_create);
58 % methods
59
60 static GstCaps *
61 gst_replace_get_caps (GstBaseSrc * src)
62 {
63   GstReplace *replace = GST_REPLACE (src);
64
65   GST_DEBUG_OBJECT (replace, "get_caps");
66
67   return NULL;
68 }
69
70 static gboolean
71 gst_replace_set_caps (GstBaseSrc * src, GstCaps * caps)
72 {
73   GstReplace *replace = GST_REPLACE (src);
74
75   GST_DEBUG_OBJECT (replace, "set_caps");
76
77   return TRUE;
78 }
79
80 static gboolean
81 gst_replace_negotiate (GstBaseSrc * src)
82 {
83   GstReplace *replace = GST_REPLACE (src);
84
85   GST_DEBUG_OBJECT (replace, "negotiate");
86
87   return TRUE;
88 }
89
90 static gboolean
91 gst_replace_newsegment (GstBaseSrc * src)
92 {
93   GstReplace *replace = GST_REPLACE (src);
94
95   GST_DEBUG_OBJECT (replace, "newsegment");
96
97   return TRUE;
98 }
99
100 static gboolean
101 gst_replace_start (GstBaseSrc * src)
102 {
103   GstReplace *replace = GST_REPLACE (src);
104
105   GST_DEBUG_OBJECT (replace, "start");
106
107   return TRUE;
108 }
109
110 static gboolean
111 gst_replace_stop (GstBaseSrc * src)
112 {
113   GstReplace *replace = GST_REPLACE (src);
114
115   GST_DEBUG_OBJECT (replace, "stop");
116
117   return TRUE;
118 }
119
120 static void
121 gst_replace_get_times (GstBaseSrc * src, GstBuffer * buffer,
122     GstClockTime * start, GstClockTime * end)
123 {
124   GstReplace *replace = GST_REPLACE (src);
125
126   GST_DEBUG_OBJECT (replace, "get_times");
127 }
128
129 static gboolean
130 gst_replace_get_size (GstBaseSrc * src, guint64 * size)
131 {
132   GstReplace *replace = GST_REPLACE (src);
133
134   GST_DEBUG_OBJECT (replace, "get_size");
135
136   return TRUE;
137 }
138
139 static gboolean
140 gst_replace_is_seekable (GstBaseSrc * src)
141 {
142   GstReplace *replace = GST_REPLACE (src);
143
144   GST_DEBUG_OBJECT (replace, "is_seekable");
145
146   return FALSE;
147 }
148
149 static gboolean
150 gst_replace_unlock (GstBaseSrc * src)
151 {
152   GstReplace *replace = GST_REPLACE (src);
153
154   GST_DEBUG_OBJECT (replace, "unlock");
155
156   return TRUE;
157 }
158
159 static gboolean
160 gst_replace_event (GstBaseSrc * src, GstEvent * event)
161 {
162   GstReplace *replace = GST_REPLACE (src);
163
164   GST_DEBUG_OBJECT (replace, "event");
165
166   return TRUE;
167 }
168
169 static gboolean
170 gst_replace_do_seek (GstBaseSrc * src, GstSegment * segment)
171 {
172   GstReplace *replace = GST_REPLACE (src);
173
174   GST_DEBUG_OBJECT (replace, "do_seek");
175
176   return FALSE;
177 }
178
179 static gboolean
180 gst_replace_query (GstBaseSrc * src, GstQuery * query)
181 {
182   GstReplace *replace = GST_REPLACE (src);
183
184   GST_DEBUG_OBJECT (replace, "query");
185
186   return TRUE;
187 }
188
189 static gboolean
190 gst_replace_check_get_range (GstBaseSrc * src)
191 {
192   GstReplace *replace = GST_REPLACE (src);
193
194   GST_DEBUG_OBJECT (replace, "get_range");
195
196   return FALSE;
197 }
198
199 static void
200 gst_replace_fixate (GstBaseSrc * src, GstCaps * caps)
201 {
202   GstReplace *replace = GST_REPLACE (src);
203
204   GST_DEBUG_OBJECT (replace, "fixate");
205 }
206
207 static gboolean
208 gst_replace_unlock_stop (GstBaseSrc * src)
209 {
210   GstReplace *replace = GST_REPLACE (src);
211
212   GST_DEBUG_OBJECT (replace, "stop");
213
214   return TRUE;
215 }
216
217 static gboolean
218 gst_replace_prepare_seek_segment (GstBaseSrc * src, GstEvent * seek,
219     GstSegment * segment)
220 {
221   GstReplace *replace = GST_REPLACE (src);
222
223   GST_DEBUG_OBJECT (replace, "seek_segment");
224
225   return FALSE;
226 }
227
228 static GstFlowReturn
229 gst_replace_create (GstPushSrc * src, GstBuffer ** buf)
230 {
231
232   return GST_FLOW_OK;
233 }
234 % end
235