Skip to content

Commit

Permalink
reimplement current_state getter
Browse files Browse the repository at this point in the history
  • Loading branch information
RSWilli committed Sep 20, 2023
1 parent 36a1608 commit 036a309
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gst/gst_element.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,15 @@ func (e *Element) GetState(state State, timeout ClockTime) (StateChangeReturn, S
return StateChangeReturn(stateChangeStatus), State(curState)
}

// this returns the value of the `current_state` member of the element:
//
// the current state of an element
//
// see https://gstreamer.freedesktop.org/documentation/gstreamer/gstelement.html?gi-language=c#members
func (e *Element) GetCurrentState() State {
return State(e.Instance().current_state)
}

// GetStaticPad retrieves a pad from element by name. This version only retrieves
// already-existing (i.e. 'static') pads.
func (e *Element) GetStaticPad(name string) *Pad {
Expand Down

0 comments on commit 036a309

Please sign in to comment.