[gstreamermm] Element: Add request_pad() and a link_pads() overload.



commit 30f97041e5ac788eebcc12b5155adfdd6661ece5
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Wed May 25 00:23:51 2011 -0400

    Element: Add request_pad() and a link_pads() overload.
    
    	* gstreamer/src/pad.hg: Wrap the GstPadLinkCheck enum.
    	* gstreamer/src/element.hg: Add regquest_pad() and link_pads() which
    	wraps gst_element_link_pads_full().
    	* tools/m4/convert_gst.m4: Add necessary conversion.

 ChangeLog                |    9 +++++++++
 gstreamer/src/element.hg |   10 ++++++++++
 gstreamer/src/pad.hg     |    5 +++--
 tools/m4/convert_gst.m4  |    2 ++
 4 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 145e5bc..85f79ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-05-25  José Alburquerque  <jaalburqu svn gnome org>
+
+	Element: Add request_pad() and a link_pads() overload.
+
+	* gstreamer/src/pad.hg: Wrap the GstPadLinkCheck enum.
+	* gstreamer/src/element.hg: Add regquest_pad() and link_pads() which
+	wraps gst_element_link_pads_full().
+	* tools/m4/convert_gst.m4: Add necessary conversion.
+
 2011-05-24  José Alburquerque  <jaalburqu svn gnome org>
 
 	ElementFactory: Added filter(), get_elements() and is_of_type().
diff --git a/gstreamer/src/element.hg b/gstreamer/src/element.hg
index 4af02a1..2a3a5df 100644
--- a/gstreamer/src/element.hg
+++ b/gstreamer/src/element.hg
@@ -24,6 +24,7 @@
 #include <gstreamermm/error.h>
 #include <gstreamermm/event.h>
 #include <gstreamermm/message.h>
+#include <gstreamermm/pad.h>
 #include <gstreamermm/query.h>
 
 _DEFS(gstreamermm,gst)
@@ -171,6 +172,10 @@ public:
   //TODO: The documentation says "The pad should be released with gst_element_release_request_pad().", which is odd. murrayc
   _WRAP_METHOD(Glib::RefPtr<Gst::Pad> get_request_pad(const Glib::ustring& name), gst_element_get_request_pad)
 
+  //TODO: The documentation says "The pad should be released with gst_element_release_request_pad().", which is odd. murrayc
+  _WRAP_METHOD(Glib::RefPtr<Gst::Pad> request_pad(const Glib::RefPtr<Gst::PadTemplate>& templ, const Glib::ustring& name, const Glib::RefPtr<const Gst::Caps>& caps), gst_element_request_pad)
+  //TODO: Write overloads without requiring a name or a caps.
+
   _WRAP_METHOD(Glib::RefPtr<Gst::Pad> get_static_pad(const Glib::ustring& name), gst_element_get_static_pad)
   _WRAP_METHOD(Glib::RefPtr<const Gst::Pad> get_static_pad(const Glib::ustring& name) const, gst_element_get_static_pad, constversion)
   _IGNORE(gst_element_get_pad)
@@ -206,6 +211,11 @@ public:
   //C API's convenience function gst_element_link_many().
   _WRAP_METHOD(bool link_pads(const Glib::ustring& srcpadname, const Glib::RefPtr<Gst::Element>& dest, const Glib::ustring& destpadname, const Glib::RefPtr<Gst::Caps>& filter), gst_element_link_pads_filtered)
 
+  //This is not like link() because link() was written to return the
+  //destination element as a convenience for further linking to compensate for
+  //C API's convenience function gst_element_link_many().
+  _WRAP_METHOD(bool link_pads(const Glib::ustring& srcpadname, const Glib::RefPtr<Gst::Element>& dest, const Glib::ustring& destpadname, PadLinkCheck flags), gst_element_link_pads_full)
+
   /** Links @a src to @a dest using the given caps as filtercaps. The link must
    * be from source to destination; the other direction will not be tried. The
    * function looks for existing pads that aren't linked yet. It will request
diff --git a/gstreamer/src/pad.hg b/gstreamer/src/pad.hg
index bd259f5..20381dc 100644
--- a/gstreamer/src/pad.hg
+++ b/gstreamer/src/pad.hg
@@ -39,11 +39,12 @@ class Query;
 template <class CppType>
 class Iterator;
 
+_WRAP_ENUM(ActivateMode, GstActivateMode)
+_WRAP_ENUM(FlowReturn, GstFlowReturn)
 _WRAP_ENUM(PadDirection, GstPadDirection)
 _WRAP_ENUM(PadFlags, GstPadFlags)
 _WRAP_ENUM(PadLinkReturn, GstPadLinkReturn)
-_WRAP_ENUM(FlowReturn, GstFlowReturn)
-_WRAP_ENUM(ActivateMode, GstActivateMode)
+_WRAP_ENUM(PadLinkCheck, GstPadLinkCheck)
 
 /** A class that represents objects contained by elements that allows links to
  * other elements.
diff --git a/tools/m4/convert_gst.m4 b/tools/m4/convert_gst.m4
index c45fb6b..41419b9 100644
--- a/tools/m4/convert_gst.m4
+++ b/tools/m4/convert_gst.m4
@@ -27,6 +27,7 @@ _CONV_ENUM(Gst,MixerFlags)
 _CONV_ENUM(Gst,MixerType)
 _CONV_ENUM(Gst,NavigationCommand)
 _CONV_ENUM(Gst,PadDirection)
+_CONV_ENUM(Gst,PadLinkCheck)
 _CONV_ENUM(Gst,PadLinkReturn)
 _CONV_ENUM(Gst,PadPresence)
 _CONV_ENUM(Gst,PluginDependencyFlags)
@@ -150,6 +151,7 @@ _CONVERSION(`const Glib::RefPtr<const Gst::Pad>&',`GstPad*',`const_cast<GstPad*>
 
 dnl PadTemplate
 _CONVERSION(`GstPadTemplate*',`Glib::RefPtr<Gst::PadTemplate>', `Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<Gst::PadTemplate>&',`GstPadTemplate*',`Glib::unwrap($3)')
 _CONVERSION(`const Glib::RefPtr<const Gst::PadTemplate>&',`GstPadTemplate*',`const_cast<GstPadTemplate*>(Glib::unwrap($3))')
 
 dnl Plugin



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