Skip to content

Commit

Permalink
Merge pull request tinyzimmer#44 from go-gst/current_state_member
Browse files Browse the repository at this point in the history
reimplement current_state getter
  • Loading branch information
RSWilli authored Sep 20, 2023
2 parents 36a1608 + 036a309 commit 11f27eb
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 11f27eb

Please sign in to comment.