[gstreamermm: 18/167] fixed basetransform class



commit 3134087f2a6f6e857a2fe8f92c7b0c43bbcb0534
Author: Marcin Kolny at Flytronic <marcin kolny flytronic pl>
Date:   Wed Jul 24 16:16:41 2013 +0200

    fixed basetransform class

 gstreamer/src/basetransform.ccg |   10 +++++-----
 gstreamer/src/basetransform.hg  |   15 +++++----------
 gstreamer/src/gst_vfuncs.defs   |    5 +++--
 tools/m4/convert_gst.m4         |    1 +
 4 files changed, 14 insertions(+), 17 deletions(-)
---
diff --git a/gstreamer/src/basetransform.ccg b/gstreamer/src/basetransform.ccg
index 171ee22..abcc04d 100644
--- a/gstreamer/src/basetransform.ccg
+++ b/gstreamer/src/basetransform.ccg
@@ -134,7 +134,7 @@ bool Gst::BaseTransform::stop_vfunc()
 
   return true;
 }
-GstFlowReturn BaseTransform_Class::prepare_output_buffer_vfunc_callback(GstBaseTransform* self, GstBuffer* 
input, gint size, GstCaps* caps, GstBuffer** buffer)
+GstFlowReturn BaseTransform_Class::prepare_output_buffer_vfunc_callback(GstBaseTransform* self, GstBuffer* 
input, GstBuffer** buffer)
 {
   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
@@ -155,7 +155,7 @@ GstFlowReturn BaseTransform_Class::prepare_output_buffer_vfunc_callback(GstBaseT
         // Call the virtual member method, which derived classes might override.
         const GstFlowReturn result =
           static_cast<GstFlowReturn>(obj->prepare_output_buffer_vfunc(
-          Glib::wrap(input, true), size , Glib::wrap(caps, true), cpp_buffer));
+          Glib::wrap(input, true), cpp_buffer));
         *buffer = cpp_buffer->gobj_copy();
         return result;
       }
@@ -172,13 +172,13 @@ GstFlowReturn BaseTransform_Class::prepare_output_buffer_vfunc_callback(GstBaseT
 
   // Call the original underlying C function:
   if(base && base->prepare_output_buffer)
-    return (*base->prepare_output_buffer)(self, input, size, caps, buffer);
+    return (*base->prepare_output_buffer)(self, input, buffer);
 
 
   typedef GstFlowReturn RType;
   return RType();
 }
-FlowReturn Gst::BaseTransform::prepare_output_buffer_vfunc(const Glib::RefPtr<Gst::Buffer>& input, int size, 
const Glib::RefPtr<Gst::Caps>& caps, Glib::RefPtr<Gst::Buffer>& buffer)
+FlowReturn Gst::BaseTransform::prepare_output_buffer_vfunc(const Glib::RefPtr<Gst::Buffer>& input, 
Glib::RefPtr<Gst::Buffer>& buffer)
 {
   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).
@@ -189,7 +189,7 @@ FlowReturn Gst::BaseTransform::prepare_output_buffer_vfunc(const Glib::RefPtr<Gs
     GstBuffer* gst_buffer;
     const Gst::FlowReturn result =
       static_cast<Gst::FlowReturn>((*base->prepare_output_buffer)(gobj(),
-      Glib::unwrap(input), size, Glib::unwrap(caps), &gst_buffer));
+      Glib::unwrap(input), &gst_buffer));
     buffer = Glib::wrap(gst_buffer, false); // Don't take copy because callback returns a newly created copy.
     return result;
   }
diff --git a/gstreamer/src/basetransform.hg b/gstreamer/src/basetransform.hg
index 2b04ff6..3ef832b 100644
--- a/gstreamer/src/basetransform.hg
+++ b/gstreamer/src/basetransform.hg
@@ -165,12 +165,12 @@ public:
   /** Optional. Given the pad in this direction and the given caps, what caps
    * are allowed on the other pad in this element ?
    */
-  _WRAP_VFUNC(Glib::RefPtr<Gst::Caps> transform_caps(PadDirection direction, const Glib::RefPtr<Gst::Caps>& 
caps), "transform_caps")
+  _WRAP_VFUNC(Glib::RefPtr<Gst::Caps> transform_caps(PadDirection direction, const Glib::RefPtr<Gst::Caps>& 
caps, const Glib::RefPtr<Gst::Caps>& filter), "transform_caps")
 
   /** Optional. Given the pad in this direction and the given caps, fixate the
    * caps on the other pad.
    */
