public enum State

The possible states an element can be in.

States can be changed using set_state and checked using get_state.

Example: Hello World:

// See
// for a detailed description

public static int main (string[] args) {
// Initialize GStreamer:
Gst.init (ref args);

// Build the pipeline:
Gst.Element pipeline;
try {
pipeline = Gst.parse_launch ("playbin uri=");
} catch (Error e) {
stderr.printf ("Error: %s\n", e.message);
return 0;

// Start playing:
pipeline.set_state (Gst.State.PLAYING);

// Wait until error or EOS:
Gst.Bus bus = pipeline.get_bus ();
bus.timed_pop_filtered (Gst.CLOCK_TIME_NONE, Gst.MessageType.ERROR | Gst.MessageType.EOS);

// Free resources:
pipeline.set_state (Gst.State.NULL);

return 0;

valac --pkg gstreamer-1.0 hello-world.vala

Namespace: Gst
Package: gstreamer-1.0


Enum values: