Debian Codegraph @

gstreamer/gstreamermm/audiobasesrc.cc

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gstreamermm/audiobasesrc.h>
7 #include <gstreamermm/private/audiobasesrc_p.h>
8
9
10 /* gstreamermm - a C++ wrapper for gstreamer
11 *
12 * Copyright 2008-2016 The gstreamermm Development Team
13 *
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29 #include <gstreamermm/audioringbuffer.h>
30
31
32 namespace
33 {
34 } // anonymous namespace
35
36 // static
37 GType Glib::Value<Gst::AudioBaseSrcSlaveMethod>::value_type()
38 {
39 return gst_audio_base_src_slave_method_get_type();
40 }
41
42
43 namespace Glib
44 {
45
46 Glib::RefPtr<Gst::AudioBaseSrc> wrap(GstAudioBaseSrc* object, bool take_copy)
47 {
48 return Glib::RefPtr<Gst::AudioBaseSrc>( dynamic_cast<Gst::AudioBaseSrc*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
49 //We use dynamic_cast<> in case of multiple inheritance.
50 }
51
52 } /* namespace Glib */
53
54
55 namespace Gst
56 {
57
58
59 /* The *_Class implementation: */
60
61 const Glib::Class& AudioBaseSrc_Class::init()
62 {
63 if(!gtype_) // create the GType if necessary
64 {
65 // Glib::Class has to know the class init function to clone custom types.
66 class_init_func_ = &AudioBaseSrc_Class::class_init_function;
67
68 // This is actually just optimized away, apparently with no harm.
69 // Make sure that the parent type has been created.
70 //CppClassParent::CppObjectType::get_type();
71
72 // Create the wrapper type, with the same class/instance size as the base type.
73 register_derived_type(gst_audio_base_src_get_type());
74
75 // Add derived versions of interfaces, if the C type implements any interfaces:
76
77 }
78
79 return *this;
80 }
81
82
83 void AudioBaseSrc_Class::class_init_function(void* g_class, void* class_data)
84 {
85 const auto klass = static_cast<BaseClassType*>(g_class);
86 CppClassParent::class_init_function(klass, class_data);
87
88 klass->create_ringbuffer = &create_ringbuffer_vfunc_callback;
89
90 }
91
92 GstAudioRingBuffer* AudioBaseSrc_Class::create_ringbuffer_vfunc_callback(GstAudioBaseSrc* self)
93 {
94 const auto obj_base = static_cast<Glib::ObjectBase*>(
95 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
96
97 // Non-gtkmmproc-generated custom classes implicitly call the default
98 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
99 // generated classes can use this optimisation, which avoids the unnecessary
100 // parameter conversions if there is no possibility of the virtual function
101 // being overridden:
102 if(obj_base && obj_base->is_derived_())
103 {
104 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
105 if(obj) // This can be NULL during destruction.
106 {
107 try // Trap C++ exceptions which would normally be lost because this is a C callback.
108 {
109 // Call the virtual member method, which derived classes might override.
110 return Glib::unwrap(obj->create_ring_buffer_vfunc());
111 }
112 catch(...)
113 {
114 Glib::exception_handlers_invoke();
115 }
116 }
117 }
118
119 BaseClassType *const base = static_cast<BaseClassType*>(
120 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
121 );
122
123 // Call the original underlying C function:
124 if(base && base->create_ringbuffer)
125 return (*base->create_ringbuffer)(self);
126
127 using RType = GstAudioRingBuffer*;
128 return RType();
129 }
130
131
132 Glib::ObjectBase* AudioBaseSrc_Class::wrap_new(GObject* object)
133 {
134 return new AudioBaseSrc((GstAudioBaseSrc*)object);
135 }
136
137
138 /* The implementation: */
139
140 GstAudioBaseSrc* AudioBaseSrc::gobj_copy()
141 {
142 reference();
143 return gobj();
144 }
145
146 AudioBaseSrc::AudioBaseSrc(const Glib::ConstructParams& construct_params)
147 :
148 Gst::PushSrc(construct_params)
149 {
150
151 }
152
153 AudioBaseSrc::AudioBaseSrc(GstAudioBaseSrc* castitem)
154 :
155 Gst::PushSrc((GstPushSrc*)(castitem))
156 {}
157
158
159 AudioBaseSrc::AudioBaseSrc(AudioBaseSrc&& src) noexcept
160 : Gst::PushSrc(std::move(src))
161 {}
162
163 AudioBaseSrc& AudioBaseSrc::operator=(AudioBaseSrc&& src) noexcept
164 {
165 Gst::PushSrc::operator=(std::move(src));
166 return *this;
167 }
168
169
170 AudioBaseSrc::~AudioBaseSrc() noexcept
171 {}
172
173
174 AudioBaseSrc::CppClassType AudioBaseSrc::audiobasesrc_class_; // initialize static member
175
176 GType AudioBaseSrc::get_type()
177 {
178 return audiobasesrc_class_.init().get_type();
179 }
180
181
182 GType AudioBaseSrc::get_base_type()
183 {
184 return gst_audio_base_src_get_type();
185 }
186
187
188 Glib::RefPtr<Gst::Clock> AudioBaseSrc::get_clock()
189 {
190 Glib::RefPtr<Gst::Clock> ref_ptr(Glib::wrap(gobj()->clock));
191
192 if(ref_ptr)
193 ref_ptr->reference();
194
195 return ref_ptr;
196 }
197
198 Glib::RefPtr<const Gst::Clock> AudioBaseSrc::get_clock() const
199 {
200 Glib::RefPtr<const Gst::Clock> ref_ptr(Glib::wrap(gobj()->clock));
201
202 if(ref_ptr)
203 ref_ptr->reference();
204
205 return ref_ptr;
206 }
207
208 Glib::RefPtr<Gst::AudioRingBuffer> AudioBaseSrc::create_ring_buffer()
209 {
210 return Glib::wrap(gst_audio_base_src_create_ringbuffer(gobj()));
211 }
212
213 void AudioBaseSrc::set_provide_clock(bool provide)
214 {
215 gst_audio_base_src_set_provide_clock(gobj(), static_cast<int>(provide));
216 }
217
218 bool AudioBaseSrc::get_provide_clock() const
219 {
220 return gst_audio_base_src_get_provide_clock(const_cast<GstAudioBaseSrc*>(gobj()));
221 }
222
223 void AudioBaseSrc::set_slave_method(Gst::AudioBaseSrcSlaveMethod method)
224 {
225 gst_audio_base_src_set_slave_method(gobj(), ((GstAudioBaseSrcSlaveMethod)(method)));
226 }
227
228 Gst::AudioBaseSrcSlaveMethod AudioBaseSrc::get_slave_method() const
229 {
230 return ((Gst::AudioBaseSrcSlaveMethod)(gst_audio_base_src_get_slave_method(const_cast<GstAudioBaseSrc*>(gobj()))));
231 }
232
233
234 Glib::PropertyProxy_ReadOnly< gint64 > AudioBaseSrc::property_actual_buffer_time() const
235 {
236 return Glib::PropertyProxy_ReadOnly< gint64 >(this, "actual-buffer-time");
237 }
238
239 Glib::PropertyProxy_ReadOnly< gint64 > AudioBaseSrc::property_actual_latency_time() const
240 {
241 return Glib::PropertyProxy_ReadOnly< gint64 >(this, "actual-latency-time");
242 }
243
244 Glib::PropertyProxy< gint64 > AudioBaseSrc::property_buffer_time()
245 {
246 return Glib::PropertyProxy< gint64 >(this, "buffer-time");
247 }
248
249 Glib::PropertyProxy_ReadOnly< gint64 > AudioBaseSrc::property_buffer_time() const
250 {
251 return Glib::PropertyProxy_ReadOnly< gint64 >(this, "buffer-time");
252 }
253
254 Glib::PropertyProxy< gint64 > AudioBaseSrc::property_latency_time()
255 {
256 return Glib::PropertyProxy< gint64 >(this, "latency-time");
257 }
258
259 Glib::PropertyProxy_ReadOnly< gint64 > AudioBaseSrc::property_latency_time() const
260 {
261 return Glib::PropertyProxy_ReadOnly< gint64 >(this, "latency-time");
262 }
263
264 Glib::PropertyProxy< bool > AudioBaseSrc::property_provide_clock()
265 {
266 return Glib::PropertyProxy< bool >(this, "provide-clock");
267 }
268
269 Glib::PropertyProxy_ReadOnly< bool > AudioBaseSrc::property_provide_clock() const
270 {
271 return Glib::PropertyProxy_ReadOnly< bool >(this, "provide-clock");
272 }
273
274 Glib::PropertyProxy< AudioBaseSrcSlaveMethod > AudioBaseSrc::property_slave_method()
275 {
276 return Glib::PropertyProxy< AudioBaseSrcSlaveMethod >(this, "slave-method");
277 }
278
279 Glib::PropertyProxy_ReadOnly< AudioBaseSrcSlaveMethod > AudioBaseSrc::property_slave_method() const
280 {
281 return Glib::PropertyProxy_ReadOnly< AudioBaseSrcSlaveMethod >(this, "slave-method");
282 }
283
284
285 Glib::RefPtr<Gst::AudioRingBuffer> Gst::AudioBaseSrc::create_ring_buffer_vfunc()
286 {
287 const auto base = static_cast<BaseClassType*>(
288 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
289 );
290
291 if(base && base->create_ringbuffer)
292 {
293 Glib::RefPtr<Gst::AudioRingBuffer> retval(Glib::wrap((*base->create_ringbuffer)(gobj())));
294 return retval;
295 }
296
297 using RType = Glib::RefPtr<Gst::AudioRingBuffer>;
298 return RType();
299 }
300
301
302 } // namespace Gst
303
304