[gstreamermm: 72/167] replaced C-type arguments to c++ types



commit 006cdbd0d1a9e0124c1ec3a0e543bcad2bdade98
Author: Marcin Kolny at Flytronic <marcin kolny flytronic pl>
Date:   Tue Jul 30 10:36:03 2013 +0200

    replaced C-type arguments to c++ types

 gstreamer/src/event.ccg |   12 ++++----
 gstreamer/src/event.hg  |   63 ++++++++++++++++++++++++-----------------------
 tools/m4/convert_gst.m4 |    5 +++
 3 files changed, 43 insertions(+), 37 deletions(-)
---
diff --git a/gstreamer/src/event.ccg b/gstreamer/src/event.ccg
index 19e63cd..c3c382d 100644
--- a/gstreamer/src/event.ccg
+++ b/gstreamer/src/event.ccg
@@ -87,9 +87,9 @@ Glib::RefPtr<Gst::EventEos> EventEos::create()
 }
 
 Glib::RefPtr<Gst::EventNewSegment>
-  EventNewSegment::create(const GstSegment* segment)
+  EventNewSegment::create(const Glib::RefPtr<Gst::Segment>& segment)
 {
-  GstEvent* event = gst_event_new_segment(segment);
+  GstEvent* event = gst_event_new_segment(segment->gobj());
   return Glib::wrap_event_derived<EventNewSegment>(event, false);
 }
 
@@ -162,18 +162,18 @@ bool EventBufferSize::parse_async() const
   return gst_async;
 }
 
