Debian Codegraph @

gstreamer/gstreamermm/audiosink.cc

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gstreamermm/audiosink.h>
7 #include <gstreamermm/private/audiosink_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
30 namespace Gst
31 {
32
33 gboolean AudioSink_Class::prepare_audiosink_vfunc_callback(GstAudioSink* self, GstAudioRingBufferSpec* spec)
34 {
35 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
36 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
37
38 // Non-gtkmmproc-generated custom classes implicitly call the default
39 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
40 // generated classes can use this optimisation, which avoids the unnecessary
41 // parameter conversions if there is no possibility of the virtual function
42 // being overridden:
43 if(obj_base && obj_base->is_derived_())
44 {
45 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
46 if(obj) // This can be NULL during destruction.
47 {
48 try // Trap C++ exceptions which would normally be lost because this is a C callback.
49 {
50 Gst::AudioRingBufferSpec cpp_spec(*spec);
51
52 // Call the virtual member method, which derived classes might override.
53 return static_cast<int>(obj->prepare_audiosink_vfunc(cpp_spec));
54 }
55 catch(...)
56 {
57 Glib::exception_handlers_invoke();
58 }
59 }
60 }
61
62 BaseClassType *const base = static_cast<BaseClassType*>(
63 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
64 );
65
66 // Call the original underlying C function:
67 if(base && base->prepare)
68 return (*base->prepare)(self, spec);
69
70
71 typedef gboolean RType;
72 return RType();
73 }
74 bool Gst::AudioSink::prepare_audiosink_vfunc(Gst::AudioRingBufferSpec& spec)
75 {
76 BaseClassType *const base = static_cast<BaseClassType*>(
77 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
78 );
79
80 if(base && base->prepare)
81 return static_cast<bool>((*base->prepare)(gobj(),spec.gobj()));
82
83 typedef bool RType;
84 return RType();
85 }
86
87 } // namespace Gst
88
89
90 namespace
91 {
92 } // anonymous namespace
93
94
95 namespace Glib
96 {
97
98 Glib::RefPtr<Gst::AudioSink> wrap(GstAudioSink* object, bool take_copy)
99 {
100 return Glib::RefPtr<Gst::AudioSink>( dynamic_cast<Gst::AudioSink*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
101 //We use dynamic_cast<> in case of multiple inheritance.
102 }
103
104 } /* namespace Glib */
105
106
107 namespace Gst
108 {
109
110
111 /* The *_Class implementation: */
112
113 const Glib::Class& AudioSink_Class::init()
114 {
115 if(!gtype_) // create the GType if necessary
116 {
117 // Glib::Class has to know the class init function to clone custom types.
118 class_init_func_ = &AudioSink_Class::class_init_function;
119
120 // This is actually just optimized away, apparently with no harm.
121 // Make sure that the parent type has been created.
122 //CppClassParent::CppObjectType::get_type();
123
124 // Create the wrapper type, with the same class/instance size as the base type.
125 register_derived_type(gst_audio_sink_get_type());
126
127 // Add derived versions of interfaces, if the C type implements any interfaces:
128
129 }
130
131 return *this;
132 }
133
134
135 void AudioSink_Class::class_init_function(void* g_class, void* class_data)
136 {
137 const auto klass = static_cast<BaseClassType*>(g_class);
138 CppClassParent::class_init_function(klass, class_data);
139
140 klass->open = &open_vfunc_callback;
141 klass->unprepare = &unprepare_vfunc_callback;
142 klass->close = &close_vfunc_callback;
143 klass->write = &write_vfunc_callback;
144 klass->delay = &delay_vfunc_callback;
145 klass->reset = &reset_vfunc_callback;
146 klass->prepare = &prepare_audiosink_vfunc_callback;
147
148 }
149
150 gboolean AudioSink_Class::open_vfunc_callback(GstAudioSink* self)
151 {
152 const auto obj_base = static_cast<Glib::ObjectBase*>(
153 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
154
155 // Non-gtkmmproc-generated custom classes implicitly call the default
156 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
157 // generated classes can use this optimisation, which avoids the unnecessary
158 // parameter conversions if there is no possibility of the virtual function
159 // being overridden:
160 if(obj_base && obj_base->is_derived_())
161 {
162 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
163 if(obj) // This can be NULL during destruction.
164 {
165 try // Trap C++ exceptions which would normally be lost because this is a C callback.
166 {
167 // Call the virtual member method, which derived classes might override.
168 return static_cast<int>(obj->open_vfunc());
169 }
170 catch(...)
171 {
172 Glib::exception_handlers_invoke();
173 }
174 }
175 }
176
177 BaseClassType *const base = static_cast<BaseClassType*>(
178 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
179 );
180
181 // Call the original underlying C function:
182 if(base && base->open)
183 return (*base->open)(self);
184
185 using RType = gboolean;
186 return RType();
187 }
188 gboolean AudioSink_Class::unprepare_vfunc_callback(GstAudioSink* self)
189 {
190 const auto obj_base = static_cast<Glib::ObjectBase*>(
191 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
192
193 // Non-gtkmmproc-generated custom classes implicitly call the default
194 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
195 // generated classes can use this optimisation, which avoids the unnecessary
196 // parameter conversions if there is no possibility of the virtual function
197 // being overridden:
198 if(obj_base && obj_base->is_derived_())
199 {
200 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
201 if(obj) // This can be NULL during destruction.
202 {
203 try // Trap C++ exceptions which would normally be lost because this is a C callback.
204 {
205 // Call the virtual member method, which derived classes might override.
206 return static_cast<int>(obj->unprepare_vfunc());
207 }
208 catch(...)
209 {
210 Glib::exception_handlers_invoke();
211 }
212 }
213 }
214
215 BaseClassType *const base = static_cast<BaseClassType*>(
216 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
217 );
218
219 // Call the original underlying C function:
220 if(base && base->unprepare)
221 return (*base->unprepare)(self);
222
223 using RType = gboolean;
224 return RType();
225 }
226 gboolean AudioSink_Class::close_vfunc_callback(GstAudioSink* self)
227 {
228 const auto obj_base = static_cast<Glib::ObjectBase*>(
229 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
230
231 // Non-gtkmmproc-generated custom classes implicitly call the default
232 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
233 // generated classes can use this optimisation, which avoids the unnecessary
234 // parameter conversions if there is no possibility of the virtual function
235 // being overridden:
236 if(obj_base && obj_base->is_derived_())
237 {
238 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
239 if(obj) // This can be NULL during destruction.
240 {
241 try // Trap C++ exceptions which would normally be lost because this is a C callback.
242 {
243 // Call the virtual member method, which derived classes might override.
244 return static_cast<int>(obj->close_vfunc());
245 }
246 catch(...)
247 {
248 Glib::exception_handlers_invoke();
249 }
250 }
251 }
252
253 BaseClassType *const base = static_cast<BaseClassType*>(
254 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
255 );
256
257 // Call the original underlying C function:
258 if(base && base->close)
259 return (*base->close)(self);
260
261 using RType = gboolean;
262 return RType();
263 }
264 gint AudioSink_Class::write_vfunc_callback(GstAudioSink* self, gpointer data, guint length)
265 {
266 const auto obj_base = static_cast<Glib::ObjectBase*>(
267 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
268
269 // Non-gtkmmproc-generated custom classes implicitly call the default
270 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
271 // generated classes can use this optimisation, which avoids the unnecessary
272 // parameter conversions if there is no possibility of the virtual function
273 // being overridden:
274 if(obj_base && obj_base->is_derived_())
275 {
276 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
277 if(obj) // This can be NULL during destruction.
278 {
279 try // Trap C++ exceptions which would normally be lost because this is a C callback.
280 {
281 // Call the virtual member method, which derived classes might override.
282 return obj->write_vfunc(data, length);
283 }
284 catch(...)
285 {
286 Glib::exception_handlers_invoke();
287 }
288 }
289 }
290
291 BaseClassType *const base = static_cast<BaseClassType*>(
292 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
293 );
294
295 // Call the original underlying C function:
296 if(base && base->write)
297 return (*base->write)(self, data, length);
298
299 using RType = gint;
300 return RType();
301 }
302 guint AudioSink_Class::delay_vfunc_callback(GstAudioSink* self)
303 {
304 const auto obj_base = static_cast<Glib::ObjectBase*>(
305 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
306
307 // Non-gtkmmproc-generated custom classes implicitly call the default
308 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
309 // generated classes can use this optimisation, which avoids the unnecessary
310 // parameter conversions if there is no possibility of the virtual function
311 // being overridden:
312 if(obj_base && obj_base->is_derived_())
313 {
314 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
315 if(obj) // This can be NULL during destruction.
316 {
317 try // Trap C++ exceptions which would normally be lost because this is a C callback.
318 {
319 // Call the virtual member method, which derived classes might override.
320 return obj->get_delay_vfunc();
321 }
322 catch(...)
323 {
324 Glib::exception_handlers_invoke();
325 }
326 }
327 }
328
329 BaseClassType *const base = static_cast<BaseClassType*>(
330 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
331 );
332
333 // Call the original underlying C function:
334 if(base && base->delay)
335 return (*base->delay)(self);
336
337 using RType = guint;
338 return RType();
339 }
340 void AudioSink_Class::reset_vfunc_callback(GstAudioSink* self)
341 {
342 const auto obj_base = static_cast<Glib::ObjectBase*>(
343 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
344
345 // Non-gtkmmproc-generated custom classes implicitly call the default
346 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
347 // generated classes can use this optimisation, which avoids the unnecessary
348 // parameter conversions if there is no possibility of the virtual function
349 // being overridden:
350 if(obj_base && obj_base->is_derived_())
351 {
352 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
353 if(obj) // This can be NULL during destruction.
354 {
355 try // Trap C++ exceptions which would normally be lost because this is a C callback.
356 {
357 // Call the virtual member method, which derived classes might override.
358 obj->reset_vfunc();
359 return;
360 }
361 catch(...)
362 {
363 Glib::exception_handlers_invoke();
364 }
365 }
366 }
367
368 BaseClassType *const base = static_cast<BaseClassType*>(
369 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
370 );
371
372 // Call the original underlying C function:
373 if(base && base->reset)
374 (*base->reset)(self);
375 }
376
377
378 Glib::ObjectBase* AudioSink_Class::wrap_new(GObject* object)
379 {
380 return new AudioSink((GstAudioSink*)object);
381 }
382
383
384 /* The implementation: */
385
386 GstAudioSink* AudioSink::gobj_copy()
387 {
388 reference();
389 return gobj();
390 }
391
392 AudioSink::AudioSink(const Glib::ConstructParams& construct_params)
393 :
394 Gst::AudioBaseSink(construct_params)
395 {
396
397 }
398
399 AudioSink::AudioSink(GstAudioSink* castitem)
400 :
401 Gst::AudioBaseSink((GstAudioBaseSink*)(castitem))
402 {}
403
404
405 AudioSink::AudioSink(AudioSink&& src) noexcept
406 : Gst::AudioBaseSink(std::move(src))
407 {}
408
409 AudioSink& AudioSink::operator=(AudioSink&& src) noexcept
410 {
411 Gst::AudioBaseSink::operator=(std::move(src));
412 return *this;
413 }
414
415
416 AudioSink::~AudioSink() noexcept
417 {}
418
419
420 AudioSink::CppClassType AudioSink::audiosink_class_; // initialize static member
421
422 GType AudioSink::get_type()
423 {
424 return audiosink_class_.init().get_type();
425 }
426
427
428 GType AudioSink::get_base_type()
429 {
430 return gst_audio_sink_get_type();
431 }
432
433
434 bool Gst::AudioSink::open_vfunc()
435 {
436 const auto base = static_cast<BaseClassType*>(
437 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
438 );
439
440 if(base && base->open)
441 {
442 bool retval((*base->open)(gobj()));
443 return retval;
444 }
445
446 using RType = bool;
447 return RType();
448 }
449 bool Gst::AudioSink::unprepare_vfunc()
450 {
451 const auto base = static_cast<BaseClassType*>(
452 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
453 );
454
455 if(base && base->unprepare)
456 {
457 bool retval((*base->unprepare)(gobj()));
458 return retval;
459 }
460
461 using RType = bool;
462 return RType();
463 }
464 bool Gst::AudioSink::close_vfunc()
465 {
466 const auto base = static_cast<BaseClassType*>(
467 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
468 );
469
470 if(base && base->close)
471 {
472 bool retval((*base->close)(gobj()));
473 return retval;
474 }
475
476 using RType = bool;
477 return RType();
478 }
479 int Gst::AudioSink::write_vfunc(gpointer data, guint lenght)
480 {
481 const auto base = static_cast<BaseClassType*>(
482 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
483 );
484
485 if(base && base->write)
486 {
487 int retval((*base->write)(gobj(),data,lenght));
488 return retval;
489 }
490
491 using RType = int;
492 return RType();
493 }
494 guint Gst::AudioSink::get_delay_vfunc() const
495 {
496 const auto base = static_cast<BaseClassType*>(
497 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
498 );
499
500 if(base && base->delay)
501 {
502 guint retval((*base->delay)(const_cast<GstAudioSink*>(gobj())));
503 return retval;
504 }
505
506 using RType = guint;
507 return RType();
508 }
509 void Gst::AudioSink::reset_vfunc()
510 {
511 const auto base = static_cast<BaseClassType*>(
512 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
513 );
514
515 if(base && base->reset)
516 {
517 (*base->reset)(gobj());
518 }
519 }
520
521
522 } // namespace Gst
523
524