| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | |
| 3 | |
| 4 | #include <glibmm.h> |
| 5 | |
| 6 | #include <gstreamermm/discoverer.h> |
| 7 | #include <gstreamermm/private/discoverer_p.h> |
| 8 | |
| 9 | |
| 10 | /* gstreamermm - a C++ wrapper for gstreamer |
| 11 | * |
| 12 | * Copyright 2011-2016 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/discovererinfo.h> |
| 30 | #include <gstreamermm/element.h> |
| 31 | |
| 32 | |
| 33 | namespace Gst |
| 34 | { |
| 35 | |
| 36 | Discoverer::Discoverer(ClockTime timeout) |
| 37 | : // Mark this class as non-derived to allow C++ vfuncs to be skipped. |
| 38 | Glib::ObjectBase(nullptr), |
| 39 | Glib::Object(Glib::ConstructParams(discoverer_class_.init(), "timeout",static_cast<GstClockTime>(timeout), nullptr)) |
| 40 | { |
| 41 | } |
| 42 | |
| 43 | } // namespace Gst |
| 44 | |
| 45 | namespace |
| 46 | { |
| 47 | |
| 48 | |
| 49 | static void Discoverer_signal_discovered_callback(GstDiscoverer* self, GstDiscovererInfo* p0,const GError* p1,void* data) |
| 50 | { |
| 51 | using namespace Gst; |
| 52 | using SlotType = sigc::slot< void,const Glib::RefPtr<Gst::DiscovererInfo>&,const Glib::Error& >; |
| 53 | |
| 54 | auto obj = dynamic_cast<Discoverer*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self)); |
| 55 | // Do not try to call a signal on a disassociated wrapper. |
| 56 | if(obj) |
| 57 | { |
| 58 | try |
| 59 | { |
| 60 | if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data)) |
| 61 | (*static_cast<SlotType*>(slot))(Glib::wrap(p0,true) |
| 62 | , Glib::Error(const_cast<GError*>(p1), true) |
| 63 | ); |
| 64 | } |
| 65 | catch(...) |
| 66 | { |
| 67 | Glib::exception_handlers_invoke(); |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | static const Glib::SignalProxyInfo Discoverer_signal_discovered_info = |
| 73 | { |
| 74 | "discovered", |
| 75 | (GCallback) &Discoverer_signal_discovered_callback, |
| 76 | (GCallback) &Discoverer_signal_discovered_callback |
| 77 | }; |
| 78 | |
| 79 | |
| 80 | static const Glib::SignalProxyInfo Discoverer_signal_finished_info = |
| 81 | { |
| 82 | "finished", |
| 83 | (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, |
| 84 | (GCallback) &Glib::SignalProxyNormal::slot0_void_callback |
| 85 | }; |
| 86 | |
| 87 | |
| 88 | static const Glib::SignalProxyInfo Discoverer_signal_starting_info = |
| 89 | { |
| 90 | "starting", |
| 91 | (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, |
| 92 | (GCallback) &Glib::SignalProxyNormal::slot0_void_callback |
| 93 | }; |
| 94 | |
| 95 | |
| 96 | static void Discoverer_signal_source_setup_callback(GstDiscoverer* self, GstElement* p0,void* data) |
| 97 | { |
| 98 | using namespace Gst; |
| 99 | using SlotType = sigc::slot< void,const Glib::RefPtr<Gst::Element>& >; |
| 100 | |
| 101 | auto obj = dynamic_cast<Discoverer*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self)); |
| 102 | // Do not try to call a signal on a disassociated wrapper. |
| 103 | if(obj) |
| 104 | { |
| 105 | try |
| 106 | { |
| 107 | if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data)) |
| 108 | (*static_cast<SlotType*>(slot))(Glib::wrap(p0,true) |
| 109 | ); |
| 110 | } |
| 111 | catch(...) |
| 112 | { |
| 113 | Glib::exception_handlers_invoke(); |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | static const Glib::SignalProxyInfo Discoverer_signal_source_setup_info = |
| 119 | { |
| 120 | "source_setup", |
| 121 | (GCallback) &Discoverer_signal_source_setup_callback, |
| 122 | (GCallback) &Discoverer_signal_source_setup_callback |
| 123 | }; |
| 124 | |
| 125 | |
| 126 | } // anonymous namespace |
| 127 | |
| 128 | |
| 129 | namespace Glib |
| 130 | { |
| 131 | |
| 132 | Glib::RefPtr<Gst::Discoverer> wrap(GstDiscoverer* object, bool take_copy) |
| 133 | { |
| 134 | return Glib::RefPtr<Gst::Discoverer>( dynamic_cast<Gst::Discoverer*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); |
| 135 | //We use dynamic_cast<> in case of multiple inheritance. |
| 136 | } |
| 137 | |
| 138 | } /* namespace Glib */ |
| 139 | |
| 140 | |
| 141 | namespace Gst |
| 142 | { |
| 143 | |
| 144 | |
| 145 | /* The *_Class implementation: */ |
| 146 | |
| 147 | const Glib::Class& Discoverer_Class::init() |
| 148 | { |
| 149 | if(!gtype_) // create the GType if necessary |
| 150 | { |
| 151 | // Glib::Class has to know the class init function to clone custom types. |
| 152 | class_init_func_ = &Discoverer_Class::class_init_function; |
| 153 | |
| 154 | // This is actually just optimized away, apparently with no harm. |
| 155 | // Make sure that the parent type has been created. |
| 156 | //CppClassParent::CppObjectType::get_type(); |
| 157 | |
| 158 | // Create the wrapper type, with the same class/instance size as the base type. |
| 159 | register_derived_type(gst_discoverer_get_type()); |
| 160 | |
| 161 | // Add derived versions of interfaces, if the C type implements any interfaces: |
| 162 | |
| 163 | } |
| 164 | |
| 165 | return *this; |
| 166 | } |
| 167 | |
| 168 | |
| 169 | void Discoverer_Class::class_init_function(void* g_class, void* class_data) |
| 170 | { |
| 171 | const auto klass = static_cast<BaseClassType*>(g_class); |
| 172 | CppClassParent::class_init_function(klass, class_data); |
| 173 | |
| 174 | |
| 175 | klass->discovered = &discovered_callback; |
| 176 | klass->finished = &finished_callback; |
| 177 | klass->starting = &starting_callback; |
| 178 | klass->source_setup = &source_setup_callback; |
| 179 | } |
| 180 | |
| 181 | |
| 182 | void Discoverer_Class::discovered_callback(GstDiscoverer* self, GstDiscovererInfo* p0, const GError* p1) |
| 183 | { |
| 184 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 185 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 186 | |
| 187 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 188 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 189 | // generated classes can use this optimisation, which avoids the unnecessary |
| 190 | // parameter conversions if there is no possibility of the virtual function |
| 191 | // being overridden: |
| 192 | if(obj_base && obj_base->is_derived_()) |
| 193 | { |
| 194 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 195 | if(obj) // This can be NULL during destruction. |
| 196 | { |
| 197 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 198 | { |
| 199 | // Call the virtual member method, which derived classes might override. |
| 200 | obj->on_discovered(Glib::wrap(p0,true) |
| 201 | , Glib::Error(const_cast<GError*>(p1), true) |
| 202 | ); |
| 203 | return; |
| 204 | } |
| 205 | catch(...) |
| 206 | { |
| 207 | Glib::exception_handlers_invoke(); |
| 208 | } |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | const auto base = static_cast<BaseClassType*>( |
| 213 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 214 | ); |
| 215 | |
| 216 | // Call the original underlying C function: |
| 217 | if(base && base->discovered) |
| 218 | (*base->discovered)(self, p0, p1); |
| 219 | } |
| 220 | void Discoverer_Class::finished_callback(GstDiscoverer* self) |
| 221 | { |
| 222 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 223 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 224 | |
| 225 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 226 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 227 | // generated classes can use this optimisation, which avoids the unnecessary |
| 228 | // parameter conversions if there is no possibility of the virtual function |
| 229 | // being overridden: |
| 230 | if(obj_base && obj_base->is_derived_()) |
| 231 | { |
| 232 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 233 | if(obj) // This can be NULL during destruction. |
| 234 | { |
| 235 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 236 | { |
| 237 | // Call the virtual member method, which derived classes might override. |
| 238 | obj->on_finished(); |
| 239 | return; |
| 240 | } |
| 241 | catch(...) |
| 242 | { |
| 243 | Glib::exception_handlers_invoke(); |
| 244 | } |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | const auto base = static_cast<BaseClassType*>( |
| 249 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 250 | ); |
| 251 | |
| 252 | // Call the original underlying C function: |
| 253 | if(base && base->finished) |
| 254 | (*base->finished)(self); |
| 255 | } |
| 256 | void Discoverer_Class::starting_callback(GstDiscoverer* self) |
| 257 | { |
| 258 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 259 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 260 | |
| 261 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 262 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 263 | // generated classes can use this optimisation, which avoids the unnecessary |
| 264 | // parameter conversions if there is no possibility of the virtual function |
| 265 | // being overridden: |
| 266 | if(obj_base && obj_base->is_derived_()) |
| 267 | { |
| 268 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 269 | if(obj) // This can be NULL during destruction. |
| 270 | { |
| 271 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 272 | { |
| 273 | // Call the virtual member method, which derived classes might override. |
| 274 | obj->on_starting(); |
| 275 | return; |
| 276 | } |
| 277 | catch(...) |
| 278 | { |
| 279 | Glib::exception_handlers_invoke(); |
| 280 | } |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | const auto base = static_cast<BaseClassType*>( |
| 285 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 286 | ); |
| 287 | |
| 288 | // Call the original underlying C function: |
| 289 | if(base && base->starting) |
| 290 | (*base->starting)(self); |
| 291 | } |
| 292 | void Discoverer_Class::source_setup_callback(GstDiscoverer* self, GstElement* p0) |
| 293 | { |
| 294 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 295 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 296 | |
| 297 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 298 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 299 | // generated classes can use this optimisation, which avoids the unnecessary |
| 300 | // parameter conversions if there is no possibility of the virtual function |
| 301 | // being overridden: |
| 302 | if(obj_base && obj_base->is_derived_()) |
| 303 | { |
| 304 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 305 | if(obj) // This can be NULL during destruction. |
| 306 | { |
| 307 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 308 | { |
| 309 | // Call the virtual member method, which derived classes might override. |
| 310 | obj->on_source_setup(Glib::wrap(p0,true) |
| 311 | ); |
| 312 | return; |
| 313 | } |
| 314 | catch(...) |
| 315 | { |
| 316 | Glib::exception_handlers_invoke(); |
| 317 | } |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | const auto base = static_cast<BaseClassType*>( |
| 322 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 323 | ); |
| 324 | |
| 325 | // Call the original underlying C function: |
| 326 | if(base && base->source_setup) |
| 327 | (*base->source_setup)(self, p0); |
| 328 | } |
| 329 | |
| 330 | |
| 331 | Glib::ObjectBase* Discoverer_Class::wrap_new(GObject* object) |
| 332 | { |
| 333 | return new Discoverer((GstDiscoverer*)object); |
| 334 | } |
| 335 | |
| 336 | |
| 337 | /* The implementation: */ |
| 338 | |
| 339 | GstDiscoverer* Discoverer::gobj_copy() |
| 340 | { |
| 341 | reference(); |
| 342 | return gobj(); |
| 343 | } |
| 344 | |
| 345 | Discoverer::Discoverer(const Glib::ConstructParams& construct_params) |
| 346 | : |
| 347 | Glib::Object(construct_params) |
| 348 | { |
| 349 | |
| 350 | } |
| 351 | |
| 352 | Discoverer::Discoverer(GstDiscoverer* castitem) |
| 353 | : |
| 354 | Glib::Object((GObject*)(castitem)) |
| 355 | {} |
| 356 | |
| 357 | |
| 358 | Discoverer::Discoverer(Discoverer&& src) noexcept |
| 359 | : Glib::Object(std::move(src)) |
| 360 | {} |
| 361 | |
| 362 | Discoverer& Discoverer::operator=(Discoverer&& src) noexcept |
| 363 | { |
| 364 | Glib::Object::operator=(std::move(src)); |
| 365 | return *this; |
| 366 | } |
| 367 | |
| 368 | |
| 369 | Discoverer::~Discoverer() noexcept |
| 370 | {} |
| 371 | |
| 372 | |
| 373 | Discoverer::CppClassType Discoverer::discoverer_class_; // initialize static member |
| 374 | |
| 375 | GType Discoverer::get_type() |
| 376 | { |
| 377 | return discoverer_class_.init().get_type(); |
| 378 | } |
| 379 | |
| 380 | |
| 381 | GType Discoverer::get_base_type() |
| 382 | { |
| 383 | return gst_discoverer_get_type(); |
| 384 | } |
| 385 | |
| 386 | |
| 387 | Glib::RefPtr<Discoverer> Discoverer::create(ClockTime timeout) |
| 388 | { |
| 389 | return Glib::RefPtr<Discoverer>( new Discoverer(timeout) ); |
| 390 | } |
| 391 | |
| 392 | void Discoverer::start() |
| 393 | { |
| 394 | gst_discoverer_start(gobj()); |
| 395 | } |
| 396 | |
| 397 | void Discoverer::stop() |
| 398 | { |
| 399 | gst_discoverer_stop(gobj()); |
| 400 | } |
| 401 | |
| 402 | Glib::RefPtr<Gst::DiscovererInfo> Discoverer::discover_uri(const Glib::ustring& uri) |
| 403 | { |
| 404 | GError* gerror = nullptr; |
| 405 | Glib::RefPtr<Gst::DiscovererInfo> retvalue = Glib::wrap(gst_discoverer_discover_uri(gobj(), uri.c_str(), &(gerror))); |
| 406 | if(gerror) |
| 407 | ::Glib::Error::throw_exception(gerror); |
| 408 | return retvalue; |
| 409 | } |
| 410 | |
| 411 | bool Discoverer::discover_uri_async(const Glib::ustring& uri) |
| 412 | { |
| 413 | return gst_discoverer_discover_uri_async(gobj(), uri.c_str()); |
| 414 | } |
| 415 | |
| 416 | |
| 417 | Glib::SignalProxy< void,const Glib::RefPtr<Gst::DiscovererInfo>&,const Glib::Error& > Discoverer::signal_discovered() |
| 418 | { |
| 419 | return Glib::SignalProxy< void,const Glib::RefPtr<Gst::DiscovererInfo>&,const Glib::Error& >(this, &Discoverer_signal_discovered_info); |
| 420 | } |
| 421 | |
| 422 | |
| 423 | Glib::SignalProxy< void > Discoverer::signal_finished() |
| 424 | { |
| 425 | return Glib::SignalProxy< void >(this, &Discoverer_signal_finished_info); |
| 426 | } |
| 427 | |
| 428 | |
| 429 | Glib::SignalProxy< void > Discoverer::signal_starting() |
| 430 | { |
| 431 | return Glib::SignalProxy< void >(this, &Discoverer_signal_starting_info); |
| 432 | } |
| 433 | |
| 434 | |
| 435 | Glib::SignalProxy< void,const Glib::RefPtr<Gst::Element>& > Discoverer::signal_source_setup() |
| 436 | { |
| 437 | return Glib::SignalProxy< void,const Glib::RefPtr<Gst::Element>& >(this, &Discoverer_signal_source_setup_info); |
| 438 | } |
| 439 | |
| 440 | |
| 441 | Glib::PropertyProxy< guint64 > Discoverer::property_timeout() |
| 442 | { |
| 443 | return Glib::PropertyProxy< guint64 >(this, "timeout"); |
| 444 | } |
| 445 | |
| 446 | Glib::PropertyProxy_ReadOnly< guint64 > Discoverer::property_timeout() const |
| 447 | { |
| 448 | return Glib::PropertyProxy_ReadOnly< guint64 >(this, "timeout"); |
| 449 | } |
| 450 | |
| 451 | |
| 452 | void Gst::Discoverer::on_discovered(const Glib::RefPtr<Gst::DiscovererInfo>& info, const Glib::Error& error) |
| 453 | { |
| 454 | const auto base = static_cast<BaseClassType*>( |
| 455 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 456 | ); |
| 457 | |
| 458 | if(base && base->discovered) |
| 459 | (*base->discovered)(gobj(),Glib::unwrap(info),error.gobj()); |
| 460 | } |
| 461 | void Gst::Discoverer::on_finished() |
| 462 | { |
| 463 | const auto base = static_cast<BaseClassType*>( |
| 464 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 465 | ); |
| 466 | |
| 467 | if(base && base->finished) |
| 468 | (*base->finished)(gobj()); |
| 469 | } |
| 470 | void Gst::Discoverer::on_starting() |
| 471 | { |
| 472 | const auto base = static_cast<BaseClassType*>( |
| 473 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 474 | ); |
| 475 | |
| 476 | if(base && base->starting) |
| 477 | (*base->starting)(gobj()); |
| 478 | } |
| 479 | void Gst::Discoverer::on_source_setup(const Glib::RefPtr<Gst::Element>& source) |
| 480 | { |
| 481 | const auto base = static_cast<BaseClassType*>( |
| 482 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 483 | ); |
| 484 | |
| 485 | if(base && base->source_setup) |
| 486 | (*base->source_setup)(gobj(),Glib::unwrap(source)); |
| 487 | } |
| 488 | |
| 489 | |
| 490 | } // namespace Gst |
| 491 | |
| 492 |