-Glib::RefPtr<Gst::EventQos> EventQos::create(GstQOSType type, double proportion,
+Glib::RefPtr<Gst::EventQos> EventQos::create(Gst::QOSType type, double proportion,
   ClockTimeDiff diff, ClockTime timestamp)
 {
-  GstEvent* event = gst_event_new_qos(type, proportion, GstClockTimeDiff(diff),
+  GstEvent* event = gst_event_new_qos(GstQOSType(type), proportion, GstClockTimeDiff(diff),
     GstClockTime(timestamp));
   return Glib::wrap_event_derived<EventQos>(event, false);
 }
 
-void EventQos::parse(GstQOSType& type, double& proportion, ClockTimeDiff& diff,
+void EventQos::parse(Gst::QOSType& type, double& proportion, ClockTimeDiff& diff,
   ClockTime& timestamp) const
 {
-  gst_event_parse_qos(const_cast<GstEvent*>(gobj()), &type, &proportion, &diff,
+  gst_event_parse_qos(const_cast<GstEvent*>(gobj()), (GstQOSType*)&type, &proportion, &diff,
     &timestamp);
 }
 
diff --git a/gstreamer/src/event.hg b/gstreamer/src/event.hg
index dc9b6a3..3e154ec 100644
--- a/gstreamer/src/event.hg
+++ b/gstreamer/src/event.hg
@@ -269,41 +269,45 @@ class EventNewSegment : public Event
 {
 public:
 
-  /** Allocate a new newsegment event with the given format/values tripplets
+  /**
+   * gst_event_new_segment:
+   * @segment: (transfer none): a #Gst::Segment
+   *
+   * Create a new SEGMENT event for @segment. The segment event can only travel
+   * downstream synchronized with the buffer flow and contains timing information
+   * and playback properties for the buffers that will follow.
    *
-   * The newsegment event marks the range of buffers to be processed. All data
-   * not within the segment range is not to be processed. This can be used
-   * intelligently by plugins to apply more efficient methods of skipping
-   * unneeded data.
+   * The newsegment event marks the range of buffers to be processed. All
+   * data not within the segment range is not to be processed. This can be
+   * used intelligently by plugins to apply more efficient methods of skipping
+   * unneeded data. The valid range is expressed with the @start and @stop
+   * values.
    *
-   * The position value of the segment is used in conjunction with the start
+   * The time value of the segment is used in conjunction with the start
    * value to convert the buffer timestamps into the stream time. This is
-   * usually done in sinks to report the current stream_time. position
-   * represents the stream_time of a buffer carrying a timestamp of start.
-   * position cannot be -1.
+   * usually done in sinks to report the current stream_time.
+   * @time represents the stream_time of a buffer carrying a timestamp of
+   * @start. @time cannot be -1.
    *
-   * start cannot be -1, stop can be -1. If there is a valid stop given, it
-   * must be greater or equal the start, including when the indicated playback
-   * rate is < 0.
+   * @start cannot be -1, @stop can be -1. If there
+   * is a valid @stop given, it must be greater or equal the @start, including
+   * when the indicated playback @rate is < 0.
    *
-   * The applied_rate value provides information about any rate adjustment that
+   * The @applied_rate value provides information about any rate adjustment that
    * has already been made to the timestamps and content on the buffers of the
-   * stream. (rate * applied_rate) should always equal the rate that has been
+   * stream. (@rate * @applied_rate) should always equal the rate that has been
    * requested for playback. For example, if an element has an input segment
-   * with intended playback rate of 2.0 and applied_rate of 1.0, it can adjust
-   * incoming timestamps and buffer content by half and output a newsegment
-   * event with rate of 1.0 and applied_rate of 2.0
+   * with intended playback @rate of 2.0 and applied_rate of 1.0, it can adjust
+   * incoming timestamps and buffer content by half and output a newsegment event
+   * with @rate of 1.0 and @applied_rate of 2.0
    *
    * After a newsegment event, the buffer stream time is calculated with:
    *
-   * position + (TIMESTAMP(buf) - start) * ABS (rate * applied_rate)
-   *
-   * @param update Is this segment an update to a previous one.
-   * @return A new newsegment event.
+   *   time + (TIMESTAMP(buf) - start) * ABS (rate * applied_rate)
    *
-   * Since 0.10.6
+   * Returns: (transfer full): the new SEGMENT event.
    */
-  static Glib::RefPtr<Gst::EventNewSegment> create(const GstSegment* segment);
+  static Glib::RefPtr<Gst::EventNewSegment> create(const Glib::RefPtr<Gst::Segment>& segment);
 
   /**
    * gst_event_parse_segment:
@@ -452,7 +456,7 @@ public:
   *
   * Returns: (transfer full): a new QOS event.
   */
-  static Glib::RefPtr<Gst::EventQos> create(GstQOSType type, double proportion,
+  static Glib::RefPtr<Gst::EventQos> create(QOSType type, double proportion,
     ClockTimeDiff diff, ClockTime timestamp);
 
  /**
@@ -466,7 +470,7 @@ public:
   * Get the type, proportion, diff and timestamp in the qos event. See
   * gst_event_new_qos() for more information about the different QoS values.
   */
-  void parse(GstQOSType& type, double& proportion, ClockTimeDiff& diff, ClockTime& timestamp) const;
+  void parse(QOSType& type, double& proportion, ClockTimeDiff& diff, ClockTime& timestamp) const;
   _IGNORE(gst_event_parse_qos)
 
   /** Get the proportion in the qos event. See create() for more information
@@ -712,17 +716,14 @@ class EventSinkMessage : public Event
 public:
 
   /**
-   * gst_event_new_sink_message:
-   * @name: a name for the event
-   * @msg: (transfer none): the #GstMessage to be posted
-   *
    * 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.
    *
    * @name is used to store multiple sticky events on one pad.
-   *
-   * Returns: (transfer full): a new #GstEvent
+   * @ param name A name for the event.
+   * @param messsage The #Gst::Message to be posted.
+   * @return a new #Gst::Event.
    */
   static Glib::RefPtr<Gst::EventSinkMessage>
     create(const Glib::ustring& name, const Glib::RefPtr<Gst::Message>& message);
diff --git a/tools/m4/convert_gst.m4 b/tools/m4/convert_gst.m4
index 94a7525..698fd0d 100644
--- a/tools/m4/convert_gst.m4
+++ b/tools/m4/convert_gst.m4
@@ -182,6 +182,11 @@ _CONVERSION(`const Glib::RefPtr<Gst::Query>&',`GstQuery*', `Glib::unwrap($3)')
 dnl Registry
 _CONVERSION(`GstRegistry*',`Glib::RefPtr<Gst::Registry>', `Glib::wrap($3)')
 
+dnl Segment
+_CONVERSION(`GstSegment*',`Glib::RefPtr<Gst::Segment>',`Glib::wrap($3)')
+_CONVERSION(`GstSegment*',`Glib::RefPtr<const Gst::Segment>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<Gst::Segment>&',`GstSegment*', `Glib::unwrap($3)')
+
 dnl AudioRingBuffer
 _CONVERSION(`GstAudioRingBuffer*',`Glib::RefPtr<Gst::AudioRingBuffer>',`Glib::wrap($3)')
 _CONVERSION(`Glib::RefPtr<Gst::AudioRingBuffer>',`GstAudioRingBuffer*',`Glib::unwrap($3)')


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