| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | |
| 3 | |
| 4 | #include <glibmm.h> |
| 5 | |
| 6 | #include <gstreamermm/basetransform.h> |
| 7 | #include <gstreamermm/private/basetransform_p.h> |
| 8 | |
| 9 | |
| 10 | /* gstreamermm - a C++ wrapper for gstreamer |
| 11 | * |
| 12 | * Copyright 2008-2016 The gstreamermm Development Team |
| 13 | * |
| 14 | * This library is free software; you can redistribute it and/or |
| 15 | * modify it under the terms of the GNU Lesser General Public |
| 16 | * License as published by the Free Software Foundation; either |
| 17 | * version 2.1 of the License, or (at your option) any later version. |
| 18 | * |
| 19 | * This library is distributed in the hope that it will be useful, |
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 22 | * Lesser General Public License for more details. |
| 23 | * |
| 24 | * You should have received a copy of the GNU Lesser General Public |
| 25 | * License along with this library; if not, write to the Free |
| 26 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 27 | */ |
| 28 | |
| 29 | #include <gstreamermm/pad.h> |
| 30 | #include <gstreamermm/caps.h> |
| 31 | #include <gstreamermm/buffer.h> |
| 32 | |
| 33 | |
| 34 | #define IGNORE_RESULT(x) { auto release_value = x; (void)release_value; } |
| 35 | |
| 36 | namespace Gst |
| 37 | { |
| 38 | |
| 39 | const Glib::ustring BaseTransform::SINK_NAME = GST_BASE_TRANSFORM_SINK_NAME; |
| 40 | const Glib::ustring BaseTransform::SRC_NAME = GST_BASE_TRANSFORM_SRC_NAME; |
| 41 | |
| 42 | GstFlowReturn BaseTransform_Class::prepare_output_buffer_vfunc_callback(GstBaseTransform* self, GstBuffer* input, GstBuffer** buffer) |
| 43 | { |
| 44 | Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>( |
| 45 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 46 | |
| 47 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 48 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 49 | // generated classes can use this optimisation, which avoids the unnecessary |
| 50 | // parameter conversions if there is no possibility of the virtual function |
| 51 | // being overridden: |
| 52 | if(obj_base && obj_base->is_derived_()) |
| 53 | { |
| 54 | CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 55 | if(obj) // This can be NULL during destruction. |
| 56 | { |
| 57 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 58 | { |
| 59 | Glib::RefPtr<Gst::Buffer> cpp_buffer; |
| 60 | // Call the virtual member method, which derived classes might override. |
| 61 | const GstFlowReturn result = |
| 62 | static_cast<GstFlowReturn>(obj->prepare_output_buffer_vfunc( |
| 63 | Glib::wrap(input, true), cpp_buffer)); |
| 64 | *buffer = cpp_buffer ? cpp_buffer->gobj_copy() : 0; |
| 65 | return result; |
| 66 | } |
| 67 | catch(...) |
| 68 | { |
| 69 | Glib::exception_handlers_invoke(); |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 75 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 76 | ); |
| 77 | |
| 78 | // Call the original underlying C function: |
| 79 | if(base && base->prepare_output_buffer) |
| 80 | return (*base->prepare_output_buffer)(self, input, buffer); |
| 81 | |
| 82 | |
| 83 | typedef GstFlowReturn RType; |
| 84 | return RType(); |
| 85 | } |
| 86 | FlowReturn Gst::BaseTransform::prepare_output_buffer_vfunc(const Glib::RefPtr<Gst::Buffer>& input, Glib::RefPtr<Gst::Buffer>& buffer) |
| 87 | { |
| 88 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 89 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 90 | ); |
| 91 | |
| 92 | if(base && base->prepare_output_buffer) |
| 93 | { |
| 94 | GstBuffer* gst_buffer; |
| 95 | const Gst::FlowReturn result = |
| 96 | static_cast<Gst::FlowReturn>((*base->prepare_output_buffer)(gobj(), |
| 97 | Glib::unwrap(input), &gst_buffer)); |
| 98 | buffer = Glib::wrap(gst_buffer, false); // Don't take copy because callback returns a newly created copy. |
| 99 | return result; |
| 100 | } |
| 101 | |
| 102 | typedef FlowReturn RType; |
| 103 | return RType(); |
| 104 | } |
| 105 | |
| 106 | Glib::RefPtr<Allocator> BaseTransform::get_allocator(AllocationParams& params) |
| 107 | { |
| 108 | GstAllocator* alloc; |
| 109 | gst_base_transform_get_allocator(gobj(), &alloc, params.gobj()); |
| 110 | return Glib::wrap(alloc, false); |
| 111 | } |
| 112 | |
| 113 | GstFlowReturn BaseTransform_Class::transform_vfunc_callback(GstBaseTransform* self, GstBuffer* inbuf, GstBuffer* outbuf) |
| 114 | { |
| 115 | Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>( |
| 116 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 117 | |
| 118 | if(obj_base && obj_base->is_derived_()) |
| 119 | { |
| 120 | CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 121 | if(obj) // This can be NULL during destruction. |
| 122 | { |
| 123 | #ifdef GLIBMM_EXCEPTIONS_ENABLED |
| 124 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 125 | { |
| 126 | #endif //GLIBMM_EXCEPTIONS_ENABLED |
| 127 | Glib::RefPtr<Gst::Buffer> w_inbuf = Glib::wrap(inbuf, false), |
| 128 | w_outbuf = Glib::wrap(outbuf, false); |
| 129 | // Call the virtual member method, which derived classes might override. |
| 130 | GstFlowReturn ret = ((GstFlowReturn)(obj->transform_vfunc(w_inbuf, w_outbuf))); |
| 131 | w_inbuf->reference(); w_outbuf->reference(); |
| 132 | return ret; |
| 133 | #ifdef GLIBMM_EXCEPTIONS_ENABLED |
| 134 | } |
| 135 | catch(...) |
| 136 | { |
| 137 | Glib::exception_handlers_invoke(); |
| 138 | } |
| 139 | #endif //GLIBMM_EXCEPTIONS_ENABLED |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 144 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 145 | ); |
| 146 | |
| 147 | // Call the original underlying C function: |
| 148 | if(base && base->transform) |
| 149 | { |
| 150 | GstFlowReturn retval = (*base->transform)(self, inbuf, outbuf); |
| 151 | return retval; |
| 152 | } |
| 153 | |
| 154 | typedef GstFlowReturn RType; |
| 155 | return RType(); |
| 156 | } |
| 157 | |
| 158 | FlowReturn Gst::BaseTransform::transform_vfunc(const Glib::RefPtr<Gst::Buffer>& inbuf, const Glib::RefPtr<Gst::Buffer>& outbuf) |
| 159 | { |
| 160 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 161 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 162 | ); |
| 163 | |
| 164 | if(base && base->transform) |
| 165 | { |
| 166 | FlowReturn retval(((FlowReturn)((*base->transform)(gobj(),Glib::unwrap(inbuf),Glib::unwrap(outbuf))))); |
| 167 | return retval; |
| 168 | } |
| 169 | |
| 170 | typedef FlowReturn RType; |
| 171 | return RType(); |
| 172 | } |
| 173 | |
| 174 | GstFlowReturn BaseTransform_Class::generate_output_vfunc_callback(GstBaseTransform* self, GstBuffer** outbuf) |
| 175 | { |
| 176 | Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>( |
| 177 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 178 | |
| 179 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 180 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 181 | // generated classes can use this optimisation, which avoids the unnecessary |
| 182 | // parameter conversions if there is no possibility of the virtual function |
| 183 | // being overridden: |
| 184 | if(obj_base && obj_base->is_derived_()) |
| 185 | { |
| 186 | CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 187 | if(obj) // This can be NULL during destruction. |
| 188 | { |
| 189 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 190 | { |
| 191 | Glib::RefPtr<Gst::Buffer> cpp_buffer; |
| 192 | // Call the virtual member method, which derived classes might override. |
| 193 | const GstFlowReturn result = |
| 194 | static_cast<GstFlowReturn>(obj->generate_output_vfunc( |
| 195 | cpp_buffer)); |
| 196 | *outbuf = cpp_buffer ? cpp_buffer->gobj_copy() : 0; |
| 197 | return result; |
| 198 | } |
| 199 | catch(...) |
| 200 | { |
| 201 | Glib::exception_handlers_invoke(); |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 207 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 208 | ); |
| 209 | |
| 210 | // Call the original underlying C function: |
| 211 | if(base && base->generate_output) |
| 212 | return (*base->generate_output)(self, outbuf); |
| 213 | |
| 214 | |
| 215 | typedef GstFlowReturn RType; |
| 216 | return RType(); |
| 217 | } |
| 218 | |
| 219 | FlowReturn Gst::BaseTransform::generate_output_vfunc(Glib::RefPtr<Gst::Buffer>& outbuf) |
| 220 | { |
| 221 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 222 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 223 | ); |
| 224 | |
| 225 | if(base && base->generate_output) |
| 226 | { |
| 227 | GstBuffer* gst_buffer = nullptr; |
| 228 | const Gst::FlowReturn result = |
| 229 | static_cast<Gst::FlowReturn>((*base->generate_output)(gobj(), &gst_buffer)); |
| 230 | outbuf = Glib::wrap(gst_buffer, false); // Don't take copy because callback returns a newly created copy. |
| 231 | return result; |
| 232 | } |
| 233 | |
| 234 | typedef FlowReturn RType; |
| 235 | return RType(); |
| 236 | } |
| 237 | |
| 238 | gboolean BaseTransform_Class::query_vfunc_callback(GstBaseTransform* self, GstPadDirection direction, GstQuery* query) |
| 239 | { |
| 240 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 241 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 242 | |
| 243 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 244 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 245 | // generated classes can use this optimisation, which avoids the unnecessary |
| 246 | // parameter conversions if there is no possibility of the virtual function |
| 247 | // being overridden: |
| 248 | if(obj_base && obj_base->is_derived_()) |
| 249 | { |
| 250 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 251 | if(obj) // This can be NULL during destruction. |
| 252 | { |
| 253 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 254 | { |
| 255 | // Call the virtual member method, which derived classes might override. |
| 256 | auto query_cpp = Glib::wrap(query, false); |
| 257 | int ret = static_cast<int>(obj->base_transform_query_vfunc(static_cast<Gst::PadDirection>(direction), query_cpp)); |
| 258 | IGNORE_RESULT(query_cpp.release()); |
| 259 | return ret; |
| 260 | } |
| 261 | catch(...) |
| 262 | { |
| 263 | Glib::exception_handlers_invoke(); |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 269 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 270 | ); |
| 271 | |
| 272 | // Call the original underlying C function: |
| 273 | if(base && base->query) |
| 274 | { |
| 275 | gboolean retval = (*base->query)(self, direction, query); |
| 276 | return retval; |
| 277 | } |
| 278 | |
| 279 | typedef gboolean RType; |
| 280 | return RType(); |
| 281 | } |
| 282 | |
| 283 | |
| 284 | bool Gst::BaseTransform::base_transform_query_vfunc(Gst::PadDirection direction, const Glib::RefPtr<Gst::Query>& query) |
| 285 | { |
| 286 | const auto base = static_cast<BaseClassType*>( |
| 287 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 288 | ); |
| 289 | |
| 290 | if(base && base->query) |
| 291 | { |
| 292 | bool retval((*base->query)(gobj(), static_cast<GstPadDirection>(direction), Glib::unwrap(query))); |
| 293 | return retval; |
| 294 | } |
| 295 | |
| 296 | typedef bool RType; |
| 297 | return RType(); |
| 298 | } |
| 299 | |
| 300 | bool BaseTransform::propose_allocation_vfunc(const Glib::RefPtr<Gst::Query>& decide_query, const Glib::RefPtr<Gst::Query>& query) |
| 301 | { |
| 302 | const auto base = static_cast<BaseClassType*>( |
| 303 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 304 | ); |
| 305 | |
| 306 | if(base && base->propose_allocation) |
| 307 | { |
| 308 | bool retval((*base->propose_allocation)(gobj(),Glib::unwrap(decide_query),Glib::unwrap(query))); |
| 309 | return retval; |
| 310 | } |
| 311 | |
| 312 | typedef bool RType; |
| 313 | return RType(); |
| 314 | } |
| 315 | |
| 316 | gboolean BaseTransform_Class::propose_allocation_vfunc_callback(GstBaseTransform* self, GstQuery* decide_query, GstQuery* query) |
| 317 | { |
| 318 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 319 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 320 | |
| 321 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 322 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 323 | // generated classes can use this optimisation, which avoids the unnecessary |
| 324 | // parameter conversions if there is no possibility of the virtual function |
| 325 | // being overridden: |
| 326 | if(obj_base && obj_base->is_derived_()) |
| 327 | { |
| 328 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 329 | if(obj) // This can be NULL during destruction. |
| 330 | { |
| 331 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 332 | { |
| 333 | // Call the virtual member method, which derived classes might override. |
| 334 | auto query_cpp = Glib::wrap(query, false); |
| 335 | auto decide_query_cpp = Glib::wrap(decide_query, false); |
| 336 | auto ret = static_cast<int>(obj->propose_allocation_vfunc(decide_query_cpp, query_cpp)); |
| 337 | IGNORE_RESULT(query_cpp.release()); |
| 338 | IGNORE_RESULT(decide_query_cpp.release()); |
| 339 | return ret; |
| 340 | } |
| 341 | catch(...) |
| 342 | { |
| 343 | Glib::exception_handlers_invoke(); |
| 344 | } |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 349 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 350 | ); |
| 351 | |
| 352 | // Call the original underlying C function: |
| 353 | if(base && base->propose_allocation) |
| 354 | return (*base->propose_allocation)(self, decide_query, query); |
| 355 | |
| 356 | typedef gboolean RType; |
| 357 | return RType(); |
| 358 | } |
| 359 | |
| 360 | bool Gst::BaseTransform::decide_allocation_vfunc(const Glib::RefPtr<Gst::Query>& query) |
| 361 | { |
| 362 | const auto base = static_cast<BaseClassType*>( |
| 363 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 364 | ); |
| 365 | |
| 366 | if(base && base->decide_allocation) |
| 367 | { |
| 368 | bool retval((*base->decide_allocation)(gobj(),Glib::unwrap(query))); |
| 369 | return retval; |
| 370 | } |
| 371 | |
| 372 | typedef bool RType; |
| 373 | return RType(); |
| 374 | } |
| 375 | |
| 376 | gboolean BaseTransform_Class::decide_allocation_vfunc_callback(GstBaseTransform* self, GstQuery* query) |
| 377 | { |
| 378 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 379 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 380 | |
| 381 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 382 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 383 | // generated classes can use this optimisation, which avoids the unnecessary |
| 384 | // parameter conversions if there is no possibility of the virtual function |
| 385 | // being overridden: |
| 386 | if(obj_base && obj_base->is_derived_()) |
| 387 | { |
| 388 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 389 | if(obj) // This can be NULL during destruction. |
| 390 | { |
| 391 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 392 | { |
| 393 | // Call the virtual member method, which derived classes might override. |
| 394 | auto query_cpp = Glib::wrap(query, false); |
| 395 | auto ret = static_cast<int>(obj->decide_allocation_vfunc(query_cpp)); |
| 396 | IGNORE_RESULT(query_cpp.release()); |
| 397 | return ret; |
| 398 | } |
| 399 | catch(...) |
| 400 | { |
| 401 | Glib::exception_handlers_invoke(); |
| 402 | } |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 407 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 408 | ); |
| 409 | |
| 410 | // Call the original underlying C function: |
| 411 | if(base && base->decide_allocation) |
| 412 | return (*base->decide_allocation)(self, query); |
| 413 | |
| 414 | typedef gboolean RType; |
| 415 | return RType(); |
| 416 | } |
| 417 | |
| 418 | |
| 419 | } //namespace Gst |
| 420 | |
| 421 | namespace |
| 422 | { |
| 423 | } // anonymous namespace |
| 424 | |
| 425 | |
| 426 | namespace Glib |
| 427 | { |
| 428 | |
| 429 | Glib::RefPtr<Gst::BaseTransform> wrap(GstBaseTransform* object, bool take_copy) |
| 430 | { |
| 431 | return Glib::RefPtr<Gst::BaseTransform>( dynamic_cast<Gst::BaseTransform*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); |
| 432 | //We use dynamic_cast<> in case of multiple inheritance. |
| 433 | } |
| 434 | |
| 435 | } /* namespace Glib */ |
| 436 | |
| 437 | |
| 438 | namespace Gst |
| 439 | { |
| 440 | |
| 441 | |
| 442 | /* The *_Class implementation: */ |
| 443 | |
| 444 | const Glib::Class& BaseTransform_Class::init() |
| 445 | { |
| 446 | if(!gtype_) // create the GType if necessary |
| 447 | { |
| 448 | // Glib::Class has to know the class init function to clone custom types. |
| 449 | class_init_func_ = &BaseTransform_Class::class_init_function; |
| 450 | |
| 451 | // This is actually just optimized away, apparently with no harm. |
| 452 | // Make sure that the parent type has been created. |
| 453 | //CppClassParent::CppObjectType::get_type(); |
| 454 | |
| 455 | // Create the wrapper type, with the same class/instance size as the base type. |
| 456 | register_derived_type(gst_base_transform_get_type()); |
| 457 | |
| 458 | // Add derived versions of interfaces, if the C type implements any interfaces: |
| 459 | |
| 460 | } |
| 461 | |
| 462 | return *this; |
| 463 | } |
| 464 | |
| 465 | |
| 466 | void BaseTransform_Class::class_init_function(void* g_class, void* class_data) |
| 467 | { |
| 468 | const auto klass = static_cast<BaseClassType*>(g_class); |
| 469 | CppClassParent::class_init_function(klass, class_data); |
| 470 | |
| 471 | klass->transform_caps = &transform_caps_vfunc_callback; |
| 472 | klass->fixate_caps = &fixate_caps_vfunc_callback; |
| 473 | klass->get_unit_size = &get_unit_size_vfunc_callback; |
| 474 | klass->set_caps = &set_caps_vfunc_callback; |
| 475 | klass->transform_ip = &transform_ip_vfunc_callback; |
| 476 | klass->src_event = &src_event_vfunc_callback; |
| 477 | klass->sink_event = &sink_event_vfunc_callback; |
| 478 | klass->before_transform = &before_transform_vfunc_callback; |
| 479 | klass->accept_caps = &accept_caps_vfunc_callback; |
| 480 | klass->start = &start_vfunc_callback; |
| 481 | klass->stop = &stop_vfunc_callback; |
| 482 | klass->filter_meta = &filter_meta_vfunc_callback; |
| 483 | klass->submit_input_buffer = &submit_input_buffer_vfunc_callback; |
| 484 | klass->copy_metadata = ©_metadata_vfunc_callback; |
| 485 | klass->prepare_output_buffer = &prepare_output_buffer_vfunc_callback; |
| 486 | klass->transform = &transform_vfunc_callback; |
| 487 | klass->generate_output = &generate_output_vfunc_callback; |
| 488 | klass->query = &query_vfunc_callback; |
| 489 | klass->propose_allocation = &propose_allocation_vfunc_callback; |
| 490 | klass->decide_allocation = &decide_allocation_vfunc_callback; |
| 491 | |
| 492 | } |
| 493 | |
| 494 | GstCaps* BaseTransform_Class::transform_caps_vfunc_callback(GstBaseTransform* self, GstPadDirection direction, GstCaps* caps, GstCaps* filter) |
| 495 | { |
| 496 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 497 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 498 | |
| 499 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 500 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 501 | // generated classes can use this optimisation, which avoids the unnecessary |
| 502 | // parameter conversions if there is no possibility of the virtual function |
| 503 | // being overridden: |
| 504 | if(obj_base && obj_base->is_derived_()) |
| 505 | { |
| 506 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 507 | if(obj) // This can be NULL during destruction. |
| 508 | { |
| 509 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 510 | { |
| 511 | // Call the virtual member method, which derived classes might override. |
| 512 | return Glib::unwrap_copy(obj->transform_caps_vfunc(((PadDirection)(direction)) |
| 513 | , Glib::wrap(caps, true) |
| 514 | , Glib::wrap(filter, true) |
| 515 | )); |
| 516 | } |
| 517 | catch(...) |
| 518 | { |
| 519 | Glib::exception_handlers_invoke(); |
| 520 | } |
| 521 | } |
| 522 | } |
| 523 | |
| 524 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 525 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 526 | ); |
| 527 | |
| 528 | // Call the original underlying C function: |
| 529 | if(base && base->transform_caps) |
| 530 | return (*base->transform_caps)(self, direction, caps, filter); |
| 531 | |
| 532 | using RType = GstCaps*; |
| 533 | return RType(); |
| 534 | } |
| 535 | GstCaps* BaseTransform_Class::fixate_caps_vfunc_callback(GstBaseTransform* self, GstPadDirection direction, GstCaps* caps, GstCaps* othercaps) |
| 536 | { |
| 537 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 538 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 539 | |
| 540 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 541 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 542 | // generated classes can use this optimisation, which avoids the unnecessary |
| 543 | // parameter conversions if there is no possibility of the virtual function |
| 544 | // being overridden: |
| 545 | if(obj_base && obj_base->is_derived_()) |
| 546 | { |
| 547 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 548 | if(obj) // This can be NULL during destruction. |
| 549 | { |
| 550 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 551 | { |
| 552 | // Call the virtual member method, which derived classes might override. |
| 553 | return Glib::unwrap_copy(obj->fixate_caps_vfunc(((PadDirection)(direction)) |
| 554 | , Glib::wrap(caps, true) |
| 555 | , Glib::wrap(othercaps, true) |
| 556 | )); |
| 557 | } |
| 558 | catch(...) |
| 559 | { |
| 560 | Glib::exception_handlers_invoke(); |
| 561 | } |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 566 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 567 | ); |
| 568 | |
| 569 | // Call the original underlying C function: |
| 570 | if(base && base->fixate_caps) |
| 571 | return (*base->fixate_caps)(self, direction, caps, othercaps); |
| 572 | |
| 573 | using RType = GstCaps*; |
| 574 | return RType(); |
| 575 | } |
| 576 | gboolean BaseTransform_Class::get_unit_size_vfunc_callback(GstBaseTransform* self, GstCaps* caps, gsize* size) |
| 577 | { |
| 578 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 579 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 580 | |
| 581 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 582 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 583 | // generated classes can use this optimisation, which avoids the unnecessary |
| 584 | // parameter conversions if there is no possibility of the virtual function |
| 585 | // being overridden: |
| 586 | if(obj_base && obj_base->is_derived_()) |
| 587 | { |
| 588 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 589 | if(obj) // This can be NULL during destruction. |
| 590 | { |
| 591 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 592 | { |
| 593 | // Call the virtual member method, which derived classes might override. |
| 594 | return static_cast<int>(obj->get_unit_size_vfunc(Glib::wrap(caps, true) |
| 595 | , *size |
| 596 | )); |
| 597 | } |
| 598 | catch(...) |
| 599 | { |
| 600 | Glib::exception_handlers_invoke(); |
| 601 | } |
| 602 | } |
| 603 | } |
| 604 | |
| 605 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 606 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 607 | ); |
| 608 | |
| 609 | // Call the original underlying C function: |
| 610 | if(base && base->get_unit_size) |
| 611 | return (*base->get_unit_size)(self, caps, size); |
| 612 | |
| 613 | using RType = gboolean; |
| 614 | return RType(); |
| 615 | } |
| 616 | gboolean BaseTransform_Class::set_caps_vfunc_callback(GstBaseTransform* self, GstCaps* incaps, GstCaps* outcaps) |
| 617 | { |
| 618 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 619 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 620 | |
| 621 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 622 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 623 | // generated classes can use this optimisation, which avoids the unnecessary |
| 624 | // parameter conversions if there is no possibility of the virtual function |
| 625 | // being overridden: |
| 626 | if(obj_base && obj_base->is_derived_()) |
| 627 | { |
| 628 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 629 | if(obj) // This can be NULL during destruction. |
| 630 | { |
| 631 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 632 | { |
| 633 | // Call the virtual member method, which derived classes might override. |
| 634 | return static_cast<int>(obj->set_caps_vfunc(Glib::wrap(incaps, true) |
| 635 | , Glib::wrap(outcaps, true) |
| 636 | )); |
| 637 | } |
| 638 | catch(...) |
| 639 | { |
| 640 | Glib::exception_handlers_invoke(); |
| 641 | } |
| 642 | } |
| 643 | } |
| 644 | |
| 645 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 646 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 647 | ); |
| 648 | |
| 649 | // Call the original underlying C function: |
| 650 | if(base && base->set_caps) |
| 651 | return (*base->set_caps)(self, incaps, outcaps); |
| 652 | |
| 653 | return static_cast<int>(true); |
| 654 | } |
| 655 | GstFlowReturn BaseTransform_Class::transform_ip_vfunc_callback(GstBaseTransform* self, GstBuffer* buf) |
| 656 | { |
| 657 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 658 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 659 | |
| 660 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 661 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 662 | // generated classes can use this optimisation, which avoids the unnecessary |
| 663 | // parameter conversions if there is no possibility of the virtual function |
| 664 | // being overridden: |
| 665 | if(obj_base && obj_base->is_derived_()) |
| 666 | { |
| 667 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 668 | if(obj) // This can be NULL during destruction. |
| 669 | { |
| 670 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 671 | { |
| 672 | // Call the virtual member method, which derived classes might override. |
| 673 | return ((GstFlowReturn)(obj->transform_ip_vfunc(Glib::wrap(buf, true) |
| 674 | ))); |
| 675 | } |
| 676 | catch(...) |
| 677 | { |
| 678 | Glib::exception_handlers_invoke(); |
| 679 | } |
| 680 | } |
| 681 | } |
| 682 | |
| 683 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 684 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 685 | ); |
| 686 | |
| 687 | // Call the original underlying C function: |
| 688 | if(base && base->transform_ip) |
| 689 | return (*base->transform_ip)(self, buf); |
| 690 | |
| 691 | using RType = GstFlowReturn; |
| 692 | return RType(); |
| 693 | } |
| 694 | gboolean BaseTransform_Class::src_event_vfunc_callback(GstBaseTransform* self, GstEvent* event) |
| 695 | { |
| 696 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 697 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 698 | |
| 699 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 700 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 701 | // generated classes can use this optimisation, which avoids the unnecessary |
| 702 | // parameter conversions if there is no possibility of the virtual function |
| 703 | // being overridden: |
| 704 | if(obj_base && obj_base->is_derived_()) |
| 705 | { |
| 706 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 707 | if(obj) // This can be NULL during destruction. |
| 708 | { |
| 709 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 710 | { |
| 711 | // Call the virtual member method, which derived classes might override. |
| 712 | return static_cast<int>(obj->src_event_vfunc(Glib::wrap(event, true) |
| 713 | )); |
| 714 | } |
| 715 | catch(...) |
| 716 | { |
| 717 | Glib::exception_handlers_invoke(); |
| 718 | } |
| 719 | } |
| 720 | } |
| 721 | |
| 722 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 723 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 724 | ); |
| 725 | |
| 726 | // Call the original underlying C function: |
| 727 | if(base && base->src_event) |
| 728 | return (*base->src_event)(self, event); |
| 729 | |
| 730 | using RType = gboolean; |
| 731 | return RType(); |
| 732 | } |
| 733 | gboolean BaseTransform_Class::sink_event_vfunc_callback(GstBaseTransform* self, GstEvent* event) |
| 734 | { |
| 735 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 736 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 737 | |
| 738 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 739 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 740 | // generated classes can use this optimisation, which avoids the unnecessary |
| 741 | // parameter conversions if there is no possibility of the virtual function |
| 742 | // being overridden: |
| 743 | if(obj_base && obj_base->is_derived_()) |
| 744 | { |
| 745 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 746 | if(obj) // This can be NULL during destruction. |
| 747 | { |
| 748 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 749 | { |
| 750 | // Call the virtual member method, which derived classes might override. |
| 751 | return static_cast<int>(obj->sink_event_vfunc(Glib::wrap(event, true) |
| 752 | )); |
| 753 | } |
| 754 | catch(...) |
| 755 | { |
| 756 | Glib::exception_handlers_invoke(); |
| 757 | } |
| 758 | } |
| 759 | } |
| 760 | |
| 761 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 762 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 763 | ); |
| 764 | |
| 765 | // Call the original underlying C function: |
| 766 | if(base && base->sink_event) |
| 767 | return (*base->sink_event)(self, event); |
| 768 | |
| 769 | using RType = gboolean; |
| 770 | return RType(); |
| 771 | } |
| 772 | void BaseTransform_Class::before_transform_vfunc_callback(GstBaseTransform* self, GstBuffer* buffer) |
| 773 | { |
| 774 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 775 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 776 | |
| 777 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 778 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 779 | // generated classes can use this optimisation, which avoids the unnecessary |
| 780 | // parameter conversions if there is no possibility of the virtual function |
| 781 | // being overridden: |
| 782 | if(obj_base && obj_base->is_derived_()) |
| 783 | { |
| 784 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 785 | if(obj) // This can be NULL during destruction. |
| 786 | { |
| 787 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 788 | { |
| 789 | // Call the virtual member method, which derived classes might override. |
| 790 | obj->before_transform_vfunc(Glib::wrap(buffer, true) |
| 791 | ); |
| 792 | return; |
| 793 | } |
| 794 | catch(...) |
| 795 | { |
| 796 | Glib::exception_handlers_invoke(); |
| 797 | } |
| 798 | } |
| 799 | } |
| 800 | |
| 801 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 802 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 803 | ); |
| 804 | |
| 805 | // Call the original underlying C function: |
| 806 | if(base && base->before_transform) |
| 807 | (*base->before_transform)(self, buffer); |
| 808 | } |
| 809 | gboolean BaseTransform_Class::accept_caps_vfunc_callback(GstBaseTransform* self, GstPadDirection direction, GstCaps* caps) |
| 810 | { |
| 811 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 812 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 813 | |
| 814 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 815 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 816 | // generated classes can use this optimisation, which avoids the unnecessary |
| 817 | // parameter conversions if there is no possibility of the virtual function |
| 818 | // being overridden: |
| 819 | if(obj_base && obj_base->is_derived_()) |
| 820 | { |
| 821 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 822 | if(obj) // This can be NULL during destruction. |
| 823 | { |
| 824 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 825 | { |
| 826 | // Call the virtual member method, which derived classes might override. |
| 827 | return static_cast<int>(obj->accept_caps_vfunc(((PadDirection)(direction)) |
| 828 | , Glib::wrap(caps, true) |
| 829 | )); |
| 830 | } |
| 831 | catch(...) |
| 832 | { |
| 833 | Glib::exception_handlers_invoke(); |
| 834 | } |
| 835 | } |
| 836 | } |
| 837 | |
| 838 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 839 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 840 | ); |
| 841 | |
| 842 | // Call the original underlying C function: |
| 843 | if(base && base->accept_caps) |
| 844 | return (*base->accept_caps)(self, direction, caps); |
| 845 | |
| 846 | using RType = gboolean; |
| 847 | return RType(); |
| 848 | } |
| 849 | gboolean BaseTransform_Class::start_vfunc_callback(GstBaseTransform* self) |
| 850 | { |
| 851 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 852 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 853 | |
| 854 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 855 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 856 | // generated classes can use this optimisation, which avoids the unnecessary |
| 857 | // parameter conversions if there is no possibility of the virtual function |
| 858 | // being overridden: |
| 859 | if(obj_base && obj_base->is_derived_()) |
| 860 | { |
| 861 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 862 | if(obj) // This can be NULL during destruction. |
| 863 | { |
| 864 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 865 | { |
| 866 | // Call the virtual member method, which derived classes might override. |
| 867 | return static_cast<int>(obj->start_vfunc()); |
| 868 | } |
| 869 | catch(...) |
| 870 | { |
| 871 | Glib::exception_handlers_invoke(); |
| 872 | } |
| 873 | } |
| 874 | } |
| 875 | |
| 876 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 877 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 878 | ); |
| 879 | |
| 880 | // Call the original underlying C function: |
| 881 | if(base && base->start) |
| 882 | return (*base->start)(self); |
| 883 | |
| 884 | return static_cast<int>(true); |
| 885 | } |
| 886 | gboolean BaseTransform_Class::stop_vfunc_callback(GstBaseTransform* self) |
| 887 | { |
| 888 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 889 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 890 | |
| 891 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 892 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 893 | // generated classes can use this optimisation, which avoids the unnecessary |
| 894 | // parameter conversions if there is no possibility of the virtual function |
| 895 | // being overridden: |
| 896 | if(obj_base && obj_base->is_derived_()) |
| 897 | { |
| 898 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 899 | if(obj) // This can be NULL during destruction. |
| 900 | { |
| 901 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 902 | { |
| 903 | // Call the virtual member method, which derived classes might override. |
| 904 | return static_cast<int>(obj->stop_vfunc()); |
| 905 | } |
| 906 | catch(...) |
| 907 | { |
| 908 | Glib::exception_handlers_invoke(); |
| 909 | } |
| 910 | } |
| 911 | } |
| 912 | |
| 913 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 914 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 915 | ); |
| 916 | |
| 917 | // Call the original underlying C function: |
| 918 | if(base && base->stop) |
| 919 | return (*base->stop)(self); |
| 920 | |
| 921 | return static_cast<int>(true); |
| 922 | } |
| 923 | gboolean BaseTransform_Class::filter_meta_vfunc_callback(GstBaseTransform* self, GstQuery* query, GType api, const GstStructure* params) |
| 924 | { |
| 925 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 926 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 927 | |
| 928 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 929 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 930 | // generated classes can use this optimisation, which avoids the unnecessary |
| 931 | // parameter conversions if there is no possibility of the virtual function |
| 932 | // being overridden: |
| 933 | if(obj_base && obj_base->is_derived_()) |
| 934 | { |
| 935 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 936 | if(obj) // This can be NULL during destruction. |
| 937 | { |
| 938 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 939 | { |
| 940 | // Call the virtual member method, which derived classes might override. |
| 941 | return static_cast<int>(obj->filter_meta_vfunc(Glib::wrap(query, true) |
| 942 | , api, Glib::wrap(const_cast<GstStructure*>(params), false) |
| 943 | )); |
| 944 | } |
| 945 | catch(...) |
| 946 | { |
| 947 | Glib::exception_handlers_invoke(); |
| 948 | } |
| 949 | } |
| 950 | } |
| 951 | |
| 952 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 953 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 954 | ); |
| 955 | |
| 956 | // Call the original underlying C function: |
| 957 | if(base && base->filter_meta) |
| 958 | return (*base->filter_meta)(self, query, api, params); |
| 959 | |
| 960 | return static_cast<int>(true); |
| 961 | } |
| 962 | GstFlowReturn BaseTransform_Class::submit_input_buffer_vfunc_callback(GstBaseTransform* self, gboolean is_discont, GstBuffer* input) |
| 963 | { |
| 964 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 965 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 966 | |
| 967 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 968 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 969 | // generated classes can use this optimisation, which avoids the unnecessary |
| 970 | // parameter conversions if there is no possibility of the virtual function |
| 971 | // being overridden: |
| 972 | if(obj_base && obj_base->is_derived_()) |
| 973 | { |
| 974 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 975 | if(obj) // This can be NULL during destruction. |
| 976 | { |
| 977 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 978 | { |
| 979 | // Call the virtual member method, which derived classes might override. |
| 980 | return ((GstFlowReturn)(obj->submit_input_buffer_vfunc(is_discont |
| 981 | , Glib::wrap(input, true) |
| 982 | ))); |
| 983 | } |
| 984 | catch(...) |
| 985 | { |
| 986 | Glib::exception_handlers_invoke(); |
| 987 | } |
| 988 | } |
| 989 | } |
| 990 | |
| 991 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 992 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 993 | ); |
| 994 | |
| 995 | // Call the original underlying C function: |
| 996 | if(base && base->submit_input_buffer) |
| 997 | return (*base->submit_input_buffer)(self, is_discont, input); |
| 998 | |
| 999 | using RType = GstFlowReturn; |
| 1000 | return RType(); |
| 1001 | } |
| 1002 | gboolean BaseTransform_Class::copy_metadata_vfunc_callback(GstBaseTransform* self, GstBuffer* input, GstBuffer* outbuf) |
| 1003 | { |
| 1004 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 1005 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 1006 | |
| 1007 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 1008 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 1009 | // generated classes can use this optimisation, which avoids the unnecessary |
| 1010 | // parameter conversions if there is no possibility of the virtual function |
| 1011 | // being overridden: |
| 1012 | if(obj_base && obj_base->is_derived_()) |
| 1013 | { |
| 1014 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 1015 | if(obj) // This can be NULL during destruction. |
| 1016 | { |
| 1017 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 1018 | { |
| 1019 | // Call the virtual member method, which derived classes might override. |
| 1020 | return static_cast<int>(obj->copy_metadata_vfunc(Glib::wrap(input, true) |
| 1021 | , Glib::wrap(outbuf, true) |
| 1022 | )); |
| 1023 | } |
| 1024 | catch(...) |
| 1025 | { |
| 1026 | Glib::exception_handlers_invoke(); |
| 1027 | } |
| 1028 | } |
| 1029 | } |
| 1030 | |
| 1031 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 1032 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 1033 | ); |
| 1034 | |
| 1035 | // Call the original underlying C function: |
| 1036 | if(base && base->copy_metadata) |
| 1037 | return (*base->copy_metadata)(self, input, outbuf); |
| 1038 | |
| 1039 | using RType = gboolean; |
| 1040 | return RType(); |
| 1041 | } |
| 1042 | |
| 1043 | |
| 1044 | Glib::ObjectBase* BaseTransform_Class::wrap_new(GObject* object) |
| 1045 | { |
| 1046 | return new BaseTransform((GstBaseTransform*)object); |
| 1047 | } |
| 1048 | |
| 1049 | |
| 1050 | /* The implementation: */ |
| 1051 | |
| 1052 | GstBaseTransform* BaseTransform::gobj_copy() |
| 1053 | { |
| 1054 | reference(); |
| 1055 | return gobj(); |
| 1056 | } |
| 1057 | |
| 1058 | BaseTransform::BaseTransform(const Glib::ConstructParams& construct_params) |
| 1059 | : |
| 1060 | Element(construct_params) |
| 1061 | { |
| 1062 | |
| 1063 | } |
| 1064 | |
| 1065 | BaseTransform::BaseTransform(GstBaseTransform* castitem) |
| 1066 | : |
| 1067 | Element((GstElement*)(castitem)) |
| 1068 | {} |
| 1069 | |
| 1070 | |
| 1071 | BaseTransform::BaseTransform(BaseTransform&& src) noexcept |
| 1072 | : Element(std::move(src)) |
| 1073 | {} |
| 1074 | |
| 1075 | BaseTransform& BaseTransform::operator=(BaseTransform&& src) noexcept |
| 1076 | { |
| 1077 | Element::operator=(std::move(src)); |
| 1078 | return *this; |
| 1079 | } |
| 1080 | |
| 1081 | |
| 1082 | BaseTransform::~BaseTransform() noexcept |
| 1083 | {} |
| 1084 | |
| 1085 | |
| 1086 | BaseTransform::CppClassType BaseTransform::basetransform_class_; // initialize static member |
| 1087 | |
| 1088 | GType BaseTransform::get_type() |
| 1089 | { |
| 1090 | return basetransform_class_.init().get_type(); |
| 1091 | } |
| 1092 | |
| 1093 | |
| 1094 | GType BaseTransform::get_base_type() |
| 1095 | { |
| 1096 | return gst_base_transform_get_type(); |
| 1097 | } |
| 1098 | |
| 1099 | |
| 1100 | bool BaseTransform::is_passthrough() const |
| 1101 | { |
| 1102 | return gst_base_transform_is_passthrough(const_cast<GstBaseTransform*>(gobj())); |
| 1103 | } |
| 1104 | |
| 1105 | void BaseTransform::set_passthrough(bool passthrough) |
| 1106 | { |
| 1107 | gst_base_transform_set_passthrough(gobj(), static_cast<int>(passthrough)); |
| 1108 | } |
| 1109 | |
| 1110 | bool BaseTransform::is_in_place() const |
| 1111 | { |
| 1112 | return gst_base_transform_is_in_place(const_cast<GstBaseTransform*>(gobj())); |
| 1113 | } |
| 1114 | |
| 1115 | void BaseTransform::set_in_place(bool in_place) |
| 1116 | { |
| 1117 | gst_base_transform_set_in_place(gobj(), static_cast<int>(in_place)); |
| 1118 | } |
| 1119 | |
| 1120 | bool BaseTransform::is_qos_enabled() const |
| 1121 | { |
| 1122 | return gst_base_transform_is_qos_enabled(const_cast<GstBaseTransform*>(gobj())); |
| 1123 | } |
| 1124 | |
| 1125 | void BaseTransform::set_qos_enabled(bool enabled) |
| 1126 | { |
| 1127 | gst_base_transform_set_qos_enabled(gobj(), static_cast<int>(enabled)); |
| 1128 | } |
| 1129 | |
| 1130 | void BaseTransform::update_qos(double proportion, Gst::ClockTimeDiff diff, Gst::ClockTime timestamp) |
| 1131 | { |
| 1132 | gst_base_transform_update_qos(gobj(), proportion, GstClockTimeDiff(diff), ((GstClockTime)(timestamp))); |
| 1133 | } |
| 1134 | |
| 1135 | void BaseTransform::set_gap_aware(bool gap_aware) |
| 1136 | { |
| 1137 | gst_base_transform_set_gap_aware(gobj(), static_cast<int>(gap_aware)); |
| 1138 | } |
| 1139 | |
| 1140 | void BaseTransform::reconfigure_sink() |
| 1141 | { |
| 1142 | gst_base_transform_reconfigure_sink(gobj()); |
| 1143 | } |
| 1144 | |
| 1145 | void BaseTransform::reconfigure_src() |
| 1146 | { |
| 1147 | gst_base_transform_reconfigure_src(gobj()); |
| 1148 | } |
| 1149 | |
| 1150 | void BaseTransform::set_prefer_passthrough(bool prefer_passthrough) |
| 1151 | { |
| 1152 | gst_base_transform_set_prefer_passthrough(gobj(), static_cast<int>(prefer_passthrough)); |
| 1153 | } |
| 1154 | |
| 1155 | bool BaseTransform::update_src_caps(const Glib::RefPtr<Gst::Caps>& updated_caps) |
| 1156 | { |
| 1157 | return gst_base_transform_update_src_caps(gobj(), Glib::unwrap(updated_caps)); |
| 1158 | } |
| 1159 | |
| 1160 | Glib::RefPtr<Gst::Pad> BaseTransform::get_sink_pad() |
| 1161 | { |
| 1162 | Glib::RefPtr<Gst::Pad> ref_ptr(Glib::wrap(gobj()->sinkpad)); |
| 1163 | |
| 1164 | if(ref_ptr) |
| 1165 | ref_ptr->reference(); |
| 1166 | |
| 1167 | return ref_ptr; |
| 1168 | } |
| 1169 | |
| 1170 | Glib::RefPtr<const Gst::Pad> BaseTransform::get_sink_pad() const |
| 1171 | { |
| 1172 | Glib::RefPtr<const Gst::Pad> ref_ptr(Glib::wrap(gobj()->sinkpad)); |
| 1173 | |
| 1174 | if(ref_ptr) |
| 1175 | ref_ptr->reference(); |
| 1176 | |
| 1177 | return ref_ptr; |
| 1178 | } |
| 1179 | |
| 1180 | Glib::RefPtr<Gst::Pad> BaseTransform::get_src_pad() |
| 1181 | { |
| 1182 | Glib::RefPtr<Gst::Pad> ref_ptr(Glib::wrap(gobj()->srcpad)); |
| 1183 | |
| 1184 | if(ref_ptr) |
| 1185 | ref_ptr->reference(); |
| 1186 | |
| 1187 | return ref_ptr; |
| 1188 | } |
| 1189 | |
| 1190 | Glib::RefPtr<const Gst::Pad> BaseTransform::get_src_pad() const |
| 1191 | { |
| 1192 | Glib::RefPtr<const Gst::Pad> ref_ptr(Glib::wrap(gobj()->srcpad)); |
| 1193 | |
| 1194 | if(ref_ptr) |
| 1195 | ref_ptr->reference(); |
| 1196 | |
| 1197 | return ref_ptr; |
| 1198 | } |
| 1199 | |
| 1200 | |
| 1201 | Glib::PropertyProxy< bool > BaseTransform::property_qos() |
| 1202 | { |
| 1203 | return Glib::PropertyProxy< bool >(this, "qos"); |
| 1204 | } |
| 1205 | |
| 1206 | Glib::PropertyProxy_ReadOnly< bool > BaseTransform::property_qos() const |
| 1207 | { |
| 1208 | return Glib::PropertyProxy_ReadOnly< bool >(this, "qos"); |
| 1209 | } |
| 1210 | |
| 1211 | |
| 1212 | Glib::RefPtr<Gst::Caps> Gst::BaseTransform::transform_caps_vfunc(PadDirection direction, const Glib::RefPtr<Gst::Caps>& caps, const Glib::RefPtr<Gst::Caps>& filter) |
| 1213 | { |
| 1214 | const auto base = static_cast<BaseClassType*>( |
| 1215 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1216 | ); |
| 1217 | |
| 1218 | if(base && base->transform_caps) |
| 1219 | { |
| 1220 | Glib::RefPtr<Gst::Caps> retval(Glib::wrap((*base->transform_caps)(gobj(),((GstPadDirection)(direction)),Glib::unwrap(caps),Glib::unwrap(filter)))); |
| 1221 | return retval; |
| 1222 | } |
| 1223 | |
| 1224 | using RType = Glib::RefPtr<Gst::Caps>; |
| 1225 | return RType(); |
| 1226 | } |
| 1227 | Glib::RefPtr<Gst::Caps> Gst::BaseTransform::fixate_caps_vfunc(PadDirection direction, const Glib::RefPtr<Gst::Caps>& caps, const Glib::RefPtr<Gst::Caps>& othercaps) |
| 1228 | { |
| 1229 | const auto base = static_cast<BaseClassType*>( |
| 1230 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1231 | ); |
| 1232 | |
| 1233 | if(base && base->fixate_caps) |
| 1234 | { |
| 1235 | Glib::RefPtr<Gst::Caps> retval(Glib::wrap((*base->fixate_caps)(gobj(),((GstPadDirection)(direction)),Glib::unwrap(caps),Glib::unwrap(othercaps)))); |
| 1236 | return retval; |
| 1237 | } |
| 1238 | |
| 1239 | using RType = Glib::RefPtr<Gst::Caps>; |
| 1240 | return RType(); |
| 1241 | } |
| 1242 | bool Gst::BaseTransform::get_unit_size_vfunc(const Glib::RefPtr<Gst::Caps>& caps, gsize& size) const |
| 1243 | { |
| 1244 | const auto base = static_cast<BaseClassType*>( |
| 1245 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1246 | ); |
| 1247 | |
| 1248 | if(base && base->get_unit_size) |
| 1249 | { |
| 1250 | bool retval((*base->get_unit_size)(const_cast<GstBaseTransform*>(gobj()),Glib::unwrap(caps),&(size))); |
| 1251 | return retval; |
| 1252 | } |
| 1253 | |
| 1254 | using RType = bool; |
| 1255 | return RType(); |
| 1256 | } |
| 1257 | bool Gst::BaseTransform::set_caps_vfunc(const Glib::RefPtr<Gst::Caps>& incaps, const Glib::RefPtr<Gst::Caps>& outcaps) |
| 1258 | { |
| 1259 | const auto base = static_cast<BaseClassType*>( |
| 1260 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1261 | ); |
| 1262 | |
| 1263 | if(base && base->set_caps) |
| 1264 | { |
| 1265 | bool retval((*base->set_caps)(gobj(),Glib::unwrap(incaps),Glib::unwrap(outcaps))); |
| 1266 | return retval; |
| 1267 | } |
| 1268 | |
| 1269 | return true; |
| 1270 | } |
| 1271 | FlowReturn Gst::BaseTransform::transform_ip_vfunc(const Glib::RefPtr<Gst::Buffer>& buf) |
| 1272 | { |
| 1273 | const auto base = static_cast<BaseClassType*>( |
| 1274 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1275 | ); |
| 1276 | |
| 1277 | if(base && base->transform_ip) |
| 1278 | { |
| 1279 | FlowReturn retval(((FlowReturn)((*base->transform_ip)(gobj(),Glib::unwrap(buf))))); |
| 1280 | return retval; |
| 1281 | } |
| 1282 | |
| 1283 | using RType = FlowReturn; |
| 1284 | return RType(); |
| 1285 | } |
| 1286 | bool Gst::BaseTransform::src_event_vfunc(const Glib::RefPtr<Gst::Event>& event) |
| 1287 | { |
| 1288 | const auto base = static_cast<BaseClassType*>( |
| 1289 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1290 | ); |
| 1291 | |
| 1292 | if(base && base->src_event) |
| 1293 | { |
| 1294 | bool retval((*base->src_event)(gobj(),Glib::unwrap(event))); |
| 1295 | return retval; |
| 1296 | } |
| 1297 | |
| 1298 | using RType = bool; |
| 1299 | return RType(); |
| 1300 | } |
| 1301 | bool Gst::BaseTransform::sink_event_vfunc(const Glib::RefPtr<Gst::Event>& event) |
| 1302 | { |
| 1303 | const auto base = static_cast<BaseClassType*>( |
| 1304 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1305 | ); |
| 1306 | |
| 1307 | if(base && base->sink_event) |
| 1308 | { |
| 1309 | bool retval((*base->sink_event)(gobj(),Glib::unwrap(event))); |
| 1310 | return retval; |
| 1311 | } |
| 1312 | |
| 1313 | using RType = bool; |
| 1314 | return RType(); |
| 1315 | } |
| 1316 | void Gst::BaseTransform::before_transform_vfunc(const Glib::RefPtr<Gst::Buffer>& buffer) |
| 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->before_transform) |
| 1323 | { |
| 1324 | (*base->before_transform)(gobj(),Glib::unwrap(buffer)); |
| 1325 | } |
| 1326 | } |
| 1327 | bool Gst::BaseTransform::accept_caps_vfunc(PadDirection direction, 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->accept_caps) |
| 1334 | { |
| 1335 | bool retval((*base->accept_caps)(gobj(),((GstPadDirection)(direction)),const_cast<GstCaps*>(Glib::unwrap(caps)))); |
| 1336 | return retval; |
| 1337 | } |
| 1338 | |
| 1339 | using RType = bool; |
| 1340 | return RType(); |
| 1341 | } |
| 1342 | bool Gst::BaseTransform::start_vfunc() |
| 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->start) |
| 1349 | { |
| 1350 | bool retval((*base->start)(gobj())); |
| 1351 | return retval; |
| 1352 | } |
| 1353 | |
| 1354 | return true; |
| 1355 | } |
| 1356 | bool Gst::BaseTransform::stop_vfunc() |
| 1357 | { |
| 1358 | const auto base = static_cast<BaseClassType*>( |
| 1359 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1360 | ); |
| 1361 | |
| 1362 | if(base && base->stop) |
| 1363 | { |
| 1364 | bool retval((*base->stop)(gobj())); |
| 1365 | return retval; |
| 1366 | } |
| 1367 | |
| 1368 | return true; |
| 1369 | } |
| 1370 | bool Gst::BaseTransform::filter_meta_vfunc(const Glib::RefPtr<Gst::Query>& query, GType api, const Gst::Structure& params) |
| 1371 | { |
| 1372 | const auto base = static_cast<BaseClassType*>( |
| 1373 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1374 | ); |
| 1375 | |
| 1376 | if(base && base->filter_meta) |
| 1377 | { |
| 1378 | bool retval((*base->filter_meta)(gobj(),Glib::unwrap(query),api,params.gobj())); |
| 1379 | return retval; |
| 1380 | } |
| 1381 | |
| 1382 | return true; |
| 1383 | } |
| 1384 | Gst::FlowReturn Gst::BaseTransform::submit_input_buffer_vfunc(bool is_discont, const Glib::RefPtr<Gst::Buffer>& input) |
| 1385 | { |
| 1386 | const auto base = static_cast<BaseClassType*>( |
| 1387 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1388 | ); |
| 1389 | |
| 1390 | if(base && base->submit_input_buffer) |
| 1391 | { |
| 1392 | Gst::FlowReturn retval(((Gst::FlowReturn)((*base->submit_input_buffer)(gobj(),static_cast<int>(is_discont),Glib::unwrap(input))))); |
| 1393 | return retval; |
| 1394 | } |
| 1395 | |
| 1396 | using RType = Gst::FlowReturn; |
| 1397 | return RType(); |
| 1398 | } |
| 1399 | bool Gst::BaseTransform::copy_metadata_vfunc(const Glib::RefPtr<Gst::Buffer>& input, const Glib::RefPtr<Gst::Buffer>& outbuf) |
| 1400 | { |
| 1401 | const auto base = static_cast<BaseClassType*>( |
| 1402 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1403 | ); |
| 1404 | |
| 1405 | if(base && base->copy_metadata) |
| 1406 | { |
| 1407 | bool retval((*base->copy_metadata)(gobj(),Glib::unwrap(input),Glib::unwrap(outbuf))); |
| 1408 | return retval; |
| 1409 | } |
| 1410 | |
| 1411 | using RType = bool; |
| 1412 | return RType(); |
| 1413 | } |
| 1414 | |
| 1415 | |
| 1416 | } // namespace Gst |
| 1417 | |
| 1418 |