Hand-written implementation of linphone_core_get_sound_devices() in the Python wrapper.

This commit is contained in:
Ghislain MARY 2014-08-20 14:53:57 +02:00
parent 7a79aa17bc
commit af6678a973
3 changed files with 27 additions and 0 deletions

View file

@ -80,6 +80,7 @@ blacklisted_functions = [
]
hand_written_functions = [
'linphone_chat_room_send_message2',
'linphone_core_get_sound_devices',
'linphone_core_get_video_devices',
'linphone_core_new',
'linphone_core_new_with_config'

View file

@ -1,3 +1,4 @@
static PyObject * pylinphone_Core_get_sound_devices(PyObject *self, void *closure);
static PyObject * pylinphone_Core_get_video_devices(PyObject *self, void *closure);
static PyTypeObject pylinphone_VideoSizeType;

View file

@ -115,6 +115,31 @@ static PyObject * pylinphone_module_method_set_log_handler(PyObject *self, PyObj
}
static PyObject * pylinphone_Core_get_sound_devices(PyObject *self, void *closure) {
PyObject *_list;
const char **_devices;
LinphoneCore *native_ptr = pylinphone_Core_get_native_ptr(self);
if (native_ptr == NULL) {
PyErr_SetString(PyExc_TypeError, "Invalid linphone.Core instance");
return NULL;
}
pylinphone_trace(1, "[PYLINPHONE] >>> %s(%p [%p])", __FUNCTION__, self, native_ptr);
_devices = linphone_core_get_sound_devices(native_ptr);
pylinphone_dispatch_messages();
_list = PyList_New(0);
while (*_devices != NULL) {
PyObject *_item = PyString_FromString(*_devices);
PyList_Append(_list, _item);
_devices++;
}
pylinphone_trace(-1, "[PYLINPHONE] <<< %s -> %p", __FUNCTION__, _list);
return _list;
}
static PyObject * pylinphone_Core_get_video_devices(PyObject *self, void *closure) {
PyObject *_list;
const char **_devices;