[gstreamermm] start stop amend



commit d95c34da963ebb13e9e63406eb05889294a7abfe
Author: Tomasz Lakota <tomasz lakota flytronic pl>
Date:   Tue Apr 1 16:08:17 2014 +0200

    start stop amend

 gstreamer/src/basetransform.ccg |  105 ---------------------------------------
 gstreamer/src/basetransform.hg  |   26 +++------
 2 files changed, 9 insertions(+), 122 deletions(-)
---
diff --git a/gstreamer/src/basetransform.ccg b/gstreamer/src/basetransform.ccg
index b571f14..1c04cc9 100644
--- a/gstreamer/src/basetransform.ccg
+++ b/gstreamer/src/basetransform.ccg
@@ -29,111 +29,6 @@ namespace Gst
 const Glib::ustring BaseTransform::SINK_NAME = GST_BASE_TRANSFORM_SINK_NAME;
 const Glib::ustring BaseTransform::SRC_NAME = GST_BASE_TRANSFORM_SRC_NAME;
 
-
-gboolean BaseTransform_Class::start_vfunc_callback(GstBaseTransform* self)
-{
-  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
-      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
-
-  // Non-gtkmmproc-generated custom classes implicitly call the default
-  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
-  // generated classes can use this optimisation, which avoids the unnecessary
-  // parameter conversions if there is no possibility of the virtual function
-  // being overridden:
-  if(obj_base && obj_base->is_derived_())
-  {
-    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
-    if(obj) // This can be NULL during destruction.
-    {
-      #ifdef GLIBMM_EXCEPTIONS_ENABLED
-      try // Trap C++ exceptions which would normally be lost because this is a C callback.
-      {
-      #endif //GLIBMM_EXCEPTIONS_ENABLED
-        // Call the virtual member method, which derived classes might override.
-        return static_cast<int>(obj->start_vfunc());
-      #ifdef GLIBMM_EXCEPTIONS_ENABLED
-      }
-      catch(...)
-      {
-        Glib::exception_handlers_invoke();
-      }
-      #endif //GLIBMM_EXCEPTIONS_ENABLED
-    }
-  }
-  
-  BaseClassType *const base = static_cast<BaseClassType*>(
-      g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The 
original underlying C class).
-  );
-
-  // Call the original underlying C function:
-  if(base && base->start)
-    return (*base->start)(self);
-
-  return true;
-}
-bool Gst::BaseTransform::start_vfunc() 
-{
-  BaseClassType *const base = static_cast<BaseClassType*>(
-      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class 
(The original underlying C class).
-  );
-
-  if(base && base->start)
-    return (*base->start)(gobj());
-
-  return true;
-}
-gboolean BaseTransform_Class::stop_vfunc_callback(GstBaseTransform* self)
-{
-  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
-      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
-
-  // Non-gtkmmproc-generated custom classes implicitly call the default
-  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
-  // generated classes can use this optimisation, which avoids the unnecessary
-  // parameter conversions if there is no possibility of the virtual function
-  // being overridden:
-  if(obj_base && obj_base->is_derived_())
-  {
-    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
-    if(obj) // This can be NULL during destruction.
-    {
-      #ifdef GLIBMM_EXCEPTIONS_ENABLED
-      try // Trap C++ exceptions which would normally be lost because this is a C callback.
-      {
-      #endif //GLIBMM_EXCEPTIONS_ENABLED
-        // Call the virtual member method, which derived classes might override.
-        return static_cast<int>(obj->stop_vfunc());
-      #ifdef GLIBMM_EXCEPTIONS_ENABLED
-      }
-      catch(...)
-      {
-        Glib::exception_handlers_invoke();
-      }
-      #endif //GLIBMM_EXCEPTIONS_ENABLED
-    }
-  }
-  
-  BaseClassType *const base = static_cast<BaseClassType*>(
-      g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The 
original underlying C class).
-  );
-
-  // Call the original underlying C function:
-  if(base && base->stop)
-    return (*base->stop)(self);
-
-  return true;
-}
-bool Gst::BaseTransform::stop_vfunc() 
-{
-  BaseClassType *const base = static_cast<BaseClassType*>(
-      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class 
(The original underlying C class).
-  );
-
-  if(base && base->stop)
-    return (*base->stop)(gobj());
-
-  return true;
-}
 GstFlowReturn BaseTransform_Class::prepare_output_buffer_vfunc_callback(GstBaseTransform* self, GstBuffer* 
input, GstBuffer** buffer)
 {
   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
diff --git a/gstreamer/src/basetransform.hg b/gstreamer/src/basetransform.hg
index 5a9a5f3..eed626b 100644
--- a/gstreamer/src/basetransform.hg
+++ b/gstreamer/src/basetransform.hg
@@ -187,21 +187,6 @@ public:
   /** Allows the subclass to be notified of the actual caps set.
    */
   _WRAP_VFUNC(bool set_caps(const Glib::RefPtr<Gst::Caps>& incaps, const Glib::RefPtr<Gst::Caps>& outcaps), 
"set_caps", return_value true)
-  _WRAP_VFUNC(bool set_caps(const Glib::RefPtr<Gst::Caps>& incaps, const Glib::RefPtr<Gst::Caps>& outcaps), 
"set_caps")
-
-  //TODO: Handwrapped because default return should be true otherwise the
-  //ogg_player_gtkmm example fails to run successfully.
-  /** Optional. Called when the element starts processing. Allows opening
-   * external resources.
-   */
-  virtual bool start_vfunc();
-
-  //TODO: Handwrapped because default return should be true otherwise the
-  //ogg_player_gtkmm example fails to run successfully.
-  /** Optional. Called when the element stops processing. Allows closing
-   * external resources.
-   */
-  virtual bool stop_vfunc();
 
 #m4 _CONVERSION(`GstEvent*', `const Glib::RefPtr<Gst::Event>&', `Glib::wrap($3, true)')
 #m4 _CONVERSION(`GstBuffer*', `const Glib::RefPtr<Gst::Buffer>&', `Glib::wrap($3, true)')
@@ -241,6 +226,15 @@ public:
    */
   _WRAP_VFUNC(bool accept_caps(PadDirection direction, const Glib::RefPtr<const Gst::Caps>& caps), 
"accept_caps")
 
+  /** Optional. Called when the element starts processing. Allows opening
+   * external resources.
+   */
+  _WRAP_VFUNC(bool start(), "start", return_value true)
+
+  /** Optional. Called when the element starts processing. Allows opening
+   * external resources.
+   */
+  _WRAP_VFUNC(bool stop(), "stop", return_value true)
 protected:
 #m4begin
   _PUSH(SECTION_PCC_CLASS_INIT_VFUNCS)
@@ -248,8 +242,6 @@ protected:
   klass->stop = &stop_vfunc_callback;
   klass->prepare_output_buffer = &prepare_output_buffer_vfunc_callback;
   _SECTION(SECTION_PH_VFUNCS)
-  static gboolean start_vfunc_callback(GstBaseTransform* self);
-  static gboolean stop_vfunc_callback(GstBaseTransform* self);
   static GstFlowReturn prepare_output_buffer_vfunc_callback(GstBaseTransform* self, GstBuffer* input, 
GstBuffer** buf);
   _POP()
 #m4end


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]