[gstreamermm] Add Gst::MessageStep{Start,Done}.
- From: José Alburquerque <jaalburqu src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gstreamermm] Add Gst::MessageStep{Start,Done}.
- Date: Wed, 19 Aug 2009 03:33:47 +0000 (UTC)
commit 0f06a675ed05526027f538529886220adea93c18
Author: José Alburquerque <jaalburqu svn gnome org>
Date: Tue Aug 18 23:31:13 2009 -0400
Add Gst::MessageStep{Start,Done}.
* gstreamer/src/message.ccg:
* gstreamer/src/message.hg: Add Gst::MessageStepStart and
Gst::MessageStepDone.
* tools/m4/plugingen_base.m4: Use gulong instead 'unsigned long' in
plug-in generation.
ChangeLog | 10 +++
gstreamer/src/message.ccg | 173 +++++++++++++++++++++++++++++++++++++++++++-
gstreamer/src/message.hg | 169 +++++++++++++++++++++++++++++++++++++++++++
tools/m4/plugingen_base.m4 | 2 +-
4 files changed, 352 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6fa0ac1..641965f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-08-18 José Alburquerque <jaalburqu svn gnome org>
+
+ Add Gst::MessageStep{Start,Done}.
+
+ * gstreamer/src/message.ccg:
+ * gstreamer/src/message.hg: Add Gst::MessageStepStart and
+ Gst::MessageStepDone.
+ * tools/m4/plugingen_base.m4: Use gulong instead 'unsigned long' in
+ plug-in generation.
+
2009-08-14 José Alburquerque <jaalburqu svn gnome org>
MessageTag: Wrapped new 0.10.24 methods.
diff --git a/gstreamer/src/message.ccg b/gstreamer/src/message.ccg
index 49ee05e..cde9dbf 100644
--- a/gstreamer/src/message.ccg
+++ b/gstreamer/src/message.ccg
@@ -362,12 +362,100 @@ MessageStateDirty::MessageStateDirty(GstMessage* castitem)
: Message(castitem)
{}
-Glib::RefPtr<Gst::Message> MessageStateDirty::create(const Glib::RefPtr<Gst::Object>& src)
+Glib::RefPtr<Gst::Message>
+ MessageStateDirty::create(const Glib::RefPtr<Gst::Object>& src)
{
GstMessage* message = gst_message_new_state_dirty(src->gobj());
return Gst::Message::wrap(message, false);
}
+MessageStepDone::MessageStepDone(GstMessage* castitem)
+: Message(castitem)
+{}
+
+Glib::RefPtr<Gst::Message>
+ MessageStepDone::create(const Glib::RefPtr<Gst::Object>& src,
+ Gst::Format format, guint64 amount, double rate, bool flush,
+ bool intermediate, guint64 duration, bool eos)
+{
+ GstMessage* message = gst_message_new_step_done(src->gobj(),
+ (GstFormat)(format), amount, rate, flush, intermediate, duration, eos);
+ return Gst::Message::wrap(message, false);
+}
+
+void MessageStepDone::parse(Gst::Format& format, guint64& amount, double& rate,
+ bool& flush, bool& intermediate, guint64& duration, bool& eos) const
+{
+ gboolean gst_flush = FALSE;
+ gboolean gst_intermediate = FALSE;
+ gboolean gst_eos = FALSE;
+
+ gst_message_parse_step_done(const_cast<GstMessage*>(gobj()),
+ (GstFormat*)(&format), &amount, &rate, &gst_flush, &gst_intermediate,
+ &duration, &gst_eos);
+
+ flush = gst_flush;
+ intermediate = gst_intermediate;
+ eos = gst_eos;
+}
+
+guint64 MessageStepDone::parse() const
+{
+ guint64 duration = 0;
+ gst_message_parse_step_done(const_cast<GstMessage*>(gobj()), 0, 0, 0, 0, 0,
+ &duration, 0);
+ return duration;
+}
+
+Gst::Format MessageStepDone::parse_format() const
+{
+ GstFormat format = GST_FORMAT_UNDEFINED;
+ gst_message_parse_step_done(const_cast<GstMessage*>(gobj()),
+ (GstFormat*)(&format), 0, 0, 0, 0, 0, 0);
+ return (Gst::Format)(format);
+}
+
+guint64 MessageStepDone::parse_amount() const
+{
+ guint64 amount = 0;
+ gst_message_parse_step_done(const_cast<GstMessage*>(gobj()), 0, &amount, 0,
+ 0, 0, 0, 0);
+ return amount;
+}
+
+double MessageStepDone::parse_rate() const
+{
+ double rate = 0;
+ gst_message_parse_step_done(const_cast<GstMessage*>(gobj()), 0, 0, &rate, 0,
+ 0, 0, 0);
+ return rate;
+}
+
+bool MessageStepDone::parse_flush() const
+{
+ gboolean gst_flush = FALSE;
+ gst_message_parse_step_done(const_cast<GstMessage*>(gobj()), 0, 0, 0,
+ &gst_flush, 0, 0, 0);
+ return gst_flush;
+}
+
+bool MessageStepDone::parse_intermediate() const
+{
+ gboolean gst_intermediate = FALSE;
+ gst_message_parse_step_done(const_cast<GstMessage*>(gobj()), 0, 0, 0, 0,
+ &gst_intermediate, 0, 0);
+ return gst_intermediate;
+}
+
+bool MessageStepDone::parse_eos() const
+{
+ gboolean gst_eos = FALSE;
+ gst_message_parse_step_done(const_cast<GstMessage*>(gobj()), 0, 0, 0, 0, 0,
+ 0, &gst_eos);
+ return gst_eos;
+}
+
+
MessageClockProvide::MessageClockProvide(GstMessage* castitem)
: Message(castitem)
{}
@@ -638,6 +726,83 @@ Glib::RefPtr<Gst::Message> MessageAsyncDone::create(const Glib::RefPtr<Gst::Obje
return Gst::Message::wrap(message, false);
}
+MessageStepStart::MessageStepStart(GstMessage* castitem)
+: Message(castitem)
+{}
+
+Glib::RefPtr<Gst::Message>
+ MessageStepStart::create(const Glib::RefPtr<Gst::Object>& src,
+ bool active, Gst::Format format, guint64 amount, double rate, bool flush,
+ bool intermediate)
+{
+ GstMessage* message = gst_message_new_step_start(src->gobj(),
+ active, (GstFormat)(format), amount, rate, flush, intermediate);
+ return Gst::Message::wrap(message, false);
+}
+
+void MessageStepStart::parse(bool& active, Gst::Format& format,
+ guint64& amount, double& rate, bool& flush, bool& intermediate) const
+{
+ gboolean gst_active = FALSE;
+ gboolean gst_flush = FALSE;
+ gboolean gst_intermediate = FALSE;
+
+ gst_message_parse_step_start(const_cast<GstMessage*>(gobj()), &gst_active,
+ (GstFormat*)(&format), &amount, &rate, &gst_flush, &gst_intermediate);
+
+ active = gst_active;
+ flush = gst_flush;
+ intermediate = gst_intermediate;
+}
+
+guint64 MessageStepStart::parse() const
+{
+ guint64 amount = 0;
+ gst_message_parse_step_start(const_cast<GstMessage*>(gobj()), 0, 0, &amount,
+ 0, 0, 0);
+ return amount;
+}
+
+bool MessageStepStart::parse_active() const
+{
+ gboolean gst_active = FALSE;
+ gst_message_parse_step_start(const_cast<GstMessage*>(gobj()), &gst_active, 0,
+ 0, 0, 0, 0);
+ return gst_active;
+}
+
+Gst::Format MessageStepStart::parse_format() const
+{
+ GstFormat format = GST_FORMAT_UNDEFINED;
+ gst_message_parse_step_start(const_cast<GstMessage*>(gobj()), 0,
+ (GstFormat*)(&format), 0, 0, 0, 0);
+ return (Gst::Format)(format);
+}
+
+double MessageStepStart::parse_rate() const
+{
+ double rate = 0;
+ gst_message_parse_step_start(const_cast<GstMessage*>(gobj()), 0, 0, 0, &rate,
+ 0, 0);
+ return rate;
+}
+
+bool MessageStepStart::parse_flush() const
+{
+ gboolean gst_flush = FALSE;
+ gst_message_parse_step_start(const_cast<GstMessage*>(gobj()), 0, 0, 0, 0,
+ &gst_flush, 0);
+ return gst_flush;
+}
+
+bool MessageStepStart::parse_intermediate() const
+{
+ gboolean gst_intermediate = FALSE;
+ gst_message_parse_step_start(const_cast<GstMessage*>(gobj()), 0, 0, 0, 0, 0,
+ &gst_intermediate);
+ return gst_intermediate;
+}
+
MessageStructureChange::MessageStructureChange(GstMessage* castitem)
: Message(castitem)
{}
@@ -798,6 +963,9 @@ Glib::RefPtr<Gst::Message> Message::wrap(GstMessage* message, bool take_copy)
case GST_MESSAGE_STATE_DIRTY:
result = Glib::RefPtr<Gst::Message>( new Gst::MessageStateDirty(message) );
break;
+ case GST_MESSAGE_STEP_DONE:
+ result = Glib::RefPtr<Gst::Message>( new Gst::MessageStepDone(message) );
+ break;
case GST_MESSAGE_CLOCK_PROVIDE:
result = Glib::RefPtr<Gst::Message>( new Gst::MessageClockProvide(message) );
break;
@@ -831,6 +999,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_STEP_START:
+ result = Glib::RefPtr<Gst::Message>( new Gst::MessageStepStart(message) );
+ break;
case GST_MESSAGE_STRUCTURE_CHANGE:
result = Glib::RefPtr<Gst::Message>( new Gst::MessageStructureChange(message) );
break;
diff --git a/gstreamer/src/message.hg b/gstreamer/src/message.hg
index 721d8e6..351f8bb 100644
--- a/gstreamer/src/message.hg
+++ b/gstreamer/src/message.hg
@@ -500,6 +500,92 @@ public:
static Glib::RefPtr<Gst::Message> create(const Glib::RefPtr<Gst::Object>& src);
};
+/** A step done message.
+ * See create() for more details.
+ */
+class MessageStepDone : public Message
+{
+public:
+ explicit MessageStepDone(GstMessage* castitem);
+
+ /** Create a step done message. This message is posted by elements when they
+ * complete a part, when @a intermediate set to true, or a complete step
+ * operation.
+ *
+ * @a duration will contain the amount of time (in Gst::FORMAT_TIME) of the
+ * stepped @a amount of media in format @a format.
+ *
+ * @param src The object originating the message.
+ * @param format The format of amount.
+ * @param amount The amount of stepped data.
+ * @param rate The rate of the stepped amount.
+ * @param flush Is this an flushing step.
+ * @param intermediate Is this an intermediate step.
+ * @param duration The duration of the data.
+ * @param eos The step caused EOS.
+ * @return The new step done message. MT safe.
+ *
+ * Since 0.10.24.
+ */
+ static Glib::RefPtr<Gst::Message>
+ create(const Glib::RefPtr<Gst::Object>& src, Gst::Format format,
+ guint64 amount, double rate, bool flush, bool intermediate,
+ guint64 duration, bool eos);
+
+ /** Extract the values of the step done message.
+ *
+ * MT safe.
+ *
+ * @param format Result location for the format.
+ * @param amount Result location for the amount.
+ * @param rate Result location for the rate.
+ * @param flush Result location for the flush flag.
+ * @param intermediate Result location for the intermediate flag.
+ * @param duration Result location for the duration.
+ * @param eos Result location for the EOS flag.
+ *
+ * Since 0.10.24.
+ */
+ void parse(Gst::Format& format, guint64& amount, double& rate, bool& flush,
+ bool& intermediate, guint64& duration, bool& eos) const;
+ _IGNORE(gst_message_parse_step_done)
+
+ /** Extracts the duration of the step done message.
+ * @return The duration.
+ */
+ guint64 parse() const;
+
+ /** Extracts the format of the step done message.
+ * @return The format.
+ */
+ Gst::Format parse_format() const;
+
+ /** Extracts the amount of the step done message.
+ * @return The amount.
+ */
+ guint64 parse_amount() const;
+
+ /** Extracts the rate of the step done message.
+ * @return The rate.
+ */
+ double parse_rate() const;
+
+ /** Extracts the flush flag of the step done message.
+ * @return The flush flag.
+ */
+ bool parse_flush() const;
+
+ /** Extracts the intermediate flag of the step done message.
+ * @return The intermediate flag.
+ */
+ bool parse_intermediate() const;
+
+ /** Extracts the eos flag of the step done message.
+ * @return The eos flag.
+ */
+ bool parse_eos() const;
+};
+
/** A clock provide message.
* See create() for more details.
*/
@@ -944,6 +1030,89 @@ public:
static Glib::RefPtr<Gst::Message> create(const Glib::RefPtr<Gst::Object>& src);
};
+/** A step start message.
+ * See create() for more details.
+ */
+class MessageStepStart : public Message
+{
+public:
+ explicit MessageStepStart(GstMessage* castitem);
+
+ /** Create a step start message. This message is posted by elements when
+ * they accept or activate a new step event for @a amount in @a format.
+ *
+ * @a active is set to false when the element accepted the new step event and
+ * has queued it for execution in the streaming threads.
+ *
+ * @a active is set to true when the element has activated the step operation
+ * and is now ready to start executing the step in the streaming thread.
+ * After this message is emited, the application can queue a new step
+ * operation in the element.
+ *
+ * @param src The object originating the message.
+ * @param active If the step is active or queued.
+ * @param format The format of amount.
+ * @param amount The amount of stepped data.
+ * @param rate The rate of the stepped amount.
+ * @param flush Is this an flushing step.
+ * @param intermediate Is this an intermediate step.
+ * @return The new step start message. MT safe.
+ *
+ * Since 0.10.24.
+ */
+ static Glib::RefPtr<Gst::Message>
+ create(const Glib::RefPtr<Gst::Object>& src, bool active,
+ Gst::Format format, guint64 amount, double rate, bool flush,
+ bool intermediate);
+
+ /** Extract the values of the step start message.
+ *
+ * MT safe.
+ *
+ * @param active Result location for the active flag.
+ * @param format Result location for the format.
+ * @param amount Result location for the amount.
+ * @param rate Result location for the rate.
+ * @param flush Result location for the flush flag.
+ * @param intermediate Result location for the intermediate flag.
+ *
+ * Since 0.10.24.
+ */
+ void parse(bool& active, Gst::Format& format, guint64& amount, double& rate,
+ bool& flush, bool& intermediate) const;
+ _IGNORE(gst_message_parse_step_start)
+
+ /** Extracts the amount of the step start message.
+ * @return The amount.
+ */
+ guint64 parse() const;
+
+ /** Extracts the active flag of the step start message.
+ * @return The active flag.
+ */
+ bool parse_active() const;
+
+ /** Extracts the format of the step start message.
+ * @return The format.
+ */
+ Gst::Format parse_format() const;
+
+ /** Extracts the rate of the step start message.
+ * @return The rate.
+ */
+ double parse_rate() const;
+
+ /** Extracts the flush flag of the step start message.
+ * @return The flush flag.
+ */
+ bool parse_flush() const;
+
+ /** Extracts the intermediate flag of the step start message.
+ * @return The intermediate flag.
+ */
+ bool parse_intermediate() const;
+};
+
/** A structure change message.
* See create() for more details.
*/
diff --git a/tools/m4/plugingen_base.m4 b/tools/m4/plugingen_base.m4
index 4f29e28..984b32f 100644
--- a/tools/m4/plugingen_base.m4
+++ b/tools/m4/plugingen_base.m4
@@ -177,7 +177,7 @@ _TRANSLATION(`void',`void',`void')
_TRANSLATION(`gboolean',`bool',`bool')
_TRANSLATION(`gint',`int',`int')
_TRANSLATION(`guint',`guint',`guint')
-_TRANSLATION(`gulong',`unsigned long',`unsigned long')
+_TRANSLATION(`gulong',`gulong',`gulong')
_TRANSLATION(`gint64',`gint64',`gint64')
_TRANSLATION(`guint64',`guint64',`guint64')
_TRANSLATION(`gfloat',`float',`float')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]