| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | |
| 3 | |
| 4 | #include <glibmm.h> |
| 5 | |
| 6 | #include <gstreamermm/basesrc.h> |
| 7 | #include <gstreamermm/private/basesrc_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/caps.h> |
| 30 | #include <gstreamermm/buffer.h> |
| 31 | |
| 32 | |
| 33 | #define IGNORE_RESULT(x) { auto release_value = x; (void)release_value; } |
| 34 | |
| 35 | namespace Gst |
| 36 | { |
| 37 | |
| 38 | gboolean BaseSrc_Class::do_seek_vfunc_callback(GstBaseSrc* self, GstSegment* segment) |
| 39 | { |
| 40 | Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>( |
| 41 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 42 | |
| 43 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 44 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 45 | // generated classes can use this optimisation, which avoids the unnecessary |
| 46 | // parameter conversions if there is no possibility of the virtual function |
| 47 | // being overridden: |
| 48 | if(obj_base && obj_base->is_derived_()) |
| 49 | { |
| 50 | CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 51 | if(obj) // This can be NULL during destruction. |
| 52 | { |
| 53 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 54 | { |
| 55 | Gst::Segment cpp_segment(segment, true); |
| 56 | // Call the virtual member method, which derived classes might override. |
| 57 | return static_cast<int>(obj->do_seek_vfunc(cpp_segment)); |
| 58 | } |
| 59 | catch(...) |
| 60 | { |
| 61 | Glib::exception_handlers_invoke(); |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 67 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 68 | ); |
| 69 | |
| 70 | // Call the original underlying C function: |
| 71 | if(base && base->do_seek) |
| 72 | return (*base->do_seek)(self, segment); |
| 73 | |
| 74 | |
| 75 | typedef gboolean RType; |
| 76 | return RType(); |
| 77 | } |
| 78 | bool Gst::BaseSrc::do_seek_vfunc(Gst::Segment& segment) |
| 79 | { |
| 80 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 81 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 82 | ); |
| 83 | |
| 84 | if(base && base->do_seek) |
| 85 | return (*base->do_seek)(gobj(),(segment).gobj()); |
| 86 | |
| 87 | typedef bool RType; |
| 88 | return RType(); |
| 89 | } |
| 90 | gboolean BaseSrc_Class::prepare_seek_segment_vfunc_callback(GstBaseSrc* self, GstEvent* seek, GstSegment* segment) |
| 91 | { |
| 92 | Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>( |
| 93 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 94 | |
| 95 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 96 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 97 | // generated classes can use this optimisation, which avoids the unnecessary |
| 98 | // parameter conversions if there is no possibility of the virtual function |
| 99 | // being overridden: |
| 100 | if(obj_base && obj_base->is_derived_()) |
| 101 | { |
| 102 | CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 103 | if(obj) // This can be NULL during destruction. |
| 104 | { |
| 105 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 106 | { |
| 107 | // Call the virtual member method, which derived classes might override. |
| 108 | Gst::Segment cpp_segment(segment, true); |
| 109 | return static_cast<int>(obj->prepare_seek_segment_vfunc(Glib::wrap(seek, true) , cpp_segment)); |
| 110 | } |
| 111 | catch(...) |
| 112 | { |
| 113 | Glib::exception_handlers_invoke(); |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 119 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 120 | ); |
| 121 | |
| 122 | // Call the original underlying C function: |
| 123 | if(base && base->prepare_seek_segment) |
| 124 | return (*base->prepare_seek_segment)(self, seek, segment); |
| 125 | |
| 126 | |
| 127 | typedef gboolean RType; |
| 128 | return RType(); |
| 129 | } |
| 130 | bool Gst::BaseSrc::prepare_seek_segment_vfunc(const Glib::RefPtr<Gst::Event>& seek, Gst::Segment& segment) |
| 131 | { |
| 132 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 133 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 134 | ); |
| 135 | |
| 136 | if(base && base->prepare_seek_segment) |
| 137 | return (*base->prepare_seek_segment)(gobj(),Glib::unwrap(seek),(segment).gobj()); |
| 138 | |
| 139 | typedef bool RType; |
| 140 | return RType(); |
| 141 | } |
| 142 | GstFlowReturn BaseSrc_Class::create_vfunc_callback(GstBaseSrc* self, guint64 offset, guint size, GstBuffer** buf) |
| 143 | { |
| 144 | Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>( |
| 145 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 146 | |
| 147 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 148 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 149 | // generated classes can use this optimisation, which avoids the unnecessary |
| 150 | // parameter conversions if there is no possibility of the virtual function |
| 151 | // being overridden: |
| 152 | if(obj_base && obj_base->is_derived_()) |
| 153 | { |
| 154 | CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 155 | if(obj) // This can be NULL during destruction. |
| 156 | { |
| 157 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 158 | { |
| 159 | Glib::RefPtr<Gst::Buffer> cpp_buffer; |
| 160 | // Call the virtual member method, which derived classes might override. |
| 161 | GstFlowReturn const result = static_cast<GstFlowReturn>(obj->create_vfunc(offset, size, cpp_buffer)); |
| 162 | *buf = cpp_buffer ? cpp_buffer->gobj_copy() : 0; |
| 163 | return result; |
| 164 | } |
| 165 | catch(...) |
| 166 | { |
| 167 | Glib::exception_handlers_invoke(); |
| 168 | } |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 173 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 174 | ); |
| 175 | |
| 176 | // Call the original underlying C function: |
| 177 | if(base && base->create) |
| 178 | return (*base->create)(self, offset, size, buf); |
| 179 | |
| 180 | |
| 181 | typedef GstFlowReturn RType; |
| 182 | return RType(); |
| 183 | } |
| 184 | FlowReturn Gst::BaseSrc::create_vfunc(guint64 offset, guint size, Glib::RefPtr<Gst::Buffer>& buffer) |
| 185 | { |
| 186 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 187 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 188 | ); |
| 189 | |
| 190 | if(base && base->create) |
| 191 | { |
| 192 | GstBuffer* gst_buffer = NULL; |
| 193 | Gst::FlowReturn const result = |
| 194 | static_cast<FlowReturn>((*base->create)(gobj(),offset, size,&gst_buffer)); |
| 195 | buffer = Glib::wrap(gst_buffer, false); // Don't take copy because callback returns a newly created copy. |
| 196 | return result; |
| 197 | } |
| 198 | |
| 199 | typedef FlowReturn RType; |
| 200 | return RType(); |
| 201 | } |
| 202 | |
| 203 | Glib::RefPtr<Allocator> BaseSrc::get_allocator(AllocationParams& params) |
| 204 | { |
| 205 | GstAllocator* alloc; |
| 206 | gst_base_src_get_allocator(gobj(), &alloc, params.gobj()); |
| 207 | return Glib::wrap(alloc, false); |
| 208 | } |
| 209 | |
| 210 | gboolean BaseSrc_Class::query_vfunc_callback(GstBaseSrc* self, GstQuery* query) |
| 211 | { |
| 212 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 213 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 214 | |
| 215 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 216 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 217 | // generated classes can use this optimisation, which avoids the unnecessary |
| 218 | // parameter conversions if there is no possibility of the virtual function |
| 219 | // being overridden: |
| 220 | if(obj_base && obj_base->is_derived_()) |
| 221 | { |
| 222 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 223 | if(obj) // This can be NULL during destruction. |
| 224 | { |
| 225 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 226 | { |
| 227 | // Call the virtual member method, which derived classes might override. |
| 228 | auto query_cpp = Glib::wrap(query, false); |
| 229 | int ret = static_cast<int>(obj->base_src_query_vfunc(query_cpp)); |
| 230 | IGNORE_RESULT(query_cpp.release()); |
| 231 | return ret; |
| 232 | } |
| 233 | catch(...) |
| 234 | { |
| 235 | Glib::exception_handlers_invoke(); |
| 236 | } |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 241 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 242 | ); |
| 243 | |
| 244 | // Call the original underlying C function: |
| 245 | if(base && base->query) |
| 246 | { |
| 247 | gboolean retval = (*base->query)(self, query); |
| 248 | return retval; |
| 249 | } |
| 250 | |
| 251 | typedef gboolean RType; |
| 252 | return RType(); |
| 253 | } |
| 254 | |
| 255 | bool Gst::BaseSrc::base_src_query_vfunc(const Glib::RefPtr<Gst::Query>& query) |
| 256 | { |
| 257 | const auto base = static_cast<BaseClassType*>( |
| 258 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 259 | ); |
| 260 | |
| 261 | if(base && base->query) |
| 262 | { |
| 263 | bool retval((*base->query)(const_cast<GstBaseSrc*>(gobj()),Glib::unwrap(query))); |
| 264 | return retval; |
| 265 | } |
| 266 | |
| 267 | typedef bool RType; |
| 268 | return RType(); |
| 269 | } |
| 270 | |
| 271 | GstFlowReturn BaseSrc_Class::alloc_vfunc_callback(GstBaseSrc* self, guint64 offset, guint size, GstBuffer** buf) |
| 272 | { |
| 273 | Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>( |
| 274 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 275 | |
| 276 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 277 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 278 | // generated classes can use this optimisation, which avoids the unnecessary |
| 279 | // parameter conversions if there is no possibility of the virtual function |
| 280 | // being overridden: |
| 281 | if(obj_base && obj_base->is_derived_()) |
| 282 | { |
| 283 | CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 284 | if(obj) // This can be NULL during destruction. |
| 285 | { |
| 286 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 287 | { |
| 288 | Glib::RefPtr<Gst::Buffer> cpp_buffer; |
| 289 | // Call the virtual member method, which derived classes might override. |
| 290 | GstFlowReturn const result = static_cast<GstFlowReturn>(obj->alloc_vfunc(offset, size, cpp_buffer)); |
| 291 | *buf = cpp_buffer ? cpp_buffer->gobj_copy() : 0; |
| 292 | return result; |
| 293 | } |
| 294 | catch(...) |
| 295 | { |
| 296 | Glib::exception_handlers_invoke(); |
| 297 | } |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 302 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 303 | ); |
| 304 | |
| 305 | // Call the original underlying C function: |
| 306 | if(base && base->alloc) |
| 307 | return (*base->alloc)(self, offset, size, buf); |
| 308 | |
| 309 | |
| 310 | typedef GstFlowReturn RType; |
| 311 | return RType(); |
| 312 | } |
| 313 | FlowReturn Gst::BaseSrc::alloc_vfunc(guint64 offset, guint size, Glib::RefPtr<Gst::Buffer>& buffer) |
| 314 | { |
| 315 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 316 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 317 | ); |
| 318 | |
| 319 | if(base && base->alloc) |
| 320 | { |
| 321 | GstBuffer* gst_buffer = NULL; |
| 322 | Gst::FlowReturn const result = |
| 323 | static_cast<FlowReturn>((*base->alloc)(gobj(),offset, size,&gst_buffer)); |
| 324 | buffer = Glib::wrap(gst_buffer, false); // Don't take copy because callback returns a newly created copy. |
| 325 | return result; |
| 326 | } |
| 327 | |
| 328 | typedef FlowReturn RType; |
| 329 | return RType(); |
| 330 | } |
| 331 | |
| 332 | |
| 333 | } // namespace Gst |
| 334 | |
| 335 | namespace |
| 336 | { |
| 337 | } // anonymous namespace |
| 338 | |
| 339 | |
| 340 | namespace Glib |
| 341 | { |
| 342 | |
| 343 | Glib::RefPtr<Gst::BaseSrc> wrap(GstBaseSrc* object, bool take_copy) |
| 344 | { |
| 345 | return Glib::RefPtr<Gst::BaseSrc>( dynamic_cast<Gst::BaseSrc*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); |
| 346 | //We use dynamic_cast<> in case of multiple inheritance. |
| 347 | } |
| 348 | |
| 349 | } /* namespace Glib */ |
| 350 | |
| 351 | |
| 352 | namespace Gst |
| 353 | { |
| 354 | |
| 355 | |
| 356 | /* The *_Class implementation: */ |
| 357 | |
| 358 | const Glib::Class& BaseSrc_Class::init() |
| 359 | { |
| 360 | if(!gtype_) // create the GType if necessary |
| 361 | { |
| 362 | // Glib::Class has to know the class init function to clone custom types. |
| 363 | class_init_func_ = &BaseSrc_Class::class_init_function; |
| 364 | |
| 365 | // This is actually just optimized away, apparently with no harm. |
| 366 | // Make sure that the parent type has been created. |
| 367 | //CppClassParent::CppObjectType::get_type(); |
| 368 | |
| 369 | // Create the wrapper type, with the same class/instance size as the base type. |
| 370 | register_derived_type(gst_base_src_get_type()); |
| 371 | |
| 372 | // Add derived versions of interfaces, if the C type implements any interfaces: |
| 373 | |
| 374 | } |
| 375 | |
| 376 | return *this; |
| 377 | } |
| 378 | |
| 379 | |
| 380 | void BaseSrc_Class::class_init_function(void* g_class, void* class_data) |
| 381 | { |
| 382 | const auto klass = static_cast<BaseClassType*>(g_class); |
| 383 | CppClassParent::class_init_function(klass, class_data); |
| 384 | |
| 385 | klass->get_caps = &get_caps_vfunc_callback; |
| 386 | klass->set_caps = &set_caps_vfunc_callback; |
| 387 | klass->negotiate = &negotiate_vfunc_callback; |
| 388 | klass->stop = &stop_vfunc_callback; |
| 389 | klass->start = &start_vfunc_callback; |
| 390 | klass->get_times = &get_times_vfunc_callback; |
| 391 | klass->get_size = &get_size_vfunc_callback; |
| 392 | klass->is_seekable = &is_seekable_vfunc_callback; |
| 393 | klass->unlock = &unlock_vfunc_callback; |
| 394 | klass->event = &event_vfunc_callback; |
| 395 | klass->fixate = &fixate_vfunc_callback; |
| 396 | klass->unlock_stop = &unlock_stop_vfunc_callback; |
| 397 | klass->decide_allocation = &decide_allocation_vfunc_callback; |
| 398 | klass->fill = &fill_vfunc_callback; |
| 399 | klass->do_seek = &do_seek_vfunc_callback; |
| 400 | klass->prepare_seek_segment = &prepare_seek_segment_vfunc_callback; |
| 401 | klass->create = &create_vfunc_callback; |
| 402 | klass->query = &query_vfunc_callback; |
| 403 | klass->alloc = &alloc_vfunc_callback; |
| 404 | |
| 405 | } |
| 406 | |
| 407 | GstCaps* BaseSrc_Class::get_caps_vfunc_callback(GstBaseSrc* self, GstCaps* filter) |
| 408 | { |
| 409 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 410 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 411 | |
| 412 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 413 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 414 | // generated classes can use this optimisation, which avoids the unnecessary |
| 415 | // parameter conversions if there is no possibility of the virtual function |
| 416 | // being overridden: |
| 417 | if(obj_base && obj_base->is_derived_()) |
| 418 | { |
| 419 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 420 | if(obj) // This can be NULL during destruction. |
| 421 | { |
| 422 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 423 | { |
| 424 | // Call the virtual member method, which derived classes might override. |
| 425 | return Glib::unwrap_copy(obj->get_caps_vfunc(Glib::wrap(filter, true) |
| 426 | )); |
| 427 | } |
| 428 | catch(...) |
| 429 | { |
| 430 | Glib::exception_handlers_invoke(); |
| 431 | } |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 436 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 437 | ); |
| 438 | |
| 439 | // Call the original underlying C function: |
| 440 | if(base && base->get_caps) |
| 441 | return (*base->get_caps)(self, filter); |
| 442 | |
| 443 | using RType = GstCaps*; |
| 444 | return RType(); |
| 445 | } |
| 446 | gboolean BaseSrc_Class::set_caps_vfunc_callback(GstBaseSrc* self, GstCaps* caps) |
| 447 | { |
| 448 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 449 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 450 | |
| 451 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 452 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 453 | // generated classes can use this optimisation, which avoids the unnecessary |
| 454 | // parameter conversions if there is no possibility of the virtual function |
| 455 | // being overridden: |
| 456 | if(obj_base && obj_base->is_derived_()) |
| 457 | { |
| 458 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 459 | if(obj) // This can be NULL during destruction. |
| 460 | { |
| 461 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 462 | { |
| 463 | // Call the virtual member method, which derived classes might override. |
| 464 | return static_cast<int>(obj->set_caps_vfunc(Glib::wrap(caps, true) |
| 465 | )); |
| 466 | } |
| 467 | catch(...) |
| 468 | { |
| 469 | Glib::exception_handlers_invoke(); |
| 470 | } |
| 471 | } |
| 472 | } |
| 473 | |
| 474 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 475 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 476 | ); |
| 477 | |
| 478 | // Call the original underlying C function: |
| 479 | if(base && base->set_caps) |
| 480 | return (*base->set_caps)(self, caps); |
| 481 | |
| 482 | using RType = gboolean; |
| 483 | return RType(); |
| 484 | } |
| 485 | gboolean BaseSrc_Class::negotiate_vfunc_callback(GstBaseSrc* self) |
| 486 | { |
| 487 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 488 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 489 | |
| 490 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 491 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 492 | // generated classes can use this optimisation, which avoids the unnecessary |
| 493 | // parameter conversions if there is no possibility of the virtual function |
| 494 | // being overridden: |
| 495 | if(obj_base && obj_base->is_derived_()) |
| 496 | { |
| 497 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 498 | if(obj) // This can be NULL during destruction. |
| 499 | { |
| 500 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 501 | { |
| 502 | // Call the virtual member method, which derived classes might override. |
| 503 | return static_cast<int>(obj->negotiate_vfunc()); |
| 504 | } |
| 505 | catch(...) |
| 506 | { |
| 507 | Glib::exception_handlers_invoke(); |
| 508 | } |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 513 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 514 | ); |
| 515 | |
| 516 | // Call the original underlying C function: |
| 517 | if(base && base->negotiate) |
| 518 | return (*base->negotiate)(self); |
| 519 | |
| 520 | using RType = gboolean; |
| 521 | return RType(); |
| 522 | } |
| 523 | gboolean BaseSrc_Class::stop_vfunc_callback(GstBaseSrc* self) |
| 524 | { |
| 525 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 526 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 527 | |
| 528 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 529 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 530 | // generated classes can use this optimisation, which avoids the unnecessary |
| 531 | // parameter conversions if there is no possibility of the virtual function |
| 532 | // being overridden: |
| 533 | if(obj_base && obj_base->is_derived_()) |
| 534 | { |
| 535 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 536 | if(obj) // This can be NULL during destruction. |
| 537 | { |
| 538 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 539 | { |
| 540 | // Call the virtual member method, which derived classes might override. |
| 541 | return static_cast<int>(obj->stop_vfunc()); |
| 542 | } |
| 543 | catch(...) |
| 544 | { |
| 545 | Glib::exception_handlers_invoke(); |
| 546 | } |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 551 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 552 | ); |
| 553 | |
| 554 | // Call the original underlying C function: |
| 555 | if(base && base->stop) |
| 556 | return (*base->stop)(self); |
| 557 | |
| 558 | return static_cast<int>(true); |
| 559 | } |
| 560 | gboolean BaseSrc_Class::start_vfunc_callback(GstBaseSrc* self) |
| 561 | { |
| 562 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 563 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 564 | |
| 565 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 566 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 567 | // generated classes can use this optimisation, which avoids the unnecessary |
| 568 | // parameter conversions if there is no possibility of the virtual function |
| 569 | // being overridden: |
| 570 | if(obj_base && obj_base->is_derived_()) |
| 571 | { |
| 572 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 573 | if(obj) // This can be NULL during destruction. |
| 574 | { |
| 575 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 576 | { |
| 577 | // Call the virtual member method, which derived classes might override. |
| 578 | return static_cast<int>(obj->start_vfunc()); |
| 579 | } |
| 580 | catch(...) |
| 581 | { |
| 582 | Glib::exception_handlers_invoke(); |
| 583 | } |
| 584 | } |
| 585 | } |
| 586 | |
| 587 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 588 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 589 | ); |
| 590 | |
| 591 | // Call the original underlying C function: |
| 592 | if(base && base->start) |
| 593 | return (*base->start)(self); |
| 594 | |
| 595 | return static_cast<int>(true); |
| 596 | } |
| 597 | void BaseSrc_Class::get_times_vfunc_callback(GstBaseSrc* self, GstBuffer* buffer, GstClockTime* start, GstClockTime* end) |
| 598 | { |
| 599 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 600 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 601 | |
| 602 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 603 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 604 | // generated classes can use this optimisation, which avoids the unnecessary |
| 605 | // parameter conversions if there is no possibility of the virtual function |
| 606 | // being overridden: |
| 607 | if(obj_base && obj_base->is_derived_()) |
| 608 | { |
| 609 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 610 | if(obj) // This can be NULL during destruction. |
| 611 | { |
| 612 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 613 | { |
| 614 | // Call the virtual member method, which derived classes might override. |
| 615 | obj->get_times_vfunc(Glib::wrap(buffer, true) |
| 616 | , *(start) |
| 617 | , *(end) |
| 618 | ); |
| 619 | return; |
| 620 | } |
| 621 | catch(...) |
| 622 | { |
| 623 | Glib::exception_handlers_invoke(); |
| 624 | } |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 629 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 630 | ); |
| 631 | |
| 632 | // Call the original underlying C function: |
| 633 | if(base && base->get_times) |
| 634 | (*base->get_times)(self, buffer, start, end); |
| 635 | } |
| 636 | gboolean BaseSrc_Class::get_size_vfunc_callback(GstBaseSrc* self, guint64* size) |
| 637 | { |
| 638 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 639 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 640 | |
| 641 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 642 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 643 | // generated classes can use this optimisation, which avoids the unnecessary |
| 644 | // parameter conversions if there is no possibility of the virtual function |
| 645 | // being overridden: |
| 646 | if(obj_base && obj_base->is_derived_()) |
| 647 | { |
| 648 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 649 | if(obj) // This can be NULL during destruction. |
| 650 | { |
| 651 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 652 | { |
| 653 | // Call the virtual member method, which derived classes might override. |
| 654 | return static_cast<int>(obj->get_size_vfunc(*(size) |
| 655 | )); |
| 656 | } |
| 657 | catch(...) |
| 658 | { |
| 659 | Glib::exception_handlers_invoke(); |
| 660 | } |
| 661 | } |
| 662 | } |
| 663 | |
| 664 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 665 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 666 | ); |
| 667 | |
| 668 | // Call the original underlying C function: |
| 669 | if(base && base->get_size) |
| 670 | return (*base->get_size)(self, size); |
| 671 | |
| 672 | using RType = gboolean; |
| 673 | return RType(); |
| 674 | } |
| 675 | gboolean BaseSrc_Class::is_seekable_vfunc_callback(GstBaseSrc* self) |
| 676 | { |
| 677 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 678 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 679 | |
| 680 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 681 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 682 | // generated classes can use this optimisation, which avoids the unnecessary |
| 683 | // parameter conversions if there is no possibility of the virtual function |
| 684 | // being overridden: |
| 685 | if(obj_base && obj_base->is_derived_()) |
| 686 | { |
| 687 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 688 | if(obj) // This can be NULL during destruction. |
| 689 | { |
| 690 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 691 | { |
| 692 | // Call the virtual member method, which derived classes might override. |
| 693 | return static_cast<int>(obj->is_seekable_vfunc()); |
| 694 | } |
| 695 | catch(...) |
| 696 | { |
| 697 | Glib::exception_handlers_invoke(); |
| 698 | } |
| 699 | } |
| 700 | } |
| 701 | |
| 702 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 703 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 704 | ); |
| 705 | |
| 706 | // Call the original underlying C function: |
| 707 | if(base && base->is_seekable) |
| 708 | return (*base->is_seekable)(self); |
| 709 | |
| 710 | using RType = gboolean; |
| 711 | return RType(); |
| 712 | } |
| 713 | gboolean BaseSrc_Class::unlock_vfunc_callback(GstBaseSrc* self) |
| 714 | { |
| 715 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 716 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 717 | |
| 718 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 719 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 720 | // generated classes can use this optimisation, which avoids the unnecessary |
| 721 | // parameter conversions if there is no possibility of the virtual function |
| 722 | // being overridden: |
| 723 | if(obj_base && obj_base->is_derived_()) |
| 724 | { |
| 725 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 726 | if(obj) // This can be NULL during destruction. |
| 727 | { |
| 728 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 729 | { |
| 730 | // Call the virtual member method, which derived classes might override. |
| 731 | return static_cast<int>(obj->unlock_vfunc()); |
| 732 | } |
| 733 | catch(...) |
| 734 | { |
| 735 | Glib::exception_handlers_invoke(); |
| 736 | } |
| 737 | } |
| 738 | } |
| 739 | |
| 740 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 741 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 742 | ); |
| 743 | |
| 744 | // Call the original underlying C function: |
| 745 | if(base && base->unlock) |
| 746 | return (*base->unlock)(self); |
| 747 | |
| 748 | using RType = gboolean; |
| 749 | return RType(); |
| 750 | } |
| 751 | gboolean BaseSrc_Class::event_vfunc_callback(GstBaseSrc* self, GstEvent* event) |
| 752 | { |
| 753 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 754 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 755 | |
| 756 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 757 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 758 | // generated classes can use this optimisation, which avoids the unnecessary |
| 759 | // parameter conversions if there is no possibility of the virtual function |
| 760 | // being overridden: |
| 761 | if(obj_base && obj_base->is_derived_()) |
| 762 | { |
| 763 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 764 | if(obj) // This can be NULL during destruction. |
| 765 | { |
| 766 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 767 | { |
| 768 | // Call the virtual member method, which derived classes might override. |
| 769 | return static_cast<int>(obj->event_vfunc(Glib::wrap(event, true) |
| 770 | )); |
| 771 | } |
| 772 | catch(...) |
| 773 | { |
| 774 | Glib::exception_handlers_invoke(); |
| 775 | } |
| 776 | } |
| 777 | } |
| 778 | |
| 779 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 780 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 781 | ); |
| 782 | |
| 783 | // Call the original underlying C function: |
| 784 | if(base && base->event) |
| 785 | return (*base->event)(self, event); |
| 786 | |
| 787 | using RType = gboolean; |
| 788 | return RType(); |
| 789 | } |
| 790 | GstCaps* BaseSrc_Class::fixate_vfunc_callback(GstBaseSrc* self, GstCaps* caps) |
| 791 | { |
| 792 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 793 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 794 | |
| 795 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 796 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 797 | // generated classes can use this optimisation, which avoids the unnecessary |
| 798 | // parameter conversions if there is no possibility of the virtual function |
| 799 | // being overridden: |
| 800 | if(obj_base && obj_base->is_derived_()) |
| 801 | { |
| 802 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 803 | if(obj) // This can be NULL during destruction. |
| 804 | { |
| 805 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 806 | { |
| 807 | // Call the virtual member method, which derived classes might override. |
| 808 | return Glib::unwrap_copy(obj->fixate_vfunc(Glib::wrap(caps, true) |
| 809 | )); |
| 810 | } |
| 811 | catch(...) |
| 812 | { |
| 813 | Glib::exception_handlers_invoke(); |
| 814 | } |
| 815 | } |
| 816 | } |
| 817 | |
| 818 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 819 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 820 | ); |
| 821 | |
| 822 | // Call the original underlying C function: |
| 823 | if(base && base->fixate) |
| 824 | return (*base->fixate)(self, caps); |
| 825 | |
| 826 | using RType = GstCaps*; |
| 827 | return RType(); |
| 828 | } |
| 829 | gboolean BaseSrc_Class::unlock_stop_vfunc_callback(GstBaseSrc* self) |
| 830 | { |
| 831 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 832 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 833 | |
| 834 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 835 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 836 | // generated classes can use this optimisation, which avoids the unnecessary |
| 837 | // parameter conversions if there is no possibility of the virtual function |
| 838 | // being overridden: |
| 839 | if(obj_base && obj_base->is_derived_()) |
| 840 | { |
| 841 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 842 | if(obj) // This can be NULL during destruction. |
| 843 | { |
| 844 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 845 | { |
| 846 | // Call the virtual member method, which derived classes might override. |
| 847 | return static_cast<int>(obj->unlock_stop_vfunc()); |
| 848 | } |
| 849 | catch(...) |
| 850 | { |
| 851 | Glib::exception_handlers_invoke(); |
| 852 | } |
| 853 | } |
| 854 | } |
| 855 | |
| 856 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 857 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 858 | ); |
| 859 | |
| 860 | // Call the original underlying C function: |
| 861 | if(base && base->unlock_stop) |
| 862 | return (*base->unlock_stop)(self); |
| 863 | |
| 864 | using RType = gboolean; |
| 865 | return RType(); |
| 866 | } |
| 867 | gboolean BaseSrc_Class::decide_allocation_vfunc_callback(GstBaseSrc* self, GstQuery* query) |
| 868 | { |
| 869 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 870 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 871 | |
| 872 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 873 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 874 | // generated classes can use this optimisation, which avoids the unnecessary |
| 875 | // parameter conversions if there is no possibility of the virtual function |
| 876 | // being overridden: |
| 877 | if(obj_base && obj_base->is_derived_()) |
| 878 | { |
| 879 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 880 | if(obj) // This can be NULL during destruction. |
| 881 | { |
| 882 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 883 | { |
| 884 | // Call the virtual member method, which derived classes might override. |
| 885 | return static_cast<int>(obj->decide_allocation_vfunc(Glib::wrap(query, true) |
| 886 | )); |
| 887 | } |
| 888 | catch(...) |
| 889 | { |
| 890 | Glib::exception_handlers_invoke(); |
| 891 | } |
| 892 | } |
| 893 | } |
| 894 | |
| 895 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 896 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 897 | ); |
| 898 | |
| 899 | // Call the original underlying C function: |
| 900 | if(base && base->decide_allocation) |
| 901 | return (*base->decide_allocation)(self, query); |
| 902 | |
| 903 | using RType = gboolean; |
| 904 | return RType(); |
| 905 | } |
| 906 | GstFlowReturn BaseSrc_Class::fill_vfunc_callback(GstBaseSrc* self, guint64 offset, guint size, GstBuffer* buf) |
| 907 | { |
| 908 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 909 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 910 | |
| 911 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 912 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 913 | // generated classes can use this optimisation, which avoids the unnecessary |
| 914 | // parameter conversions if there is no possibility of the virtual function |
| 915 | // being overridden: |
| 916 | if(obj_base && obj_base->is_derived_()) |
| 917 | { |
| 918 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 919 | if(obj) // This can be NULL during destruction. |
| 920 | { |
| 921 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 922 | { |
| 923 | // Call the virtual member method, which derived classes might override. |
| 924 | return ((GstFlowReturn)(obj->fill_vfunc(offset, size, Glib::wrap(buf, true) |
| 925 | ))); |
| 926 | } |
| 927 | catch(...) |
| 928 | { |
| 929 | Glib::exception_handlers_invoke(); |
| 930 | } |
| 931 | } |
| 932 | } |
| 933 | |
| 934 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 935 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 936 | ); |
| 937 | |
| 938 | // Call the original underlying C function: |
| 939 | if(base && base->fill) |
| 940 | return (*base->fill)(self, offset, size, buf); |
| 941 | |
| 942 | using RType = GstFlowReturn; |
| 943 | return RType(); |
| 944 | } |
| 945 | |
| 946 | |
| 947 | Glib::ObjectBase* BaseSrc_Class::wrap_new(GObject* object) |
| 948 | { |
| 949 | return new BaseSrc((GstBaseSrc*)object); |
| 950 | } |
| 951 | |
| 952 | |
| 953 | /* The implementation: */ |
| 954 | |
| 955 | GstBaseSrc* BaseSrc::gobj_copy() |
| 956 | { |
| 957 | reference(); |
| 958 | return gobj(); |
| 959 | } |
| 960 | |
| 961 | BaseSrc::BaseSrc(const Glib::ConstructParams& construct_params) |
| 962 | : |
| 963 | Element(construct_params) |
| 964 | { |
| 965 | |
| 966 | } |
| 967 | |
| 968 | BaseSrc::BaseSrc(GstBaseSrc* castitem) |
| 969 | : |
| 970 | Element((GstElement*)(castitem)) |
| 971 | {} |
| 972 | |
| 973 | |
| 974 | BaseSrc::BaseSrc(BaseSrc&& src) noexcept |
| 975 | : Element(std::move(src)) |
| 976 | {} |
| 977 | |
| 978 | BaseSrc& BaseSrc::operator=(BaseSrc&& src) noexcept |
| 979 | { |
| 980 | Element::operator=(std::move(src)); |
| 981 | return *this; |
| 982 | } |
| 983 | |
| 984 | |
| 985 | BaseSrc::~BaseSrc() noexcept |
| 986 | {} |
| 987 | |
| 988 | |
| 989 | BaseSrc::CppClassType BaseSrc::basesrc_class_; // initialize static member |
| 990 | |
| 991 | GType BaseSrc::get_type() |
| 992 | { |
| 993 | return basesrc_class_.init().get_type(); |
| 994 | } |
| 995 | |
| 996 | |
| 997 | GType BaseSrc::get_base_type() |
| 998 | { |
| 999 | return gst_base_src_get_type(); |
| 1000 | } |
| 1001 | |
| 1002 | |
| 1003 | FlowReturn BaseSrc::wait_playing() |
| 1004 | { |
| 1005 | return ((FlowReturn)(gst_base_src_wait_playing(gobj()))); |
| 1006 | } |
| 1007 | |
| 1008 | bool BaseSrc::is_live() const |
| 1009 | { |
| 1010 | return gst_base_src_is_live(const_cast<GstBaseSrc*>(gobj())); |
| 1011 | } |
| 1012 | |
| 1013 | void BaseSrc::set_live(bool live) |
| 1014 | { |
| 1015 | gst_base_src_set_live(gobj(), static_cast<int>(live)); |
| 1016 | } |
| 1017 | |
| 1018 | void BaseSrc::set_format(Format format) |
| 1019 | { |
| 1020 | gst_base_src_set_format(gobj(), ((GstFormat)(format))); |
| 1021 | } |
| 1022 | |
| 1023 | bool BaseSrc::query_latency(bool& live, Gst::ClockTime& min_latency, Gst::ClockTime& max_latency) const |
| 1024 | { |
| 1025 | return gst_base_src_query_latency(const_cast<GstBaseSrc*>(gobj()), ((gboolean*) &(live)), (GstClockTime*)(&min_latency), (GstClockTime*)(&max_latency)); |
| 1026 | } |
| 1027 | |
| 1028 | guint BaseSrc::get_blocksize() const |
| 1029 | { |
| 1030 | return gst_base_src_get_blocksize(const_cast<GstBaseSrc*>(gobj())); |
| 1031 | } |
| 1032 | |
| 1033 | void BaseSrc::set_blocksize(guint blocksize) |
| 1034 | { |
| 1035 | gst_base_src_set_blocksize(gobj(), blocksize); |
| 1036 | } |
| 1037 | |
| 1038 | bool BaseSrc::get_do_timestamp() const |
| 1039 | { |
| 1040 | return gst_base_src_get_do_timestamp(const_cast<GstBaseSrc*>(gobj())); |
| 1041 | } |
| 1042 | |
| 1043 | void BaseSrc::set_do_timestamp(bool timestamp) |
| 1044 | { |
| 1045 | gst_base_src_set_do_timestamp(gobj(), static_cast<int>(timestamp)); |
| 1046 | } |
| 1047 | |
| 1048 | bool BaseSrc::new_seamless_segment(gint64 start, gint64 stop, gint64 position) |
| 1049 | { |
| 1050 | return gst_base_src_new_seamless_segment(gobj(), start, stop, position); |
| 1051 | } |
| 1052 | |
| 1053 | bool BaseSrc::set_caps(const Glib::RefPtr<Gst::Caps>& caps) |
| 1054 | { |
| 1055 | return gst_base_src_set_caps(gobj(), Glib::unwrap(caps)); |
| 1056 | } |
| 1057 | |
| 1058 | Gst::FlowReturn BaseSrc::start_wait() |
| 1059 | { |
| 1060 | return ((Gst::FlowReturn)(gst_base_src_start_wait(gobj()))); |
| 1061 | } |
| 1062 | |
| 1063 | void BaseSrc::set_dynamic_size(bool dynamic_size) |
| 1064 | { |
| 1065 | gst_base_src_set_dynamic_size(gobj(), static_cast<int>(dynamic_size)); |
| 1066 | } |
| 1067 | |
| 1068 | void BaseSrc::set_async(bool async) |
| 1069 | { |
| 1070 | gst_base_src_set_async(gobj(), static_cast<int>(async)); |
| 1071 | } |
| 1072 | |
| 1073 | bool BaseSrc::is_async() const |
| 1074 | { |
| 1075 | return gst_base_src_is_async(const_cast<GstBaseSrc*>(gobj())); |
| 1076 | } |
| 1077 | |
| 1078 | void BaseSrc::start_complete(Gst::FlowReturn ret) |
| 1079 | { |
| 1080 | gst_base_src_start_complete(gobj(), ((GstFlowReturn)(ret))); |
| 1081 | } |
| 1082 | |
| 1083 | void BaseSrc::set_automatic_eos(bool automatic_eos) |
| 1084 | { |
| 1085 | gst_base_src_set_automatic_eos(gobj(), static_cast<int>(automatic_eos)); |
| 1086 | } |
| 1087 | |
| 1088 | Glib::RefPtr<Gst::Pad> BaseSrc::get_src_pad() |
| 1089 | { |
| 1090 | Glib::RefPtr<Gst::Pad> ref_ptr(Glib::wrap(gobj()->srcpad)); |
| 1091 | |
| 1092 | if(ref_ptr) |
| 1093 | ref_ptr->reference(); |
| 1094 | |
| 1095 | return ref_ptr; |
| 1096 | } |
| 1097 | |
| 1098 | Glib::RefPtr<const Gst::Pad> BaseSrc::get_src_pad() const |
| 1099 | { |
| 1100 | Glib::RefPtr<const Gst::Pad> ref_ptr(Glib::wrap(gobj()->srcpad)); |
| 1101 | |
| 1102 | if(ref_ptr) |
| 1103 | ref_ptr->reference(); |
| 1104 | |
| 1105 | return ref_ptr; |
| 1106 | } |
| 1107 | |
| 1108 | |
| 1109 | Glib::PropertyProxy< gulong > BaseSrc::property_blocksize() |
| 1110 | { |
| 1111 | return Glib::PropertyProxy< gulong >(this, "blocksize"); |
| 1112 | } |
| 1113 | |
| 1114 | Glib::PropertyProxy_ReadOnly< gulong > BaseSrc::property_blocksize() const |
| 1115 | { |
| 1116 | return Glib::PropertyProxy_ReadOnly< gulong >(this, "blocksize"); |
| 1117 | } |
| 1118 | |
| 1119 | Glib::PropertyProxy< bool > BaseSrc::property_do_timestamp() |
| 1120 | { |
| 1121 | return Glib::PropertyProxy< bool >(this, "do-timestamp"); |
| 1122 | } |
| 1123 | |
| 1124 | Glib::PropertyProxy_ReadOnly< bool > BaseSrc::property_do_timestamp() const |
| 1125 | { |
| 1126 | return Glib::PropertyProxy_ReadOnly< bool >(this, "do-timestamp"); |
| 1127 | } |
| 1128 | |
| 1129 | Glib::PropertyProxy< int > BaseSrc::property_num_buffers() |
| 1130 | { |
| 1131 | return Glib::PropertyProxy< int >(this, "num-buffers"); |
| 1132 | } |
| 1133 | |
| 1134 | Glib::PropertyProxy_ReadOnly< int > BaseSrc::property_num_buffers() const |
| 1135 | { |
| 1136 | return Glib::PropertyProxy_ReadOnly< int >(this, "num-buffers"); |
| 1137 | } |
| 1138 | |
| 1139 | Glib::PropertyProxy< bool > BaseSrc::property_typefind() |
| 1140 | { |
| 1141 | return Glib::PropertyProxy< bool >(this, "typefind"); |
| 1142 | } |
| 1143 | |
| 1144 | Glib::PropertyProxy_ReadOnly< bool > BaseSrc::property_typefind() const |
| 1145 | { |
| 1146 | return Glib::PropertyProxy_ReadOnly< bool >(this, "typefind"); |
| 1147 | } |
| 1148 | |
| 1149 | |
| 1150 | Glib::RefPtr<Gst::Caps> Gst::BaseSrc::get_caps_vfunc(const Glib::RefPtr<Gst::Caps>& caps) const |
| 1151 | { |
| 1152 | const auto base = static_cast<BaseClassType*>( |
| 1153 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1154 | ); |
| 1155 | |
| 1156 | if(base && base->get_caps) |
| 1157 | { |
| 1158 | Glib::RefPtr<Gst::Caps> retval(Glib::wrap((*base->get_caps)(const_cast<GstBaseSrc*>(gobj()),Glib::unwrap(caps)))); |
| 1159 | return retval; |
| 1160 | } |
| 1161 | |
| 1162 | using RType = Glib::RefPtr<Gst::Caps>; |
| 1163 | return RType(); |
| 1164 | } |
| 1165 | bool Gst::BaseSrc::set_caps_vfunc(const Glib::RefPtr<Gst::Caps>& caps) |
| 1166 | { |
| 1167 | const auto base = static_cast<BaseClassType*>( |
| 1168 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1169 | ); |
| 1170 | |
| 1171 | if(base && base->set_caps) |
| 1172 | { |
| 1173 | bool retval((*base->set_caps)(gobj(),Glib::unwrap(caps))); |
| 1174 | return retval; |
| 1175 | } |
| 1176 | |
| 1177 | using RType = bool; |
| 1178 | return RType(); |
| 1179 | } |
| 1180 | bool Gst::BaseSrc::negotiate_vfunc() |
| 1181 | { |
| 1182 | const auto base = static_cast<BaseClassType*>( |
| 1183 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1184 | ); |
| 1185 | |
| 1186 | if(base && base->negotiate) |
| 1187 | { |
| 1188 | bool retval((*base->negotiate)(gobj())); |
| 1189 | return retval; |
| 1190 | } |
| 1191 | |
| 1192 | using RType = bool; |
| 1193 | return RType(); |
| 1194 | } |
| 1195 | bool Gst::BaseSrc::stop_vfunc() |
| 1196 | { |
| 1197 | const auto base = static_cast<BaseClassType*>( |
| 1198 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1199 | ); |
| 1200 | |
| 1201 | if(base && base->stop) |
| 1202 | { |
| 1203 | bool retval((*base->stop)(gobj())); |
| 1204 | return retval; |
| 1205 | } |
| 1206 | |
| 1207 | return true; |
| 1208 | } |
| 1209 | bool Gst::BaseSrc::start_vfunc() |
| 1210 | { |
| 1211 | const auto base = static_cast<BaseClassType*>( |
| 1212 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1213 | ); |
| 1214 | |
| 1215 | if(base && base->start) |
| 1216 | { |
| 1217 | bool retval((*base->start)(gobj())); |
| 1218 | return retval; |
| 1219 | } |
| 1220 | |
| 1221 | return true; |
| 1222 | } |
| 1223 | void Gst::BaseSrc::get_times_vfunc(const Glib::RefPtr<Gst::Buffer>& buffer, Gst::ClockTime& start, Gst::ClockTime& end) const |
| 1224 | { |
| 1225 | const auto base = static_cast<BaseClassType*>( |
| 1226 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1227 | ); |
| 1228 | |
| 1229 | if(base && base->get_times) |
| 1230 | { |
| 1231 | (*base->get_times)(const_cast<GstBaseSrc*>(gobj()),Glib::unwrap(buffer),(GstClockTime*)(&start),(GstClockTime*)(&end)); |
| 1232 | } |
| 1233 | } |
| 1234 | bool Gst::BaseSrc::get_size_vfunc(guint64& size) const |
| 1235 | { |
| 1236 | const auto base = static_cast<BaseClassType*>( |
| 1237 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1238 | ); |
| 1239 | |
| 1240 | if(base && base->get_size) |
| 1241 | { |
| 1242 | bool retval((*base->get_size)(const_cast<GstBaseSrc*>(gobj()),&(size))); |
| 1243 | return retval; |
| 1244 | } |
| 1245 | |
| 1246 | using RType = bool; |
| 1247 | return RType(); |
| 1248 | } |
| 1249 | bool Gst::BaseSrc::is_seekable_vfunc() const |
| 1250 | { |
| 1251 | const auto base = static_cast<BaseClassType*>( |
| 1252 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1253 | ); |
| 1254 | |
| 1255 | if(base && base->is_seekable) |
| 1256 | { |
| 1257 | bool retval((*base->is_seekable)(const_cast<GstBaseSrc*>(gobj()))); |
| 1258 | return retval; |
| 1259 | } |
| 1260 | |
| 1261 | using RType = bool; |
| 1262 | return RType(); |
| 1263 | } |
| 1264 | bool Gst::BaseSrc::unlock_vfunc() |
| 1265 | { |
| 1266 | const auto base = static_cast<BaseClassType*>( |
| 1267 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1268 | ); |
| 1269 | |
| 1270 | if(base && base->unlock) |
| 1271 | { |
| 1272 | bool retval((*base->unlock)(gobj())); |
| 1273 | return retval; |
| 1274 | } |
| 1275 | |
| 1276 | using RType = bool; |
| 1277 | return RType(); |
| 1278 | } |
| 1279 | bool Gst::BaseSrc::event_vfunc(const Glib::RefPtr<Gst::Event>& event) |
| 1280 | { |
| 1281 | const auto base = static_cast<BaseClassType*>( |
| 1282 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1283 | ); |
| 1284 | |
| 1285 | if(base && base->event) |
| 1286 | { |
| 1287 | bool retval((*base->event)(gobj(),Glib::unwrap(event))); |
| 1288 | return retval; |
| 1289 | } |
| 1290 | |
| 1291 | using RType = bool; |
| 1292 | return RType(); |
| 1293 | } |
| 1294 | Glib::RefPtr<Gst::Caps> Gst::BaseSrc::fixate_vfunc(const Glib::RefPtr<Gst::Caps>& caps) |
| 1295 | { |
| 1296 | const auto base = static_cast<BaseClassType*>( |
| 1297 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1298 | ); |
| 1299 | |
| 1300 | if(base && base->fixate) |
| 1301 | { |
| 1302 | Glib::RefPtr<Gst::Caps> retval(Glib::wrap((*base->fixate)(gobj(),Glib::unwrap(caps)))); |
| 1303 | return retval; |
| 1304 | } |
| 1305 | |
| 1306 | using RType = Glib::RefPtr<Gst::Caps>; |
| 1307 | return RType(); |
| 1308 | } |
| 1309 | bool Gst::BaseSrc::unlock_stop_vfunc() |
| 1310 | { |
| 1311 | const auto base = static_cast<BaseClassType*>( |
| 1312 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1313 | ); |
| 1314 | |
| 1315 | if(base && base->unlock_stop) |
| 1316 | { |
| 1317 | bool retval((*base->unlock_stop)(gobj())); |
| 1318 | return retval; |
| 1319 | } |
| 1320 | |
| 1321 | using RType = bool; |
| 1322 | return RType(); |
| 1323 | } |
| 1324 | bool Gst::BaseSrc::decide_allocation_vfunc(const Glib::RefPtr<Gst::Query>& query) |
| 1325 | { |
| 1326 | const auto base = static_cast<BaseClassType*>( |
| 1327 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1328 | ); |
| 1329 | |
| 1330 | if(base && base->decide_allocation) |
| 1331 | { |
| 1332 | bool retval((*base->decide_allocation)(gobj(),Glib::unwrap(query))); |
| 1333 | return retval; |
| 1334 | } |
| 1335 | |
| 1336 | using RType = bool; |
| 1337 | return RType(); |
| 1338 | } |
| 1339 | Gst::FlowReturn Gst::BaseSrc::fill_vfunc(guint64 offset, guint size, const Glib::RefPtr<Gst::Buffer>& buffer) |
| 1340 | { |
| 1341 | const auto base = static_cast<BaseClassType*>( |
| 1342 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 1343 | ); |
| 1344 | |
| 1345 | if(base && base->fill) |
| 1346 | { |
| 1347 | Gst::FlowReturn retval(((Gst::FlowReturn)((*base->fill)(gobj(),offset,size,Glib::unwrap(buffer))))); |
| 1348 | return retval; |
| 1349 | } |
| 1350 | |
| 1351 | using RType = Gst::FlowReturn; |
| 1352 | return RType(); |
| 1353 | } |
| 1354 | |
| 1355 | |
| 1356 | } // namespace Gst |
| 1357 | |
| 1358 |