Yes, but your gst_element_get_state() is gstreamer c code. We use gstreamer's python bindings (pygst). Off the top of my head I believe the equivalent function is self.player.get_state(). I think it requires some parameters though so you may need to look up the pygst documentation to confirm.