Commit af6678a9 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

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

parent 7a79aa17
......@@ -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'
......
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;
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment