element-maker: improve generation of several classes
[platform/upstream/gstreamer.git] / tools / gstbasesink.c
1 % ClassName
2 GstBaseSink
3 % TYPE_CLASS_NAME
4 GST_TYPE_BASE_SINK
5 % pads
6 sinkpad-simple
7 % pkg-config
8 gstreamer-base-0.10
9 % includes
10 #include <gst/base/gstbasesink.h>
11 % prototypes
12 static GstCaps *gst_replace_get_caps (GstBaseSink * sink);
13 static gboolean gst_replace_set_caps (GstBaseSink * sink, GstCaps * caps);
14 static GstFlowReturn
15 gst_replace_buffer_alloc (GstBaseSink * sink, guint64 offset, guint size,
16     GstCaps * caps, GstBuffer ** buf);
17 static void
18 gst_replace_get_times (GstBaseSink * sink, GstBuffer * buffer,
19     GstClockTime * start, GstClockTime * end);
20 static gboolean gst_replace_start (GstBaseSink * sink);
21 static gboolean gst_replace_stop (GstBaseSink * sink);
22 static gboolean gst_replace_unlock (GstBaseSink * sink);
23 static gboolean gst_replace_event (GstBaseSink * sink, GstEvent * event);
24 static GstFlowReturn
25 gst_replace_preroll (GstBaseSink * sink, GstBuffer * buffer);
26 static GstFlowReturn
27 gst_replace_render (GstBaseSink * sink, GstBuffer * buffer);
28 static GstStateChangeReturn gst_replace_async_play (GstBaseSink * sink);
29 static gboolean gst_replace_activate_pull (GstBaseSink * sink, gboolean active);
30 static void gst_replace_fixate (GstBaseSink * sink, GstCaps * caps);
31 static gboolean gst_replace_unlock_stop (GstBaseSink * sink);
32 static GstFlowReturn
33 gst_replace_render_list (GstBaseSink * sink, GstBufferList * buffer_list);
34 % declare-class
35   GstBaseSinkClass *base_sink_class = GST_BASE_SINK_CLASS (klass);
36 % set-methods
37   base_sink_class->get_caps = GST_DEBUG_FUNCPTR (gst_replace_get_caps);
38   base_sink_class->set_caps = GST_DEBUG_FUNCPTR (gst_replace_set_caps);
39   base_sink_class->buffer_alloc = GST_DEBUG_FUNCPTR (gst_replace_buffer_alloc);
40   base_sink_class->get_times = GST_DEBUG_FUNCPTR (gst_replace_get_times);
41   base_sink_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
42   base_sink_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
43   base_sink_class->unlock = GST_DEBUG_FUNCPTR (gst_replace_unlock);
44   base_sink_class->event = GST_DEBUG_FUNCPTR (gst_replace_event);
45   base_sink_class->preroll = GST_DEBUG_FUNCPTR (gst_replace_preroll);
46   base_sink_class->render = GST_DEBUG_FUNCPTR (gst_replace_render);
47   base_sink_class->async_play = GST_DEBUG_FUNCPTR (gst_replace_async_play);
48   base_sink_class->activate_pull = GST_DEBUG_FUNCPTR (gst_replace_activate_pull);
49   base_sink_class->fixate = GST_DEBUG_FUNCPTR (gst_replace_fixate);
50   base_sink_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_replace_unlock_stop);
51   base_sink_class->render_list = GST_DEBUG_FUNCPTR (gst_replace_render_list);
52 % methods
53
54
55 static GstCaps *
56 gst_replace_get_caps (GstBaseSink * sink)
57 {
58
59   return NULL;
60 }
61
62 static gboolean
63 gst_replace_set_caps (GstBaseSink * sink, GstCaps * caps)
64 {
65
66   return FALSE;
67 }
68
69 static GstFlowReturn
70 gst_replace_buffer_alloc (GstBaseSink * sink, guint64 offset, guint size,
71     GstCaps * caps, GstBuffer ** buf)
72 {
73
74   return GST_FLOW_ERROR;
75 }
76
77 static void
78 gst_replace_get_times (GstBaseSink * sink, GstBuffer * buffer,
79     GstClockTime * start, GstClockTime * end)
80 {
81
82 }
83
84 static gboolean
85 gst_replace_start (GstBaseSink * sink)
86 {
87
88   return TRUE;
89 }
90
91 static gboolean
92 gst_replace_stop (GstBaseSink * sink)
93 {
94
95   return TRUE;
96 }
97
98 static gboolean
99 gst_replace_unlock (GstBaseSink * sink)
100 {
101
102   return TRUE;
103 }
104
105 static gboolean
106 gst_replace_event (GstBaseSink * sink, GstEvent * event)
107 {
108
109   return TRUE;
110 }
111
112 static GstFlowReturn
113 gst_replace_preroll (GstBaseSink * sink, GstBuffer * buffer)
114 {
115
116   return GST_FLOW_OK;
117 }
118
119 static GstFlowReturn
120 gst_replace_render (GstBaseSink * sink, GstBuffer * buffer)
121 {
122
123   return GST_FLOW_OK;
124 }
125
126 static GstStateChangeReturn
127 gst_replace_async_play (GstBaseSink * sink)
128 {
129
130   return GST_STATE_CHANGE_SUCCESS;
131 }
132
133 static gboolean
134 gst_replace_activate_pull (GstBaseSink * sink, gboolean active)
135 {
136
137   return TRUE;
138 }
139
140 static void
141 gst_replace_fixate (GstBaseSink * sink, GstCaps * caps)
142 {
143
144 }
145
146 static gboolean
147 gst_replace_unlock_stop (GstBaseSink * sink)
148 {
149
150   return TRUE;
151 }
152
153 static GstFlowReturn
154 gst_replace_render_list (GstBaseSink * sink, GstBufferList * buffer_list)
155 {
156
157   return GST_FLOW_OK;
158 }
159 % end
160
161
162