[gstreamermm] MessageTag: Wrapped new 0.10.24 methods.



commit e6deee59dcc2c555d50a85516f3dd38bc48fedad
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Fri Aug 14 18:02:53 2009 -0400

    	MessageTag: Wrapped new 0.10.24 methods.
    
    	* gstreamer/src/message.ccg:
    	* gstreamer/src/message.hg: Wrapped full create() method, void parse()
    	method and parse_pad() methods.

 ChangeLog                 |    8 ++++++++
 gstreamer/src/message.ccg |   40 ++++++++++++++++++++++++++++++++++++++--
 gstreamer/src/message.hg  |   40 +++++++++++++++++++++++++++++++++++++++-
 3 files changed, 85 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a706136..6fa0ac1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-08-14  José Alburquerque  <jaalburqu svn gnome org>
+
+	MessageTag: Wrapped new 0.10.24 methods.
+
+	* gstreamer/src/message.ccg:
+	* gstreamer/src/message.hg: Wrapped full create() method, void parse()
+	method and parse_pad() methods.
+
 2009-08-12  José Alburquerque  <jaalburqu svn gnome org>
 
 	Gst::Event Classes: Overload the parse methods.
diff --git a/gstreamer/src/message.ccg b/gstreamer/src/message.ccg
index 727e133..49ee05e 100644
--- a/gstreamer/src/message.ccg
+++ b/gstreamer/src/message.ccg
@@ -21,6 +21,7 @@
 #include <gst/interfaces/mixer.h>
 #include <gstreamermm/element.h>
 #include <gstreamermm/mixer.h>
+#include <gstreamermm/pad.h>
 #include <gstreamermm/structure.h>
 #include <gstreamermm/taglist.h>
 _PINCLUDE(gstreamermm/private/miniobject_p.h)
@@ -197,7 +198,9 @@ MessageTag::MessageTag(GstMessage* castitem)
 : Message(castitem)
 {}
 
-Glib::RefPtr<Gst::Message> MessageTag::create(const Glib::RefPtr<Gst::Object>& src, const Gst::TagList& taglist)
+Glib::RefPtr<Gst::Message>
+  MessageTag::create(const Glib::RefPtr<Gst::Object>& src,
+  const Gst::TagList& taglist)
 {
   //We create a copy because gst_message_new_tag() takes ownership:
   GstTagList* c_taglist = gst_tag_list_copy(taglist.gobj());
@@ -205,13 +208,46 @@ Glib::RefPtr<Gst::Message> MessageTag::create(const Glib::RefPtr<Gst::Object>& s
   return Gst::Message::wrap(message, false);
 }
 
+Glib::RefPtr<Gst::Message>
+  MessageTag::create(const Glib::RefPtr<Gst::Object>& src,
+  const Glib::RefPtr<Gst::Pad>& pad, const Gst::TagList& taglist)
+{
+  //We create a copy because gst_message_new_tag() takes ownership:
+  GstTagList* c_taglist = gst_tag_list_copy(taglist.gobj());
+  GstMessage* message = gst_message_new_tag_full(src->gobj(), pad->gobj(),
+    c_taglist);
+  return Gst::Message::wrap(message, false);
+}
+
+void MessageTag::parse(Glib::RefPtr<Gst::Pad>& pad, Gst::TagList& tag_list)
+  const
+{
+  GstTagList* gst_tag_list = 0;
+  GstPad* gst_pad = 0;
+
+  gst_message_parse_tag_full(const_cast<GstMessage*>(gobj()), &gst_pad,
+    &gst_tag_list);
+
+  pad = Glib::wrap(gst_pad);
+
+  // Use the Gst::TagList specific Glib::wrap() function:
+  tag_list = Glib::wrap(gst_tag_list, 0);
+}
+
 Gst::TagList MessageTag::parse() const
 {
-  GstTagList* gst_tag_list = gst_tag_list_new();
+  GstTagList* gst_tag_list = 0;
   gst_message_parse_tag(const_cast<GstMessage*>(gobj()), &gst_tag_list);
   return Gst::TagList(gst_tag_list);
 }
 
+Glib::RefPtr<Gst::Pad> MessageTag::parse_pad() const
+{
+  GstPad* gst_pad = 0;
+  gst_message_parse_tag_full(const_cast<GstMessage*>(gobj()), &gst_pad, 0);
+  return Glib::wrap(gst_pad);
+}
+
 MessageBuffering::MessageBuffering(GstMessage* castitem)
 : Message(castitem)
 {}
diff --git a/gstreamer/src/message.hg b/gstreamer/src/message.hg
index 3295950..721d8e6 100644
--- a/gstreamer/src/message.hg
+++ b/gstreamer/src/message.hg
@@ -51,6 +51,7 @@ Glib::QueryQuark get_quark(MessageType type);
 } //namespace Enums
 
 class Element;
+class Pad;
 class Structure;
 class TagList;
 
@@ -291,7 +292,33 @@ public:
    * @param tag_list The tag list for the message.
    * @return The new tag message. MT safe.
    */
-  static Glib::RefPtr<Gst::Message> create(const Glib::RefPtr<Gst::Object>& src, const Gst::TagList& taglist);
+  static Glib::RefPtr<Gst::Message>
+    create(const Glib::RefPtr<Gst::Object>& src, const Gst::TagList& taglist);
+
+  /** Create a new tag message. The taglist will be copied.  The message is
+   * posted by elements that discovered a new taglist.
+   *
+   * @param src The object originating the message.
+   * @param pad The originating pad for the tag.
+   * @param tag_list The tag list for the message.
+   * @return The new tag message. MT safe.
+   * 
+   * Since 0.10.24.
+   */
+  static Glib::RefPtr<Gst::Message>
+    create(const Glib::RefPtr<Gst::Object>& src,
+    const Glib::RefPtr<Gst::Pad>& pad, const Gst::TagList& taglist);
+
+  /** Extracts the Gst::Pad and Gst::TagList from the Gst::MessageTag.
+   *
+   * MT safe.
+   *
+   * @param pad Location where the originating pad is stored.
+   * @param tag_list Location for the tag-list.
+   *
+   * Since 0.10.24.
+   */
+  void parse(Glib::RefPtr<Gst::Pad>& pad, Gst::TagList& tag_list) const;
 
   /** Extracts and returns the Gst::TagList from the Gst::MessageTag.
    *
@@ -301,6 +328,17 @@ public:
    */
   Gst::TagList parse() const;
   _IGNORE(gst_message_parse_tag)
+
+  /** Extracts and returns the Gst::Pad from the Gst::MessageTag.
+   *
+   * MT safe.
+   *
+   * @return The Gst::Pad.
+   *
+   * Since 0.10.24.
+   */
+  Glib::RefPtr<Gst::Pad> parse_pad() const;
+  _IGNORE(gst_message_parse_tag_full)
 };
 
 /** A buffering message.



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