-  _WRAP_VFUNC(void fixate_caps(PadDirection direction, const Glib::RefPtr<Gst::Caps>& caps, const 
Glib::RefPtr<Gst::Caps>& othercaps), "fixate_caps")
+  _WRAP_VFUNC(Glib::RefPtr<Gst::Caps> fixate_caps(PadDirection direction, const Glib::RefPtr<Gst::Caps>& 
caps, const Glib::RefPtr<Gst::Caps>& othercaps), "fixate_caps")
 
   //TODO: This virtual function can't be wrapped without causing execution
   //errors with the ogg_player_gtkmm example.
@@ -184,7 +184,7 @@ public:
   /** Required if the transform is not in-place. Get the size in bytes of one
    * unit for the given caps.
    */
-  _WRAP_VFUNC(bool get_unit_size(const Glib::RefPtr<Gst::Caps>& caps, guint& size) const, "get_unit_size")
+  _WRAP_VFUNC(bool get_unit_size(const Glib::RefPtr<Gst::Caps>& caps, gsize& size) const, "get_unit_size")
 
   /** Allows the subclass to be notified of the actual caps set.
    */
@@ -205,11 +205,6 @@ public:
   virtual bool stop_vfunc();
 
 #m4 _CONVERSION(`GstEvent*', `const Glib::RefPtr<Gst::Event>&', `Glib::wrap($3, true)')
-  /* Optional. Event handler on the sink pad. This function should return
-   * <tt>true</tt> if the base class should forward the event.
-   */
-  _WRAP_VFUNC(bool event(const Glib::RefPtr<Gst::Event>& event), "event")
-
 #m4 _CONVERSION(`GstBuffer*', `const Glib::RefPtr<Gst::Buffer>&', `Glib::wrap($3, true)')
 
   /** Required if the element does not operate in-place. Transforms one
@@ -228,7 +223,7 @@ public:
    * even just increment the reference to the input buffer (if in passthrough
    * mode).
    */
-  virtual FlowReturn prepare_output_buffer_vfunc(const Glib::RefPtr<Gst::Buffer>& input, int size, const 
Glib::RefPtr<Gst::Caps>& caps, Glib::RefPtr<Gst::Buffer>& buffer);
+  virtual FlowReturn prepare_output_buffer_vfunc(const Glib::RefPtr<Gst::Buffer>& input, 
Glib::RefPtr<Gst::Buffer>& buffer);
 
   /** Optional. Event handler on the source pad.
    */
@@ -256,7 +251,7 @@ protected:
   _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, gint 
size, GstCaps* caps, GstBuffer** buf);
+  static GstFlowReturn prepare_output_buffer_vfunc_callback(GstBaseTransform* self, GstBuffer* input, 
GstBuffer** buf);
   _POP()
 #m4end
 };
diff --git a/gstreamer/src/gst_vfuncs.defs b/gstreamer/src/gst_vfuncs.defs
index 153e7c9..22e5ec7 100644
--- a/gstreamer/src/gst_vfuncs.defs
+++ b/gstreamer/src/gst_vfuncs.defs
@@ -362,12 +362,13 @@
   (parameters
    '("GstPadDirection" "direction")
    '("GstCaps*" "caps")
+   '("GstCaps*" "filter")
   )
 )
 
 (define-vfunc fixate_caps
   (of-object "GstBaseTransform")
-  (return-type "void")
+  (return-type "GstCaps*")
   (parameters
    '("GstPadDirection" "direction")
    '("GstCaps*" "caps")
@@ -392,7 +393,7 @@
   (return-type "gboolean")
   (parameters
    '("GstCaps*" "caps")
-   '("guint*" "size")
+   '("gsize*" "size")
   )
 )
 
diff --git a/tools/m4/convert_gst.m4 b/tools/m4/convert_gst.m4
index c3370de..550e7ad 100644
--- a/tools/m4/convert_gst.m4
+++ b/tools/m4/convert_gst.m4
@@ -228,6 +228,7 @@ dnl Basic General Conversions
 _CONVERSION(`guint64&',`guint64*',`&$3')
 _CONVERSION(`guint*',`guint&',`*$3')
 _CONVERSION(`const guint&',`guint',`$3')
+_CONVERSION(`gsize*',`gsize&',`*$3')
 _CONVERSION(`const guint32&',`guint32',`$3')
 _CONVERSION(`guint8*&',`guint8**',`&$3')
 


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