[gstreamermm] added a EventCaps class



commit 0ead0c3eed07f5a950bdb6b55c6e5f5980505382
Author: Marcin Kolny <marcin kolny flytronic pl>
Date:   Mon Oct 7 15:59:35 2013 +0200

    added a EventCaps class

 gstreamer/src/event.ccg |   14 ++++++++++++++
 gstreamer/src/event.hg  |   19 +++++++++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/gstreamer/src/event.ccg b/gstreamer/src/event.ccg
index 0fc60a9..0de9f85 100644
--- a/gstreamer/src/event.ccg
+++ b/gstreamer/src/event.ccg
@@ -382,4 +382,18 @@ EventStreamStart::create(const Glib::ustring& stream_id)
   return Glib::wrap_event_derived<EventStreamStart>(event, false);
 }
 
+Glib::RefPtr<Gst::EventCaps>
+EventCaps::create(const Glib::RefPtr<Gst::Caps>& caps)
+{
+  GstEvent* event = gst_event_new_caps(caps->gobj());
+  return Glib::wrap_event_derived<EventCaps>(event, false);
+}
+
+Glib::RefPtr<Gst::Caps> EventCaps::parse()
+{
+  GstCaps* gst_caps = 0;
+  gst_event_parse_caps(gobj(), &gst_caps);
+  return Glib::wrap(gst_caps);
+}
+
 } //namespace Gst
diff --git a/gstreamer/src/event.hg b/gstreamer/src/event.hg
index 6f82edb..6318552 100644
--- a/gstreamer/src/event.hg
+++ b/gstreamer/src/event.hg
@@ -22,6 +22,7 @@
 #include <gstreamermm/format.h>
 #include <gstreamermm/clock.h>
 #include <gstreamermm/segment.h>
+#include <gstreamermm/caps.h>
 
 _DEFS(gstreamermm,gst)
 
@@ -744,4 +745,22 @@ public:
     create(const Glib::ustring& stream_id);
 };
 
+class EventCaps : public Event
+{
+public:
+
+  /**
+   * Create a new CAPS event for @caps. The caps event can only travel downstream
+   * synchronized with the buffer flow and contains the format of the buffers
+   * that will follow after the event.
+   *
+   * @param caps event caps
+   * @return the new CAPS event.
+  */
+  static Glib::RefPtr<Gst::EventCaps>
+    create(const Glib::RefPtr<Gst::Caps>& caps);
+
+  Glib::RefPtr<Gst::Caps> parse();
+};
+
 } //namespace Gst


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