gnomemm r1728 - in gstreamermm/trunk: . gstreamer/src
- From: jaalburqu svn gnome org
- To: svn-commits-list gnome org
- Subject: gnomemm r1728 - in gstreamermm/trunk: . gstreamer/src
- Date: Mon, 6 Oct 2008 19:56:50 +0000 (UTC)
Author: jaalburqu
Date: Mon Oct 6 19:56:49 2008
New Revision: 1728
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1728&view=rev
Log:
2008-10-06 Josà Alburquerque <jaalburqu svn gnome org>
* gstreamer/src/event.ccg:
* gstreamer/src/event.hg: Reordered class declarations according to
the C API docs.
* gstreamer/src/message.ccg: Slightly re-wrote Gst::Message::wrap() to
use Gst::MessageCustom where appropriate.
Modified:
gstreamermm/trunk/ChangeLog
gstreamermm/trunk/gstreamer/src/event.ccg
gstreamermm/trunk/gstreamer/src/event.hg
gstreamermm/trunk/gstreamer/src/message.ccg
Modified: gstreamermm/trunk/gstreamer/src/event.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/event.ccg (original)
+++ gstreamermm/trunk/gstreamer/src/event.ccg Mon Oct 6 19:56:49 2008
@@ -68,107 +68,100 @@
return GST_EVENT_IS_SERIALIZED(gobj());
}
-EventBufferSize::EventBufferSize(GstEvent* castitem) :
+EventFlushStart::EventFlushStart(GstEvent* castitem) :
Event(castitem)
{
}
-Glib::RefPtr<Event> EventBufferSize::create(Format format, gint64 minsize, gint64 maxsize, bool async)
+Glib::RefPtr<Event> EventFlushStart::create()
{
- GstEvent* event = gst_event_new_buffer_size(GstFormat(format), minsize, maxsize, async);
+ GstEvent* event = gst_event_new_flush_start();
return Gst::Event::wrap(event, false);
}
-void EventBufferSize::parse(Format& format, gint64& minsize, gint64& maxsize, bool& async)
-{
- gboolean result;
- gst_event_parse_buffer_size(gobj(), (GstFormat*)&format, &minsize, &maxsize, &result);
- async = result;
-}
-
-EventEos::EventEos(GstEvent* castitem) :
+EventFlushStop::EventFlushStop(GstEvent* castitem) :
Event(castitem)
{
}
-Glib::RefPtr<Event> EventEos::create()
+Glib::RefPtr<Event> EventFlushStop::create()
{
- GstEvent* event = gst_event_new_eos();
+ GstEvent* event = gst_event_new_flush_stop();
return Gst::Event::wrap(event, false);
}
-EventFlushStart::EventFlushStart(GstEvent* castitem) :
+EventEos::EventEos(GstEvent* castitem) :
Event(castitem)
{
}
-Glib::RefPtr<Event> EventFlushStart::create()
+Glib::RefPtr<Event> EventEos::create()
{
- GstEvent* event = gst_event_new_flush_start();
+ GstEvent* event = gst_event_new_eos();
return Gst::Event::wrap(event, false);
}
-EventFlushStop::EventFlushStop(GstEvent* castitem) :
+EventNewSegment::EventNewSegment(GstEvent* castitem) :
Event(castitem)
{
}
-Glib::RefPtr<Event> EventFlushStop::create()
+Glib::RefPtr<Event> EventNewSegment::create(bool update, double rate, Format format, gint64 start, gint64 stop, gint64 position, double applied_rate)
{
- GstEvent* event = gst_event_new_flush_stop();
+ GstEvent* event = gst_event_new_new_segment_full(update, rate, applied_rate, GstFormat(format), start, stop, position);
return Gst::Event::wrap(event, false);
}
-EventLatency::EventLatency(GstEvent* castitem) :
-Event(castitem)
-{
-}
-
-void EventLatency::parse(ClockTime& latency)
+void EventNewSegment::parse(bool& update, double& rate, Format& format, gint64& start, gint64& stop, gint64& position)
{
- gst_event_parse_latency(gobj(), &latency);
+ gboolean result;
+ gst_event_parse_new_segment(gobj(), &result, &rate, (GstFormat*)&format, &start, &stop, &position);
+ update = result;
}
-Glib::RefPtr<Event> EventLatency::create(ClockTime time)
+void EventNewSegment::parse(bool& update, double& rate, Format& format, gint64& start, gint64& stop, gint64& position, double& applied_rate)
{
- GstEvent* event = gst_event_new_latency(GstClockTime(time));
- return Gst::Event::wrap(event, false);
+ gboolean result;
+ gst_event_parse_new_segment_full(gobj(), &result, &rate, &applied_rate, (GstFormat*)&format, &start, &stop, &position);
+ update = result;
}
-EventNavigation::EventNavigation(GstEvent* castitem) :
+EventTag::EventTag(GstEvent* castitem) :
Event(castitem)
{
}
-Glib::RefPtr<Event> EventNavigation::create(Structure& structure)
+Glib::RefPtr<Event> EventTag::create(const TagList& taglist)
{
- GstEvent* event = gst_event_new_navigation(structure.gobj());
+ //We create a copy because gst_event_new_tag() takes ownership:
+ GstTagList* c_taglist = gst_tag_list_copy(taglist.gobj());
+ GstEvent* event = gst_event_new_tag(c_taglist);
return Gst::Event::wrap(event, false);
}
-EventNewSegment::EventNewSegment(GstEvent* castitem) :
-Event(castitem)
+TagList EventTag::parse()
{
+ GstTagList* gst_taglist = gst_tag_list_new();
+ gst_event_parse_tag(gobj(), &gst_taglist);
+ return TagList(gst_taglist);
}
-Glib::RefPtr<Event> EventNewSegment::create(bool update, double rate, Format format, gint64 start, gint64 stop, gint64 position, double applied_rate)
+EventBufferSize::EventBufferSize(GstEvent* castitem) :
+Event(castitem)
{
- GstEvent* event = gst_event_new_new_segment_full(update, rate, applied_rate, GstFormat(format), start, stop, position);
- return Gst::Event::wrap(event, false);
}
-void EventNewSegment::parse(bool& update, double& rate, Format& format, gint64& start, gint64& stop, gint64& position)
+Glib::RefPtr<Event> EventBufferSize::create(Format format, gint64 minsize, gint64 maxsize, bool async)
{
- gboolean result;
- gst_event_parse_new_segment(gobj(), &result, &rate, (GstFormat*)&format, &start, &stop, &position);
- update = result;
+ GstEvent* event = gst_event_new_buffer_size(GstFormat(format), minsize, maxsize, async);
+ return Gst::Event::wrap(event, false);
}
-void EventNewSegment::parse(bool& update, double& rate, Format& format, gint64& start, gint64& stop, gint64& position, double& applied_rate)
+void EventBufferSize::parse(Format& format, gint64& minsize, gint64& maxsize, bool& async)
{
gboolean result;
- gst_event_parse_new_segment_full(gobj(), &result, &rate, &applied_rate, (GstFormat*)&format, &start, &stop, &position);
- update = result;
+ gst_event_parse_buffer_size(gobj(), (GstFormat*)&format, &minsize, &maxsize, &result);
+ async = result;
}
EventQos::EventQos(GstEvent* castitem) :
@@ -203,24 +196,31 @@
gst_event_parse_seek(gobj(), &rate, (GstFormat*)&format, (GstSeekFlags*)&flags, (GstSeekType*)&start_type, &start, (GstSeekType*)&stop_type, &stop);
}
-EventTag::EventTag(GstEvent* castitem) :
+EventNavigation::EventNavigation(GstEvent* castitem) :
Event(castitem)
{
}
-Glib::RefPtr<Event> EventTag::create(const TagList& taglist)
+Glib::RefPtr<Event> EventNavigation::create(Structure& structure)
{
- //We create a copy because gst_event_new_tag() takes ownership:
- GstTagList* c_taglist = gst_tag_list_copy(taglist.gobj());
- GstEvent* event = gst_event_new_tag(c_taglist);
+ GstEvent* event = gst_event_new_navigation(structure.gobj());
return Gst::Event::wrap(event, false);
}
-TagList EventTag::parse()
+EventLatency::EventLatency(GstEvent* castitem) :
+Event(castitem)
{
- GstTagList* gst_taglist = gst_tag_list_new();
- gst_event_parse_tag(gobj(), &gst_taglist);
- return TagList(gst_taglist);
+}
+
+void EventLatency::parse(ClockTime& latency)
+{
+ gst_event_parse_latency(gobj(), &latency);
+}
+
+Glib::RefPtr<Event> EventLatency::create(ClockTime time)
+{
+ GstEvent* event = gst_event_new_latency(GstClockTime(time));
+ return Gst::Event::wrap(event, false);
}
Glib::RefPtr<Event> Event::wrap(GstEvent* event, bool take_copy) {
Modified: gstreamermm/trunk/gstreamer/src/event.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/event.hg (original)
+++ gstreamermm/trunk/gstreamer/src/event.hg Mon Oct 6 19:56:49 2008
@@ -169,61 +169,6 @@
//Glib::RefPtrs references the objects which causes problems when GStreamer API
//tries to modify the GstStructures of the objects.
-/** A buffer size event. See create() for more details.
- */
-class EventBufferSize : public Event
-{
-public:
- explicit EventBufferSize(GstEvent* event);
-
- /** Create a new buffersize event. The event is sent downstream and notifies
- * elements that they should provide a buffer of the specified dimensions.
- *
- * When the async flag is set, a thread boundary is prefered.
- *
- * @param format Buffer format.
- * @param minsize Minimum buffer size.
- * @param maxsize Maximum buffer size.
- * @param async Thread behavior.
- * @return A new Gst::EventBufferSize.
- */
- static Glib::RefPtr<Event> create(Format format, gint64 minsize, gint64 maxsize, bool async);
-
- /** Get the format, minsize, maxsize and async-flag in the buffersize event.
- *
- * @param format A pointer to store the format in.
- * @param minsize A pointer to store the minsize in.
- * @param maxsize A pointer to store the maxsize in.
- * @param async A pointer to store the async-flag in.
- */
- void parse(Format& format, gint64& minsize, gint64& maxsize, bool& async);
- _IGNORE(gst_event_parse_buffer_size)
-};
-
-/** An end of stream event. See create() for more details.
- */
-class EventEos : public Event
-{
-public:
- explicit EventEos(GstEvent* event);
-
- /** Create a new EOS event. The eos event can only travel downstream
- * synchronized with the buffer flow. Elements that receive the EOS event on
- * a pad can return Gst::FLOW_UNEXPECTED as a Gst::FlowReturn when data after
- * the EOS event arrives.
- *
- * The EOS event will travel down to the sink elements in the pipeline which
- * will then post the Gst::MESSAGE_EOS on the bus after they have finished
- * playing any buffered data.
- *
- * When all sinks have posted an EOS message, an EOS message is forwarded to
- * the application.
- *
- * @return The new EOS event.
- */
- static Glib::RefPtr<Event> create();
-};
-
/** A flush start event. See create() for more details.
*/
class EventFlushStart : public Event
@@ -274,48 +219,28 @@
static Glib::RefPtr<Event> create();
};
-/** A latency event. See create() for more details.
+/** An end of stream event. See create() for more details.
*/
-class EventLatency : public Event
+class EventEos : public Event
{
public:
- explicit EventLatency(GstEvent* event);
+ explicit EventEos(GstEvent* event);
- /** Create a new latency event. The event is sent upstream from the sinks and
- * notifies elements that they should add an additional latency to the
- * timestamps before synchronising against the clock.
- *
- * The latency is mostly used in live sinks and is always expressed in the
- * time format.
- *
- * @param latency The new latency value.
- * @return A new Gst::EventLatency.
+ /** Create a new EOS event. The eos event can only travel downstream
+ * synchronized with the buffer flow. Elements that receive the EOS event on
+ * a pad can return Gst::FLOW_UNEXPECTED as a Gst::FlowReturn when data after
+ * the EOS event arrives.
*
- * Since 0.10.12
- */
- static Glib::RefPtr<Event> create(ClockTime latency);
-
- /** Get the latency in the latency event.
+ * The EOS event will travel down to the sink elements in the pipeline which
+ * will then post the Gst::MESSAGE_EOS on the bus after they have finished
+ * playing any buffered data.
*
- * @param latency A pointer to store the latency in.
- */
- void parse(ClockTime& latency);
- _IGNORE(gst_event_parse_latency)
-};
-
-/** A Navigation event. See create() for more details.
- */
-class EventNavigation : public Event
-{
-public:
- explicit EventNavigation(GstEvent* event);
-
- /** Create a new navigation event from the given description.
+ * When all sinks have posted an EOS message, an EOS message is forwarded to
+ * the application.
*
- * @param structure Description of the event.
- * @return A new Gst::EventNavigation.
+ * @return The new EOS event.
*/
- static Glib::RefPtr<Event> create(Structure& structure);
+ static Glib::RefPtr<Event> create();
};
/** A new segment event. See create() for more details.
@@ -397,6 +322,57 @@
_IGNORE(gst_event_parse_new_segment, gst_event_parse_new_segment_full)
};
+/** A tag event.
+ */
+class EventTag : public Event
+{
+public:
+ explicit EventTag(GstEvent* event);
+
+ /** Generates a metadata tag event from the given taglist.
+ * @param taglist Metadata list.
+ * @return A new Gst::Event.
+ */
+ static Glib::RefPtr<Event> create(const TagList& taglist);
+
+ /** Parses a tag event and stores the results in the given taglist location.
+ * @return Metadata list.
+ */
+ TagList parse();
+ _IGNORE(gst_event_parse_tag)
+};
+
+/** A buffer size event. See create() for more details.
+ */
+class EventBufferSize : public Event
+{
+public:
+ explicit EventBufferSize(GstEvent* event);
+
+ /** Create a new buffersize event. The event is sent downstream and notifies
+ * elements that they should provide a buffer of the specified dimensions.
+ *
+ * When the async flag is set, a thread boundary is prefered.
+ *
+ * @param format Buffer format.
+ * @param minsize Minimum buffer size.
+ * @param maxsize Maximum buffer size.
+ * @param async Thread behavior.
+ * @return A new Gst::EventBufferSize.
+ */
+ static Glib::RefPtr<Event> create(Format format, gint64 minsize, gint64 maxsize, bool async);
+
+ /** Get the format, minsize, maxsize and async-flag in the buffersize event.
+ *
+ * @param format A pointer to store the format in.
+ * @param minsize A pointer to store the minsize in.
+ * @param maxsize A pointer to store the maxsize in.
+ * @param async A pointer to store the async-flag in.
+ */
+ void parse(Format& format, gint64& minsize, gint64& maxsize, bool& async);
+ _IGNORE(gst_event_parse_buffer_size)
+};
+
/** A QOS event. See create() for more details.
*/
class EventQos : public Event
@@ -519,24 +495,48 @@
_IGNORE(gst_event_parse_seek)
};
-/** A tag event.
+/** A Navigation event. See create() for more details.
*/
-class EventTag : public Event
+class EventNavigation : public Event
{
public:
- explicit EventTag(GstEvent* event);
+ explicit EventNavigation(GstEvent* event);
- /** Generates a metadata tag event from the given taglist.
- * @param taglist Metadata list.
- * @return A new Gst::Event.
+ /** Create a new navigation event from the given description.
+ *
+ * @param structure Description of the event.
+ * @return A new Gst::EventNavigation.
*/
- static Glib::RefPtr<Event> create(const TagList& taglist);
+ static Glib::RefPtr<Event> create(Structure& structure);
+};
- /** Parses a tag event and stores the results in the given taglist location.
- * @return Metadata list.
+/** A latency event. See create() for more details.
+ */
+class EventLatency : public Event
+{
+public:
+ explicit EventLatency(GstEvent* event);
+
+ /** Create a new latency event. The event is sent upstream from the sinks and
+ * notifies elements that they should add an additional latency to the
+ * timestamps before synchronising against the clock.
+ *
+ * The latency is mostly used in live sinks and is always expressed in the
+ * time format.
+ *
+ * @param latency The new latency value.
+ * @return A new Gst::EventLatency.
+ *
+ * Since 0.10.12
*/
- TagList parse();
- _IGNORE(gst_event_parse_tag)
+ static Glib::RefPtr<Event> create(ClockTime latency);
+
+ /** Get the latency in the latency event.
+ *
+ * @param latency A pointer to store the latency in.
+ */
+ void parse(ClockTime& latency);
+ _IGNORE(gst_event_parse_latency)
};
} //namespace Gst
Modified: gstreamermm/trunk/gstreamer/src/message.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/message.ccg (original)
+++ gstreamermm/trunk/gstreamer/src/message.ccg Mon Oct 6 19:56:49 2008
@@ -652,8 +652,13 @@
case GST_MESSAGE_ASYNC_DONE:
result = Glib::RefPtr<Message>( new Gst::MessageAsyncDone(message) );
break;
- default:
+ case GST_MESSAGE_UNKNOWN:
+ case GST_MESSAGE_ANY:
result = Gst::wrap(message, false);
+ break;
+ /* The rest of the message types are custom ones */
+ default:
+ result = Glib::RefPtr<Message>( new Gst::MessageCustom(message) );
}
if(result && take_copy)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]