[gstreamermm: 41/167] removed some functions from element



commit a1f57f7f0424ef5ca8ac3a577d88c20ec9232e39
Author: Marcin Kolny at Flytronic <marcin kolny flytronic pl>
Date:   Thu Jul 25 15:41:12 2013 +0200

    removed some functions from element

 gstreamer/src/element.ccg |   60 +++------------------------------------------
 gstreamer/src/element.hg  |   29 +++++----------------
 2 files changed, 11 insertions(+), 78 deletions(-)
---
diff --git a/gstreamer/src/element.ccg b/gstreamer/src/element.ccg
index b79aac1..bfad3ea 100644
--- a/gstreamer/src/element.ccg
+++ b/gstreamer/src/element.ccg
@@ -22,7 +22,6 @@
 #include <gstreamermm/caps.h>
 #include <gstreamermm/elementfactory.h>
 #include <gstreamermm/event.h>
-#include <gstreamermm/index.h>
 #include <gstreamermm/pad.h>
 #include <gstreamermm/padtemplate.h>
 #include <gstreamermm/query.h>
@@ -107,14 +106,14 @@ void Element::post_message(int code, int line, MessageType type,
     domain, code, gst_text, gst_debug, file.c_str(), function.c_str(), line);
 }
 
-bool Element::query_position(Format& format) const
+bool Element::query_position(Gst::Format format) const
 {
-  return gst_element_query_position(const_cast<GstElement*>(gobj()), reinterpret_cast<GstFormat*>(&format), 
0);
+  return gst_element_query_position(const_cast<GstElement*>(gobj()), (GstFormat)format, 0);
 }
 
-bool Element::query_duration(Format& format) const
+bool Element::query_duration(Format format) const
 {
-  return gst_element_query_duration(const_cast<GstElement*>(gobj()), reinterpret_cast<GstFormat*>(&format), 
0);
+  return gst_element_query_duration(const_cast<GstElement*>(gobj()), (GstFormat)format, 0);
 }
 
 // This method is written manually because an extra ref is necessary. See
@@ -178,56 +177,5 @@ bool Gst::Element::set_clock_vfunc(const Glib::RefPtr<Gst::Clock>& clock)
   typedef bool RType;
   return RType();
 }
-const GstQueryType* Element_Class::get_query_types_vfunc_callback(GstElement* 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.
-    {
-      try // Trap C++ exceptions which would normally be lost because this is a C callback.
-      {
-        // Call the virtual member method, which derived classes might override.
-        return reinterpret_cast<const GstQueryType*>((obj->get_query_types_vfunc()).data());
-      }
-      catch(...)
-      {
-        Glib::exception_handlers_invoke();
-      }
-    }
-  }
-  
-  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->get_query_types)
-    return (*base->get_query_types)(self);
-
-
-  typedef const GstQueryType* RType;
-  return RType();
-}
-Glib::ArrayHandle<QueryType> Gst::Element::get_query_types_vfunc() const
-{
-  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->get_query_types)
-    return Glib::ArrayHandle<QueryType>(reinterpret_cast<const 
QueryType*>((*base->get_query_types)(const_cast<GstElement*>(gobj()))), Glib::OWNERSHIP_SHALLOW);
-
-  typedef Glib::ArrayHandle<QueryType> RType;
-  return RType(0, 0, Glib::OWNERSHIP_NONE);
-}
 
 } //namespace Gst
diff --git a/gstreamer/src/element.hg b/gstreamer/src/element.hg
index d920c20..f1bfc49 100644
--- a/gstreamer/src/element.hg
+++ b/gstreamer/src/element.hg
@@ -301,26 +301,26 @@ public:
   _WRAP_METHOD(Glib::ArrayHandle<QueryType> get_query_types() const, gst_element_get_query_types)
 
   _WRAP_METHOD(bool query(const Glib::RefPtr<Gst::Query>& query) const, gst_element_query)
