[gstreamermm] Wrap some new API included in recent GStreamer release.



commit 3c387daba286042b1d450b30f1e4531837013113
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Fri Apr 9 00:41:04 2010 -0400

    	Wrap some new API included in recent GStreamer release.
    
    	* gstreamer/src/basesrc.hg: Wrapped new_seamless_segment().
    	* gstreamer/src/caps.hg: Wrapped set_value() and can_intersect()
    	methods.
    	* gstreamer/src/event.ccg:
    	* gstreamer/src/event.hg: Added new EventSinkMessage class.
    	* gstreamer/src/registry.hg: Wrapped get_feature_list_cookie().
    	* gstreamer/src/structure.hg: Included _IGNORE()'s for functions that
    	need not be wrapped.

 ChangeLog                  |   13 +++++++++++++
 gstreamer/src/basesrc.hg   |    1 +
 gstreamer/src/caps.hg      |   29 +++++++++++++++++++++++++++--
 gstreamer/src/event.ccg    |   29 +++++++++++++++++++++++++++++
 gstreamer/src/event.hg     |   29 +++++++++++++++++++++++++++++
 gstreamer/src/registry.hg  |    1 +
 gstreamer/src/structure.hg |    4 ++++
 7 files changed, 104 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fb1dd3a..795e94b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-04-09  José Alburquerque  <jaalburqu svn gnome org>
+
+	Wrap some new API included in recent GStreamer release.
+
+	* gstreamer/src/basesrc.hg: Wrapped new_seamless_segment().
+	* gstreamer/src/caps.hg: Wrapped set_value() and can_intersect()
+	methods.
+	* gstreamer/src/event.ccg:
+	* gstreamer/src/event.hg: Added new EventSinkMessage class.
+	* gstreamer/src/registry.hg: Wrapped get_feature_list_cookie().
+	* gstreamer/src/structure.hg: Included _IGNORE()'s for functions that
+	need not be wrapped.
+
 2010-03-21  kitone <kitone free fr>
 
 	MessageDuration: Correct variables named 'position' to 'duration'.
diff --git a/gstreamer/src/basesrc.hg b/gstreamer/src/basesrc.hg
index 851c9bb..b494c0a 100644
--- a/gstreamer/src/basesrc.hg
+++ b/gstreamer/src/basesrc.hg
@@ -157,6 +157,7 @@ public:
   _WRAP_METHOD(void set_blocksize(gulong blocksize), gst_base_src_set_blocksize)
   _WRAP_METHOD(bool get_do_timestamp() const, gst_base_src_get_do_timestamp)
   _WRAP_METHOD(void set_do_timestamp(bool timestamp), gst_base_src_set_do_timestamp)
+  _WRAP_METHOD(bool new_seamless_segment(gint64 start, gint64 stop, gint64 position), gst_base_src_new_seamless_segment)
 
   /** Gets the source Gst::Pad object of the element.
    */
diff --git a/gstreamer/src/caps.hg b/gstreamer/src/caps.hg
index 00a571e..4d45af8 100644
--- a/gstreamer/src/caps.hg
+++ b/gstreamer/src/caps.hg
@@ -151,6 +151,19 @@ public:
    */
   void set_simple(const Glib::ustring& name, const char* data);
 
+  _WRAP_METHOD(void set_value(const Glib::ustring& field, const Glib::ValueBase& value), gst_caps_set_value)
+
+  /** Sets the given @a field on all structures to the given value. This is a
+   * convenience function for calling Gst::Structure::set_value()  on all
+   * structures.
+   *
+   * @param name Field to set.
+   * @param data A value which the field should be set to (this can be any
+   * supported C++ type).
+   */
+  template <class DataType>
+  void set_value(const Glib::ustring& name, const DataType& data);
+
   _WRAP_METHOD(bool is_any() const, gst_caps_is_any)
   _WRAP_METHOD(bool empty() const, gst_caps_is_empty)
   _WRAP_METHOD(bool is_fixed() const, gst_caps_is_fixed)
@@ -158,6 +171,7 @@ public:
   _WRAP_METHOD(bool equals_fixed(const Glib::RefPtr<const Gst::Caps>& other_caps) const, gst_caps_is_equal_fixed)
   _WRAP_METHOD(bool is_always_compatible(const Glib::RefPtr<const Gst::Caps>& other_caps) const, gst_caps_is_always_compatible)
   _WRAP_METHOD(bool is_subset(const Glib::RefPtr<const Gst::Caps>& superset_caps) const, gst_caps_is_subset)
+  _WRAP_METHOD(bool can_intersect(const Glib::RefPtr<const Gst::Caps>& caps2) const, gst_caps_can_intersect)
 
   //This is const (returns a non const) because it always creates a new instance:
   _WRAP_METHOD(Glib::RefPtr<Gst::Caps> get_intersect(const Glib::RefPtr<const Gst::Caps>& other_caps) const, gst_caps_intersect)
@@ -188,10 +202,10 @@ public:
   _WRAP_METHOD(void truncate(), gst_caps_truncate)
 };
 
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
 /******************************* Gst::Caps *******************************/
 
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
 template <class DataType>
 void Caps::set_simple(const Glib::ustring& name, const DataType& data)
 {
@@ -203,6 +217,17 @@ void Caps::set_simple(const Glib::ustring& name, const DataType& data)
   this->set_simple(name, reinterpret_cast<Glib::ValueBase&>(value));
 }
 
+template <class DataType>
+void Caps::set_value(const Glib::ustring& name, const DataType& data)
+{
+  typedef Glib::Value<DataType> ValueType;
+
+  ValueType value;
+  value.init(ValueType::value_type());
+  value.set(data);
+  this->set_value(name, reinterpret_cast<Glib::ValueBase&>(value));
+}
+
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
 } //namespace Gst
