| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | |
| 3 | |
| 4 | #include <glibmm.h> |
| 5 | |
| 6 | #include <gstreamermm/clock.h> |
| 7 | #include <gstreamermm/private/clock_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 | |
| 30 | namespace |
| 31 | { |
| 32 | |
| 33 | extern "C" |
| 34 | { |
| 35 | |
| 36 | static gboolean ClockID_Clock_gstreamermm_callback(GstClock* clock, GstClockTime time, GstClockID id, void* data) |
| 37 | { |
| 38 | Gst::ClockID::SlotClock* the_slot = static_cast<Gst::ClockID::SlotClock*>(data); |
| 39 | |
| 40 | try |
| 41 | { |
| 42 | bool result = (*the_slot)(Glib::wrap(clock, true), time, |
| 43 | Glib::wrap(reinterpret_cast<GstClockEntry*>(id), true)); |
| 44 | |
| 45 | //Delete the once executing slot before returning result |
| 46 | delete the_slot; |
| 47 | |
| 48 | return result; |
| 49 | } |
| 50 | catch(...) |
| 51 | { |
| 52 | Glib::exception_handlers_invoke(); |
| 53 | } |
| 54 | |
| 55 | return false; |
| 56 | } |
| 57 | |
| 58 | |
| 59 | static void ClockID_Clock_gstreamermm_callback_destroy(void* data) |
| 60 | { |
| 61 | delete static_cast<Gst::ClockID::SlotClock*>(data); |
| 62 | } |
| 63 | |
| 64 | } // extern "C" |
| 65 | |
| 66 | } // anonymous namespace |
| 67 | |
| 68 | namespace Gst |
| 69 | { |
| 70 | |
| 71 | ClockReturn ClockID::wait_async(const SlotClock& slot) |
| 72 | { |
| 73 | SlotClock* slot_copy = new SlotClock(slot); |
| 74 | return static_cast<ClockReturn>(gst_clock_id_wait_async(gobj(), &ClockID_Clock_gstreamermm_callback, slot_copy, &ClockID_Clock_gstreamermm_callback_destroy)); |
| 75 | } |
| 76 | |
| 77 | } |
| 78 | |
| 79 | namespace |
| 80 | { |
| 81 | |
| 82 | |
| 83 | static void Clock_signal_synced_callback(GstClock* self, gboolean p0,void* data) |
| 84 | { |
| 85 | using namespace Gst; |
| 86 | using SlotType = sigc::slot< void,bool >; |
| 87 | |
| 88 | auto obj = dynamic_cast<Clock*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self)); |
| 89 | // Do not try to call a signal on a disassociated wrapper. |
| 90 | if(obj) |
| 91 | { |
| 92 | try |
| 93 | { |
| 94 | if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data)) |
| 95 | (*static_cast<SlotType*>(slot))(p0 |
| 96 | ); |
| 97 | } |
| 98 | catch(...) |
| 99 | { |
| 100 | Glib::exception_handlers_invoke(); |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | static const Glib::SignalProxyInfo Clock_signal_synced_info = |
| 106 | { |
| 107 | "synced", |
| 108 | (GCallback) &Clock_signal_synced_callback, |
| 109 | (GCallback) &Clock_signal_synced_callback |
| 110 | }; |
| 111 | |
| 112 | |
| 113 | } // anonymous namespace |
| 114 | |
| 115 | |
| 116 | /* Why reinterpret_cast<ClockID*>(gobject) is needed: |
| 117 | * |
| 118 | * A ClockID instance is in fact always a GstClockEntry instance. |
| 119 | * Unfortunately, GstClockEntry cannot be a member of ClockID, |
| 120 | * because it is an opaque struct. Also, the C interface does not provide |
| 121 | * any hooks to install a destroy notification handler, thus we cannot |
| 122 | * wrap it dynamically either. |
| 123 | * |
| 124 | * The cast works because ClockID does not have any member data, and |
| 125 | * it is impossible to derive from it. This is ensured by using final on the |
| 126 | * class and by using = delete on the default constructor. |
| 127 | */ |
| 128 | |
| 129 | namespace Glib |
| 130 | { |
| 131 | |
| 132 | Glib::RefPtr<Gst::ClockID> wrap(GstClockEntry* object, bool take_copy) |
| 133 | { |
| 134 | if(take_copy && object) |
| 135 | gst_clock_id_ref(object); |
| 136 | |
| 137 | // See the comment at the top of this file, if you want to know why the cast works. |
| 138 | return Glib::RefPtr<Gst::ClockID>(reinterpret_cast<Gst::ClockID*>(object)); |
| 139 | } |
| 140 | |
| 141 | } // namespace Glib |
| 142 | |
| 143 | |
| 144 | namespace Gst |
| 145 | { |
| 146 | |
| 147 | |
| 148 | void ClockID::reference() const |
| 149 | { |
| 150 | // See the comment at the top of this file, if you want to know why the cast works. |
| 151 | gst_clock_id_ref(reinterpret_cast<GstClockEntry*>(const_cast<ClockID*>(this))); |
| 152 | } |
| 153 | |
| 154 | void ClockID::unreference() const |
| 155 | { |
| 156 | // See the comment at the top of this file, if you want to know why the cast works. |
| 157 | gst_clock_id_unref(reinterpret_cast<GstClockEntry*>(const_cast<ClockID*>(this))); |
| 158 | } |
| 159 | |
| 160 | GstClockEntry* ClockID::gobj() |
| 161 | { |
| 162 | // See the comment at the top of this file, if you want to know why the cast works. |
| 163 | return reinterpret_cast<GstClockEntry*>(this); |
| 164 | } |
| 165 | |
| 166 | const GstClockEntry* ClockID::gobj() const |
| 167 | { |
| 168 | // See the comment at the top of this file, if you want to know why the cast works. |
| 169 | return reinterpret_cast<const GstClockEntry*>(this); |
| 170 | } |
| 171 | |
| 172 | GstClockEntry* ClockID::gobj_copy() const |
| 173 | { |
| 174 | // See the comment at the top of this file, if you want to know why the cast works. |
| 175 | const auto gobject = reinterpret_cast<GstClockEntry*>(const_cast<ClockID*>(this)); |
| 176 | gst_clock_id_ref(gobject); |
| 177 | return gobject; |
| 178 | } |
| 179 | |
| 180 | |
| 181 | Gst::ClockTime ClockID::get_time() const |
| 182 | { |
| 183 | return ((Gst::ClockTime)(gst_clock_id_get_time(const_cast<GstClockEntry*>(gobj())))); |
| 184 | } |
| 185 | |
| 186 | ClockReturn ClockID::wait(Gst::ClockTimeDiff& jitter) |
| 187 | { |
| 188 | return ((ClockReturn)(gst_clock_id_wait(gobj(), (GstClockTimeDiff*)(&jitter)))); |
| 189 | } |
| 190 | |
| 191 | ClockReturn ClockID::wait() |
| 192 | { |
| 193 | return ((ClockReturn)(gst_clock_id_wait(gobj(), nullptr))); |
| 194 | } |
| 195 | |
| 196 | void ClockID::unschedule() |
| 197 | { |
| 198 | gst_clock_id_unschedule(gobj()); |
| 199 | } |
| 200 | |
| 201 | |
| 202 | } // namespace Gst |
| 203 | |
| 204 | |
| 205 | namespace Glib |
| 206 | { |
| 207 | |
| 208 | Glib::RefPtr<Gst::Clock> wrap(GstClock* object, bool take_copy) |
| 209 | { |
| 210 | return Glib::RefPtr<Gst::Clock>( dynamic_cast<Gst::Clock*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); |
| 211 | //We use dynamic_cast<> in case of multiple inheritance. |
| 212 | } |
| 213 | |
| 214 | } /* namespace Glib */ |
| 215 | |
| 216 | |
| 217 | namespace Gst |
| 218 | { |
| 219 | |
| 220 | |
| 221 | /* The *_Class implementation: */ |
| 222 | |
| 223 | const Glib::Class& Clock_Class::init() |
| 224 | { |
| 225 | if(!gtype_) // create the GType if necessary |
| 226 | { |
| 227 | // Glib::Class has to know the class init function to clone custom types. |
| 228 | class_init_func_ = &Clock_Class::class_init_function; |
| 229 | |
| 230 | // This is actually just optimized away, apparently with no harm. |
| 231 | // Make sure that the parent type has been created. |
| 232 | //CppClassParent::CppObjectType::get_type(); |
| 233 | |
| 234 | // Create the wrapper type, with the same class/instance size as the base type. |
| 235 | register_derived_type(gst_clock_get_type()); |
| 236 | |
| 237 | // Add derived versions of interfaces, if the C type implements any interfaces: |
| 238 | |
| 239 | } |
| 240 | |
| 241 | return *this; |
| 242 | } |
| 243 | |
| 244 | |
| 245 | void Clock_Class::class_init_function(void* g_class, void* class_data) |
| 246 | { |
| 247 | const auto klass = static_cast<BaseClassType*>(g_class); |
| 248 | CppClassParent::class_init_function(klass, class_data); |
| 249 | |
| 250 | klass->change_resolution = &change_resolution_vfunc_callback; |
| 251 | klass->get_resolution = &get_resolution_vfunc_callback; |
| 252 | klass->get_internal_time = &get_internal_time_vfunc_callback; |
| 253 | klass->wait = &wait_vfunc_callback; |
| 254 | klass->wait_async = &wait_async_vfunc_callback; |
| 255 | klass->unschedule = &unschedule_vfunc_callback; |
| 256 | |
| 257 | } |
| 258 | |
| 259 | GstClockTime Clock_Class::change_resolution_vfunc_callback(GstClock* self, GstClockTime old_resolution, GstClockTime new_resolution) |
| 260 | { |
| 261 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 262 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 263 | |
| 264 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 265 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 266 | // generated classes can use this optimisation, which avoids the unnecessary |
| 267 | // parameter conversions if there is no possibility of the virtual function |
| 268 | // being overridden: |
| 269 | if(obj_base && obj_base->is_derived_()) |
| 270 | { |
| 271 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 272 | if(obj) // This can be NULL during destruction. |
| 273 | { |
| 274 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 275 | { |
| 276 | // Call the virtual member method, which derived classes might override. |
| 277 | return ((GstClockTime)(obj->change_resolution_vfunc(((Gst::ClockTime)(old_resolution)) |
| 278 | , ((Gst::ClockTime)(new_resolution)) |
| 279 | ))); |
| 280 | } |
| 281 | catch(...) |
| 282 | { |
| 283 | Glib::exception_handlers_invoke(); |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 289 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 290 | ); |
| 291 | |
| 292 | // Call the original underlying C function: |
| 293 | if(base && base->change_resolution) |
| 294 | return (*base->change_resolution)(self, old_resolution, new_resolution); |
| 295 | |
| 296 | using RType = GstClockTime; |
| 297 | return RType(); |
| 298 | } |
| 299 | GstClockTime Clock_Class::get_resolution_vfunc_callback(GstClock* self) |
| 300 | { |
| 301 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 302 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 303 | |
| 304 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 305 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 306 | // generated classes can use this optimisation, which avoids the unnecessary |
| 307 | // parameter conversions if there is no possibility of the virtual function |
| 308 | // being overridden: |
| 309 | if(obj_base && obj_base->is_derived_()) |
| 310 | { |
| 311 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 312 | if(obj) // This can be NULL during destruction. |
| 313 | { |
| 314 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 315 | { |
| 316 | // Call the virtual member method, which derived classes might override. |
| 317 | return ((GstClockTime)(obj->get_resolution_vfunc())); |
| 318 | } |
| 319 | catch(...) |
| 320 | { |
| 321 | Glib::exception_handlers_invoke(); |
| 322 | } |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 327 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 328 | ); |
| 329 | |
| 330 | // Call the original underlying C function: |
| 331 | if(base && base->get_resolution) |
| 332 | return (*base->get_resolution)(self); |
| 333 | |
| 334 | using RType = GstClockTime; |
| 335 | return RType(); |
| 336 | } |
| 337 | GstClockTime Clock_Class::get_internal_time_vfunc_callback(GstClock* self) |
| 338 | { |
| 339 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 340 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 341 | |
| 342 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 343 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 344 | // generated classes can use this optimisation, which avoids the unnecessary |
| 345 | // parameter conversions if there is no possibility of the virtual function |
| 346 | // being overridden: |
| 347 | if(obj_base && obj_base->is_derived_()) |
| 348 | { |
| 349 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 350 | if(obj) // This can be NULL during destruction. |
| 351 | { |
| 352 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 353 | { |
| 354 | // Call the virtual member method, which derived classes might override. |
| 355 | return ((GstClockTime)(obj->get_internal_time_vfunc())); |
| 356 | } |
| 357 | catch(...) |
| 358 | { |
| 359 | Glib::exception_handlers_invoke(); |
| 360 | } |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 365 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 366 | ); |
| 367 | |
| 368 | // Call the original underlying C function: |
| 369 | if(base && base->get_internal_time) |
| 370 | return (*base->get_internal_time)(self); |
| 371 | |
| 372 | using RType = GstClockTime; |
| 373 | return RType(); |
| 374 | } |
| 375 | GstClockReturn Clock_Class::wait_vfunc_callback(GstClock* self, GstClockEntry* entry, GstClockTimeDiff* jitter) |
| 376 | { |
| 377 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 378 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 379 | |
| 380 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 381 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 382 | // generated classes can use this optimisation, which avoids the unnecessary |
| 383 | // parameter conversions if there is no possibility of the virtual function |
| 384 | // being overridden: |
| 385 | if(obj_base && obj_base->is_derived_()) |
| 386 | { |
| 387 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 388 | if(obj) // This can be NULL during destruction. |
| 389 | { |
| 390 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 391 | { |
| 392 | // Call the virtual member method, which derived classes might override. |
| 393 | return ((GstClockReturn)(obj->wait_vfunc(Glib::wrap(entry, true) |
| 394 | , (Gst::ClockTimeDiff&)(*jitter) |
| 395 | ))); |
| 396 | } |
| 397 | catch(...) |
| 398 | { |
| 399 | Glib::exception_handlers_invoke(); |
| 400 | } |
| 401 | } |
| 402 | } |
| 403 | |
| 404 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 405 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 406 | ); |
| 407 | |
| 408 | // Call the original underlying C function: |
| 409 | if(base && base->wait) |
| 410 | return (*base->wait)(self, entry, jitter); |
| 411 | |
| 412 | using RType = GstClockReturn; |
| 413 | return RType(); |
| 414 | } |
| 415 | GstClockReturn Clock_Class::wait_async_vfunc_callback(GstClock* self, GstClockEntry* entry) |
| 416 | { |
| 417 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 418 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 419 | |
| 420 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 421 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 422 | // generated classes can use this optimisation, which avoids the unnecessary |
| 423 | // parameter conversions if there is no possibility of the virtual function |
| 424 | // being overridden: |
| 425 | if(obj_base && obj_base->is_derived_()) |
| 426 | { |
| 427 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 428 | if(obj) // This can be NULL during destruction. |
| 429 | { |
| 430 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 431 | { |
| 432 | // Call the virtual member method, which derived classes might override. |
| 433 | return ((GstClockReturn)(obj->wait_async_vfunc(Glib::wrap(entry, true) |
| 434 | ))); |
| 435 | } |
| 436 | catch(...) |
| 437 | { |
| 438 | Glib::exception_handlers_invoke(); |
| 439 | } |
| 440 | } |
| 441 | } |
| 442 | |
| 443 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 444 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 445 | ); |
| 446 | |
| 447 | // Call the original underlying C function: |
| 448 | if(base && base->wait_async) |
| 449 | return (*base->wait_async)(self, entry); |
| 450 | |
| 451 | using RType = GstClockReturn; |
| 452 | return RType(); |
| 453 | } |
| 454 | void Clock_Class::unschedule_vfunc_callback(GstClock* self, GstClockEntry* entry) |
| 455 | { |
| 456 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 457 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 458 | |
| 459 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 460 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 461 | // generated classes can use this optimisation, which avoids the unnecessary |
| 462 | // parameter conversions if there is no possibility of the virtual function |
| 463 | // being overridden: |
| 464 | if(obj_base && obj_base->is_derived_()) |
| 465 | { |
| 466 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 467 | if(obj) // This can be NULL during destruction. |
| 468 | { |
| 469 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 470 | { |
| 471 | // Call the virtual member method, which derived classes might override. |
| 472 | obj->unschedule_vfunc(Glib::wrap(entry, true) |
| 473 | ); |
| 474 | return; |
| 475 | } |
| 476 | catch(...) |
| 477 | { |
| 478 | Glib::exception_handlers_invoke(); |
| 479 | } |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 484 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 485 | ); |
| 486 | |
| 487 | // Call the original underlying C function: |
| 488 | if(base && base->unschedule) |
| 489 | (*base->unschedule)(self, entry); |
| 490 | } |
| 491 | |
| 492 | |
| 493 | Glib::ObjectBase* Clock_Class::wrap_new(GObject* object) |
| 494 | { |
| 495 | return new Clock((GstClock*)object); |
| 496 | } |
| 497 | |
| 498 | |
| 499 | /* The implementation: */ |
| 500 | |
| 501 | GstClock* Clock::gobj_copy() |
| 502 | { |
| 503 | reference(); |
| 504 | return gobj(); |
| 505 | } |
| 506 | |
| 507 | Clock::Clock(const Glib::ConstructParams& construct_params) |
| 508 | : |
| 509 | Object(construct_params) |
| 510 | { |
| 511 | |
| 512 | } |
| 513 | |
| 514 | Clock::Clock(GstClock* castitem) |
| 515 | : |
| 516 | Object((GstObject*)(castitem)) |
| 517 | {} |
| 518 | |
| 519 | |
| 520 | Clock::Clock(Clock&& src) noexcept |
| 521 | : Object(std::move(src)) |
| 522 | {} |
| 523 | |
| 524 | Clock& Clock::operator=(Clock&& src) noexcept |
| 525 | { |
| 526 | Object::operator=(std::move(src)); |
| 527 | return *this; |
| 528 | } |
| 529 | |
| 530 | |
| 531 | Clock::~Clock() noexcept |
| 532 | {} |
| 533 | |
| 534 | |
| 535 | Clock::CppClassType Clock::clock_class_; // initialize static member |
| 536 | |
| 537 | GType Clock::get_type() |
| 538 | { |
| 539 | return clock_class_.init().get_type(); |
| 540 | } |
| 541 | |
| 542 | |
| 543 | GType Clock::get_base_type() |
| 544 | { |
| 545 | return gst_clock_get_type(); |
| 546 | } |
| 547 | |
| 548 | bool Clock::add_observation(Gst::ClockTime slave_time, Gst::ClockTime master_time, gdouble& result) |
| 549 | { |
| 550 | return gst_clock_add_observation(gobj(), ((GstClockTime)(slave_time)), ((GstClockTime)(master_time)), &result); |
| 551 | } |
| 552 | |
| 553 | bool Clock::add_observation(Gst::ClockTime slave_time, Gst::ClockTime master_time, gdouble& result, Gst::ClockTime& internal, Gst::ClockTime& external, Gst::ClockTime& rate_num, Gst::ClockTime& rate_denom) |
| 554 | { |
| 555 | return gst_clock_add_observation_unapplied(gobj(), ((GstClockTime)(slave_time)), ((GstClockTime)(master_time)), &result, (GstClockTime*)(&internal), (GstClockTime*)(&external), (GstClockTime*)(&rate_num), (GstClockTime*)(&rate_denom)); |
| 556 | } |
| 557 | |
| 558 | bool Clock::set_master(const Clock& master_clock) |
| 559 | { |
| 560 | return gst_clock_set_master(gobj(), ((GstClock*)(&master_clock))); |
| 561 | } |
| 562 | |
| 563 | Glib::RefPtr<Gst::Clock> Clock::get_master() |
| 564 | { |
| 565 | return Glib::wrap(gst_clock_get_master(gobj())); |
| 566 | } |
| 567 | |
| 568 | Glib::RefPtr<const Gst::Clock> Clock::get_master() const |
| 569 | { |
| 570 | return const_cast<Clock*>(this)->get_master(); |
| 571 | } |
| 572 | |
| 573 | Gst::ClockTime Clock::set_resolution(Gst::ClockTime resolution) |
| 574 | { |
| 575 | return ((Gst::ClockTime)(gst_clock_set_resolution(gobj(), ((GstClockTime)(resolution))))); |
| 576 | } |
| 577 | |
| 578 | Gst::ClockTime Clock::get_resolution() const |
| 579 | { |
| 580 | return ((Gst::ClockTime)(gst_clock_get_resolution(const_cast<GstClock*>(gobj())))); |
| 581 | } |
| 582 | |
| 583 | Gst::ClockTime Clock::get_time() const |
| 584 | { |
| 585 | return ((Gst::ClockTime)(gst_clock_get_time(const_cast<GstClock*>(gobj())))); |
| 586 | } |
| 587 | |
| 588 | Glib::RefPtr<Gst::ClockID> Clock::create_single_shot_id(Gst::ClockTime time) |
| 589 | { |
| 590 | return Glib::wrap((GstClockEntry*)(gst_clock_new_single_shot_id(gobj(), ((GstClockTime)(time))))); |
| 591 | } |
| 592 | |
| 593 | Glib::RefPtr<Gst::ClockID> Clock::create_periodic_id(Gst::ClockTime start_time, Gst::ClockTime intervals) |
| 594 | { |
| 595 | return Glib::wrap((GstClockEntry*)(gst_clock_new_periodic_id(gobj(), ((GstClockTime)(start_time)), ((GstClockTime)(intervals))))); |
| 596 | } |
| 597 | |
| 598 | bool Clock::single_shot_id_reinit(const Glib::RefPtr<Gst::ClockID>& id, Gst::ClockTime time) |
| 599 | { |
| 600 | return gst_clock_single_shot_id_reinit(gobj(), Glib::unwrap(id), ((GstClockTime)(time))); |
| 601 | } |
| 602 | |
| 603 | bool Clock::periodic_id_reinit(const Glib::RefPtr<Gst::ClockID>& id, Gst::ClockTime start_time, Gst::ClockTime interval) |
| 604 | { |
| 605 | return gst_clock_periodic_id_reinit(gobj(), Glib::unwrap(id), ((GstClockTime)(start_time)), ((GstClockTime)(interval))); |
| 606 | } |
| 607 | |
| 608 | Gst::ClockTime Clock::get_internal_time() const |
| 609 | { |
| 610 | return ((Gst::ClockTime)(gst_clock_get_internal_time(const_cast<GstClock*>(gobj())))); |
| 611 | } |
| 612 | |
| 613 | Gst::ClockTime Clock::adjust_unlocked(Gst::ClockTime internal_time) |
| 614 | { |
| 615 | return ((Gst::ClockTime)(gst_clock_adjust_unlocked(gobj(), ((GstClockTime)(internal_time))))); |
| 616 | } |
| 617 | |
| 618 | Gst::ClockTime Clock::unadjust_unlocked(Gst::ClockTime external_time) |
| 619 | { |
| 620 | return ((Gst::ClockTime)(gst_clock_unadjust_unlocked(gobj(), ((GstClockTime)(external_time))))); |
| 621 | } |
| 622 | |
| 623 | Gst::ClockTime Clock::adjust_with_calibration(Gst::ClockTime internal_target, Gst::ClockTime cinternal, Gst::ClockTime cexternal, Gst::ClockTime cnum, Gst::ClockTime cdenom) |
| 624 | { |
| 625 | return ((Gst::ClockTime)(gst_clock_adjust_with_calibration(gobj(), ((GstClockTime)(internal_target)), ((GstClockTime)(cinternal)), ((GstClockTime)(cexternal)), ((GstClockTime)(cnum)), ((GstClockTime)(cdenom))))); |
| 626 | } |
| 627 | |
| 628 | Gst::ClockTime Clock::unadjust_with_calibration(Gst::ClockTime external_target, Gst::ClockTime cinternal, Gst::ClockTime cexternal, Gst::ClockTime cnum, Gst::ClockTime cdenom) |
| 629 | { |
| 630 | return ((Gst::ClockTime)(gst_clock_unadjust_with_calibration(gobj(), ((GstClockTime)(external_target)), ((GstClockTime)(cinternal)), ((GstClockTime)(cexternal)), ((GstClockTime)(cnum)), ((GstClockTime)(cdenom))))); |
| 631 | } |
| 632 | |
| 633 | void Clock::get_calibration(Gst::ClockTime& internal, Gst::ClockTime& external, Gst::ClockTime& rate_num, Gst::ClockTime& rate_denom) const |
| 634 | { |
| 635 | gst_clock_get_calibration(const_cast<GstClock*>(gobj()), (GstClockTime*)(&internal), (GstClockTime*)(&external), (GstClockTime*)(&rate_num), (GstClockTime*)(&rate_denom)); |
| 636 | } |
| 637 | |
| 638 | void Clock::set_calibration(Gst::ClockTime internal, Gst::ClockTime external, Gst::ClockTime rate_num, Gst::ClockTime rate_denom) |
| 639 | { |
| 640 | gst_clock_set_calibration(gobj(), ((GstClockTime)(internal)), ((GstClockTime)(external)), ((GstClockTime)(rate_num)), ((GstClockTime)(rate_denom))); |
| 641 | } |
| 642 | |
| 643 | bool Clock::wait_for_sync(Gst::ClockTime timeout) |
| 644 | { |
| 645 | return gst_clock_wait_for_sync(gobj(), ((GstClockTime)(timeout))); |
| 646 | } |
| 647 | |
| 648 | bool Clock::is_synced() const |
| 649 | { |
| 650 | return gst_clock_is_synced(const_cast<GstClock*>(gobj())); |
| 651 | } |
| 652 | |
| 653 | void Clock::set_synced(bool synced) |
| 654 | { |
| 655 | gst_clock_set_synced(gobj(), static_cast<int>(synced)); |
| 656 | } |
| 657 | |
| 658 | |
| 659 | Glib::SignalProxy< void,bool > Clock::signal_synced() |
| 660 | { |
| 661 | return Glib::SignalProxy< void,bool >(this, &Clock_signal_synced_info); |
| 662 | } |
| 663 | |
| 664 | |
| 665 | Glib::PropertyProxy< guint64 > Clock::property_timeout() |
| 666 | { |
| 667 | return Glib::PropertyProxy< guint64 >(this, "timeout"); |
| 668 | } |
| 669 | |
| 670 | Glib::PropertyProxy_ReadOnly< guint64 > Clock::property_timeout() const |
| 671 | { |
| 672 | return Glib::PropertyProxy_ReadOnly< guint64 >(this, "timeout"); |
| 673 | } |
| 674 | |
| 675 | Glib::PropertyProxy< int > Clock::property_window_size() |
| 676 | { |
| 677 | return Glib::PropertyProxy< int >(this, "window-size"); |
| 678 | } |
| 679 | |
| 680 | Glib::PropertyProxy_ReadOnly< int > Clock::property_window_size() const |
| 681 | { |
| 682 | return Glib::PropertyProxy_ReadOnly< int >(this, "window-size"); |
| 683 | } |
| 684 | |
| 685 | Glib::PropertyProxy< int > Clock::property_window_threshold() |
| 686 | { |
| 687 | return Glib::PropertyProxy< int >(this, "window-threshold"); |
| 688 | } |
| 689 | |
| 690 | Glib::PropertyProxy_ReadOnly< int > Clock::property_window_threshold() const |
| 691 | { |
| 692 | return Glib::PropertyProxy_ReadOnly< int >(this, "window-threshold"); |
| 693 | } |
| 694 | |
| 695 | |
| 696 | Gst::ClockTime Gst::Clock::change_resolution_vfunc(Gst::ClockTime old_resolution, Gst::ClockTime new_resolution) |
| 697 | { |
| 698 | const auto base = static_cast<BaseClassType*>( |
| 699 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 700 | ); |
| 701 | |
| 702 | if(base && base->change_resolution) |
| 703 | { |
| 704 | Gst::ClockTime retval(((Gst::ClockTime)((*base->change_resolution)(gobj(),((GstClockTime)(old_resolution)),((GstClockTime)(new_resolution)))))); |
| 705 | return retval; |
| 706 | } |
| 707 | |
| 708 | using RType = Gst::ClockTime; |
| 709 | return RType(); |
| 710 | } |
| 711 | Gst::ClockTime Gst::Clock::get_resolution_vfunc() const |
| 712 | { |
| 713 | const auto base = static_cast<BaseClassType*>( |
| 714 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 715 | ); |
| 716 | |
| 717 | if(base && base->get_resolution) |
| 718 | { |
| 719 | Gst::ClockTime retval(((Gst::ClockTime)((*base->get_resolution)(const_cast<GstClock*>(gobj()))))); |
| 720 | return retval; |
| 721 | } |
| 722 | |
| 723 | using RType = Gst::ClockTime; |
| 724 | return RType(); |
| 725 | } |
| 726 | Gst::ClockTime Gst::Clock::get_internal_time_vfunc() const |
| 727 | { |
| 728 | const auto base = static_cast<BaseClassType*>( |
| 729 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 730 | ); |
| 731 | |
| 732 | if(base && base->get_internal_time) |
| 733 | { |
| 734 | Gst::ClockTime retval(((Gst::ClockTime)((*base->get_internal_time)(const_cast<GstClock*>(gobj()))))); |
| 735 | return retval; |
| 736 | } |
| 737 | |
| 738 | using RType = Gst::ClockTime; |
| 739 | return RType(); |
| 740 | } |
| 741 | ClockReturn Gst::Clock::wait_vfunc(const Glib::RefPtr<Gst::ClockID>& id, Gst::ClockTimeDiff& jitter) |
| 742 | { |
| 743 | const auto base = static_cast<BaseClassType*>( |
| 744 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 745 | ); |
| 746 | |
| 747 | if(base && base->wait) |
| 748 | { |
| 749 | ClockReturn retval(((ClockReturn)((*base->wait)(gobj(),Glib::unwrap(id),(GstClockTimeDiff*)(&jitter))))); |
| 750 | return retval; |
| 751 | } |
| 752 | |
| 753 | using RType = ClockReturn; |
| 754 | return RType(); |
| 755 | } |
| 756 | ClockReturn Gst::Clock::wait_async_vfunc(const Glib::RefPtr<Gst::ClockID>& id) |
| 757 | { |
| 758 | const auto base = static_cast<BaseClassType*>( |
| 759 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 760 | ); |
| 761 | |
| 762 | if(base && base->wait_async) |
| 763 | { |
| 764 | ClockReturn retval(((ClockReturn)((*base->wait_async)(gobj(),Glib::unwrap(id))))); |
| 765 | return retval; |
| 766 | } |
| 767 | |
| 768 | using RType = ClockReturn; |
| 769 | return RType(); |
| 770 | } |
| 771 | void Gst::Clock::unschedule_vfunc(const Glib::RefPtr<Gst::ClockID>& id) |
| 772 | { |
| 773 | const auto base = static_cast<BaseClassType*>( |
| 774 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 775 | ); |
| 776 | |
| 777 | if(base && base->unschedule) |
| 778 | { |
| 779 | (*base->unschedule)(gobj(),Glib::unwrap(id)); |
| 780 | } |
| 781 | } |
| 782 | |
| 783 | |
| 784 | } // namespace Gst |
| 785 | |
| 786 |