Re: Fixing the Gst::Message classes



Murray Cumming wrote:
On Tue, 2007-12-11 at 21:37 -0500, José Alburquerque wrote:
The good news is that I was able to implement a Gst::Message::wrap() method and modify gstmm to use it for wrapping messages. Unfortunately, I think I've reached my C++ knowledge limit :-). It looks like the Gst::Message::wrap() method should return the appropriate class based on the "message type", however, I tested with the modified test-mini-object-wrap test (to use the new Gst::Message::wrap() method) and also by trying to cast a Gst::Message (wrapped form a Gst::MessageError) to a Gst::MessageError in the on_bus_message() function of the ogg player example (by using RefPtr<...>::cast_dynamic) and both tests were unsuccessful.

At this point I'm pretty much stuck so I'm hoping you might be able to shed some light on what I'm doing. Would you be able to look at my changes? Thanks.

In Gst::Message::wrap() I changed it to just use new rather than
wrap_auto() and reinterpret_cast<> because that seemed simpler. I had to
add constructors for that. It seems to work now (in svn). I added a new
test for this new wrap() function.

I also changed the calls to wrap() to Gst::Message::wrap() to avoid any
confusion.


I can see now that casting and constructors are related. I'm working with classes that have multiple inheritance and sub-constructors that rely on parent constructors (and dealing with casting as well), but I have to admit, I couldn't remember (or maybe it never really registered) that constructors are used for casting. I'll have to review some C++ a little. Works fine. Thanks.

BTW, I was just testing the signal version of the ogg player and it seems to not be transmitting the signal. I'm thinking of looking into this a bit and trying to move further into the examples. I hope it's not inconvenient for me to continue to send patches as I modify and add things to gstmm. I wish I could check stuff in, but at least my work can be checked before a check-in just in case something is wrong.

-Jose


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