Merge pull request #140 from do-hyung-kim/enhance_usability

Enhance usability
This commit is contained in:
Wilhelm Bartel
2024-10-28 17:01:27 +01:00
committed by GitHub
2 changed files with 11 additions and 0 deletions

View File

@@ -531,6 +531,15 @@ func (e *Element) SetState(state State) error {
return nil
}
// SetLockedState sets the locked state flag for this element.
func (e *Element) SetLockedState(lockedState bool) error {
ret := C.gst_element_set_locked_state((*C.GstElement)(e.Instance()), gboolean(lockedState))
if !gobool(ret) {
return fmt.Errorf("failed to set locked state")
}
return nil
}
// SyncStateWithParent tries to change the state of the element to the same as its parent. If this function returns
// FALSE, the state of element is undefined.
func (e *Element) SyncStateWithParent() bool {

View File

@@ -86,6 +86,8 @@ func (m *Message) GetStructure() *Structure {
C.gst_message_parse_warning_details(m.Instance(), (**C.GstStructure)(unsafe.Pointer(&st)))
case MessageElement:
st = C.gst_message_get_structure(m.Instance())
case MessageApplication:
st = C.gst_message_get_structure(m.Instance())
}
// if no structure was returned, immediately return nil