Debian Codegraph @

gstreamer/gstreamermm/bin.cc

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gstreamermm/bin.h>
7 #include <gstreamermm/private/bin_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 <gst/gst.h>
30 #include <gstreamermm/pad.h>
31 #include <gstreamermm/ghostpad.h>
32 #include <gstreamermm/iterator.h>
33 #include <gstreamermm/bus.h>
34 #include <gstreamermm/handle_error.h>
35
36
37 namespace Gst
38 {
39
40 Bin::Bin()
41 : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
42 Glib::ObjectBase(nullptr),
43 Element(Glib::ConstructParams(bin_class_.init(), "name",nullptr, nullptr))
44 {}
45
46 Glib::RefPtr<Gst::Bin> Bin::add(const Glib::RefPtr<Gst::Element>& element)
47 {
48 if(!element)
49 gstreamermm_handle_error("Failed to add null element.");
50
51 GstElement* celement = Glib::unwrap(element);
52
53 // The following is needed because when adding an element to a bin, the bin
54 // likes to have the last reference and then destroy it when the bin itself
55 // is destroyed. Without the extra reference, when the last Glib::RefPtr<>
56 // to the element goes out of scope, the element may be destroyed before the
57 // bin and GStreamer complains about it. The extra reference to the element
58 // is removed when the bin is destroyed or when the element is removed from
59 // the bin (see gst_bin_remove).
60 if(G_LIKELY(g_object_is_floating(celement)))
61 element->reference();
62
63 const bool result = gst_bin_add(gobj(), celement);
64
65 // If addition successful, return RefPtr<..> to this bin, otherwise throw an
66 // exception
67 if(!result)
68 gstreamermm_handle_error("Failed to add " + element->get_name() +
69 " element.");
70
71 return Glib::wrap(gobj(), true);
72 }
73
74 Glib::RefPtr<Gst::Bin> Bin::remove(const Glib::RefPtr<Gst::Element>& element)
75 {
76 if(!element)
77 gstreamermm_handle_error("Failed to remove null element.");
78
79
80 const bool result = gst_bin_remove(gobj(), Glib::unwrap(element));
81
82 // If removal successful, return RefPtr<..> to this bin, otherwise throw an
83 // exception
84 if(!result)
85 gstreamermm_handle_error("Failed to remove " + element->get_name() +
86 " element.");
87
88 return Glib::wrap(gobj(), true);
89 }
90
91 Glib::RefPtr<Gst::GhostPad> Bin::add_ghost_pad(const
92 Glib::RefPtr<Gst::Element>& element, const Glib::ustring& pad_name, const
93 Glib::ustring& name)
94 {
95 Glib::RefPtr<Gst::Pad> static_pad = element->get_static_pad(pad_name);
96 Glib::RefPtr<Gst::GhostPad> ghost_pad = Gst::GhostPad::create(static_pad,
97 name);
98 add_pad(ghost_pad);
99 return ghost_pad;
100 }
101
102 } //namespace Gst
103
104 namespace
105 {
106
107
108 static void Bin_signal_element_added_callback(GstBin* self, GstElement* p0,void* data)
109 {
110 using namespace Gst;
111 using SlotType = sigc::slot< void,const Glib::RefPtr<Gst::Element>& >;
112
113 auto obj = dynamic_cast<Bin*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
114 // Do not try to call a signal on a disassociated wrapper.
115 if(obj)
116 {
117 try
118 {
119 if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
120 (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
121 );
122 }
123 catch(...)
124 {
125 Glib::exception_handlers_invoke();
126 }
127 }
128 }
129
130 static const Glib::SignalProxyInfo Bin_signal_element_added_info =
131 {
132 "element-added",
133 (GCallback) &Bin_signal_element_added_callback,
134 (GCallback) &Bin_signal_element_added_callback
135 };
136
137
138 static void Bin_signal_element_removed_callback(GstBin* self, GstElement* p0,void* data)
139 {
140 using namespace Gst;
141 using SlotType = sigc::slot< void,const Glib::RefPtr<Gst::Element>& >;
142
143 auto obj = dynamic_cast<Bin*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
144 // Do not try to call a signal on a disassociated wrapper.
145 if(obj)
146 {
147 try
148 {
149 if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
150 (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
151 );
152 }
153 catch(...)
154 {
155 Glib::exception_handlers_invoke();
156 }
157 }
158 }
159
160 static const Glib::SignalProxyInfo Bin_signal_element_removed_info =
161 {
162 "element-removed",
163 (GCallback) &Bin_signal_element_removed_callback,
164 (GCallback) &Bin_signal_element_removed_callback
165 };
166
167
168 static gboolean Bin_signal_do_latency_callback(GstBin* self, void* data)
169 {
170 using namespace Gst;
171 using SlotType = sigc::slot< bool >;
172
173 auto obj = dynamic_cast<Bin*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
174 // Do not try to call a signal on a disassociated wrapper.
175 if(obj)
176 {
177 try
178 {
179 if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
180 return static_cast<int>((*static_cast<SlotType*>(slot))());
181 }
182 catch(...)
183 {
184 Glib::exception_handlers_invoke();
185 }
186 }
187
188 using RType = gboolean;
189 return RType();
190 }
191
192 static gboolean Bin_signal_do_latency_notify_callback(GstBin* self, void* data)
193 {
194 using namespace Gst;
195 using SlotType = sigc::slot< void >;
196
197 auto obj = dynamic_cast<Bin*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
198 // Do not try to call a signal on a disassociated wrapper.
199 if(obj)
200 {
201 try
202 {
203 if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
204 (*static_cast<SlotType*>(slot))();
205 }
206 catch(...)
207 {
208 Glib::exception_handlers_invoke();
209 }
210 }
211
212 using RType = gboolean;
213 return RType();
214 }
215
216 static const Glib::SignalProxyInfo Bin_signal_do_latency_info =
217 {
218 "do-latency",
219 (GCallback) &Bin_signal_do_latency_callback,
220 (GCallback) &Bin_signal_do_latency_notify_callback
221 };
222
223
224 } // anonymous namespace
225
226 // static
227 GType Glib::Value<Gst::BinFlags>::value_type()
228 {
229 return gst_bin_flags_get_type();
230 }
231
232
233 namespace Glib
234 {
235
236 Glib::RefPtr<Gst::Bin> wrap(GstBin* object, bool take_copy)
237 {
238 return Glib::RefPtr<Gst::Bin>( dynamic_cast<Gst::Bin*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
239 //We use dynamic_cast<> in case of multiple inheritance.
240 }
241
242 } /* namespace Glib */
243
244
245 namespace Gst
246 {
247
248
249 /* The *_Class implementation: */
250
251 const Glib::Class& Bin_Class::init()
252 {
253 if(!gtype_) // create the GType if necessary
254 {
255 // Glib::Class has to know the class init function to clone custom types.
256 class_init_func_ = &Bin_Class::class_init_function;
257
258 // This is actually just optimized away, apparently with no harm.
259 // Make sure that the parent type has been created.
260 //CppClassParent::CppObjectType::get_type();
261
262 // Create the wrapper type, with the same class/instance size as the base type.
263 register_derived_type(gst_bin_get_type());
264
265 // Add derived versions of interfaces, if the C type implements any interfaces:
266 ChildProxy::add_interface(get_type());
267
268 }
269
270 return *this;
271 }
272
273
274 void Bin_Class::class_init_function(void* g_class, void* class_data)
275 {
276 const auto klass = static_cast<BaseClassType*>(g_class);
277 CppClassParent::class_init_function(klass, class_data);
278
279 klass->add_element = &add_element_vfunc_callback;
280 klass->remove_element = &remove_element_vfunc_callback;
281 klass->handle_message = &handle_message_vfunc_callback;
282
283 klass->element_added = &element_added_callback;
284 klass->element_removed = &element_removed_callback;
285 klass->do_latency = &do_latency_callback;
286 }
287
288 gboolean Bin_Class::add_element_vfunc_callback(GstBin* self, GstElement* element)
289 {
290 const auto obj_base = static_cast<Glib::ObjectBase*>(
291 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
292
293 // Non-gtkmmproc-generated custom classes implicitly call the default
294 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
295 // generated classes can use this optimisation, which avoids the unnecessary
296 // parameter conversions if there is no possibility of the virtual function
297 // being overridden:
298 if(obj_base && obj_base->is_derived_())
299 {
300 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
301 if(obj) // This can be NULL during destruction.
302 {
303 try // Trap C++ exceptions which would normally be lost because this is a C callback.
304 {
305 // Call the virtual member method, which derived classes might override.
306 return static_cast<int>(obj->add_element_vfunc(Glib::wrap(element, true)
307 ));
308 }
309 catch(...)
310 {
311 Glib::exception_handlers_invoke();
312 }
313 }
314 }
315
316 BaseClassType *const base = static_cast<BaseClassType*>(
317 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
318 );
319
320 // Call the original underlying C function:
321 if(base && base->add_element)
322 return (*base->add_element)(self, element);
323
324 using RType = gboolean;
325 return RType();
326 }
327 gboolean Bin_Class::remove_element_vfunc_callback(GstBin* self, GstElement* element)
328 {
329 const auto obj_base = static_cast<Glib::ObjectBase*>(
330 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
331
332 // Non-gtkmmproc-generated custom classes implicitly call the default
333 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
334 // generated classes can use this optimisation, which avoids the unnecessary
335 // parameter conversions if there is no possibility of the virtual function
336 // being overridden:
337 if(obj_base && obj_base->is_derived_())
338 {
339 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
340 if(obj) // This can be NULL during destruction.
341 {
342 try // Trap C++ exceptions which would normally be lost because this is a C callback.
343 {
344 // Call the virtual member method, which derived classes might override.
345 return static_cast<int>(obj->remove_element_vfunc(Glib::wrap(element, true)
346 ));
347 }
348 catch(...)
349 {
350 Glib::exception_handlers_invoke();
351 }
352 }
353 }
354
355 BaseClassType *const base = static_cast<BaseClassType*>(
356 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
357 );
358
359 // Call the original underlying C function:
360 if(base && base->remove_element)
361 return (*base->remove_element)(self, element);
362
363 using RType = gboolean;
364 return RType();
365 }
366 void Bin_Class::handle_message_vfunc_callback(GstBin* self, GstMessage* message)
367 {
368 const auto obj_base = static_cast<Glib::ObjectBase*>(
369 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
370
371 // Non-gtkmmproc-generated custom classes implicitly call the default
372 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
373 // generated classes can use this optimisation, which avoids the unnecessary
374 // parameter conversions if there is no possibility of the virtual function
375 // being overridden:
376 if(obj_base && obj_base->is_derived_())
377 {
378 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
379 if(obj) // This can be NULL during destruction.
380 {
381 try // Trap C++ exceptions which would normally be lost because this is a C callback.
382 {
383 // Call the virtual member method, which derived classes might override.
384 obj->handle_message_vfunc(Glib::wrap(message, true)
385 );
386 return;
387 }
388 catch(...)
389 {
390 Glib::exception_handlers_invoke();
391 }
392 }
393 }
394
395 BaseClassType *const base = static_cast<BaseClassType*>(
396 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
397 );
398
399 // Call the original underlying C function:
400 if(base && base->handle_message)
401 (*base->handle_message)(self, message);
402 }
403
404 void Bin_Class::element_added_callback(GstBin* self, GstElement* p0)
405 {
406 const auto obj_base = static_cast<Glib::ObjectBase*>(
407 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
408
409 // Non-gtkmmproc-generated custom classes implicitly call the default
410 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
411 // generated classes can use this optimisation, which avoids the unnecessary
412 // parameter conversions if there is no possibility of the virtual function
413 // being overridden:
414 if(obj_base && obj_base->is_derived_())
415 {
416 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
417 if(obj) // This can be NULL during destruction.
418 {
419 try // Trap C++ exceptions which would normally be lost because this is a C callback.
420 {
421 // Call the virtual member method, which derived classes might override.
422 obj->on_element_added(Glib::wrap(p0, true)
423 );
424 return;
425 }
426 catch(...)
427 {
428 Glib::exception_handlers_invoke();
429 }
430 }
431 }
432
433 const auto base = static_cast<BaseClassType*>(
434 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
435 );
436
437 // Call the original underlying C function:
438 if(base && base->element_added)
439 (*base->element_added)(self, p0);
440 }
441 void Bin_Class::element_removed_callback(GstBin* self, GstElement* p0)
442 {
443 const auto obj_base = static_cast<Glib::ObjectBase*>(
444 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
445
446 // Non-gtkmmproc-generated custom classes implicitly call the default
447 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
448 // generated classes can use this optimisation, which avoids the unnecessary
449 // parameter conversions if there is no possibility of the virtual function
450 // being overridden:
451 if(obj_base && obj_base->is_derived_())
452 {
453 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
454 if(obj) // This can be NULL during destruction.
455 {
456 try // Trap C++ exceptions which would normally be lost because this is a C callback.
457 {
458 // Call the virtual member method, which derived classes might override.
459 obj->on_element_removed(Glib::wrap(p0, true)
460 );
461 return;
462 }
463 catch(...)
464 {
465 Glib::exception_handlers_invoke();
466 }
467 }
468 }
469
470 const auto base = static_cast<BaseClassType*>(
471 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
472 );
473
474 // Call the original underlying C function:
475 if(base && base->element_removed)
476 (*base->element_removed)(self, p0);
477 }
478 gboolean Bin_Class::do_latency_callback(GstBin* self)
479 {
480 const auto obj_base = static_cast<Glib::ObjectBase*>(
481 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
482
483 // Non-gtkmmproc-generated custom classes implicitly call the default
484 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
485 // generated classes can use this optimisation, which avoids the unnecessary
486 // parameter conversions if there is no possibility of the virtual function
487 // being overridden:
488 if(obj_base && obj_base->is_derived_())
489 {
490 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
491 if(obj) // This can be NULL during destruction.
492 {
493 try // Trap C++ exceptions which would normally be lost because this is a C callback.
494 {
495 // Call the virtual member method, which derived classes might override.
496 return static_cast<int>(obj->on_do_latency());
497 }
498 catch(...)
499 {
500 Glib::exception_handlers_invoke();
501 }
502 }
503 }
504
505 const auto base = static_cast<BaseClassType*>(
506 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
507 );
508
509 // Call the original underlying C function:
510 if(base && base->do_latency)
511 return (*base->do_latency)(self);
512
513 using RType = gboolean;
514 return RType();
515 }
516
517
518 Glib::ObjectBase* Bin_Class::wrap_new(GObject* object)
519 {
520 return new Bin((GstBin*)object);
521 }
522
523
524 /* The implementation: */
525
526 GstBin* Bin::gobj_copy()
527 {
528 reference();
529 return gobj();
530 }
531
532 Bin::Bin(const Glib::ConstructParams& construct_params)
533 :
534 Element(construct_params)
535 {
536
537 }
538
539 Bin::Bin(GstBin* castitem)
540 :
541 Element((GstElement*)(castitem))
542 {}
543
544
545 Bin::Bin(Bin&& src) noexcept
546 : Element(std::move(src))
547 , ChildProxy(std::move(src))
548 {}
549
550 Bin& Bin::operator=(Bin&& src) noexcept
551 {
552 Element::operator=(std::move(src));
553 ChildProxy::operator=(std::move(src));
554 return *this;
555 }
556
557
558 Bin::~Bin() noexcept
559 {}
560
561
562 Bin::CppClassType Bin::bin_class_; // initialize static member
563
564 GType Bin::get_type()
565 {
566 return bin_class_.init().get_type();
567 }
568
569
570 GType Bin::get_base_type()
571 {
572 return gst_bin_get_type();
573 }
574
575
576 Bin::Bin(const Glib::ustring& name)
577 :
578 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
579 Glib::ObjectBase(nullptr),
580 Element(Glib::ConstructParams(bin_class_.init(), "name", name.c_str(), nullptr))
581 {
582
583
584 }
585
586 Glib::RefPtr<Bin> Bin::create(const Glib::ustring& name)
587 {
588 return Glib::RefPtr<Bin>( new Bin(name) );
589 }
590
591 Glib::RefPtr<Bin> Bin::create()
592 {
593 return Glib::RefPtr<Bin>( new Bin() );
594 }
595
596 Glib::RefPtr<Gst::Element> Bin::get_element(const Glib::ustring& name)
597 {
598 return Glib::wrap(gst_bin_get_by_name(gobj(), name.c_str()));
599 }
600
601 Glib::RefPtr<const Gst::Element> Bin::get_element(const Glib::ustring& name) const
602 {
603 return const_cast<Bin*>(this)->get_element(name);
604 }
605
606 Glib::RefPtr<Gst::Element> Bin::get_element_recurse_up(const Glib::ustring& name)
607 {
608 return Glib::wrap(gst_bin_get_by_name_recurse_up(gobj(), name.c_str()));
609 }
610
611 Glib::RefPtr<const Gst::Element> Bin::get_element_recurse_up(const Glib::ustring& name) const
612 {
613 return const_cast<Bin*>(this)->get_element_recurse_up(name);
614 }
615
616 Glib::RefPtr<Gst::Element> Bin::get_element(GType interface)
617 {
618 return Glib::wrap(gst_bin_get_by_interface(gobj(), interface));
619 }
620
621 Glib::RefPtr<const Gst::Element> Bin::get_element(GType interface) const
622 {
623 return const_cast<Bin*>(this)->get_element(interface);
624 }
625
626 Glib::RefPtr<Gst::Pad> Bin::find_unlinked_pad(PadDirection dir)
627 {
628 return Glib::wrap(gst_bin_find_unlinked_pad(gobj(), ((GstPadDirection)(dir))));
629 }
630
631 Glib::RefPtr<const Gst::Pad> Bin::find_unlinked_pad(PadDirection dir) const
632 {
633 return const_cast<Bin*>(this)->find_unlinked_pad(dir);
634 }
635
636 Gst::Iterator<Gst::Element> Bin::iterate_elements()
637 {
638 return Gst::Iterator<Gst::Element>(gst_bin_iterate_elements(gobj()));
639 }
640
641 Gst::Iterator<const Gst::Element> Bin::iterate_elements() const
642 {
643 return Gst::Iterator<const Gst::Element>(gst_bin_iterate_elements(const_cast<GstBin*>(gobj())));
644 }
645
646 Gst::Iterator<Gst::Element> Bin::iterate_recurse()
647 {
648 return Gst::Iterator<Gst::Element>(gst_bin_iterate_recurse(gobj()));
649 }
650
651 Gst::Iterator<const Gst::Element> Bin::iterate_recurse() const
652 {
653 return Gst::Iterator<const Gst::Element>(gst_bin_iterate_recurse(const_cast<GstBin*>(gobj())));
654 }
655
656 Gst::Iterator<Gst::Element> Bin::iterate_sorted()
657 {
658 return Gst::Iterator<Gst::Element>(gst_bin_iterate_sorted(gobj()));
659 }
660
661 Gst::Iterator<const Gst::Element> Bin::iterate_sorted() const
662 {
663 return Gst::Iterator<const Gst::Element>(gst_bin_iterate_sorted(const_cast<GstBin*>(gobj())));
664 }
665
666 Gst::Iterator<Gst::Element> Bin::iterate_sources()
667 {
668 return Gst::Iterator<Gst::Element>(gst_bin_iterate_sources(gobj()));
669 }
670
671 Gst::Iterator<const Gst::Element> Bin::iterate_sources() const
672 {
673 return Gst::Iterator<const Gst::Element>(gst_bin_iterate_sources(const_cast<GstBin*>(gobj())));
674 }
675
676 Gst::Iterator<Gst::Element> Bin::iterate_sinks()
677 {
678 return Gst::Iterator<Gst::Element>(gst_bin_iterate_sinks(gobj()));
679 }
680
681 Gst::Iterator<const Gst::Element> Bin::iterate_sinks() const
682 {
683 return Gst::Iterator<const Gst::Element>(gst_bin_iterate_sinks(const_cast<GstBin*>(gobj())));
684 }
685
686 Gst::Iterator<Gst::Element> Bin::iterate_by_interface(GType iface)
687 {
688 return Gst::Iterator<Gst::Element>(gst_bin_iterate_all_by_interface(gobj(), iface));
689 }
690
691 Gst::Iterator<const Gst::Element> Bin::iterate_by_interface(GType iface) const
692 {
693 return Gst::Iterator<const Gst::Element>(gst_bin_iterate_all_by_interface(const_cast<GstBin*>(gobj()), iface));
694 }
695
696 bool Bin::sync_children_states()
697 {
698 return gst_bin_sync_children_states(gobj());
699 }
700
701 bool Bin::recalculate_latency()
702 {
703 return gst_bin_recalculate_latency(gobj());
704 }
705
706 Glib::ListHandle< Glib::RefPtr<Gst::Element> > Bin::get_children() const
707 {
708 return Glib::ListHandle< Glib::RefPtr<Gst::Element> >(gobj()->children, Glib::OWNERSHIP_NONE);
709 }
710
711 guint32 Bin::get_children_cookie() const
712 {
713 return gobj()->children_cookie;
714 }
715
716 int Bin::get_num_children() const
717 {
718 return gobj()->numchildren;
719 }
720
721 Glib::RefPtr<Gst::Bus> Bin::get_child_bus()
722 {
723 Glib::RefPtr<Gst::Bus> ref_ptr(Glib::wrap(gobj()->child_bus));
724
725 if(ref_ptr)
726 ref_ptr->reference();
727
728 return ref_ptr;
729 }
730
731 Glib::RefPtr<const Gst::Bus> Bin::get_child_bus() const
732 {
733 Glib::RefPtr<const Gst::Bus> ref_ptr(Glib::wrap(gobj()->child_bus));
734
735 if(ref_ptr)
736 ref_ptr->reference();
737
738 return ref_ptr;
739 }
740
741 Glib::ListHandle< Glib::RefPtr<Gst::Message> > Bin::get_messages() const
742 {
743 return Glib::ListHandle< Glib::RefPtr<Gst::Message> >(gobj()->messages, Glib::OWNERSHIP_NONE);
744 }
745
746 bool Bin::get_polling() const
747 {
748 return gobj()->polling;
749 }
750
751 bool Bin::get_clock_dirty() const
752 {
753 return gobj()->clock_dirty;
754 }
755
756 Glib::RefPtr<Gst::Clock> Bin::get_provided_clock()
757 {
758 Glib::RefPtr<Gst::Clock> ref_ptr(Glib::wrap(gobj()->provided_clock));
759
760 if(ref_ptr)
761 ref_ptr->reference();
762
763 return ref_ptr;
764 }
765
766 Glib::RefPtr<const Gst::Clock> Bin::get_provided_clock() const
767 {
768 Glib::RefPtr<const Gst::Clock> ref_ptr(Glib::wrap(gobj()->provided_clock));
769
770 if(ref_ptr)
771 ref_ptr->reference();
772
773 return ref_ptr;
774 }
775
776 Glib::RefPtr<Gst::Element> Bin::get_clock_provider()
777 {
778 Glib::RefPtr<Gst::Element> ref_ptr(Glib::wrap(gobj()->clock_provider));
779
780 if(ref_ptr)
781 ref_ptr->reference();
782
783 return ref_ptr;
784 }
785
786 Glib::RefPtr<const Gst::Element> Bin::get_clock_provider() const
787 {
788 Glib::RefPtr<const Gst::Element> ref_ptr(Glib::wrap(gobj()->clock_provider));
789
790 if(ref_ptr)
791 ref_ptr->reference();
792
793 return ref_ptr;
794 }
795
796
797 Glib::SignalProxy< void,const Glib::RefPtr<Gst::Element>& > Bin::signal_element_added()
798 {
799 return Glib::SignalProxy< void,const Glib::RefPtr<Gst::Element>& >(this, &Bin_signal_element_added_info);
800 }
801
802
803 Glib::SignalProxy< void,const Glib::RefPtr<Gst::Element>& > Bin::signal_element_removed()
804 {
805 return Glib::SignalProxy< void,const Glib::RefPtr<Gst::Element>& >(this, &Bin_signal_element_removed_info);
806 }
807
808
809 Glib::SignalProxy< bool > Bin::signal_do_latency()
810 {
811 return Glib::SignalProxy< bool >(this, &Bin_signal_do_latency_info);
812 }
813
814
815 Glib::PropertyProxy< bool > Bin::property_async_handling()
816 {
817 return Glib::PropertyProxy< bool >(this, "async-handling");
818 }
819
820 Glib::PropertyProxy_ReadOnly< bool > Bin::property_async_handling() const
821 {
822 return Glib::PropertyProxy_ReadOnly< bool >(this, "async-handling");
823 }
824
825 Glib::PropertyProxy< bool > Bin::property_message_forward()
826 {
827 return Glib::PropertyProxy< bool >(this, "message-forward");
828 }
829
830 Glib::PropertyProxy_ReadOnly< bool > Bin::property_message_forward() const
831 {
832 return Glib::PropertyProxy_ReadOnly< bool >(this, "message-forward");
833 }
834
835
836 void Gst::Bin::on_element_added(const Glib::RefPtr<Gst::Element>& element)
837 {
838 const auto base = static_cast<BaseClassType*>(
839 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
840 );
841
842 if(base && base->element_added)
843 (*base->element_added)(gobj(),Glib::unwrap(element));
844 }
845 void Gst::Bin::on_element_removed(const Glib::RefPtr<Gst::Element>& element)
846 {
847 const auto base = static_cast<BaseClassType*>(
848 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
849 );
850
851 if(base && base->element_removed)
852 (*base->element_removed)(gobj(),Glib::unwrap(element));
853 }
854 bool Gst::Bin::on_do_latency()
855 {
856 const auto base = static_cast<BaseClassType*>(
857 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
858 );
859
860 if(base && base->do_latency)
861 return (*base->do_latency)(gobj());
862
863 using RType = bool;
864 return RType();
865 }
866
867 bool Gst::Bin::add_element_vfunc(const Glib::RefPtr<Gst::Element>& element)
868 {
869 const auto base = static_cast<BaseClassType*>(
870 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
871 );
872
873 if(base && base->add_element)
874 {
875 bool retval((*base->add_element)(gobj(),Glib::unwrap(element)));
876 return retval;
877 }
878
879 using RType = bool;
880 return RType();
881 }
882 bool Gst::Bin::remove_element_vfunc(const Glib::RefPtr<Gst::Element>& element)
883 {
884 const auto base = static_cast<BaseClassType*>(
885 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
886 );
887
888 if(base && base->remove_element)
889 {
890 bool retval((*base->remove_element)(gobj(),Glib::unwrap(element)));
891 return retval;
892 }
893
894 using RType = bool;
895 return RType();
896 }
897 void Gst::Bin::handle_message_vfunc(const Glib::RefPtr<Gst::Message>& message)
898 {
899 const auto base = static_cast<BaseClassType*>(
900 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
901 );
902
903 if(base && base->handle_message)
904 {
905 (*base->handle_message)(gobj(),Glib::unwrap(message));
906 }
907 }
908
909
910 } // namespace Gst
911
912