| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | |
| 3 | |
| 4 | #include <glibmm.h> |
| 5 | |
| 6 | #include <gstreamermm/audiobasesink.h> |
| 7 | #include <gstreamermm/private/audiobasesink_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/audioringbuffer.h> |
| 30 | |
| 31 | namespace Gst |
| 32 | { |
| 33 | |
| 34 | extern "C" |
| 35 | { |
| 36 | |
| 37 | static void AudioBaseSink_CustomSlaving_gstreamermm_callback(GstAudioBaseSink* sink, GstClockTime etime, GstClockTime itime, |
| 38 | GstClockTimeDiff *requested_skew, GstAudioBaseSinkDiscontReason discont_reason, gpointer user_data) |
| 39 | { |
| 40 | Gst::AudioBaseSink::SlotCustomSlaving* the_slot = static_cast<Gst::AudioBaseSink::SlotCustomSlaving*>(user_data); |
| 41 | Glib::RefPtr<Gst::AudioBaseSink> sink_wrapper = Glib::wrap(sink, true); |
| 42 | try |
| 43 | { |
| 44 | (*the_slot)(sink_wrapper, static_cast<Gst::ClockTime>(etime), static_cast<Gst::ClockTime>(itime), |
| 45 | *requested_skew, static_cast<Gst::AudioBaseSinkDiscontReason>(discont_reason)); |
| 46 | } |
| 47 | catch(...) |
| 48 | { |
| 49 | Glib::exception_handlers_invoke(); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | static void AudioBaseSink_CustomSlaving_gstreamermm_callback_disconnect(gpointer data) |
| 54 | { |
| 55 | Gst::AudioBaseSink::SlotCustomSlaving* the_slot = static_cast<Gst::AudioBaseSink::SlotCustomSlaving*>(data); |
| 56 | |
| 57 | if(the_slot) |
| 58 | delete the_slot; |
| 59 | } |
| 60 | |
| 61 | } |
| 62 | |
| 63 | void AudioBaseSink::set_custom_slaving_callback(const SlotCustomSlaving& slot) |
| 64 | { |
| 65 | SlotCustomSlaving *slot_copy = new SlotCustomSlaving(slot); |
| 66 | |
| 67 | return gst_audio_base_sink_set_custom_slaving_callback(gobj(), &AudioBaseSink_CustomSlaving_gstreamermm_callback, slot_copy, &AudioBaseSink_CustomSlaving_gstreamermm_callback_disconnect); |
| 68 | } |
| 69 | |
| 70 | } |
| 71 | |
| 72 | namespace |
| 73 | { |
| 74 | } // anonymous namespace |
| 75 | |
| 76 | // static |
| 77 | GType Glib::Value<Gst::AudioBaseSinkSlaveMethod>::value_type() |
| 78 | { |
| 79 | return gst_audio_base_sink_slave_method_get_type(); |
| 80 | } |
| 81 | |
| 82 | |
| 83 | namespace Glib |
| 84 | { |
| 85 | |
| 86 | Glib::RefPtr<Gst::AudioBaseSink> wrap(GstAudioBaseSink* object, bool take_copy) |
| 87 | { |
| 88 | return Glib::RefPtr<Gst::AudioBaseSink>( dynamic_cast<Gst::AudioBaseSink*> (Glib::wrap_auto ((GObject*)(object), take_copy)) ); |
| 89 | //We use dynamic_cast<> in case of multiple inheritance. |
| 90 | } |
| 91 | |
| 92 | } /* namespace Glib */ |
| 93 | |
| 94 | |
| 95 | namespace Gst |
| 96 | { |
| 97 | |
| 98 | |
| 99 | /* The *_Class implementation: */ |
| 100 | |
| 101 | const Glib::Class& AudioBaseSink_Class::init() |
| 102 | { |
| 103 | if(!gtype_) // create the GType if necessary |
| 104 | { |
| 105 | // Glib::Class has to know the class init function to clone custom types. |
| 106 | class_init_func_ = &AudioBaseSink_Class::class_init_function; |
| 107 | |
| 108 | // This is actually just optimized away, apparently with no harm. |
| 109 | // Make sure that the parent type has been created. |
| 110 | //CppClassParent::CppObjectType::get_type(); |
| 111 | |
| 112 | // Create the wrapper type, with the same class/instance size as the base type. |
| 113 | register_derived_type(gst_audio_base_sink_get_type()); |
| 114 | |
| 115 | // Add derived versions of interfaces, if the C type implements any interfaces: |
| 116 | |
| 117 | } |
| 118 | |
| 119 | return *this; |
| 120 | } |
| 121 | |
| 122 | |
| 123 | void AudioBaseSink_Class::class_init_function(void* g_class, void* class_data) |
| 124 | { |
| 125 | const auto klass = static_cast<BaseClassType*>(g_class); |
| 126 | CppClassParent::class_init_function(klass, class_data); |
| 127 | |
| 128 | klass->create_ringbuffer = &create_ringbuffer_vfunc_callback; |
| 129 | klass->payload = &payload_vfunc_callback; |
| 130 | |
| 131 | } |
| 132 | |
| 133 | GstAudioRingBuffer* AudioBaseSink_Class::create_ringbuffer_vfunc_callback(GstAudioBaseSink* self) |
| 134 | { |
| 135 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 136 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 137 | |
| 138 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 139 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 140 | // generated classes can use this optimisation, which avoids the unnecessary |
| 141 | // parameter conversions if there is no possibility of the virtual function |
| 142 | // being overridden: |
| 143 | if(obj_base && obj_base->is_derived_()) |
| 144 | { |
| 145 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 146 | if(obj) // This can be NULL during destruction. |
| 147 | { |
| 148 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 149 | { |
| 150 | // Call the virtual member method, which derived classes might override. |
| 151 | return Glib::unwrap(obj->create_ring_buffer_vfunc()); |
| 152 | } |
| 153 | catch(...) |
| 154 | { |
| 155 | Glib::exception_handlers_invoke(); |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 161 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 162 | ); |
| 163 | |
| 164 | // Call the original underlying C function: |
| 165 | if(base && base->create_ringbuffer) |
| 166 | return (*base->create_ringbuffer)(self); |
| 167 | |
| 168 | using RType = GstAudioRingBuffer*; |
| 169 | return RType(); |
| 170 | } |
| 171 | GstBuffer* AudioBaseSink_Class::payload_vfunc_callback(GstAudioBaseSink* self, GstBuffer* buffer) |
| 172 | { |
| 173 | const auto obj_base = static_cast<Glib::ObjectBase*>( |
| 174 | Glib::ObjectBase::_get_current_wrapper((GObject*)self)); |
| 175 | |
| 176 | // Non-gtkmmproc-generated custom classes implicitly call the default |
| 177 | // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- |
| 178 | // generated classes can use this optimisation, which avoids the unnecessary |
| 179 | // parameter conversions if there is no possibility of the virtual function |
| 180 | // being overridden: |
| 181 | if(obj_base && obj_base->is_derived_()) |
| 182 | { |
| 183 | const auto obj = dynamic_cast<CppObjectType* const>(obj_base); |
| 184 | if(obj) // This can be NULL during destruction. |
| 185 | { |
| 186 | try // Trap C++ exceptions which would normally be lost because this is a C callback. |
| 187 | { |
| 188 | // Call the virtual member method, which derived classes might override. |
| 189 | return Glib::unwrap(obj->payload_vfunc(Glib::wrap(buffer, true) |
| 190 | )); |
| 191 | } |
| 192 | catch(...) |
| 193 | { |
| 194 | Glib::exception_handlers_invoke(); |
| 195 | } |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | BaseClassType *const base = static_cast<BaseClassType*>( |
| 200 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). |
| 201 | ); |
| 202 | |
| 203 | // Call the original underlying C function: |
| 204 | if(base && base->payload) |
| 205 | return (*base->payload)(self, buffer); |
| 206 | |
| 207 | using RType = GstBuffer*; |
| 208 | return RType(); |
| 209 | } |
| 210 | |
| 211 | |
| 212 | Glib::ObjectBase* AudioBaseSink_Class::wrap_new(GObject* object) |
| 213 | { |
| 214 | return new AudioBaseSink((GstAudioBaseSink*)object); |
| 215 | } |
| 216 | |
| 217 | |
| 218 | /* The implementation: */ |
| 219 | |
| 220 | GstAudioBaseSink* AudioBaseSink::gobj_copy() |
| 221 | { |
| 222 | reference(); |
| 223 | return gobj(); |
| 224 | } |
| 225 | |
| 226 | AudioBaseSink::AudioBaseSink(const Glib::ConstructParams& construct_params) |
| 227 | : |
| 228 | Gst::BaseSink(construct_params) |
| 229 | { |
| 230 | |
| 231 | } |
| 232 | |
| 233 | AudioBaseSink::AudioBaseSink(GstAudioBaseSink* castitem) |
| 234 | : |
| 235 | Gst::BaseSink((GstBaseSink*)(castitem)) |
| 236 | {} |
| 237 | |
| 238 | |
| 239 | AudioBaseSink::AudioBaseSink(AudioBaseSink&& src) noexcept |
| 240 | : Gst::BaseSink(std::move(src)) |
| 241 | {} |
| 242 | |
| 243 | AudioBaseSink& AudioBaseSink::operator=(AudioBaseSink&& src) noexcept |
| 244 | { |
| 245 | Gst::BaseSink::operator=(std::move(src)); |
| 246 | return *this; |
| 247 | } |
| 248 | |
| 249 | |
| 250 | AudioBaseSink::~AudioBaseSink() noexcept |
| 251 | {} |
| 252 | |
| 253 | |
| 254 | AudioBaseSink::CppClassType AudioBaseSink::audiobasesink_class_; // initialize static member |
| 255 | |
| 256 | GType AudioBaseSink::get_type() |
| 257 | { |
| 258 | return audiobasesink_class_.init().get_type(); |
| 259 | } |
| 260 | |
| 261 | |
| 262 | GType AudioBaseSink::get_base_type() |
| 263 | { |
| 264 | return gst_audio_base_sink_get_type(); |
| 265 | } |
| 266 | |
| 267 | |
| 268 | Glib::RefPtr<Gst::Clock> AudioBaseSink::get_provided_clock() |
| 269 | { |
| 270 | Glib::RefPtr<Gst::Clock> ref_ptr(Glib::wrap(gobj()->provided_clock)); |
| 271 | |
| 272 | if(ref_ptr) |
| 273 | ref_ptr->reference(); |
| 274 | |
| 275 | return ref_ptr; |
| 276 | } |
| 277 | |
| 278 | Glib::RefPtr<const Gst::Clock> AudioBaseSink::get_provided_clock() const |
| 279 | { |
| 280 | Glib::RefPtr<const Gst::Clock> ref_ptr(Glib::wrap(gobj()->provided_clock)); |
| 281 | |
| 282 | if(ref_ptr) |
| 283 | ref_ptr->reference(); |
| 284 | |
| 285 | return ref_ptr; |
| 286 | } |
| 287 | |
| 288 | Glib::RefPtr<Gst::AudioRingBuffer> AudioBaseSink::create_ring_buffer() |
| 289 | { |
| 290 | return Glib::wrap(gst_audio_base_sink_create_ringbuffer(gobj())); |
| 291 | } |
| 292 | |
| 293 | void AudioBaseSink::set_provide_clock(bool provide) |
| 294 | { |
| 295 | gst_audio_base_sink_set_provide_clock(gobj(), static_cast<int>(provide)); |
| 296 | } |
| 297 | |
| 298 | bool AudioBaseSink::get_provide_clock() const |
| 299 | { |
| 300 | return gst_audio_base_sink_get_provide_clock(const_cast<GstAudioBaseSink*>(gobj())); |
| 301 | } |
| 302 | |
| 303 | void AudioBaseSink::set_slave_method(Gst::AudioBaseSinkSlaveMethod method) |
| 304 | { |
| 305 | gst_audio_base_sink_set_slave_method(gobj(), ((GstAudioBaseSinkSlaveMethod)(method))); |
| 306 | } |
| 307 | |
| 308 | Gst::AudioBaseSinkSlaveMethod AudioBaseSink::get_slave_method() const |
| 309 | { |
| 310 | return ((Gst::AudioBaseSinkSlaveMethod)(gst_audio_base_sink_get_slave_method(const_cast<GstAudioBaseSink*>(gobj())))); |
| 311 | } |
| 312 | |
| 313 | gint64 AudioBaseSink::get_drift_tolerance() const |
| 314 | { |
| 315 | return gst_audio_base_sink_get_drift_tolerance(const_cast<GstAudioBaseSink*>(gobj())); |
| 316 | } |
| 317 | |
| 318 | void AudioBaseSink::set_drift_tolerance(gint64 drift_tolerance) |
| 319 | { |
| 320 | gst_audio_base_sink_set_drift_tolerance(gobj(), drift_tolerance); |
| 321 | } |
| 322 | |
| 323 | void AudioBaseSink::set_discont_wait(Gst::ClockTime discont_wait) |
| 324 | { |
| 325 | gst_audio_base_sink_set_discont_wait(gobj(), ((GstClockTime)(discont_wait))); |
| 326 | } |
| 327 | |
| 328 | Gst::ClockTime AudioBaseSink::get_discont_wait() const |
| 329 | { |
| 330 | return ((Gst::ClockTime)(gst_audio_base_sink_get_discont_wait(const_cast<GstAudioBaseSink*>(gobj())))); |
| 331 | } |
| 332 | |
| 333 | void AudioBaseSink::set_alignment_threshold(Gst::ClockTime alignment_threshold) |
| 334 | { |
| 335 | gst_audio_base_sink_set_alignment_threshold(gobj(), ((GstClockTime)(alignment_threshold))); |
| 336 | } |
| 337 | |
| 338 | Gst::ClockTime AudioBaseSink::get_alignment_threshold() const |
| 339 | { |
| 340 | return ((Gst::ClockTime)(gst_audio_base_sink_get_alignment_threshold(const_cast<GstAudioBaseSink*>(gobj())))); |
| 341 | } |
| 342 | |
| 343 | void AudioBaseSink::report_device_failure() |
| 344 | { |
| 345 | gst_audio_base_sink_report_device_failure(gobj()); |
| 346 | } |
| 347 | |
| 348 | |
| 349 | Glib::PropertyProxy< guint64 > AudioBaseSink::property_alignment_threshold() |
| 350 | { |
| 351 | return Glib::PropertyProxy< guint64 >(this, "alignment-threshold"); |
| 352 | } |
| 353 | |
| 354 | Glib::PropertyProxy_ReadOnly< guint64 > AudioBaseSink::property_alignment_threshold() const |
| 355 | { |
| 356 | return Glib::PropertyProxy_ReadOnly< guint64 >(this, "alignment-threshold"); |
| 357 | } |
| 358 | |
| 359 | Glib::PropertyProxy< gint64 > AudioBaseSink::property_buffer_time() |
| 360 | { |
| 361 | return Glib::PropertyProxy< gint64 >(this, "buffer-time"); |
| 362 | } |
| 363 | |
| 364 | Glib::PropertyProxy_ReadOnly< gint64 > AudioBaseSink::property_buffer_time() const |
| 365 | { |
| 366 | return Glib::PropertyProxy_ReadOnly< gint64 >(this, "buffer-time"); |
| 367 | } |
| 368 | |
| 369 | Glib::PropertyProxy< bool > AudioBaseSink::property_can_activate_pull() |
| 370 | { |
| 371 | return Glib::PropertyProxy< bool >(this, "can-activate-pull"); |
| 372 | } |
| 373 | |
| 374 | Glib::PropertyProxy_ReadOnly< bool > AudioBaseSink::property_can_activate_pull() const |
| 375 | { |
| 376 | return Glib::PropertyProxy_ReadOnly< bool >(this, "can-activate-pull"); |
| 377 | } |
| 378 | |
| 379 | Glib::PropertyProxy< guint64 > AudioBaseSink::property_discont_wait() |
| 380 | { |
| 381 | return Glib::PropertyProxy< guint64 >(this, "discont-wait"); |
| 382 | } |
| 383 | |
| 384 | Glib::PropertyProxy_ReadOnly< guint64 > AudioBaseSink::property_discont_wait() const |
| 385 | { |
| 386 | return Glib::PropertyProxy_ReadOnly< guint64 >(this, "discont-wait"); |
| 387 | } |
| 388 | |
| 389 | Glib::PropertyProxy< gint64 > AudioBaseSink::property_drift_tolerance() |
| 390 | { |
| 391 | return Glib::PropertyProxy< gint64 >(this, "drift-tolerance"); |
| 392 | } |
| 393 | |
| 394 | Glib::PropertyProxy_ReadOnly< gint64 > AudioBaseSink::property_drift_tolerance() const |
| 395 | { |
| 396 | return Glib::PropertyProxy_ReadOnly< gint64 >(this, "drift-tolerance"); |
| 397 | } |
| 398 | |
| 399 | Glib::PropertyProxy< gint64 > AudioBaseSink::property_latency_time() |
| 400 | { |
| 401 | return Glib::PropertyProxy< gint64 >(this, "latency-time"); |
| 402 | } |
| 403 | |
| 404 | Glib::PropertyProxy_ReadOnly< gint64 > AudioBaseSink::property_latency_time() const |
| 405 | { |
| 406 | return Glib::PropertyProxy_ReadOnly< gint64 >(this, "latency-time"); |
| 407 | } |
| 408 | |
| 409 | Glib::PropertyProxy< bool > AudioBaseSink::property_provide_clock() |
| 410 | { |
| 411 | return Glib::PropertyProxy< bool >(this, "provide-clock"); |
| 412 | } |
| 413 | |
| 414 | Glib::PropertyProxy_ReadOnly< bool > AudioBaseSink::property_provide_clock() const |
| 415 | { |
| 416 | return Glib::PropertyProxy_ReadOnly< bool >(this, "provide-clock"); |
| 417 | } |
| 418 | |
| 419 | Glib::PropertyProxy< Gst::AudioBaseSinkSlaveMethod > AudioBaseSink::property_slave_method() |
| 420 | { |
| 421 | return Glib::PropertyProxy< Gst::AudioBaseSinkSlaveMethod >(this, "slave-method"); |
| 422 | } |
| 423 | |
| 424 | Glib::PropertyProxy_ReadOnly< Gst::AudioBaseSinkSlaveMethod > AudioBaseSink::property_slave_method() const |
| 425 | { |
| 426 | return Glib::PropertyProxy_ReadOnly< Gst::AudioBaseSinkSlaveMethod >(this, "slave-method"); |
| 427 | } |
| 428 | |
| 429 | |
| 430 | Glib::RefPtr<Gst::AudioRingBuffer> Gst::AudioBaseSink::create_ring_buffer_vfunc() |
| 431 | { |
| 432 | const auto base = static_cast<BaseClassType*>( |
| 433 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 434 | ); |
| 435 | |
| 436 | if(base && base->create_ringbuffer) |
| 437 | { |
| 438 | Glib::RefPtr<Gst::AudioRingBuffer> retval(Glib::wrap((*base->create_ringbuffer)(gobj()))); |
| 439 | return retval; |
| 440 | } |
| 441 | |
| 442 | using RType = Glib::RefPtr<Gst::AudioRingBuffer>; |
| 443 | return RType(); |
| 444 | } |
| 445 | Glib::RefPtr<Gst::Buffer> Gst::AudioBaseSink::payload_vfunc(const Glib::RefPtr<Gst::Buffer>& buffer) |
| 446 | { |
| 447 | const auto base = static_cast<BaseClassType*>( |
| 448 | g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). |
| 449 | ); |
| 450 | |
| 451 | if(base && base->payload) |
| 452 | { |
| 453 | Glib::RefPtr<Gst::Buffer> retval(Glib::wrap((*base->payload)(gobj(),Glib::unwrap(buffer)))); |
| 454 | return retval; |
| 455 | } |
| 456 | |
| 457 | using RType = Glib::RefPtr<Gst::Buffer>; |
| 458 | return RType(); |
| 459 | } |
| 460 | |
| 461 | |
| 462 | } // namespace Gst |
| 463 | |
| 464 |