[gstreamermm] Added Gst::EventStep.



commit 60ceb211dd560f1f33d9b51fb8351b8b7b9c10b4
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Tue Aug 11 15:48:15 2009 -0400

    	Added Gst::EventStep.
    
    	* gstreamer/src/event.ccg:
    	* gstreamer/src/event.hg: Wrapped Gst::EventStep.  It will be
    	necessary to overload the parse() methods of the event classes as in
    	Gst::Message and Gst::Query.

 ChangeLog               |    9 ++++++++
 gstreamer/src/event.ccg |   32 +++++++++++++++++++++++++++++-
 gstreamer/src/event.hg  |   48 ++++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 86 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2be090d..9a506e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-08-11  José Alburquerque  <jaalburqu svn gnome org>
+
+	Added Gst::EventStep.
+
+	* gstreamer/src/event.ccg:
+	* gstreamer/src/event.hg: Wrapped Gst::EventStep.  It will be
+	necessary to overload the parse() methods of the event classes as in
+	Gst::Message and Gst::Query.
+
 2009-08-09  José Alburquerque  <jaalburqu svn gnome org>
 
 	Media Player Example: Typos in source.
diff --git a/gstreamer/src/event.ccg b/gstreamer/src/event.ccg
index 33adc1c..fb5a30b 100644
--- a/gstreamer/src/event.ccg
+++ b/gstreamer/src/event.ccg
@@ -207,17 +207,42 @@ EventLatency::EventLatency(GstEvent* castitem) :
 Event(castitem)
 {}
 
+Glib::RefPtr<Gst::Event> EventLatency::create(ClockTime time)
+{
+  GstEvent* event = gst_event_new_latency(GstClockTime(time));
+  return Gst::Event::wrap(event, false);
+}
+
 void EventLatency::parse(ClockTime& latency) const
 {
   gst_event_parse_latency(const_cast<GstEvent*>(gobj()), &latency);
 }
 
-Glib::RefPtr<Gst::Event> EventLatency::create(ClockTime time)
+EventStep::EventStep(GstEvent* castitem) :
+Event(castitem)
+{}
+
+Glib::RefPtr<Gst::Event> EventStep::create(Gst::Format format, guint64 amount,
+  double rate, bool flush, bool intermediate)
 {
-  GstEvent* event = gst_event_new_latency(GstClockTime(time));
+  GstEvent* event = gst_event_new_step((GstFormat)(format), amount, rate,
+    flush, intermediate);
   return Gst::Event::wrap(event, false);
 }
 
+void EventStep::parse(Gst::Format& format, guint64& amount, double& rate,
+  bool& flush, bool& intermediate) const
+{
+  gboolean gst_flush = FALSE;
+  gboolean gst_intermediate = FALSE;
+
+  gst_event_parse_step(const_cast<GstEvent*>(gobj()), (GstFormat*)(&format),
+    &amount, &rate, &gst_flush, &gst_intermediate);
+
+  flush = gst_flush;
+  intermediate = gst_intermediate;
+}
+
 Glib::RefPtr<Gst::Event> Event::wrap(GstEvent* event, bool take_copy)
 {
   Glib::RefPtr<Gst::Event> result;
@@ -257,6 +282,9 @@ Glib::RefPtr<Gst::Event> Event::wrap(GstEvent* event, bool take_copy)
     case GST_EVENT_LATENCY:
       result = Glib::RefPtr<Gst::Event>( new Gst::EventLatency(event) );
       break;
+    case GST_EVENT_STEP:
+      result = Glib::RefPtr<Gst::Event>( new Gst::EventStep(event) );
+      break;
     default:
       result = Gst::wrap(event, false);
   }
diff --git a/gstreamer/src/event.hg b/gstreamer/src/event.hg
index 5f3d797..753ad18 100644
--- a/gstreamer/src/event.hg
+++ b/gstreamer/src/event.hg
@@ -537,7 +537,7 @@ public:
    * @param latency The new latency value.
    * @return A new Gst::EventLatency.
    *
-   * Since 0.10.12 
+   * Since 0.10.12.
    */
   static Glib::RefPtr<Gst::Event> create(ClockTime latency);
 
@@ -549,4 +549,50 @@ public:
   _IGNORE(gst_event_parse_latency)
 };
 
+/** A step event.  See create() for more details.
+ */
+class EventStep : public Event
+{
+public:
+  explicit EventStep(GstEvent* event);
+
+  /** Create a new step event. The purpose of the step event is to instruct a
+   * sink to skip @a amount (expressed in @a format) of media. It can be used
+   * to implement stepping through the video frame by frame or for doing fast
+   * trick modes.
+   *
+   * A rate of <= 0.0 is not allowed, pause the pipeline or reverse the
+   * playback direction of the pipeline to get the same effect.
+   *
+   * The @a flush flag will clear any pending data in the pipeline before
+   * starting the step operation.
+   *
+   * The @a intermediate flag instructs the pipeline that this step operation
+   * is part of a larger step operation.
+   *
+   * @param format The format of amount.
+   * @param amount The amount of data to step.
+   * @param rate The step rate.
+   * @param flush Flushing steps.
+   * @param intermediate Intermediate steps.
+   * @return A new Gst::Event.
+   *
+   * Since 0.10.24.
+   */
+  static Glib::RefPtr<Gst::Event> create(Gst::Format format, guint64 amount,
+    double rate, bool flush, bool intermediate);
+
+  /** Parse the step event.
+   *
+   * @param format A reference to store the format in.
+   * @param amount A reference to store the amount in.
+   * @param rate A reference to store the rate in.
+   * @param flush A reference to store the flush boolean in.
+   * @param intermediate A reference to store the intermediate boolean in.
+   */
+  void parse(Gst::Format& format, guint64& amount, double& rate,
+    bool& flush, bool& intermediate) const;
+  _IGNORE(gst_event_parse_step)
+};
+
 } //namespace Gst



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