| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | |
| 3 | |
| 4 | #include <glibmm.h> |
| 5 | |
| 6 | #include <gstreamermm/element.h> |
| 7 | #include <gstreamermm/private/element_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/bus.h> |
| 31 | #include <gstreamermm/caps.h> |
| 32 | #include <gstreamermm/elementfactory.h> |
| 33 | #include <gstreamermm/event.h> |
| 34 | #include <gstreamermm/pad.h> |
| 35 | #include <gstreamermm/padtemplate.h> |
| 36 | #include <gstreamermm/query.h> |
| 37 | #include <gstreamermm/iterator.h> |
| 38 | #include <gstreamermm/handle_error.h> |
| 39 | |
| 40 | |
| 41 | namespace Gst |
| 42 | { |
| 43 | |
| 44 | namespace Enums |
| 45 | { |
| 46 | |
| 47 | Glib::ustring get_name(State s) |
| 48 | { |
| 49 | return gst_element_state_get_name(GstState(s)); |
| 50 | } |
| 51 | |
| 52 | Glib::ustring get_name(StateChangeReturn s) |
| 53 | { |
| 54 | return gst_element_state_change_return_get_name(GstStateChangeReturn(s)); |
| 55 | } |
| 56 | |
| 57 | } //namespace Enums |
| 58 | |
| 59 | Glib::RefPtr<Gst::Element> Element::link(const Glib::RefPtr<Gst::Element>& dest) |
| 60 | { |
| 61 | if(!dest) |
| 62 | gstreamermm_handle_error("Failed to link null element."); |
| 63 | |
| 64 | const bool result = gst_element_link(gobj(), Glib::unwrap(dest)); |
| 65 | |
| 66 | if(result) |
| 67 | return dest; |
| 68 | else |
| 69 | { |
| 70 | gstreamermm_handle_error("failed to link: " + get_name() + "->" + |
| 71 | dest->get_name()); |
| 72 | return Glib::RefPtr<Gst::Element>(); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | Glib::RefPtr<Gst::Element> Element::link(const Glib::RefPtr<Gst::Element>& dest, const Glib::RefPtr<Gst::Caps>& filter) |
| 77 | { |
| 78 | if(!dest) |
| 79 | gstreamermm_handle_error("Failed to link null element."); |
| 80 | |
| 81 | const bool result = gst_element_link_filtered(gobj(), Glib::unwrap(dest), |
| 82 | Glib::unwrap(filter)); |
| 83 | |
| 84 | if(result) |
| 85 | return dest; |
| 86 | else |
| 87 | { |
| 88 | gstreamermm_handle_error("failed to link: " + get_name() + "->" + |
| 89 | dest->get_name()); |
| 90 | return Glib::RefPtr<Gst::Element>(); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | void Element::post_message(int code, int line, MessageType type, |
| 95 | const Glib::QueryQuark& domain, const Glib::ustring& text, |
| 96 | const Glib::ustring& debug, const Glib::ustring& file, |
| 97 | const Glib::ustring& function) |
| 98 | { |
| 99 | gchar* gst_text = g_strdup(text.c_str()); |
| 100 | gchar* gst_debug = g_strdup(debug.c_str()); |
| 101 | |
| 102 | gst_element_message_full(gobj(), static_cast<GstMessageType>(type), |
| 103 | domain, code, gst_text, gst_debug, file.c_str(), function.c_str(), line); |
| 104 | } |
| 105 | |
| 106 | bool Element::send_event(const Glib::RefPtr<Gst::Event>& event) |
| 107 | { |
| 108 | event->reference(); |
| 109 | return gst_element_send_event(gobj(), Glib::unwrap(event)); |
| 110 | } |
| 111 | |
| 112 | Glib::RefPtr<Gst::PadTemplate> Gst::Element::get_pad_template(const Glib::ustring &factory_name) const |
| 113 | { |
| 114 | return Glib::wrap(gst_element_class_get_pad_template(GST_ELEMENT_GET_CLASS(gobject_), factory_name.c_str()), true); |
| 115 | } |
| 116 | |
| 117 | } //namespace Gst |
| 118 | |
| 119 | namespace |
| 120 | { |
| 121 | |
| 122 | |
| 123 | static const Glib::SignalProxyInfo Element_signal_no_more_pads_info = |
| 124 | { |
| 125 | "no-more-pads", |
| 126 | (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, |
| 127 | (GCallback) &Glib::SignalProxyNormal::slot0_void_callback |
| 128 | }; |
| 129 | |
| 130 | |
| 131 | static void Element_signal_pad_added_callback(GstElement* self, GstPad* p0,void* data) |
| 132 | { |
| 133 | using namespace Gst; |
| 134 | using SlotType = sigc::slot< void,const Glib::RefPtr<Gst::Pad>& >; |
| 135 | |
| 136 | auto obj = dynamic_cast<Element*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self)); |
| 137 | // Do not try to call a signal on a disassociated wrapper. |
| 138 | if(obj) |
| 139 | { |
| 140 | try |
| 141 | { |
| 142 | if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data)) |
| 143 | (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true) |
| 144 | ); |
| 145 | } |
| 146 | catch(...) |
| 147 | { |
| 148 | Glib::exception_handlers_invoke(); |
| 149 | } |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | static const Glib::SignalProxyInfo Element_signal_pad_added_info = |
| 154 | { |
| 155 | "pad-added", |
| 156 | (GCallback) &Element_signal_pad_added_callback, |
| 157 | (GCallback) &Element_signal_pad_added_callback |
| 158 | }; |
| 159 | |
| 160 | |
| 161 | static void Element_signal_pad_removed_callback(GstElement* self, GstPad* p0,void* data) |
| 162 | { |
| 163 | using namespace Gst; |
| 164 | using SlotType = sigc::slot< void,const Glib::RefPtr<Gst::Pad>& >; |
| 165 | |
| 166 | auto obj = dynamic_cast<Element*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self)); |
| 167 | // Do not try to call a signal on a disassociated wrapper. |
| 168 | if(obj) |
| 169 | { |
| 170 | try |
| 171 | { |
| 172 | if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data)) |
| 173 | (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true) |
| 174 | ); |
| 175 | } |
| 176 | catch(...) |
| 177 | { |
| 178 | Glib::exception_handlers_invoke(); |
| 179 | } |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | static const Glib::SignalProxyInfo Element_signal_pad_removed_info = |
| 184 | { |
| 185 | "pad-removed", |
| 186 | (GCallback) &Element_signal_pad_removed_callback, |
| 187 | (GCallback) &Element_signal_pad_removed_callback |
| 188 | }; |
| 189 | |
| 190 | |
| 191 | } // anonymous namespace |
| 192 | |
| 193 | // static |
| 194 | GType Glib::Value<Gst::ElementFlags>::value_type() |
| 195 | { |
| 196 | return gst_element_flags_get_type(); |
| 197 | } |
| 198 | |
| 199 | // static |
| 200 | GType Glib::Value<Gst::StateChange>::value_type() |
| 201 | { |
| 202 | return gst_state_change_get_type(); |
| 203 | } |
| 204 | |
| 205 | // static |
| 206 | GType Glib::Value<Gst::StateChangeReturn>::value_type() |
| 207 | { |
| 208 | return gst_state_change_return_get_type(); |
| 209 | } |
| 210 | |
| 211 | |
| 212 | namespace Glib |
| 213 | { |
| 214 | |
| 215 | Glib::RefPtr<Gst::Element> wrap(GstElement* object, bool take_copy) |
| 216 | { |
| 217 | return Glib::RefPtr<Gst::Element>( dynamic_cast<Gst::Element*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); |
| 218 | //We use dynamic_cast<> in case of multiple inheritance. |
| 219 | } |
| 220 | |
| 221 | } /* namespace Glib */ |
| 222 | |
| 223 | |
| 224 | namespace Gst |
| 225 | { |
| 226 | |
| 227 | |
| 228 | /* The *_Class implementation: */ |
| 229 | |
| 230 | const Glib::Class& Element_Class::init() |
| 231 | { |
| 232 | if(!gtype_) // create the GType if necessary |
| 233 | { |
| 234 | // Glib::Class has to know the class init function to clone custom types. |
| 235 | class_init_func_ = &Element_Class::class_init_function; |
| 236 | |
| 237 | // This is actually just optimized away, apparently with no harm. |
| 238 | // Make sure that the parent type has been created. |
| 239 | //CppClassParent::CppObjectType::get_type(); |
| 240 | |
| 241 | // Create the wrapper type, with the same class/instance size as the base type. |
| 242 | register_derived_type(gst_element_get_type()); |
| 243 | |
| 244 | // Add derived versions of interfaces, if the C type implements any interfaces: |
| 245 | |
| 246 | } |
| 247 | |
| 248 | return *this; |
| 249 | } |
| 250 | |
| 251 | |
| 252 | void Element_Class::class_init_function(void* g_class, void* class_data) |
| 253 | { |
| 254 | const auto klass = static_cast<BaseClassType*>(g_class); |
| 255 | CppClassParent::class_init_function(klass, class_data); |
| 256 | |
| 257 | klass->release_pad = &release_pad_vfunc_callback; |
| 258 | klass->request_new_pad = &request_new_pad_vfunc_callback; |
| 259 | klass->get_state = &get_state_vfunc_callback; |
| 260 | klass->set_state = &set_state_vfunc_callback; |
| 261 | klass->change_state = &change_state_vfunc_callback; |
| 262 | klass->state_changed = &state_changed_vfunc_callback; |
| 263 | klass->set_bus = &set_bus_vfunc_callback; |
| 264 | klass->provide_clock = &provide_clock_vfunc_callback; |
| 265 | klass->set_clock = &set_clock_vfunc_callback; |
| 266 | klass->send_event = &send_event_vfunc_callback; |
| 267 | klass->query = &query_vfunc_callback; |
| 268 | klass->set_context = &set_context_vfunc_callback; |
| 269 | klass->post_message = &post_message_vfunc_callback; |
| 270 | |
| 271 | klass->no_more_pads = &no_more_pads_callback; |
| 272 | klass->pad_added = &pad_added_callback; |
| 273 | klass->pad_removed = &pad_removed_callback; |
| 274 | } |
| 275 | |
| 276 | void Element_Class::release_pad_vfunc_callback(GstElement* self, GstPad* pad) |
| 277 | { |
| 278 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 279 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 280 | |
| 281 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 282 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 283 | // generated classes can use this optimisation, which avoids the unnecessary |
| 284 | // parameter conversions if there is no possibility of the virtual function |
| 285 | // being overridden: |
| 286 | if(obj_base && obj_base->is_derived_()) |
| 287 | { |
| 288 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 289 | if(obj) // This can be NULL during destruction. |
| 290 | { |
| 291 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 292 | { |
| 293 | // Call the virtual member method, which derived classes might override. |
| 294 | obj->release_pad_vfunc(Glib::wrap(pad, true) |
| 295 | ); |
| 296 | return; |
| 297 | } |
| 298 | catch(...) |
| 299 | { |
| 300 | Glib::exception_handlers_invoke(); |
| 301 | } |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 306 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 307 | ); |
| 308 | |
| 309 | // Call the original underlying C function: |
| 310 | if(base && base->release_pad) |
| 311 | (*base->release_pad)(self, pad); |
| 312 | } |
| 313 | GstPad* Element_Class::request_new_pad_vfunc_callback(GstElement* self, GstPadTemplate* templ, const gchar* name, const GstCaps* caps) |
| 314 | { |
| 315 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 316 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 317 | |
| 318 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 319 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 320 | // generated classes can use this optimisation, which avoids the unnecessary |
| 321 | // parameter conversions if there is no possibility of the virtual function |
| 322 | // being overridden: |
| 323 | if(obj_base && obj_base->is_derived_()) |
| 324 | { |
| 325 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 326 | if(obj) // This can be NULL during destruction. |
| 327 | { |
| 328 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 329 | { |
| 330 | // Call the virtual member method, which derived classes might override. |
| 331 | return Glib::unwrap(obj->request_new_pad_vfunc(Glib::wrap(templ) |
| 332 | , Glib::convert_const_gchar_ptr_to_ustring(name) |
| 333 | , Glib::wrap(const_cast<GstCaps*>(caps)) |
| 334 | )); |
| 335 | } |
| 336 | catch(...) |
| 337 | { |
| 338 | Glib::exception_handlers_invoke(); |
| 339 | } |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 344 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 345 | ); |
| 346 | |
| 347 | // Call the original underlying C function: |
| 348 | if(base && base->request_new_pad) |
| 349 | return (*base->request_new_pad)(self, templ, name, caps); |
| 350 | |
| 351 | using RType = GstPad*; |
| 352 | return RType(); |
| 353 | } |
| 354 | GstStateChangeReturn Element_Class::get_state_vfunc_callback(GstElement* self, GstState* state, GstState* pending, GstClockTime timeout) |
| 355 | { |
| 356 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 357 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 358 | |
| 359 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 360 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 361 | // generated classes can use this optimisation, which avoids the unnecessary |
| 362 | // parameter conversions if there is no possibility of the virtual function |
| 363 | // being overridden: |
| 364 | if(obj_base && obj_base->is_derived_()) |
| 365 | { |
| 366 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 367 | if(obj) // This can be NULL during destruction. |
| 368 | { |
| 369 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 370 | { |
| 371 | // Call the virtual member method, which derived classes might override. |
| 372 | return ((GstStateChangeReturn)(obj->get_state_vfunc(*reinterpret_cast<Gst::State*>(state) |
| 373 | , *reinterpret_cast<Gst::State*>(pending) |
| 374 | , ((ClockTime)(timeout)) |
| 375 | ))); |
| 376 | } |
| 377 | catch(...) |
| 378 | { |
| 379 | Glib::exception_handlers_invoke(); |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 385 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 386 | ); |
| 387 | |
| 388 | // Call the original underlying C function: |
| 389 | if(base && base->get_state) |
| 390 | return (*base->get_state)(self, state, pending, timeout); |
| 391 | |
| 392 | using RType = GstStateChangeReturn; |
| 393 | return RType(); |
| 394 | } |
| 395 | GstStateChangeReturn Element_Class::set_state_vfunc_callback(GstElement* self, GstState state) |
| 396 | { |
| 397 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 398 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 399 | |
| 400 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 401 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 402 | // generated classes can use this optimisation, which avoids the unnecessary |
| 403 | // parameter conversions if there is no possibility of the virtual function |
| 404 | // being overridden: |
| 405 | if(obj_base && obj_base->is_derived_()) |
| 406 | { |
| 407 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 408 | if(obj) // This can be NULL during destruction. |
| 409 | { |
| 410 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 411 | { |
| 412 | // Call the virtual member method, which derived classes might override. |
| 413 | return ((GstStateChangeReturn)(obj->set_state_vfunc(((State)(state)) |
| 414 | ))); |
| 415 | } |
| 416 | catch(...) |
| 417 | { |
| 418 | Glib::exception_handlers_invoke(); |
| 419 | } |
| 420 | } |
| 421 | } |
| 422 | |
| 423 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 424 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 425 | ); |
| 426 | |
| 427 | // Call the original underlying C function: |
| 428 | if(base && base->set_state) |
| 429 | return (*base->set_state)(self, state); |
| 430 | |
| 431 | using RType = GstStateChangeReturn; |
| 432 | return RType(); |
| 433 | } |
| 434 | GstStateChangeReturn Element_Class::change_state_vfunc_callback(GstElement* self, GstStateChange transition) |
| 435 | { |
| 436 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 437 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 438 | |
| 439 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 440 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 441 | // generated classes can use this optimisation, which avoids the unnecessary |
| 442 | // parameter conversions if there is no possibility of the virtual function |
| 443 | // being overridden: |
| 444 | if(obj_base && obj_base->is_derived_()) |
| 445 | { |
| 446 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 447 | if(obj) // This can be NULL during destruction. |
| 448 | { |
| 449 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 450 | { |
| 451 | // Call the virtual member method, which derived classes might override. |
| 452 | return ((GstStateChangeReturn)(obj->change_state_vfunc(((StateChange)(transition)) |
| 453 | ))); |
| 454 | } |
| 455 | catch(...) |
| 456 | { |
| 457 | Glib::exception_handlers_invoke(); |
| 458 | } |
| 459 | } |
| 460 | } |
| 461 | |
| 462 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 463 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 464 | ); |
| 465 | |
| 466 | // Call the original underlying C function: |
| 467 | if(base && base->change_state) |
| 468 | return (*base->change_state)(self, transition); |
| 469 | |
| 470 | using RType = GstStateChangeReturn; |
| 471 | return RType(); |
| 472 | } |
| 473 | void Element_Class::state_changed_vfunc_callback(GstElement* self, GstState oldstate, GstState newstate, GstState pending) |
| 474 | { |
| 475 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 476 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 477 | |
| 478 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 479 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 480 | // generated classes can use this optimisation, which avoids the unnecessary |
| 481 | // parameter conversions if there is no possibility of the virtual function |
| 482 | // being overridden: |
| 483 | if(obj_base && obj_base->is_derived_()) |
| 484 | { |
| 485 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 486 | if(obj) // This can be NULL during destruction. |
| 487 | { |
| 488 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 489 | { |
| 490 | // Call the virtual member method, which derived classes might override. |
| 491 | obj->state_changed_vfunc(((Gst::State)(oldstate)) |
| 492 | , ((Gst::State)(newstate)) |
| 493 | , ((Gst::State)(pending)) |
| 494 | ); |
| 495 | return; |
| 496 | } |
| 497 | catch(...) |
| 498 | { |
| 499 | Glib::exception_handlers_invoke(); |
| 500 | } |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 505 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 506 | ); |
| 507 | |
| 508 | // Call the original underlying C function: |
| 509 | if(base && base->state_changed) |
| 510 | (*base->state_changed)(self, oldstate, newstate, pending); |
| 511 | } |
| 512 | void Element_Class::set_bus_vfunc_callback(GstElement* self, GstBus* bus) |
| 513 | { |
| 514 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 515 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 516 | |
| 517 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 518 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 519 | // generated classes can use this optimisation, which avoids the unnecessary |
| 520 | // parameter conversions if there is no possibility of the virtual function |
| 521 | // being overridden: |
| 522 | if(obj_base && obj_base->is_derived_()) |
| 523 | { |
| 524 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 525 | if(obj) // This can be NULL during destruction. |
| 526 | { |
| 527 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 528 | { |
| 529 | // Call the virtual member method, which derived classes might override. |
| 530 | obj->set_bus_vfunc(Glib::wrap(bus, true) |
| 531 | ); |
| 532 | return; |
| 533 | } |
| 534 | catch(...) |
| 535 | { |
| 536 | Glib::exception_handlers_invoke(); |
| 537 | } |
| 538 | } |
| 539 | } |
| 540 | |
| 541 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 542 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 543 | ); |
| 544 | |
| 545 | // Call the original underlying C function: |
| 546 | if(base && base->set_bus) |
| 547 | (*base->set_bus)(self, bus); |
| 548 | } |
| 549 | GstClock* Element_Class::provide_clock_vfunc_callback(GstElement* self) |
| 550 | { |
| 551 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 552 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 553 | |
| 554 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 555 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 556 | // generated classes can use this optimisation, which avoids the unnecessary |
| 557 | // parameter conversions if there is no possibility of the virtual function |
| 558 | // being overridden: |
| 559 | if(obj_base && obj_base->is_derived_()) |
| 560 | { |
| 561 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 562 | if(obj) // This can be NULL during destruction. |
| 563 | { |
| 564 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 565 | { |
| 566 | // Call the virtual member method, which derived classes might override. |
| 567 | return Glib::unwrap(obj->provide_clock_vfunc()); |
| 568 | } |
| 569 | catch(...) |
| 570 | { |
| 571 | Glib::exception_handlers_invoke(); |
| 572 | } |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 577 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 578 | ); |
| 579 | |
| 580 | // Call the original underlying C function: |
| 581 | if(base && base->provide_clock) |
| 582 | return (*base->provide_clock)(self); |
| 583 | |
| 584 | using RType = GstClock*; |
| 585 | return RType(); |
| 586 | } |
| 587 | gboolean Element_Class::set_clock_vfunc_callback(GstElement* self, GstClock* clock) |
| 588 | { |
| 589 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 590 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 591 | |
| 592 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 593 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 594 | // generated classes can use this optimisation, which avoids the unnecessary |
| 595 | // parameter conversions if there is no possibility of the virtual function |
| 596 | // being overridden: |
| 597 | if(obj_base && obj_base->is_derived_()) |
| 598 | { |
| 599 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 600 | if(obj) // This can be NULL during destruction. |
| 601 | { |
| 602 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 603 | { |
| 604 | // Call the virtual member method, which derived classes might override. |
| 605 | return static_cast<int>(obj->set_clock_vfunc(Glib::wrap(clock, true) |
| 606 | )); |
| 607 | } |
| 608 | catch(...) |
| 609 | { |
| 610 | Glib::exception_handlers_invoke(); |
| 611 | } |
| 612 | } |
| 613 | } |
| 614 | |
| 615 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 616 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 617 | ); |
| 618 | |
| 619 | // Call the original underlying C function: |
| 620 | if(base && base->set_clock) |
| 621 | return (*base->set_clock)(self, clock); |
| 622 | |
| 623 | return static_cast<int>(true); |
| 624 | } |
| 625 | gboolean Element_Class::send_event_vfunc_callback(GstElement* self, GstEvent* event) |
| 626 | { |
| 627 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 628 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 629 | |
| 630 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 631 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 632 | // generated classes can use this optimisation, which avoids the unnecessary |
| 633 | // parameter conversions if there is no possibility of the virtual function |
| 634 | // being overridden: |
| 635 | if(obj_base && obj_base->is_derived_()) |
| 636 | { |
| 637 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 638 | if(obj) // This can be NULL during destruction. |
| 639 | { |
| 640 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 641 | { |
| 642 | // Call the virtual member method, which derived classes might override. |
| 643 | return static_cast<int>(obj->send_event_vfunc(Glib::wrap(event, true) |
| 644 | )); |
| 645 | } |
| 646 | catch(...) |
| 647 | { |
| 648 | Glib::exception_handlers_invoke(); |
| 649 | } |
| 650 | } |
| 651 | } |
| 652 | |
| 653 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 654 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 655 | ); |
| 656 | |
| 657 | // Call the original underlying C function: |
| 658 | if(base && base->send_event) |
| 659 | return (*base->send_event)(self, event); |
| 660 | |
| 661 | using RType = gboolean; |
| 662 | return RType(); |
| 663 | } |
| 664 | gboolean Element_Class::query_vfunc_callback(GstElement* self, GstQuery* query) |
| 665 | { |
| 666 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 667 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 668 | |
| 669 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 670 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 671 | // generated classes can use this optimisation, which avoids the unnecessary |
| 672 | // parameter conversions if there is no possibility of the virtual function |
| 673 | // being overridden: |
| 674 | if(obj_base && obj_base->is_derived_()) |
| 675 | { |
| 676 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 677 | if(obj) // This can be NULL during destruction. |
| 678 | { |
| 679 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 680 | { |
| 681 | // Call the virtual member method, which derived classes might override. |
| 682 | return static_cast<int>(obj->query_vfunc(Glib::wrap(query, true) |
| 683 | )); |
| 684 | } |
| 685 | catch(...) |
| 686 | { |
| 687 | Glib::exception_handlers_invoke(); |
| 688 | } |
| 689 | } |
| 690 | } |
| 691 | |
| 692 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 693 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 694 | ); |
| 695 | |
| 696 | // Call the original underlying C function: |
| 697 | if(base && base->query) |
| 698 | return (*base->query)(self, query); |
| 699 | |
| 700 | using RType = gboolean; |
| 701 | return RType(); |
| 702 | } |
| 703 | void Element_Class::set_context_vfunc_callback(GstElement* self, GstContext* context) |
| 704 | { |
| 705 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 706 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 707 | |
| 708 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 709 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 710 | // generated classes can use this optimisation, which avoids the unnecessary |
| 711 | // parameter conversions if there is no possibility of the virtual function |
| 712 | // being overridden: |
| 713 | if(obj_base && obj_base->is_derived_()) |
| 714 | { |
| 715 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 716 | if(obj) // This can be NULL during destruction. |
| 717 | { |
| 718 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 719 | { |
| 720 | // Call the virtual member method, which derived classes might override. |
| 721 | obj->set_context_vfunc(Glib::wrap(context) |
| 722 | ); |
| 723 | return; |
| 724 | } |
| 725 | catch(...) |
| 726 | { |
| 727 | Glib::exception_handlers_invoke(); |
| 728 | } |
| 729 | } |
| 730 | } |
| 731 | |
| 732 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 733 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 734 | ); |
| 735 | |
| 736 | // Call the original underlying C function: |
| 737 | if(base && base->set_context) |
| 738 | (*base->set_context)(self, context); |
| 739 | } |
| 740 | gboolean Element_Class::post_message_vfunc_callback(GstElement* self, GstMessage* message) |
| 741 | { |
| 742 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 743 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 744 | |
| 745 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 746 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 747 | // generated classes can use this optimisation, which avoids the unnecessary |
| 748 | // parameter conversions if there is no possibility of the virtual function |
| 749 | // being overridden: |
| 750 | if(obj_base && obj_base->is_derived_()) |
| 751 | { |
| 752 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 753 | if(obj) // This can be NULL during destruction. |
| 754 | { |
| 755 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 756 | { |
| 757 | // Call the virtual member method, which derived classes might override. |
| 758 | return static_cast<int>(obj->post_message_vfunc(Glib::wrap(message, true) |
| 759 | )); |
| 760 | } |
| 761 | catch(...) |
| 762 | { |
| 763 | Glib::exception_handlers_invoke(); |
| 764 | } |
| 765 | } |
| 766 | } |
| 767 | |
| 768 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 769 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 770 | ); |
| 771 | |
| 772 | // Call the original underlying C function: |
| 773 | if(base && base->post_message) |
| 774 | return (*base->post_message)(self, message); |
| 775 | |
| 776 | using RType = gboolean; |
| 777 | return RType(); |
| 778 | } |
| 779 | |
| 780 | void Element_Class::no_more_pads_callback(GstElement* self) |
| 781 | { |
| 782 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 783 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 784 | |
| 785 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 786 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 787 | // generated classes can use this optimisation, which avoids the unnecessary |
| 788 | // parameter conversions if there is no possibility of the virtual function |
| 789 | // being overridden: |
| 790 | if(obj_base && obj_base->is_derived_()) |
| 791 | { |
| 792 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 793 | if(obj) // This can be NULL during destruction. |
| 794 | { |
| 795 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 796 | { |
| 797 | // Call the virtual member method, which derived classes might override. |
| 798 | obj->on_no_more_pads(); |
| 799 | return; |
| 800 | } |
| 801 | catch(...) |
| 802 | { |
| 803 | Glib::exception_handlers_invoke(); |
| 804 | } |
| 805 | } |
| 806 | } |
| 807 | |
| 808 | const auto base = static_cast<BaseClassType*>( |
| 809 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 810 | ); |
| 811 | |
| 812 | // Call the original underlying C function: |
| 813 | if(base && base->no_more_pads) |
| 814 | (*base->no_more_pads)(self); |
| 815 | } |
| 816 | void Element_Class::pad_added_callback(GstElement* self, GstPad* p0) |
| 817 | { |
| 818 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 819 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 820 | |
| 821 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 822 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 823 | // generated classes can use this optimisation, which avoids the unnecessary |
| 824 | // parameter conversions if there is no possibility of the virtual function |
| 825 | // being overridden: |
| 826 | if(obj_base && obj_base->is_derived_()) |
| 827 | { |
| 828 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 829 | if(obj) // This can be NULL during destruction. |
| 830 | { |
| 831 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 832 | { |
| 833 | // Call the virtual member method, which derived classes might override. |
| 834 | obj->on_pad_added(Glib::wrap(p0, true) |
| 835 | ); |
| 836 | return; |
| 837 | } |
| 838 | catch(...) |
| 839 | { |
| 840 | Glib::exception_handlers_invoke(); |
| 841 | } |
| 842 | } |
| 843 | } |
| 844 | |
| 845 | const auto base = static_cast<BaseClassType*>( |
| 846 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 847 | ); |
| 848 | |
| 849 | // Call the original underlying C function: |
| 850 | if(base && base->pad_added) |
| 851 | (*base->pad_added)(self, p0); |
| 852 | } |
| 853 | void Element_Class::pad_removed_callback(GstElement* self, GstPad* p0) |
| 854 | { |
| 855 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 856 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 857 | |
| 858 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 859 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 860 | // generated classes can use this optimisation, which avoids the unnecessary |
| 861 | // parameter conversions if there is no possibility of the virtual function |
| 862 | // being overridden: |
| 863 | if(obj_base && obj_base->is_derived_()) |
| 864 | { |
| 865 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 866 | if(obj) // This can be NULL during destruction. |
| 867 | { |
| 868 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 869 | { |
| 870 | // Call the virtual member method, which derived classes might override. |
| 871 | obj->on_pad_removed(Glib::wrap(p0, true) |
| 872 | ); |
| 873 | return; |
| 874 | } |
| 875 | catch(...) |
| 876 | { |
| 877 | Glib::exception_handlers_invoke(); |
| 878 | } |
| 879 | } |
| 880 | } |
| 881 | |
| 882 | const auto base = static_cast<BaseClassType*>( |
| 883 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 884 | ); |
| 885 | |
| 886 | // Call the original underlying C function: |
| 887 | if(base && base->pad_removed) |
| 888 | (*base->pad_removed)(self, p0); |
| 889 | } |
| 890 | |
| 891 | |
| 892 | Glib::ObjectBase* Element_Class::wrap_new(GObject* object) |
| 893 | { |
| 894 | return new Element((GstElement*)object); |
| 895 | } |
| 896 | |
| 897 | |
| 898 | /* The implementation: */ |
| 899 | |
| 900 | GstElement* Element::gobj_copy() |
| 901 | { |
| 902 | reference(); |
| 903 | return gobj(); |
| 904 | } |
| 905 | |
| 906 | Element::Element(const Glib::ConstructParams& construct_params) |
| 907 | : |
| 908 | Gst::Object(construct_params) |
| 909 | { |
| 910 | |
| 911 | } |
| 912 | |
| 913 | Element::Element(GstElement* castitem) |
| 914 | : |
| 915 | Gst::Object((GstObject*)(castitem)) |
| 916 | {} |
| 917 | |
| 918 | |
| 919 | Element::Element(Element&& src) noexcept |
| 920 | : Gst::Object(std::move(src)) |
| 921 | {} |
| 922 | |
| 923 | Element& Element::operator=(Element&& src) noexcept |
| 924 | { |
| 925 | Gst::Object::operator=(std::move(src)); |
| 926 | return *this; |
| 927 | } |
| 928 | |
| 929 | |
| 930 | Element::~Element() noexcept |
| 931 | {} |
| 932 | |
| 933 | |
| 934 | Element::CppClassType Element::element_class_; // initialize static member |
| 935 | |
| 936 | GType Element::get_type() |
| 937 | { |
| 938 | return element_class_.init().get_type(); |
| 939 | } |
| 940 | |
| 941 | |
| 942 | GType Element::get_base_type() |
| 943 | { |
| 944 | return gst_element_get_type(); |
| 945 | } |
| 946 | |
| 947 | |
| 948 | bool Element::add_pad(const Glib::RefPtr<Gst::Pad>& pad) |
| 949 | { |
| 950 | return gst_element_add_pad(gobj(), Glib::unwrap(pad)); |
| 951 | } |
| 952 | |
| 953 | void Element::create_all_pads() |
| 954 | { |
| 955 | gst_element_create_all_pads(gobj()); |
| 956 | } |
| 957 | |
| 958 | Glib::RefPtr<Gst::Pad> Element::create_compatible_pad(const Glib::RefPtr<const Gst::Pad>& pad, const Glib::RefPtr<const Gst::Caps>& caps) |
| 959 | { |
| 960 | return Glib::wrap(gst_element_get_compatible_pad(gobj(), const_cast<GstPad*>(Glib::unwrap(pad)), const_cast<GstCaps*>(Glib::unwrap(caps)))); |
| 961 | } |
| 962 | |
| 963 | Glib::RefPtr<Gst::PadTemplate> Element::get_compatible_pad_template(const Glib::RefPtr<const Gst::PadTemplate>& compattempl) |
| 964 | { |
| 965 | Glib::RefPtr<Gst::PadTemplate> retvalue = Glib::wrap(gst_element_get_compatible_pad_template(gobj(), const_cast<GstPadTemplate*>(Glib::unwrap(compattempl)))); |
| 966 | if(retvalue) |
| 967 | retvalue->reference(); //The function does not do a ref for us. |
| 968 | return retvalue; |
| 969 | } |
| 970 | |
| 971 | Glib::RefPtr<const Gst::PadTemplate> Element::get_compatible_pad_template(const Glib::RefPtr<const Gst::PadTemplate>& compattempl) const |
| 972 | { |
| 973 | return const_cast<Element*>(this)->get_compatible_pad_template(compattempl); |
| 974 | } |
| 975 | |
| 976 | Glib::RefPtr<Gst::Pad> Element::get_request_pad(const Glib::ustring& name) |
| 977 | { |
| 978 | return Glib::wrap(gst_element_get_request_pad(gobj(), name.c_str())); |
| 979 | } |
| 980 | |
| 981 | Glib::RefPtr<Gst::Pad> Element::request_pad(const Glib::RefPtr<Gst::PadTemplate>& templ, const Glib::ustring& name, const Glib::RefPtr<const Gst::Caps>& caps) |
| 982 | { |
| 983 | return Glib::wrap(gst_element_request_pad(gobj(), Glib::unwrap(templ), name.empty() ? nullptr : name.c_str(), Glib::unwrap(caps))); |
| 984 | } |
| 985 | |
| 986 | Glib::RefPtr<Gst::Pad> Element::request_pad(const Glib::RefPtr<Gst::PadTemplate>& templ, const Glib::ustring& name) |
| 987 | { |
| 988 | return Glib::wrap(gst_element_request_pad(gobj(), Glib::unwrap(templ), name.empty() ? nullptr : name.c_str(), nullptr)); |
| 989 | } |
| 990 | |
| 991 | Glib::RefPtr<Gst::Pad> Element::request_pad(const Glib::RefPtr<Gst::PadTemplate>& templ, const Glib::RefPtr<const Gst::Caps>& caps) |
| 992 | { |
| 993 | return Glib::wrap(gst_element_request_pad(gobj(), Glib::unwrap(templ), nullptr, Glib::unwrap(caps))); |
| 994 | } |
| 995 | |
| 996 | Glib::RefPtr<Gst::Pad> Element::request_pad(const Glib::RefPtr<Gst::PadTemplate>& templ) |
| 997 | { |
| 998 | return Glib::wrap(gst_element_request_pad(gobj(), Glib::unwrap(templ), nullptr, nullptr)); |
| 999 | } |
| 1000 | |
| 1001 | Glib::RefPtr<Gst::Pad> Element::get_static_pad(const Glib::ustring& name) |
| 1002 | { |
| 1003 | return Glib::wrap(gst_element_get_static_pad(gobj(), name.c_str())); |
| 1004 | } |
| 1005 | |
| 1006 | Glib::RefPtr<const Gst::Pad> Element::get_static_pad(const Glib::ustring& name) const |
| 1007 | { |
| 1008 | return const_cast<Element*>(this)->get_static_pad(name); |
| 1009 | } |
| 1010 | |
| 1011 | void Element::no_more_pads() |
| 1012 | { |
| 1013 | gst_element_no_more_pads(gobj()); |
| 1014 | } |
| 1015 | |
| 1016 | void Element::release_request_pad(const Glib::RefPtr<Gst::Pad>& pad) |
| 1017 | { |
| 1018 | gst_element_release_request_pad(gobj(), Glib::unwrap(pad)); |
| 1019 | } |
| 1020 | |
| 1021 | bool Element::remove_pad(const Glib::RefPtr<Gst::Pad>& pad) |
| 1022 | { |
| 1023 | return gst_element_remove_pad(gobj(), Glib::unwrap(pad)); |
| 1024 | } |
| 1025 | |
| 1026 | Gst::Iterator<Gst::Pad> Element::iterate_pads() |
| 1027 | { |
| 1028 | return Gst::Iterator<Gst::Pad>(gst_element_iterate_pads(gobj())); |
| 1029 | } |
| 1030 | |
| 1031 | Gst::Iterator<const Gst::Pad> Element::iterate_pads() const |
| 1032 | { |
| 1033 | return Gst::Iterator<const Gst::Pad>(gst_element_iterate_pads(const_cast<GstElement*>(gobj()))); |
| 1034 | } |
| 1035 | |
| 1036 | Gst::Iterator<Gst::Pad> Element::iterate_sink_pads() |
| 1037 | { |
| 1038 | return Gst::Iterator<Gst::Pad>(gst_element_iterate_sink_pads(gobj())); |
| 1039 | } |
| 1040 | |
| 1041 | Gst::Iterator<const Gst::Pad> Element::iterate_sink_pads() const |
| 1042 | { |
| 1043 | return Gst::Iterator<const Gst::Pad>(gst_element_iterate_sink_pads(const_cast<GstElement*>(gobj()))); |
| 1044 | } |
| 1045 | |
| 1046 | Gst::Iterator<Gst::Pad> Element::iterate_src_pads() |
| 1047 | { |
| 1048 | return Gst::Iterator<Gst::Pad>(gst_element_iterate_src_pads(gobj())); |
| 1049 | } |
| 1050 | |
| 1051 | Gst::Iterator<const Gst::Pad> Element::iterate_src_pads() const |
| 1052 | { |
| 1053 | return Gst::Iterator<const Gst::Pad>(gst_element_iterate_src_pads(const_cast<GstElement*>(gobj()))); |
| 1054 | } |
| 1055 | |
| 1056 | void Element::unlink(const Glib::RefPtr<Gst::Element>& dest) |
| 1057 | { |
| 1058 | gst_element_unlink(gobj(), Glib::unwrap(dest)); |
| 1059 | } |
| 1060 | |
| 1061 | void Element::set_context(const Glib::RefPtr<Gst::Context>& context) |
| 1062 | { |
| 1063 | gst_element_set_context(gobj(), context->gobj()); |
| 1064 | } |
| 1065 | |
| 1066 | bool Element::link_pads(const Glib::ustring& srcpadname, const Glib::RefPtr<Gst::Element>& dest, const Glib::ustring& destpadname) |
| 1067 | { |
| 1068 | return gst_element_link_pads(gobj(), srcpadname.c_str(), Glib::unwrap(dest), destpadname.c_str()); |
| 1069 | } |
| 1070 | |
| 1071 | void Element::unlink_pads(const Glib::ustring& srcpadname, const Glib::RefPtr<Gst::Element>& dest, const Glib::ustring& destpadname) |
| 1072 | { |
| 1073 | gst_element_unlink_pads(gobj(), srcpadname.c_str(), Glib::unwrap(dest), destpadname.c_str()); |
| 1074 | } |
| 1075 | |
| 1076 | bool Element::link_pads(const Glib::ustring& srcpadname, const Glib::RefPtr<Gst::Element>& dest, const Glib::ustring& destpadname, const Glib::RefPtr<Gst::Caps>& filter) |
| 1077 | { |
| 1078 | return gst_element_link_pads_filtered(gobj(), srcpadname.c_str(), Glib::unwrap(dest), destpadname.c_str(), Glib::unwrap(filter)); |
| 1079 | } |
| 1080 | |
| 1081 | bool Element::link_pads(const Glib::ustring& srcpadname, const Glib::RefPtr<Gst::Element>& dest, const Glib::ustring& destpadname, PadLinkCheck flags) |
| 1082 | { |
| 1083 | return gst_element_link_pads_full(gobj(), srcpadname.c_str(), Glib::unwrap(dest), destpadname.c_str(), ((GstPadLinkCheck)(flags))); |
| 1084 | } |
| 1085 | |
| 1086 | void Element::set_base_time(ClockTime time) |
| 1087 | { |
| 1088 | gst_element_set_base_time(gobj(), ((GstClockTime)(time))); |
| 1089 | } |
| 1090 | |
| 1091 | ClockTime Element::get_base_time() const |
| 1092 | { |
| 1093 | return ((ClockTime)(gst_element_get_base_time(const_cast<GstElement*>(gobj())))); |
| 1094 | } |
| 1095 | |
| 1096 | void Element::set_start_time(Gst::ClockTime time) |
| 1097 | { |
| 1098 | gst_element_set_start_time(gobj(), ((GstClockTime)(time))); |
| 1099 | } |
| 1100 | |
| 1101 | Gst::ClockTime Element::get_start_time() const |
| 1102 | { |
| 1103 | return ((Gst::ClockTime)(gst_element_get_start_time(const_cast<GstElement*>(gobj())))); |
| 1104 | } |
| 1105 | |
| 1106 | void Element::set_bus(const Glib::RefPtr<Gst::Bus>& bus) |
| 1107 | { |
| 1108 | gst_element_set_bus(gobj(), Glib::unwrap(bus)); |
| 1109 | } |
| 1110 | |
| 1111 | Glib::RefPtr<Gst::Bus> Element::get_bus() |
| 1112 | { |
| 1113 | return Glib::wrap(gst_element_get_bus(gobj())); |
| 1114 | } |
| 1115 | |
| 1116 | Glib::RefPtr<const Gst::Bus> Element::get_bus() const |
| 1117 | { |
| 1118 | return const_cast<Element*>(this)->get_bus(); |
| 1119 | } |
| 1120 | |
| 1121 | Glib::RefPtr<Gst::ElementFactory> Element::get_factory() |
| 1122 | { |
| 1123 | Glib::RefPtr<Gst::ElementFactory> retvalue = Glib::wrap(gst_element_get_factory(gobj())); |
| 1124 | if(retvalue) |
| 1125 | retvalue->reference(); //The function does not do a ref for us. |
| 1126 | return retvalue; |
| 1127 | } |
| 1128 | |
| 1129 | Glib::RefPtr<const Gst::ElementFactory> Element::get_factory() const |
| 1130 | { |
| 1131 | return const_cast<Element*>(this)->get_factory(); |
| 1132 | } |
| 1133 | |
| 1134 | bool Element::set_clock(const Glib::RefPtr<Gst::Clock>& clock) |
| 1135 | { |
| 1136 | return gst_element_set_clock(gobj(), Glib::unwrap(clock)); |
| 1137 | } |
| 1138 | |
| 1139 | Glib::RefPtr<Gst::Clock> Element::get_clock() |
| 1140 | { |
| 1141 | return Glib::wrap(gst_element_get_clock(gobj())); |
| 1142 | } |
| 1143 | |
| 1144 | Glib::RefPtr<const Gst::Clock> Element::get_clock() const |
| 1145 | { |
| 1146 | return const_cast<Element*>(this)->get_clock(); |
| 1147 | } |
| 1148 | |
| 1149 | Glib::RefPtr<Gst::Clock> Element::provide_clock() |
| 1150 | { |
| 1151 | return Glib::wrap(gst_element_provide_clock(gobj())); |
| 1152 | } |
| 1153 | |
| 1154 | Glib::RefPtr<const Gst::Clock> Element::provide_clock() const |
| 1155 | { |
| 1156 | return const_cast<Element*>(this)->provide_clock(); |
| 1157 | } |
| 1158 | |
| 1159 | StateChangeReturn Element::set_state(State state) |
| 1160 | { |
| 1161 | return ((StateChangeReturn)(gst_element_set_state(gobj(), ((GstState)(state))))); |
| 1162 | } |
| 1163 | |
| 1164 | StateChangeReturn Element::get_state(State& state, State& pending, ClockTime timeout) const |
| 1165 | { |
| 1166 | return ((StateChangeReturn)(gst_element_get_state(const_cast<GstElement*>(gobj()), (GstState*)(&state), (GstState*)(&pending), ((GstClockTime)(timeout))))); |
| 1167 | } |
| 1168 | |
| 1169 | bool Element::set_locked_state(gboolean locked_state) |
| 1170 | { |
| 1171 | return gst_element_set_locked_state(gobj(), locked_state); |
| 1172 | } |
| 1173 | |
| 1174 | bool Element::is_locked_state() const |
| 1175 | { |
| 1176 | return gst_element_is_locked_state(const_cast<GstElement*>(gobj())); |
| 1177 | } |
| 1178 | |
| 1179 | void Element::abort_state() |
| 1180 | { |
| 1181 | gst_element_abort_state(gobj()); |
| 1182 | } |
| 1183 | |
| 1184 | StateChangeReturn Element::continue_state(StateChangeReturn ret) |
| 1185 | { |
| 1186 | return ((StateChangeReturn)(gst_element_continue_state(gobj(), ((GstStateChangeReturn)(ret))))); |
| 1187 | } |
| 1188 | |
| 1189 | void Element::lost_state() |
| 1190 | { |
| 1191 | gst_element_lost_state(gobj()); |
| 1192 | } |
| 1193 | |
| 1194 | bool Element::sync_state_with_parent() |
| 1195 | { |
| 1196 | return gst_element_sync_state_with_parent(gobj()); |
| 1197 | } |
| 1198 | |
| 1199 | StateChangeReturn Element::change_state(StateChange transition) |
| 1200 | { |
| 1201 | return ((StateChangeReturn)(gst_element_change_state(gobj(), ((GstStateChange)(transition))))); |
| 1202 | } |
| 1203 | |
| 1204 | bool Element::post_message(Glib::RefPtr<Gst::Message>&& message) |
| 1205 | { |
| 1206 | return gst_element_post_message(gobj(), (message) ? message.release()->gobj() : nullptr); |
| 1207 | } |
| 1208 | |
| 1209 | bool Element::query(const Glib::RefPtr<Gst::Query>& query) const |
| 1210 | { |
| 1211 | return gst_element_query(const_cast<GstElement*>(gobj()), Glib::unwrap(query)); |
| 1212 | } |
| 1213 | |
| 1214 | bool Element::query_convert(Gst::Format src_format, gint64 src_val, Format dest_format, gint64& dest_val) const |
| 1215 | { |
| 1216 | return gst_element_query_convert(const_cast<GstElement*>(gobj()), ((GstFormat)(src_format)), src_val, ((GstFormat)(dest_format)), &(dest_val)); |
| 1217 | } |
| 1218 | |
| 1219 | bool Element::query_position(Gst::Format format, gint64& cur) const |
| 1220 | { |
| 1221 | return gst_element_query_position(const_cast<GstElement*>(gobj()), ((GstFormat)(format)), &(cur)); |
| 1222 | } |
| 1223 | |
| 1224 | bool Element::query_position(Gst::Format format) const |
| 1225 | { |
| 1226 | return gst_element_query_position(const_cast<GstElement*>(gobj()), ((GstFormat)(format)), nullptr); |
| 1227 | } |
| 1228 | |
| 1229 | bool Element::query_duration(Gst::Format format, gint64& duration) const |
| 1230 | { |
| 1231 | return gst_element_query_duration(const_cast<GstElement*>(gobj()), ((GstFormat)(format)), &(duration)); |
| 1232 | } |
| 1233 | |
| 1234 | bool Element::query_duration(Gst::Format format) const |
| 1235 | { |
| 1236 | return gst_element_query_duration(const_cast<GstElement*>(gobj()), ((GstFormat)(format)), nullptr); |
| 1237 | } |
| 1238 | |
| 1239 | bool Element::seek(Format format, SeekFlags seek_flags, gint64 seek_pos) |
| 1240 | { |
| 1241 | return gst_element_seek_simple(gobj(), ((GstFormat)(format)), ((GstSeekFlags)(seek_flags)), seek_pos); |
| 1242 | } |
| 1243 | |
| 1244 | bool Element::seek(double rate, Format format, SeekFlags flags, SeekType cur_type, gint64 cur, SeekType stop_type, gint64 stop) |
| 1245 | { |
| 1246 | return gst_element_seek(gobj(), rate, ((GstFormat)(format)), ((GstSeekFlags)(flags)), ((GstSeekType)(cur_type)), cur, ((GstSeekType)(stop_type)), stop); |
| 1247 | } |
| 1248 | |
| 1249 | bool Element::send_event(Glib::RefPtr<Gst::Event>&& event) |
| 1250 | { |
| 1251 | return gst_element_send_event(gobj(), (event) ? event.release()->gobj() : nullptr); |
| 1252 | } |
| 1253 | |
| 1254 | Glib::RefPtr<Gst::Context> Element::get_context(const Glib::ustring& context_type) |
| 1255 | { |
| 1256 | return Glib::wrap(gst_element_get_context(gobj(), context_type.c_str())); |
| 1257 | } |
| 1258 | |
| 1259 | Glib::RefPtr<Gst::Context> Element::get_context_unlocked(const Glib::ustring& context_type) |
| 1260 | { |
| 1261 | return Glib::wrap(gst_element_get_context_unlocked(gobj(), context_type.c_str())); |
| 1262 | } |
| 1263 | |
| 1264 | std::vector< Glib::RefPtr<Gst::Context> > Element::get_contexts() |
| 1265 | { |
| 1266 | return Glib::ListHandler< Glib::RefPtr<Gst::Context> >::list_to_vector(const_cast<GList*>(gst_element_get_contexts(gobj())), Glib::OWNERSHIP_DEEP); |
| 1267 | } |
| 1268 | |
| 1269 | |
| 1270 | Glib::SignalProxy< void > Element::signal_no_more_pads() |
| 1271 | { |
| 1272 | return Glib::SignalProxy< void >(this, &Element_signal_no_more_pads_info); |
| 1273 | } |
| 1274 | |
| 1275 | |
| 1276 | Glib::SignalProxy< void,const Glib::RefPtr<Gst::Pad>& > Element::signal_pad_added() |
| 1277 | { |
| 1278 | return Glib::SignalProxy< void,const Glib::RefPtr<Gst::Pad>& >(this, &Element_signal_pad_added_info); |
| 1279 | } |
| 1280 | |
| 1281 | |
| 1282 | Glib::SignalProxy< void,const Glib::RefPtr<Gst::Pad>& > Element::signal_pad_removed() |
| 1283 | { |
| 1284 | return Glib::SignalProxy< void,const Glib::RefPtr<Gst::Pad>& >(this, &Element_signal_pad_removed_info); |
| 1285 | } |
| 1286 | |
| 1287 | |
| 1288 | void Gst::Element::on_no_more_pads() |
| 1289 | { |
| 1290 | const auto base = static_cast<BaseClassType*>( |
| 1291 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1292 | ); |
| 1293 | |
| 1294 | if(base && base->no_more_pads) |
| 1295 | (*base->no_more_pads)(gobj()); |
| 1296 | } |
| 1297 | void Gst::Element::on_pad_added(const Glib::RefPtr<Gst::Pad>& new_pad) |
| 1298 | { |
| 1299 | const auto base = static_cast<BaseClassType*>( |
| 1300 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1301 | ); |
| 1302 | |
| 1303 | if(base && base->pad_added) |
| 1304 | (*base->pad_added)(gobj(),Glib::unwrap(new_pad)); |
| 1305 | } |
| 1306 | void Gst::Element::on_pad_removed(const Glib::RefPtr<Gst::Pad>& old_pad) |
| 1307 | { |
| 1308 | const auto base = static_cast<BaseClassType*>( |
| 1309 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1310 | ); |
| 1311 | |
| 1312 | if(base && base->pad_removed) |
| 1313 | (*base->pad_removed)(gobj(),Glib::unwrap(old_pad)); |
| 1314 | } |
| 1315 | |
| 1316 | void Gst::Element::release_pad_vfunc(const Glib::RefPtr<Gst::Pad>& pad) |
| 1317 | { |
| 1318 | const auto base = static_cast<BaseClassType*>( |
| 1319 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1320 | ); |
| 1321 | |
| 1322 | if(base && base->release_pad) |
| 1323 | { |
| 1324 | (*base->release_pad)(gobj(),Glib::unwrap(pad)); |
| 1325 | } |
| 1326 | } |
| 1327 | Glib::RefPtr<Gst::Pad> Gst::Element::request_new_pad_vfunc(Glib::RefPtr<Gst::PadTemplate> templ, const Glib::ustring& name, const Glib::RefPtr<const Gst::Caps>& caps) |
| 1328 | { |
| 1329 | const auto base = static_cast<BaseClassType*>( |
| 1330 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1331 | ); |
| 1332 | |
| 1333 | if(base && base->request_new_pad) |
| 1334 | { |
| 1335 | Glib::RefPtr<Gst::Pad> retval(Glib::wrap((*base->request_new_pad)(gobj(),Glib::unwrap(templ),name.c_str(),Glib::unwrap(caps)))); |
| 1336 | return retval; |
| 1337 | } |
| 1338 | |
| 1339 | using RType = Glib::RefPtr<Gst::Pad>; |
| 1340 | return RType(); |
| 1341 | } |
| 1342 | StateChangeReturn Gst::Element::get_state_vfunc(State& state, State& pending, ClockTime timeout) const |
| 1343 | { |
| 1344 | const auto base = static_cast<BaseClassType*>( |
| 1345 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1346 | ); |
| 1347 | |
| 1348 | if(base && base->get_state) |
| 1349 | { |
| 1350 | StateChangeReturn retval(((StateChangeReturn)((*base->get_state)(const_cast<GstElement*>(gobj()),(GstState*)(&state),(GstState*)(&pending),((GstClockTime)(timeout)))))); |
| 1351 | return retval; |
| 1352 | } |
| 1353 | |
| 1354 | using RType = StateChangeReturn; |
| 1355 | return RType(); |
| 1356 | } |
| 1357 | StateChangeReturn Gst::Element::set_state_vfunc(State state) |
| 1358 | { |
| 1359 | const auto base = static_cast<BaseClassType*>( |
| 1360 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1361 | ); |
| 1362 | |
| 1363 | if(base && base->set_state) |
| 1364 | { |
| 1365 | StateChangeReturn retval(((StateChangeReturn)((*base->set_state)(gobj(),((GstState)(state)))))); |
| 1366 | return retval; |
| 1367 | } |
| 1368 | |
| 1369 | using RType = StateChangeReturn; |
| 1370 | return RType(); |
| 1371 | } |
| 1372 | StateChangeReturn Gst::Element::change_state_vfunc(StateChange transition) |
| 1373 | { |
| 1374 | const auto base = static_cast<BaseClassType*>( |
| 1375 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1376 | ); |
| 1377 | |
| 1378 | if(base && base->change_state) |
| 1379 | { |
| 1380 | StateChangeReturn retval(((StateChangeReturn)((*base->change_state)(gobj(),((GstStateChange)(transition)))))); |
| 1381 | return retval; |
| 1382 | } |
| 1383 | |
| 1384 | using RType = StateChangeReturn; |
| 1385 | return RType(); |
| 1386 | } |
| 1387 | void Gst::Element::state_changed_vfunc(Gst::State oldstate, Gst::State newstate, Gst::State pending) |
| 1388 | { |
| 1389 | const auto base = static_cast<BaseClassType*>( |
| 1390 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1391 | ); |
| 1392 | |
| 1393 | if(base && base->state_changed) |
| 1394 | { |
| 1395 | (*base->state_changed)(gobj(),((GstState)(oldstate)),((GstState)(newstate)),((GstState)(pending))); |
| 1396 | } |
| 1397 | } |
| 1398 | void Gst::Element::set_bus_vfunc(const Glib::RefPtr<Gst::Bus>& bus) |
| 1399 | { |
| 1400 | const auto base = static_cast<BaseClassType*>( |
| 1401 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1402 | ); |
| 1403 | |
| 1404 | if(base && base->set_bus) |
| 1405 | { |
| 1406 | (*base->set_bus)(gobj(),Glib::unwrap(bus)); |
| 1407 | } |
| 1408 | } |
| 1409 | Glib::RefPtr<Gst::Clock> Gst::Element::provide_clock_vfunc() |
| 1410 | { |
| 1411 | const auto base = static_cast<BaseClassType*>( |
| 1412 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1413 | ); |
| 1414 | |
| 1415 | if(base && base->provide_clock) |
| 1416 | { |
| 1417 | Glib::RefPtr<Gst::Clock> retval(Glib::wrap((*base->provide_clock)(gobj()))); |
| 1418 | return retval; |
| 1419 | } |
| 1420 | |
| 1421 | using RType = Glib::RefPtr<Gst::Clock>; |
| 1422 | return RType(); |
| 1423 | } |
| 1424 | bool Gst::Element::set_clock_vfunc(const Glib::RefPtr<Gst::Clock>& clock) |
| 1425 | { |
| 1426 | const auto base = static_cast<BaseClassType*>( |
| 1427 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1428 | ); |
| 1429 | |
| 1430 | if(base && base->set_clock) |
| 1431 | { |
| 1432 | bool retval((*base->set_clock)(gobj(),Glib::unwrap(clock))); |
| 1433 | return retval; |
| 1434 | } |
| 1435 | |
| 1436 | return true; |
| 1437 | } |
| 1438 | bool Gst::Element::send_event_vfunc(const Glib::RefPtr<Gst::Event>& event) |
| 1439 | { |
| 1440 | const auto base = static_cast<BaseClassType*>( |
| 1441 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1442 | ); |
| 1443 | |
| 1444 | if(base && base->send_event) |
| 1445 | { |
| 1446 | bool retval((*base->send_event)(gobj(),Glib::unwrap(event))); |
| 1447 | return retval; |
| 1448 | } |
| 1449 | |
| 1450 | using RType = bool; |
| 1451 | return RType(); |
| 1452 | } |
| 1453 | bool Gst::Element::query_vfunc(const Glib::RefPtr<Gst::Query>& query) const |
| 1454 | { |
| 1455 | const auto base = static_cast<BaseClassType*>( |
| 1456 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1457 | ); |
| 1458 | |
| 1459 | if(base && base->query) |
| 1460 | { |
| 1461 | bool retval((*base->query)(const_cast<GstElement*>(gobj()),Glib::unwrap(query))); |
| 1462 | return retval; |
| 1463 | } |
| 1464 | |
| 1465 | using RType = bool; |
| 1466 | return RType(); |
| 1467 | } |
| 1468 | void Gst::Element::set_context_vfunc(const Glib::RefPtr<Gst::Context>& context) |
| 1469 | { |
| 1470 | const auto base = static_cast<BaseClassType*>( |
| 1471 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1472 | ); |
| 1473 | |
| 1474 | if(base && base->set_context) |
| 1475 | { |
| 1476 | (*base->set_context)(gobj(),context->gobj()); |
| 1477 | } |
| 1478 | } |
| 1479 | bool Gst::Element::post_message_vfunc(const Glib::RefPtr<Gst::Message>& message) |
| 1480 | { |
| 1481 | const auto base = static_cast<BaseClassType*>( |
| 1482 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1483 | ); |
| 1484 | |
| 1485 | if(base && base->post_message) |
| 1486 | { |
| 1487 | bool retval((*base->post_message)(gobj(),Glib::unwrap(message))); |
| 1488 | return retval; |
| 1489 | } |
| 1490 | |
| 1491 | using RType = bool; |
| 1492 | return RType(); |
| 1493 | } |
| 1494 | |
| 1495 | |
| 1496 | } // namespace Gst |
| 1497 | |
| 1498 |