gnomemm r1362 - in gstreamermm/trunk: . gstreamer/gstreamermm gstreamer/src tools/m4
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: gnomemm r1362 - in gstreamermm/trunk: . gstreamer/gstreamermm gstreamer/src tools/m4
- Date: Thu, 21 Feb 2008 17:03:47 +0000 (GMT)
Author: murrayc
Date: Thu Feb 21 17:03:47 2008
New Revision: 1362
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1362&view=rev
Log:
2008-02-21 Murray Cumming <murrayc murrayc com>
* gstreamer/gstreamermm/miniobject.h: Added gobj(). Otherwise
Glib::ObjectBase::gobj() is called.
* gstreamer/src/bus.hg: pop_filtered(), timed_pop(), timed_pop_filtered():
Renamed all these to pop().
* gstreamer/src/element.hg: Renamed message_full() to post_message()
so it looks like a method overload.
* gstreamer/src/pad.ccg:
* gstreamer/src/pad.hg: Wrapped have_data signal.
* gstreamer/src/xml.hg: Added const version of get_topelements().
* tools/m4/convert_gst.m4:
* gstreamer/src/childproxy.hg: Moved signal-specific conversion to the
.hg file where it is used.
Modified:
gstreamermm/trunk/ChangeLog
gstreamermm/trunk/gstreamer/gstreamermm/miniobject.h
gstreamermm/trunk/gstreamer/src/bus.hg
gstreamermm/trunk/gstreamer/src/childproxy.hg
gstreamermm/trunk/gstreamer/src/element.hg
gstreamermm/trunk/gstreamer/src/pad.ccg
gstreamermm/trunk/gstreamer/src/pad.hg
gstreamermm/trunk/gstreamer/src/xml.hg
gstreamermm/trunk/tools/m4/convert_gst.m4
Modified: gstreamermm/trunk/gstreamer/gstreamermm/miniobject.h
==============================================================================
--- gstreamermm/trunk/gstreamer/gstreamermm/miniobject.h (original)
+++ gstreamermm/trunk/gstreamer/gstreamermm/miniobject.h Thu Feb 21 17:03:47 2008
@@ -71,10 +71,17 @@
void reference() const;
void unreference() const;
+ ///Provides access to the underlying C GstMiniObject.
+ GstMiniObject* gobj() { return reinterpret_cast<GstMiniObject*>(gobject_); }
+
+ ///Provides access to the underlying C GstMiniObject.
+ const GstMiniObject* gobj() const { return reinterpret_cast<GstMiniObject*>(gobject_); }
+
+
// static void replace(Glib::RefPtr<Gst::MiniObject> & olddata, Glib::RefPtr<Gst::MiniObject> & newdata);
protected:
- GstMiniObject* gobject_;
+ GstMiniObject* gobject_; //TODO: Doesn't this shadow a member variable in Glib::ObjectBase?
};
} // namespace Gst
Modified: gstreamermm/trunk/gstreamer/src/bus.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/bus.hg (original)
+++ gstreamermm/trunk/gstreamer/src/bus.hg Thu Feb 21 17:03:47 2008
@@ -54,9 +54,9 @@
_WRAP_METHOD(Glib::RefPtr<const Message> peek() const, gst_bus_peek)
_WRAP_METHOD(Glib::RefPtr<Message> pop(), gst_bus_pop)
- _WRAP_METHOD(Glib::RefPtr<Message> pop_filtered(MessageType message_type), gst_bus_pop_filtered)
- _WRAP_METHOD(Glib::RefPtr<Message> timed_pop(ClockTime timeout), gst_bus_timed_pop)
- _WRAP_METHOD(Glib::RefPtr<Message> timed_pop_filtered(ClockTime timeout, MessageType message_type), gst_bus_timed_pop_filtered)
+ _WRAP_METHOD(Glib::RefPtr<Message> pop(MessageType message_type), gst_bus_pop_filtered)
+ _WRAP_METHOD(Glib::RefPtr<Message> pop(ClockTime timeout), gst_bus_timed_pop)
+ _WRAP_METHOD(Glib::RefPtr<Message> pop(ClockTime timeout, MessageType message_type), gst_bus_timed_pop_filtered)
_WRAP_METHOD(void set_flushing(bool flushing = true), gst_bus_set_flushing)
Modified: gstreamermm/trunk/gstreamer/src/childproxy.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/childproxy.hg (original)
+++ gstreamermm/trunk/gstreamer/src/childproxy.hg Thu Feb 21 17:03:47 2008
@@ -59,6 +59,7 @@
void child_added(const Glib::RefPtr<Gst::Object>& child);
void child_removed(const Glib::RefPtr<Gst::Object>& child);
+#m4 _CONVERSION(`GstObject*',`const Glib::RefPtr<Gst::Object>&',`Glib::wrap($3)')
_WRAP_SIGNAL(void child_added(const Glib::RefPtr<Gst::Object>& object), "child-added")
_WRAP_SIGNAL(void child_removed(const Glib::RefPtr<Gst::Object>& object), "child-removed")
Modified: gstreamermm/trunk/gstreamer/src/element.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/element.hg (original)
+++ gstreamermm/trunk/gstreamer/src/element.hg Thu Feb 21 17:03:47 2008
@@ -81,8 +81,12 @@
_WRAP_METHOD(Glib::RefPtr<Bus> get_bus(), gst_element_get_bus)
_WRAP_METHOD(Glib::RefPtr<const Bus> get_bus() const, gst_element_get_bus, constversion)
_WRAP_METHOD(void set_index(const Glib::RefPtr<Index>& index), gst_element_set_index)
+
+ //Note: gst_element_get_index provides a reference.
_WRAP_METHOD(Glib::RefPtr<Index> get_index(), gst_element_get_index)
_WRAP_METHOD(Glib::RefPtr<Index const> get_index() const, gst_element_get_index, constversion)
+
+
_WRAP_METHOD(Glib::RefPtr<ElementFactory> get_factory(), gst_element_get_factory)
_WRAP_METHOD(bool is_indexable() const, gst_element_is_indexable)
_WRAP_METHOD(bool requires_clock() const, gst_element_requires_clock)
@@ -102,9 +106,13 @@
_WRAP_METHOD(bool sync_state_with_parent(), gst_element_sync_state_with_parent)
_WRAP_METHOD(StateChangeReturn change_state(StateChange transition), gst_element_change_state)
- _WRAP_METHOD(void message_full(MessageType message_type, GQuark domain, int code, const Glib::ustring& message, const Glib::ustring& debug, const Glib::ustring& filename, const Glib::ustring& function_name, int line_number), gst_element_message_full)
+ //TODO: Change the parameter order?
+ _WRAP_METHOD(void post_message(MessageType message_type, GQuark domain, int code, const Glib::ustring& message, const Glib::ustring& debug, const Glib::ustring& filename, const Glib::ustring& function_name, int line_number), gst_element_message_full)
_WRAP_METHOD(bool post_message(const Glib::RefPtr<Message>& message), gst_element_post_message)
+
+ //TODO: Use ArrayHandle?
_WRAP_METHOD(const QueryType* get_query_types() const, gst_element_get_query_types)
+
_WRAP_METHOD(bool query(const Glib::RefPtr<Query>& query), gst_element_query)
_WRAP_METHOD(bool query_convert(Format src_format, gint64 src_value, Format& dst_format, gint64& dst_value) const, gst_element_query_convert)
_WRAP_METHOD(bool query_position(Format& format, gint64& position) const, gst_element_query_position)
Modified: gstreamermm/trunk/gstreamer/src/pad.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/pad.ccg (original)
+++ gstreamermm/trunk/gstreamer/src/pad.ccg Thu Feb 21 17:03:47 2008
@@ -47,7 +47,7 @@
FlowReturn Pad::alloc_buffer(guint64 offset, int size, const Glib::RefPtr<Caps>& caps, Glib::RefPtr<Buffer>& buffer)
{
- GstBuffer* c_buffer;
+ GstBuffer* c_buffer = 0;
GstFlowReturn result = gst_pad_alloc_buffer(gobj(), offset, size, caps->gobj(), &c_buffer);
buffer = wrap(c_buffer, false);
return FlowReturn(result);
@@ -55,7 +55,7 @@
FlowReturn Pad::alloc_buffer_and_set_caps(guint64 offset, int size, const Glib::RefPtr<Caps>& caps, Glib::RefPtr<Buffer>& buffer)
{
- GstBuffer* c_buffer;
+ GstBuffer* c_buffer = 0;
GstFlowReturn result = gst_pad_alloc_buffer_and_set_caps(gobj(), offset, size, caps->gobj(), &c_buffer);
buffer = wrap(c_buffer, false);
return FlowReturn(result);
@@ -63,7 +63,7 @@
FlowReturn Pad::get_range(guint64 offset, guint size, Glib::RefPtr<Buffer>& buffer)
{
- GstBuffer* c_buffer;
+ GstBuffer* c_buffer = 0;
GstFlowReturn result = gst_pad_get_range(gobj(), offset, size, &c_buffer);
buffer = wrap(c_buffer, false);
return FlowReturn(result);
@@ -83,7 +83,7 @@
FlowReturn Pad::pull_range(guint64 offset, guint size, Glib::RefPtr<Buffer>& buffer)
{
- GstBuffer* c_buffer;
+ GstBuffer* c_buffer = 0;
GstFlowReturn result = gst_pad_pull_range(gobj(), offset, size, &c_buffer);
buffer = wrap(c_buffer, false);
return FlowReturn(result);
Modified: gstreamermm/trunk/gstreamer/src/pad.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/pad.hg (original)
+++ gstreamermm/trunk/gstreamer/src/pad.hg Thu Feb 21 17:03:47 2008
@@ -20,6 +20,7 @@
*/
#include <gstreamermm/object.h>
+#include <gstreamermm/miniobject.h>
#include <gstreamermm/enums.h>
_DEFS(gstreamermm,gst)
@@ -61,8 +62,11 @@
_WRAP_METHOD(Glib::RefPtr<Caps> get_negotiated_caps(), gst_pad_get_negotiated_caps)
_WRAP_METHOD(Glib::RefPtr<const Caps> get_negotiated_caps() const, gst_pad_get_negotiated_caps, constversion)
- // hand coded because we need to copy the Caps
+ // Hand coded because the documentation tells us that we need to copy the Caps
+ //TODO: Should/Could this be const?
+ //TODO: Documentation.
Glib::RefPtr<Caps> get_pad_template_caps();
+
_WRAP_METHOD(bool set_caps (const Glib::RefPtr<Caps>& caps), gst_pad_set_caps)
_WRAP_METHOD(Glib::RefPtr<Pad> get_peer(), gst_pad_get_peer)
_WRAP_METHOD(Glib::RefPtr<const Pad> get_peer() const, gst_pad_get_peer, constversion)
@@ -122,6 +126,8 @@
bool query_peer_duration(Format& format) const;
_WRAP_METHOD(bool query_peer_duration(Format& format, gint64& duration) const, gst_pad_query_peer_duration)
_WRAP_METHOD(bool query_peer_convert(Format src_format, gint64 src_value, Format& dst_format, gint64& dst_value) const, gst_pad_query_peer_convert)
+
+ //TODO: Use ArrayHandle?
_WRAP_METHOD(const QueryType* get_query_types() const, gst_pad_get_query_types)
_WRAP_METHOD(const QueryType* get_query_types_default() const, gst_pad_get_query_types_default)
@@ -159,9 +165,9 @@
#m4 _CONVERSION(`GstMiniObject*',`const Glib::RefPtr<MiniObject>&',`wrap($3, false)')
-// TODO: this fails to compile! is there something wrong with unwrap() ?
-//#m4 _CONVERSION(`const Glib::RefPtr<MiniObject>&',`GstMiniObject*',`unwrap($3)')
-// _WRAP_SIGNAL(bool have_data(const Glib::RefPtr<MiniObject>& mini_obj), "have-data")
+#m4 _CONVERSION(`const Glib::RefPtr<Gst::MiniObject>&',`GstMiniObject*',`Gst::unwrap($3)')
+#m4 _CONVERSION(`GstMiniObject*',`const Glib::RefPtr<Gst::MiniObject>&',`Gst::wrap($3)')
+ _WRAP_SIGNAL(bool have_data(const Glib::RefPtr<Gst::MiniObject>& mini_obj), "have-data")
#m4 _CONVERSION(`GstPad*',`const Glib::RefPtr<Pad>&',`Glib::wrap($3, true)')
_WRAP_SIGNAL(void linked(const Glib::RefPtr<Pad>& peer_pad), "linked")
Modified: gstreamermm/trunk/gstreamer/src/xml.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/xml.hg (original)
+++ gstreamermm/trunk/gstreamer/src/xml.hg Thu Feb 21 17:03:47 2008
@@ -43,12 +43,19 @@
_WRAP_METHOD(bool parse_doc(xmlDocPtr doc, const std::string& root), gst_xml_parse_doc)
_WRAP_METHOD(bool parse_file(const std::string& filename, const std::string& root), gst_xml_parse_file)
+
+ //TODO: Documentation.
bool parse_memory(const std::string& buffer, const std::string& root);
+
+ //Note: gst_xml_get_element() returns a reference.
_WRAP_METHOD(Glib::RefPtr<Element> get_element(const std::string& name), gst_xml_get_element)
_WRAP_METHOD(Glib::RefPtr<const Element> get_element(const std::string& name) const, gst_xml_get_element, constversion)
#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Element> >',`$2($3, Glib::OWNERSHIP_NONE)')
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Element> > get_topelements() const, gst_xml_get_topelements)
+ _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Element> > get_topelements(), gst_xml_get_topelements)
+
+#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<const Element> >',`$2($3, Glib::OWNERSHIP_NONE)')
+ _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<const Element> > get_topelements() const, gst_xml_get_topelements)
_IGNORE(gst_xml_parse_memory)
Modified: gstreamermm/trunk/tools/m4/convert_gst.m4
==============================================================================
--- gstreamermm/trunk/tools/m4/convert_gst.m4 (original)
+++ gstreamermm/trunk/tools/m4/convert_gst.m4 Thu Feb 21 17:03:47 2008
@@ -12,7 +12,6 @@
_CONVERSION(`GstObject*',`Glib::RefPtr<Gst::Object>',`Glib::wrap($3)')
_CONVERSION(`GstObject*',`Glib::RefPtr<const Gst::Object>',`Glib::wrap($3)')
_CONVERSION(`const Glib::RefPtr<Gst::Object>&',`GstObject*',`Glib::unwrap($3)')
-_CONVERSION(`GstObject*',`const Glib::RefPtr<Gst::Object>&',`Glib::wrap($3)')
#Buffer
_CONVERSION(`GstBuffer*',`Glib::RefPtr<Buffer>',`wrap($3)')
@@ -92,7 +91,7 @@
_CONVERSION(`GstStructure*',`Structure*',`((Structure*) ($3))')
#URIHandler
-_CONVERSION(`GstURIHandler*',`const Glib::RefPtr<URIHandler>&',`Glib::wrap($3)')
+#_CONVERSION(`GstURIHandler*',`const Glib::RefPtr<URIHandler>&',`Glib::wrap($3)')
_CONVERSION(`const Glib::RefPtr<URIHandler>&',`GstURIHandler*',`Glib::unwrap($3)')
#General Conversions
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]