Add subclasses to QGst::Message so that it is possible to create and parse the various types of messages.
This commit also adds two helper template structures:
QGlib::Private::CanConvertTo and QGlib::Private::CanConvertFrom.
These are used to abstract away the conversion check from RefPointer::dynamicCast()
and the conversion sanity checks from ValueBase::set() and ValueBase::get().
This is required to make the Message subclasses work properly with these
functions, since they are not real Gst classes and do not have registered GTypes.
Each Message subclass gets a specialization for these structures which lets
RefPointer::dynamicCast() check the message type to determine whether to allow
the cast and ValueBase::set() to treat the subclass as if it was a Message.
ValueBase::get() will fail to compile if used with one of those subclasses
and this is done in purpose, since a Value can never contain one of these
(it will contain a Message, which has a GType!) and get() is not supposed to
allow upcasts, like dynamicCast() does.
So, to sum up, this trick allows you to do:
QGst::MessagePtr msg = getSomeMessage();
QGst::EosMessagePtr eosMsg = msg.dynamicCast<QGst::EosMessage>(); //checks if msg->type() == QGst::MessageEos
and
QGlib::Value v;
v.init<QGst::Message>();
QGst::EosMessagePtr eosMsg = getSomeEosMessage();
value.set(eosMsg); //will not fail, it will treat EosMessage as a Message
but not
QGlib::Value v = getSomeValue();
QGst::EosMessagePtr eosMsg = v.get<QGst::EosMessagePtr>(); //compilation error