From 16da69ecfba52fe2221aa9b7132b74f7a1a82eb8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Einar=20J=C3=B8rgen=20Haraldseid?= Date: Sat, 3 Jun 2017 09:51:20 +0200 Subject: [PATCH] Added a dead simple example --- example0.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 example0.py diff --git a/example0.py b/example0.py new file mode 100644 index 0000000..8254be8 --- /dev/null +++ b/example0.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +# An even simpler gstreamer example, omitting all that class stuff + +import gi, time +gi.require_version('Gst', '1.0') +from gi.repository import Gst + +# Create the gstreamer pipeline +Gst.init(None) +pipeline = Gst.Pipeline() + +# Audio source (src) +audio = Gst.ElementFactory.make("audiotestsrc") +pipeline.add(audio) + +# Audio output (sink) +pulsesink = Gst.ElementFactory.make("pulsesink") +pipeline.add(pulsesink) + +# Link our two elements together +audio.link(pulsesink) + +# Start the pipeline +pipeline.set_state(Gst.State.PLAYING) + +# Something to do while the pipeline is playing +while True: + time.sleep(0.001) -- 2.30.2