Gstreamer tests: use fakesink for audio output

This commit is contained in:
Stein Magnus Jodal 2010-06-16 22:07:35 +02:00
parent d396b7d114
commit f2547199a0
2 changed files with 10 additions and 0 deletions

View File

@ -61,6 +61,12 @@ class GStreamerPlaybackController(BasePlaybackController):
self.stop()
def use_fake_sink(self):
"""For testing. To avoid audio output during testing, and the need for
a sound card and a fully working gstreamer installation."""
sink = gst.element_factory_make("fakesink", "fakesink")
self._bin.set_property("audio-sink", sink)
def _set_state(self, state):
self._bin.set_state(state)

View File

@ -28,6 +28,10 @@ class GStreamerPlaybackControllerTest(BasePlaybackControllerTest,
for i in range(1, 4)]
backend_class = GStreamerBackend
def setUp(self):
super(GStreamerPlaybackControllerTest, self).setUp()
self.backend.playback.use_fake_sink()
def add_track(self, path):
uri = path_to_uri(data_folder(path))
track = Track(uri=uri, id=1, length=4464)