Set buffer properties of gstreamer pipeline

Manually set the `playbin2` buffer properties to their default values. The
default values are not documented but hard-coded in gstreamer [1].

This is a starting point for making these properties configurable. For example
we might want higher values on system with unsteady network connection.

[1]: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/gst/playback/gsturidecodebin.c?h=0.10#n1714
This commit is contained in:
Thomas Scholtes 2014-03-29 15:22:34 +01:00
parent 4d287697e4
commit d42ebd1fec

View File

@ -100,6 +100,9 @@ class Audio(pykka.ThreadingActor):
playbin = gst.element_factory_make('playbin2')
playbin.set_property('flags', PLAYBIN_FLAGS)
playbin.set_property('buffer-size', 2*1024*1024)
playbin.set_property('buffer-duration', 2*gst.SECOND)
self._connect(playbin, 'about-to-finish', self._on_about_to_finish)
self._connect(playbin, 'notify::source', self._on_new_source)