-  _WRAP_METHOD(bool query_convert(Format src_format, gint64 src_val, Format dest_format, gint64& dest_val) 
const, gst_element_query_convert)
-  _WRAP_METHOD(bool query_position(Format format, gint64& cur) const, gst_element_query_position)
+  _WRAP_METHOD(bool query_convert(Gst::Format src_format, gint64 src_val, Format dest_format, gint64& 
dest_val) const, gst_element_query_convert)
+  _WRAP_METHOD(bool query_position(Gst::Format format, gint64& cur) const, gst_element_query_position)
 
   /** Queries an element for the stream position.
    *
-   * @param format A pointer to the Gst::Format asked for. On return will
+   * @param format On return will
    * contain the Gst::Format used.
    * @return true if the query could be performed.
    */
-  bool query_position(Format& format) const;
+  bool query_position(Gst::Format format) const;
 
-  _WRAP_METHOD(bool query_duration(Format format, gint64& duration) const, gst_element_query_duration)
+  _WRAP_METHOD(bool query_duration(Gst::Format format, gint64& duration) const, gst_element_query_duration)
 
   /** Queries an element for the total stream duration.
    *
-   * @param format A pointer to the Gst::Format asked for. On return contains
+   * @param format On return contains
    * the Gst::Format used.
    * @return true if the query could be performed.
    */
-  bool query_duration(Format& format) const;
+  bool query_duration(Gst::Format format) const;
 
   _WRAP_METHOD(bool seek(Format format, SeekFlags seek_flags, gint64 seek_pos), gst_element_seek_simple)
   _WRAP_METHOD(bool seek(double rate, Format format, SeekFlags flags, SeekType cur_type, gint64 cur, 
SeekType stop_type, gint64 stop), gst_element_seek)
@@ -346,11 +346,6 @@ public:
   _WRAP_SIGNAL(void pad_added(const Glib::RefPtr<Gst::Pad>& new_pad), "pad-added")
   _WRAP_SIGNAL(void pad_removed(const Glib::RefPtr<Gst::Pad>& old_pad), "pad-removed")
 
-#m4 _CONVERSION(`GstPadTemplate*', `const Glib::RefPtr<const Gst::PadTemplate>&', `Glib::wrap(($3), true)')
-  /** Called when a new pad is requested.
-   */
-  _WRAP_VFUNC(Glib::RefPtr<Gst::Pad> request_new_pad(const Glib::RefPtr<const Gst::PadTemplate>& templ, 
const Glib::ustring& name), "request_new_pad")
-
   /** Called when a request pad is to be released.
    */
   _WRAP_VFUNC(void release_pad(const Glib::RefPtr<Gst::Pad>& pad), "release_pad")
@@ -386,14 +381,6 @@ public:
    */
   virtual bool set_clock_vfunc(const Glib::RefPtr<Gst::Clock>& clock);
 
-  // This vfunc is handwritten because the default gmmproc code produces a
-  // compile error related to tyring to use Glib::ArrayHandle<>'s default
-  // constructor when returning a default value at the end of both the callback
-  // and the vfunc.
-  /** Get the supported Gst::QueryType of this element.
-   */
-   virtual Glib::ArrayHandle<QueryType> get_query_types_vfunc() const;
-
 #m4 _CONVERSION(`GstEvent*',`const Glib::RefPtr<Gst::Event>&', `Glib::wrap($3, true)')
   /** Send a Gst::Event to the element.
    */
@@ -408,10 +395,8 @@ protected:
 #m4begin
   _PUSH(SECTION_PCC_CLASS_INIT_VFUNCS)
   klass->set_clock = &set_clock_vfunc_callback;
-  klass->get_query_types = &get_query_types_vfunc_callback;
   _SECTION(SECTION_PH_VFUNCS)
   static gboolean set_clock_vfunc_callback(GstElement* self, GstClock* clock);
-  static const GstQueryType* get_query_types_vfunc_callback(GstElement* self);
   _POP()
 #m4end
 };


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