Merge pull request #164 from m1k1o/feature/source-object

add SourceObject to GstMessage.
This commit is contained in:
Wilhelm Bartel
2025-01-27 15:55:20 +01:00
committed by GitHub

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)