diff --git a/tools/python/apixml2python.py b/tools/python/apixml2python.py index b1bf3ebb2..712466e83 100755 --- a/tools/python/apixml2python.py +++ b/tools/python/apixml2python.py @@ -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' diff --git a/tools/python/apixml2python/handwritten_declarations.mustache b/tools/python/apixml2python/handwritten_declarations.mustache index eac0ba4b3..d5be0a3c4 100644 --- a/tools/python/apixml2python/handwritten_declarations.mustache +++ b/tools/python/apixml2python/handwritten_declarations.mustache @@ -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; diff --git a/tools/python/apixml2python/handwritten_definitions.mustache b/tools/python/apixml2python/handwritten_definitions.mustache index e52f55e3a..bf1a4d7d6 100644 --- a/tools/python/apixml2python/handwritten_definitions.mustache +++ b/tools/python/apixml2python/handwritten_definitions.mustache @@ -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;