diff --git a/gstreamer/src/event.ccg b/gstreamer/src/event.ccg
index d7e629e..fd83531 100644
--- a/gstreamer/src/event.ccg
+++ b/gstreamer/src/event.ccg
@@ -18,6 +18,8 @@
  */
 
 #include <gst/gstenumtypes.h>
+#include <gst/gstutils.h>
+#include <gstreamermm/message.h>
 #include <gstreamermm/structure.h>
 #include <gstreamermm/taglist.h>
 _PINCLUDE(gstreamermm/private/miniobject_p.h)
@@ -448,6 +450,30 @@ bool EventStep::parse_intermediate() const
   return gst_intermediate;
 }
 
+EventSinkMessage::EventSinkMessage(GstEvent* castitem) :
+Event(castitem)
+{}
+
+Glib::RefPtr<Gst::Event> EventSinkMessage::create(const Glib::RefPtr<Gst::Message>& msg)
+{
+  GstEvent* event = gst_event_new_sink_message(msg->gobj());
+  return Gst::Event::wrap(event, false);
+}
+
+Glib::RefPtr<Gst::Message> EventSinkMessage::parse()
+{
+  GstMessage* gst_msg = 0;
+  gst_event_parse_sink_message(gobj(), &gst_msg);
+  return Gst::wrap(gst_msg);
+}
+
+Glib::RefPtr<const Gst::Message> EventSinkMessage::parse() const
+{
+  GstMessage* gst_msg = 0;
+  gst_event_parse_sink_message(const_cast<GstEvent*>(gobj()), &gst_msg);
+  return Gst::wrap(gst_msg);
+}
+
 Glib::RefPtr<Gst::Event> Event::wrap(GstEvent* event, bool take_copy)
 {
   Gst::Event* wrapper = 0;
@@ -476,6 +502,9 @@ Glib::RefPtr<Gst::Event> Event::wrap(GstEvent* event, bool take_copy)
     case GST_EVENT_BUFFERSIZE:
       wrapper = new Gst::EventBufferSize(event);
       break;
+    case GST_EVENT_SINK_MESSAGE:
+      wrapper = new Gst::EventSinkMessage(event);
+      break;
     case GST_EVENT_QOS:
       wrapper = new Gst::EventQos(event);
       break;
diff --git a/gstreamer/src/event.hg b/gstreamer/src/event.hg
index 85b4e69..8b2676a 100644
--- a/gstreamer/src/event.hg
+++ b/gstreamer/src/event.hg
@@ -57,6 +57,7 @@ _WRAP_ENUM(SeekType, GstSeekType)
 _WRAP_ENUM(SeekFlags, GstSeekFlags)
 _WRAP_ENUM(EventTypeFlags, GstEventTypeFlags)
 
+class Message;
 class Structure;
 class TagList;
 
@@ -792,4 +793,32 @@ public:
   bool parse_intermediate() const;
 };
 
+/** A sink-message event.  See create() for more details.
+ */
+class EventSinkMessage : public Event
+{
+public:
+  explicit EventSinkMessage(GstEvent* event);
+
+  /** Create a new sink-message event.  The purpose of the sink-message event
+   * is to instruct a sink to post the message contained in the event
+   * synchronized with the stream.
+   *
+   * @param msg The message to be posted.
+   * @return A new Gst::EventSinkMessage.
+   */
+  static Glib::RefPtr<Gst::Event> create(const Glib::RefPtr<Gst::Message>& message);
+
+  /** Parse the sink-message event.
+   * @return the sink-messge's event message.
+   */
+  Glib::RefPtr<Gst::Message> parse();
+  _IGNORE(gst_event_parse_sink_message)
+
+  /** Parse the sink-message event.
+   * @return the sink-messge's event message.
+   */
+  Glib::RefPtr<const Gst::Message> parse() const;
+};
+
 } //namespace Gst
diff --git a/gstreamer/src/registry.hg b/gstreamer/src/registry.hg
index 32074dd..15a5243 100644
--- a/gstreamer/src/registry.hg
+++ b/gstreamer/src/registry.hg
@@ -98,6 +98,7 @@ public:
 #m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> >',`$2($3, Glib::OWNERSHIP_DEEP)')
   _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> > get_feature_list(GType type) const, gst_registry_get_feature_list)
 
+  _WRAP_METHOD(guint32 get_feature_list_cookie() const, gst_registry_get_feature_list_cookie)
   _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> > get_feature_list(const Glib::ustring& name), gst_registry_get_feature_list_by_plugin)
   _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> > get_feature_list(const Glib::ustring& name) const, gst_registry_get_feature_list_by_plugin)
 
diff --git a/gstreamer/src/structure.hg b/gstreamer/src/structure.hg
index c4d3af8..813ea02 100644
--- a/gstreamer/src/structure.hg
+++ b/gstreamer/src/structure.hg
@@ -294,8 +294,12 @@ public:
   _IGNORE(gst_structure_foreach)
 
   _WRAP_METHOD(int size() const, gst_structure_n_fields)
+
   _WRAP_METHOD(bool has_field(const Glib::ustring& fieldname) const, gst_structure_has_field)
+  _IGNORE(gst_structure_id_has_field)
+
   _WRAP_METHOD(bool has_field(const Glib::ustring& fieldname, GType type) const, gst_structure_has_field_typed)
+  _IGNORE(gst_structure_id_has_field_typed)
 
   /** Gets the value of field @a fieldname into boolean @a value.
    * The caller is responsible for making sure the field exists and has the



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