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