add SourceObject to GstMessage.

This commit is contained in:
Miroslav Šedivý
2025-01-06 12:01:30 +01:00
parent b307113477
commit 70723da789

View File

@@ -59,9 +59,14 @@ func (m *Message) Copy() *Message {
return FromGstMessageUnsafeFull(unsafe.Pointer(newNative))
}
// Source returns the source of the message.
// Source returns name of the source of the message.
func (m *Message) Source() string { return C.GoString(m.Instance().src.name) }
// Source returns object of the source of the message.
func (m *Message) SourceObject() *Object {
return wrapObject(glib.Take(unsafe.Pointer(m.Instance().src)))
}
// Type returns the MessageType of the message.
func (m *Message) Type() MessageType {
return MessageType(m.Instance()._type)