[Tomas Herfert] support for pulseaudio for audio calls.

This commit is contained in:
Yann Leboulanger 2011-03-27 18:47:02 +02:00
parent 2a7feb827c
commit 3d65d05487
1 changed files with 32 additions and 23 deletions

View File

@ -28,7 +28,9 @@ class DeviceManager(object):
def detect_element(self, name, text, pipe='%s'):
try:
element = gst.element_factory_make(name, '%spresencetest' % name)
if gst.element_factory_find(name):
element = gst.element_factory_make(name,
'%spresencetest' % name)
if isinstance(element, gst.interfaces.PropertyProbe):
element.set_state(gst.STATE_READY)
element.probe_property_name('device')
@ -40,7 +42,8 @@ class DeviceManager(object):
element.set_property('device', device)
element.set_state(gst.STATE_READY)
device_name = element.get_property('device-name')
self.devices[text % device_name] = pipe % '%s device=%s' % (name, device)
self.devices[text % device_name] = pipe % \
'%s device=%s' % (name, device)
element.set_state(gst.STATE_NULL)
else:
self.devices[text] = pipe % name
@ -62,6 +65,9 @@ class AudioInputManager(DeviceManager):
# Alsa src
self.detect_element('alsasrc', _('ALSA: %s'),
'%s ! volume name=gajim_vol')
# Pulseaudio src
self.detect_element('pulsesrc', _('Pulse: %s'),
'%s ! volume name=gajim_vol')
class AudioOutputManager(DeviceManager):
@ -72,8 +78,9 @@ class AudioOutputManager(DeviceManager):
# Auto sink
self.detect_element('autoaudiosink', _('Autodetect'))
# Alsa sink
self.detect_element('alsasink', _('ALSA: %s'),
'%s sync=false')
self.detect_element('alsasink', _('ALSA: %s'), '%s sync=false')
# Pulseaudio sink
self.detect_element('pulsesink', _('Pulse: %s'), '%s sync=false')
class VideoInputManager(DeviceManager):
@ -97,7 +104,9 @@ class VideoOutputManager(DeviceManager):
# Fake video output
self.detect_element('fakesink', _('Fake audio output'))
# Auto sink
self.detect_element('xvimagesink', _('X Window System (X11/XShm/Xv): %s'))
self.detect_element('xvimagesink',
_('X Window System (X11/XShm/Xv): %s'))
# ximagesink
self.detect_element('ximagesink', _('X Window System (without Xv)'))
self.detect_element('autovideosink', _('Autodetect'))