rind: Set the playbin video-sink to a fakesink element

I have a few tracks that have their album art embedded as a separate
stream. This results in emmental popping up a window with an image, and
sending an EOS when the image is closed. Suppress any video elements by
setting a fakesink instead of letting the playbin handle this
automatically.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2019-04-24 16:43:05 -04:00
parent 52df4373b5
commit b94cc5bd87
2 changed files with 8 additions and 2 deletions

View File

@ -31,11 +31,13 @@ VolumeAdj = gtk.Builder.get_object("volume_adjustment")
class EmmentalAudio:
def __init__(self):
self.playbin = Gst.ElementFactory.make("playbin")
self.fakesink = Gst.ElementFactory.make("fakesink")
self.bus = self.playbin.get_bus()
self.have_next = False
self.pause_count = -1
self.pause_pop = 0
self.playbin.set_property("video-sink", self.fakesink)
self.bus.add_signal_watch()
self.bus_cb = self.bus.connect("message", self.on_message)

View File

@ -60,8 +60,9 @@ class TestGst(unittest.TestCase):
self.stream = True
def test_gst_types(self):
self.assertIsInstance(self.audio.playbin, Gst.Element)
self.assertIsInstance(self.audio.bus, Gst.Bus)
self.assertIsInstance(self.audio.playbin, Gst.Element)
self.assertIsInstance(self.audio.fakesink, Gst.Element)
self.assertIsInstance(self.audio.bus, Gst.Bus)
self.assertIsInstance(gst.Adjustment, Gtk.Adjustment)
self.assertIsInstance(gst.Artist, Gtk.Label)
@ -101,6 +102,9 @@ class TestGst(unittest.TestCase):
self.assertEqual(gst.ProgScale.get_fill_level(), 100.0)
self.assertEqual(gst.Volume.get_value(), 100)
video = self.audio.playbin.get_property("video-sink")
self.assertEqual(video, self.audio.fakesink)
self.audio.load(None)
self.assertFalse(gst.PauseButton.is_visible())
self.assertTrue( gst.PlayButton.is_visible())