[gstreamermm] Added Gst::MessageStreamStatus.
- From: José Alburquerque <jaalburqu src gnome org>
- To: svn-commits-list gnome org
- Subject: [gstreamermm] Added Gst::MessageStreamStatus.
- Date: Fri, 10 Jul 2009 04:34:49 +0000 (UTC)
commit 9220cbd5be4e7585e4b7b24dfc7faa199558f275
Author: José Alburquerque <jaalburqu svn gnome org>
Date: Fri Jul 10 00:17:26 2009 -0400
Added Gst::MessageStreamStatus.
ChangeLog | 5 +++
gstreamer/src/message.ccg | 59 +++++++++++++++++++++++++++++++++++
gstreamer/src/message.hg | 75 +++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 139 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9206d25..df3d9ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-10 José Alburquerque <jaalburqu svn gnome org>
+
+ * gstreamer/src/message.ccg:
+ * gstreamer/src/message.hg: Added Gst::MessageStreamStatus.
+
2009-07-02 José Alburquerque <jaalburqu svn gnome org>
* configure.ac: Require glibmm-2.21.1 because of dependency on new
diff --git a/gstreamer/src/message.ccg b/gstreamer/src/message.ccg
index c395333..0ce1136 100644
--- a/gstreamer/src/message.ccg
+++ b/gstreamer/src/message.ccg
@@ -19,6 +19,7 @@
#include <gst/gstenumtypes.h>
#include <gst/interfaces/mixer.h>
+#include <gstreamermm/element.h>
#include <gstreamermm/mixer.h>
#include <gstreamermm/structure.h>
#include <gstreamermm/taglist.h>
@@ -601,6 +602,61 @@ Glib::RefPtr<Gst::Message> MessageAsyncDone::create(const Glib::RefPtr<Gst::Obje
return Gst::Message::wrap(message, false);
}
+MessageStreamStatus::MessageStreamStatus(GstMessage* castitem)
+: Message(castitem)
+{}
+
+Glib::RefPtr<Gst::Message>
+ MessageStreamStatus::create(const Glib::RefPtr<Gst::Object>& src,
+ Gst::StreamStatusType type, const Glib::RefPtr<Gst::Element>& owner)
+{
+ GstMessage* message = gst_message_new_stream_status(src->gobj(),
+ (GstStreamStatusType)(type), owner->gobj());
+ return Gst::Message::wrap(message, false);
+}
+
+void MessageStreamStatus::set_object(const Glib::RefPtr<Gst::Object>& object)
+{
+ Glib::Value< Glib::RefPtr<Gst::Object> > value;
+ value.init(Glib::Value< Glib::RefPtr<Gst::Object> >::value_type());
+ value.set(object);
+
+ gst_message_set_stream_status_object(gobj(), value.gobj());
+}
+
+Glib::RefPtr<Gst::Object> MessageStreamStatus::get_object() const
+{
+ const GValue* g_val =
+ gst_message_get_stream_status_object(const_cast<GstMessage*>(gobj()));
+ GstObject* gst_object = static_cast<GstObject*>(g_value_get_object(g_val));
+ return Glib::wrap(gst_object, true);
+}
+
+void MessageStreamStatus::parse(Gst::StreamStatusType& type,
+ Glib::RefPtr<Gst::Element>& owner) const
+{
+ GstElement* gst_element;
+ gst_message_parse_stream_status(const_cast<GstMessage*>(gobj()),
+ (GstStreamStatusType*)(&type), &gst_element);
+ owner = Glib::wrap(gst_element, true);
+}
+
+Gst::StreamStatusType MessageStreamStatus::parse() const
+{
+ GstStreamStatusType type;
+ gst_message_parse_stream_status(const_cast<GstMessage*>(gobj()),
+ &type, 0);
+ return (Gst::StreamStatusType)(type);
+}
+
+Glib::RefPtr<Gst::Element> MessageStreamStatus::parse_owner() const
+{
+ GstElement* gst_element;
+ gst_message_parse_stream_status(const_cast<GstMessage*>(gobj()), 0,
+ &gst_element);
+ return Glib::wrap(gst_element, true);
+}
+
Glib::RefPtr<Gst::Message> Message::wrap(GstMessage* message, bool take_copy)
{
Glib::RefPtr<Gst::Message> result;
@@ -669,6 +725,9 @@ Glib::RefPtr<Gst::Message> Message::wrap(GstMessage* message, bool take_copy)
case GST_MESSAGE_ASYNC_DONE:
result = Glib::RefPtr<Gst::Message>( new Gst::MessageAsyncDone(message) );
break;
+ case GST_MESSAGE_STREAM_STATUS:
+ result = Glib::RefPtr<Gst::Message>( new Gst::MessageStreamStatus(message) );
+ break;
case GST_MESSAGE_UNKNOWN:
case GST_MESSAGE_ANY:
result = Gst::wrap(message, false);
diff --git a/gstreamer/src/message.hg b/gstreamer/src/message.hg
index 8ce6b50..902631d 100644
--- a/gstreamer/src/message.hg
+++ b/gstreamer/src/message.hg
@@ -29,6 +29,7 @@ namespace Gst
{
_WRAP_ENUM(MessageType, GstMessageType)
+_WRAP_ENUM(StreamStatusType, GstStreamStatusType)
namespace Enums
{
@@ -47,6 +48,7 @@ Glib::QueryQuark get_quark(MessageType type);
} //namespace Enums
+class Element;
class Structure;
class TagList;
@@ -902,4 +904,77 @@ public:
static Glib::RefPtr<Gst::Message> create(const Glib::RefPtr<Gst::Object>& src);
};
+/** A stream status message.
+ * See create() for more details.
+ */
+class MessageStreamStatus : public Message
+{
+public:
+ explicit MessageStreamStatus(GstMessage* castitem);
+
+ /** Create a new stream status message. This message is posted when a
+ * streaming thread is created/destroyed or when the state changed.
+ *
+ * @param src The object originating the message.
+ * @param type The stream status type.
+ * @param owner The owner element of @a src.
+ * @return The new stream status message. MT safe.
+ */
+ static Glib::RefPtr<Gst::Message>
+ create(const Glib::RefPtr<Gst::Object>& src, Gst::StreamStatusType type,
+ const Glib::RefPtr<Gst::Element>& owner);
+
+ /** Configures the object handling the streaming thread. This is usually a
+ * Gst::Task object but other objects might be added in the future.
+ * @param object The object controlling the streaming.
+ *
+ * Since 0.10.24.
+ */
+ void set_object(const Glib::RefPtr<Gst::Object>& object);
+ _IGNORE(gst_message_set_stream_status_object)
+
+ /** Extracts the object managing the streaming thread from message.
+ * @return The object that manages the streaming thread. The actual object
+ * is usually a Gst::Task but other types can be added in the future. The
+ * object remains valid as long as the message is valid.
+ */
+ Glib::RefPtr<Gst::Object> get_object() const;
+ _IGNORE(gst_message_get_stream_status_object)
+
+ /** Extracts the stream status type and owner of the Gst::Message. The
+ * returned owner remains valid for as long as the reference to the message
+ * is valid.
+ *
+ * MT safe.
+ *
+ * @param type A reference to hold the status type.
+ * @param owner A reference to hold the owner Gst::Element.
+ *
+ * Since 0.10.24.
+ */
+ void parse(Gst::StreamStatusType& type, Glib::RefPtr<Gst::Element>& owner) const;
+ _IGNORE(gst_message_parse_stream_status)
+
+ /** Extracts the stream status type.
+ *
+ * MT safe.
+ *
+ * @return The stream status type.
+ *
+ * Since 0.10.24.
+ */
+ Gst::StreamStatusType parse() const;
+
+ /** Extracts the owner of the Gst::Message. The returned owner remains valid
+ * for as long as the reference to the message is valid.
+ *
+ * MT safe.
+ *
+ * @return The owner Gst::Element.
+ *
+ * Since 0.10.24.
+ */
+ Glib::RefPtr<Gst::Element> parse_owner() const;
+};
+
} //namespace Gst
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]