Fixing the Gst::Message classes



Hi. I'm thinking of working on the Gst::Message class in such a way so that when messages are sent out to the Gst::Bus they are the right type (e.g. Gst::MessageError when an error occurs instead of just a Gst::Message). I'm looking at things and see that Gst::Message should inherit from Gst::MiniObject (see http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstMessage.html#GstMessage). I made a small change to message.hg and miniobject.h which makes Gst::Message inherit from Gst::MiniObject just fine (which I'm attaching), I'm just not sure if it's the best change. I'm noticing that both Gst::MiniObject and Gst::Message both now have reference()/unreference() methods, but Gst::Message can use the Gst::MiniObject methods without having to implement its own (in fact, the gst_message_{ref,unref} are actually macros calling gst_mini_object_{ref,unref} respectively).

I was thinking of changing the "_CLASS_OPAQUE_REFCOUNTED(Message, GstMessage, NONE, gst_message_ref, gst_message_unref)" line in message.hg to something like "_CLASS_GOBJECT(Message, GstMessage, GST_MESSAGE, Gst::MiniObject, GstMiniObject)". Is this a good approach? I suspect that miniobject.{h,cc} will probably have to change some also, but I just want to get a sense as to where to begin or if I'm not going about things the right way. BTW, is this the right place/way to ask these questions? Thanks.

-Jose
Index: gst/gstmm/miniobject.h
===================================================================
--- gst/gstmm/miniobject.h	(revision 99)
+++ gst/gstmm/miniobject.h	(working copy)
@@ -1,14 +1,13 @@
 #ifndef _GSTMM_MINIOBJECT_H
 #define _GSTMM_MINIOBJECT_H
 
-#include <glibmm/objectbase.h>
 #include <gst/gstminiobject.h>
 
 namespace Gst
 {
 
 //This is a base class for gstreamer objects.
-class MiniObject : Glib::ObjectBase
+class MiniObject
 {
 protected:
 
Index: gst/src/message.hg
===================================================================
--- gst/src/message.hg	(revision 99)
+++ gst/src/message.hg	(working copy)
@@ -1,4 +1,4 @@
-#include <gstmm/object.h>
+#include <gstmm/miniobject.h>
 #include <gstmm/structure.h>
 #include <gstmm/format.h>
 #include <gstmm/element.h>
@@ -7,7 +7,7 @@
 namespace Gst
 {
 
-  class Message
+  class Message : public MiniObject
   {
     public:
       _CLASS_OPAQUE_REFCOUNTED(Message, GstMessage, NONE, gst_message_ref, gst_message_unref)


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