From f1d60ac38b8df2a3686e9a2be96192e6c91f8d6e Mon Sep 17 00:00:00 2001 From: philippewarren <55722645+philippewarren@users.noreply.github.com> Date: Tue, 30 May 2023 10:19:40 -0400 Subject: [PATCH] Fix python documentation warnings and format (#121) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix python documentation warnings and format * Fix build when not using GStreamer * Pin Sphinx theme dependencies versions to remove pip install warnings on Ubuntu 20.04 * Bump version * Increase the abs error for the audio stream tests. * Added visibility flag for OSX -fvisibility=hidden --------- Co-authored-by: Marc-Antoine Maheux Co-authored-by: Dominic LeĢtourneau --- CMakeLists.txt | 2 +- VERSION | 2 +- cmake/pip_utils.cmake | 20 +++++- .../python/package/CMakeLists.txt | 19 +++--- .../python/package/_source/conf.py.in | 3 + .../package/_source/theme/requirements.txt | 3 + .../python/package/post-process-doc.sh | 3 + .../python/package/post-process-stub.sh | 2 +- .../python/package/setup.py.in | 3 +- .../python/package/setup_gstreamer.py.in | 61 ------------------- .../AudioSourceConfigurationPython.cpp | 10 +++ .../DataChannelConfigurationPython.cpp | 16 +++++ .../SignalingServerConfigurationPython.cpp | 11 +++- .../VideoSourceConfigurationPython.cpp | 3 + .../VideoStreamConfigurationPython.cpp | 5 ++ .../WebrtcConfigurationPython.cpp | 4 ++ .../python/src/SignalingClientPython.cpp | 7 +++ .../python/src/Sources/AudioSourcePython.cpp | 6 ++ .../python/src/StreamClientPython.cpp | 3 +- .../python/src/Utils/ClientPython.cpp | 7 +++ .../python/src/Utils/IceServerPython.cpp | 10 ++- .../test/src/StreamClientTests.cpp | 6 +- .../_source/theme/requirements.txt | 5 +- 23 files changed, 127 insertions(+), 84 deletions(-) delete mode 100644 opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/setup_gstreamer.py.in diff --git a/CMakeLists.txt b/CMakeLists.txt index b764bc3e..7f0cbc99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,6 @@ set( "3" CACHE STRING "Specific Python version to use" - FORCE ) find_package(Python ${OPENTERA_WEBRTC_NATIVE_CLIENT_PYTHON_VERSION} EXACT COMPONENTS Interpreter Development REQUIRED) @@ -114,6 +113,7 @@ elseif (UNIX) set(CMAKE_CXX_FLAGS "-fPIC") add_compile_definitions(WEBRTC_POSIX) if (APPLE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") add_compile_definitions(WEBRTC_MAC) endif(APPLE) else() diff --git a/VERSION b/VERSION index a918a2aa..ee6cdce3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.0 +0.6.1 diff --git a/cmake/pip_utils.cmake b/cmake/pip_utils.cmake index aa3ff689..4143a625 100644 --- a/cmake/pip_utils.cmake +++ b/cmake/pip_utils.cmake @@ -50,6 +50,20 @@ function(pip_configure_subpackage_file in_file out_file) set(PIP_CONFIGURE_OUTPUT_FILES ${PIP_CONFIGURE_OUTPUT_FILES} PARENT_SCOPE) endfunction() +function(add_dummy_target) + set(options) + set(oneValueArgs NAME) + set(multiValueArgs) + cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + add_custom_target( + ${ARGS_NAME}-target + ALL + VERBATIM + ) + set(${ARGS_NAME} ${ARGS_NAME}-target PARENT_SCOPE) +endfunction() + function(pip_add_requirements_target) set(options) set(oneValueArgs NAME REQUIREMENTS_FILE) @@ -75,14 +89,14 @@ endfunction() function(pip_add_so_target) set(options) - set(oneValueArgs NAME SO_NAME) + set(oneValueArgs NAME SO_TARGET_NAME) set(multiValueArgs DEPENDS) cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) add_custom_command( OUTPUT ${WORKING_DIR}/${ARGS_NAME}.stamp - DEPENDS ${ARGS_SO_NAME} ${ARGS_DEPENDS} - COMMAND ${CMAKE_COMMAND} -E copy $ ${PYTHON_PACKAGE_CONTENT_DIR}/$ + DEPENDS ${ARGS_SO_TARGET_NAME} ${ARGS_DEPENDS} + COMMAND ${CMAKE_COMMAND} -E copy $ ${PYTHON_PACKAGE_CONTENT_DIR}/$ COMMAND ${CMAKE_COMMAND} -E touch ${WORKING_DIR}/${ARGS_NAME}.stamp WORKING_DIRECTORY ${PYTHON_PACKAGE_DIR} VERBATIM diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/CMakeLists.txt b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/CMakeLists.txt index 26de01c9..6a346cbc 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/CMakeLists.txt +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/CMakeLists.txt @@ -11,6 +11,7 @@ set(USE_EXACT_LIB_SUBPATH ${OPENTERA_WEBRTC_NATIVE_CLIENT_PYTHON_PIP_PREFIX_USE_ set(USE_EXACT_LIB_SUBPATH_SOURCE ${OPENTERA_WEBRTC_NATIVE_CLIENT_PYTHON_PIP_PREFIX_USE_EXACT_LIB_SUBPATH_SOURCE}) set(ENABLE_HTML_DOC ${OPENTERA_WEBRTC_ENABLE_PYTHON_HTML_DOC}) set(ENABLE_SO_STUB ${OPENTERA_WEBRTC_ENABLE_PYTHON_SO_STUB}) +set(ENABLE_GSTREAMER ${OPENTERA_WEBRTC_ENABLE_GSTREAMER}) set(PYTHON_HTML_IGNORE_PREFIXES ${PIP_DEVEL_PREFIX} ${PIP_INSTALL_PREFIX}) set(PIP_PYTHON_EXECUTABLE ${PYTHON3_EXECUTABLE}) @@ -30,13 +31,14 @@ include(../../../../cmake/pip_utils.cmake) set(LICENSE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../../../LICENSE) set(REQUIREMENTS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../../../requirements.txt) -# Set the variable for the target file name of OpenteraWebrtcNativeGStreamer -if (OPENTERA_WEBRTC_ENABLE_GSTREAMER) - pip_configure_setup(setup_gstreamer.py.in) +if (ENABLE_GSTREAMER) + set(GSTREAMER_TARGET_FILE_NAME "$") else() - pip_configure_setup(setup.py.in) + set(GSTREAMER_TARGET_FILE_NAME "") endif() +pip_configure_setup(setup.py.in) + pip_configure_package_file(${LICENSE_FILE} LICENSE) pip_configure_package_file(${CMAKE_CURRENT_SOURCE_DIR}/README.md.in README.md) pip_configure_package_file(${CMAKE_CURRENT_SOURCE_DIR}/MANIFEST.in.in MANIFEST.in) @@ -49,9 +51,11 @@ pip_configure_doc_file(${CMAKE_CURRENT_SOURCE_DIR}/_source/index.rst index.rst) pip_configure_doc_file(${CMAKE_CURRENT_SOURCE_DIR}/_source/theme/requirements.txt theme/requirements.txt) pip_configure_doc_file(${CMAKE_CURRENT_SOURCE_DIR}/post-process-doc.sh ../post-process-doc.sh) -pip_add_so_target(NAME ${PYTHON_LIB_NAME}-so SO_NAME ${PYTHON_LIB_NAME}) -if (OPENTERA_WEBRTC_ENABLE_GSTREAMER) - pip_add_so_target(NAME OpenteraWebrtcNativeGStreamer-so SO_NAME OpenteraWebrtcNativeGStreamer) +pip_add_so_target(NAME ${PYTHON_LIB_NAME}-so SO_TARGET_NAME ${PYTHON_LIB_NAME}) +if (ENABLE_GSTREAMER) + pip_add_so_target(NAME OpenteraWebrtcNativeGStreamer-so SO_TARGET_NAME OpenteraWebrtcNativeGStreamer) +else() + add_dummy_target(NAME OpenteraWebrtcNativeGStreamer-so) endif() pip_add_requirements_target(NAME ${PYTHON_SUBPACKAGE_NAME}-requirements REQUIREMENTS_FILE ${REQUIREMENTS_FILE}) @@ -78,6 +82,7 @@ pip_add_dist_target( DEPENDS ${${PYTHON_SUBPACKAGE_NAME}-html} ${${PYTHON_SUBPACKAGE_NAME}-requirements} + ${OpenteraWebrtcNativeGStreamer-so} ) pip_add_install_target( NAME ${PYTHON_SUBPACKAGE_NAME}-install diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/_source/conf.py.in b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/_source/conf.py.in index 39aae956..aa68b3dc 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/_source/conf.py.in +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/_source/conf.py.in @@ -67,6 +67,9 @@ templates_path = ['_templates'] # This pattern also affects html_static_path and html_extra_path. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'setup.py', 'theme'] +autosummary_mock_imports = [ + 'opentera_webrtc.native_client.libOpenteraWebrtcNativeGStreamer', +] # -- Options for HTML output ------------------------------------------------- diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/_source/theme/requirements.txt b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/_source/theme/requirements.txt index d2dc2709..a60a173e 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/_source/theme/requirements.txt +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/_source/theme/requirements.txt @@ -1 +1,4 @@ sphinx-rtd-theme==1.1.1 +charset-normalizer<3.0,>=2.0 +sphinx==5.3.0 +urllib3<2.0 diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/post-process-doc.sh b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/post-process-doc.sh index a826ad06..2e89e404 100755 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/post-process-doc.sh +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/post-process-doc.sh @@ -4,3 +4,6 @@ find . -type f -name '*.html' | xargs sed -i.bak 's/opentera_webrtc\.native_clie # Remove _opentera_webrtc_native_client find . -type f -name '*.html' | xargs sed -i.bak 's/opentera_webrtc\.native_client\._opentera_webrtc_native_client/opentera_webrtc.native_client/g' && find . -type f -name '*.html.bak' | xargs rm + +# Fix opentera:: prefix +find . -type f -name '*.html' | xargs sed -i.bak 's/opentera:://g' && find . -type f -name '*.html.bak' | xargs rm diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/post-process-stub.sh b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/post-process-stub.sh index 208dce3c..9fea3b00 100755 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/post-process-stub.sh +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/post-process-stub.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh sed -i.bak 's/_opentera_webrtc_native_client\.//g' $1 && rm $1.bak -sed -i.bak 's/opentera::IceServer/IceServer/g' $1 && rm $1.bak +sed -i.bak 's/opentera:://g' $1 && rm $1.bak diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/setup.py.in b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/setup.py.in index 2c414606..883e87fe 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/setup.py.in +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/setup.py.in @@ -11,7 +11,7 @@ def get_doc_files(): files = {} for root, _, filenames in os.walk('_doc'): for filename in filenames: - rootless = root.replace('_doc', os.path.join('doc', 'opentera', 'webrtc', 'native_client')) + rootless = root.replace('_doc', os.path.join('doc', 'opentera_webrtc', 'native_client')) if not rootless in files.keys(): files[rootless] = [] files[rootless].append(os.path.join(root, filename)) @@ -50,6 +50,7 @@ setup( package_data={ 'opentera_webrtc.native_client': [ "$", + $,"${GSTREAMER_TARGET_FILE_NAME}"$,> $,"opentera_webrtc/native_client/py.typed"$,> $,"opentera_webrtc/native_client/__init__.pyi"$,> ], diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/setup_gstreamer.py.in b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/setup_gstreamer.py.in deleted file mode 100644 index 55f838d1..00000000 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/package/setup_gstreamer.py.in +++ /dev/null @@ -1,61 +0,0 @@ -from setuptools import setup, dist, find_packages -from setuptools.command.install import install -import os - -def read_file(name): - with open(name, "r", encoding="utf-8") as fh: - return fh.read() - - -def get_doc_files(): - files = {} - for root, _, filenames in os.walk('_doc'): - for filename in filenames: - rootless = root.replace('_doc', os.path.join('doc', 'opentera', 'webrtc', 'native_client')) - if not rootless in files.keys(): - files[rootless] = [] - files[rootless].append(os.path.join(root, filename)) - return list(files.items()) - - -long_description = read_file("README.md") - - -class BinaryDistribution(dist.Distribution): - """Force setuptools to recognize that this is actually a binary distribution""" - def has_ext_modules(self): - return True - - -setup( - name="opentera_webrtc_native_client", - version="${OPENTERA_WEBRTC_NATIVE_CLIENT_VERSION}", - author="Marc-Antoine Maheux, Cedric Godin, Dominic Letourneau", - author_email="marc-antoine.maheux@usherbrooke.ca, cedric.godin@usherbrooke.ca, dominic.letourneau@usherbrooke.ca", - description="OpenTera WebRTC Client Library for Python", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/introlab/opentera-webrtc", - packages=['opentera_webrtc.native_client'], - classifiers=[ - "Programming Language :: Python :: 3", - "Development Status :: 4 - Beta", - "License :: OSI Approved :: Apache Software License", - "Operating System :: POSIX", - ], - license="Apache Software License", - distclass=BinaryDistribution, - platforms=['linux_x86_64'], - # python_requires='==3.8', - package_data={ - 'opentera_webrtc.native_client': [ - "$", - "$", - $,"opentera_webrtc/native_client/py.typed"$,> - $,"opentera_webrtc/native_client/__init__.pyi"$,> - ], - }, - $,data_files=get_doc_files()$,> - include_package_data=True, - zip_safe=False, -) diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/AudioSourceConfigurationPython.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/AudioSourceConfigurationPython.cpp index 1e584ac4..b9e7ef14 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/AudioSourceConfigurationPython.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/AudioSourceConfigurationPython.cpp @@ -18,8 +18,10 @@ void opentera::initAudioSourceConfigurationPython(py::module& m) "create", py::overload_cast(&AudioSourceConfiguration::create), "Creates an audio source configuration with default values.\n" + "\n" ":param sound_card_total_delay_ms: The sum of the playback and " "recording delays\n" + "\n" ":return: An audio source configuration with default values", py::arg("sound_card_total_delay_ms")) .def_static( @@ -43,6 +45,7 @@ void opentera::initAudioSourceConfigurationPython(py::module& m) ":param stereo_swapping: Enable or disable the stereo swapping\n" ":param transient_suppression: Enable or disable the transient " "suppression\n" + "\n" ":return: An audio source configuration with the specified values", py::arg("sound_card_total_delay_ms"), py::arg("echo_cancellation"), @@ -56,35 +59,42 @@ void opentera::initAudioSourceConfigurationPython(py::module& m) "sound_card_total_delay_ms", &AudioSourceConfiguration::soundCardTotalDelayMs, "Returns the sum of the playback and recording delays.\n" + "\n" ":return: The sum of the playback and recording delays") .def_property_readonly( "echo_cancellation", &AudioSourceConfiguration::echoCancellation, "Indicates if the echo cancellation is enabled.\n" + "\n" ":return: True if the echo cancellation is enabled") .def_property_readonly( "auto_gain_control", &AudioSourceConfiguration::autoGainControl, "Indicates if the auto gain control is enabled.\n" + "\n" ":return: True if the auto gain control is enabled") .def_property_readonly( "noise_suppression", &AudioSourceConfiguration::noiseSuppression, "Indicates if the noise suppression is enabled.\n" + "\n" ":return: True if the noise suppression is enabled") .def_property_readonly( "highpass_filter", &AudioSourceConfiguration::highpassFilter, "Indicates if the highpass filter is enabled.\n" + "\n" ":return: True if the highpass filter is enabled") .def_property_readonly( "stereo_swapping", &AudioSourceConfiguration::stereoSwapping, "Indicates if the stereo swapping is enabled.\n" + "\n" ":return: true if the stereo swapping is enabled") .def_property_readonly( "transient_suppression", &AudioSourceConfiguration::transientSuppression, "Indicates if the transient suppression is enabled.\n" + "\n" ":return: True if the transient suppression is enabled"); } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/DataChannelConfigurationPython.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/DataChannelConfigurationPython.cpp index 700b45da..efc4e71d 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/DataChannelConfigurationPython.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/DataChannelConfigurationPython.cpp @@ -14,6 +14,7 @@ void opentera::initDataChannelConfigurationPython(py::module& m) "create", py::overload_cast<>(&DataChannelConfiguration::create), "Creates a data channel configuration with default values.\n" + "\n" ":return: A data channel configuration with default values") .def_static( "create", @@ -22,6 +23,7 @@ void opentera::initDataChannelConfigurationPython(py::module& m) "Creates a data channel configuration with the specified value.\n" "\n" ":param ordered: Indicates if the message order must be preserved\n" + "\n" ":return: A data channel configuration with the specified value") .def_static( "create_protocol", @@ -30,6 +32,7 @@ void opentera::initDataChannelConfigurationPython(py::module& m) "Creates a data channel configuration with the specified value.\n" "\n" ":param protocol: The data channel protocol\n" + "\n" ":return: A data channel configuration with the specified value") .def_static( "create", @@ -38,6 +41,7 @@ void opentera::initDataChannelConfigurationPython(py::module& m) "\n" ":param ordered: Indicates if the message order must be preserved\n" ":param protocol: The data channel protocol\n" + "\n" ":return: A data channel configuration with the specified values", py::arg("ordered"), py::arg("protocol")) @@ -49,6 +53,7 @@ void opentera::initDataChannelConfigurationPython(py::module& m) "\n" ":param max_packet_life_time: Indicates the amount of time a message " "can be retransmitted (ms)\n" + "\n" ":return: A data channel configuration with the specified value", py::arg("max_packet_life_time")) .def_static( @@ -59,6 +64,7 @@ void opentera::initDataChannelConfigurationPython(py::module& m) ":param ordered: Indicates if the message order must be preserved\n" ":param max_packet_life_time: Indicates the amount of time a message " "can be retransmitted (ms)\n" + "\n" ":return: A data channel configuration with the specified values", py::arg("ordered"), py::arg("max_packet_life_time")) @@ -70,6 +76,7 @@ void opentera::initDataChannelConfigurationPython(py::module& m) ":param max_packet_life_time: Indicates the amount of time a message " "can be retransmitted (ms)\n" ":param protocol: The data channel protocol\n" + "\n" ":return: A data channel configuration with the specified values", py::arg("max_packet_life_time"), py::arg("protocol")) @@ -82,6 +89,7 @@ void opentera::initDataChannelConfigurationPython(py::module& m) ":param max_packet_life_time: Indicates the amount of time a message " "can be retransmitted (ms)\n" ":param protocol: The data channel protocol\n" + "\n" ":return: A data channel configuration with the specified values", py::arg("ordered"), py::arg("max_packet_life_time"), @@ -94,6 +102,7 @@ void opentera::initDataChannelConfigurationPython(py::module& m) "\n" ":param max_retransmits: Indicates the maximum number of time a " "message can be retransmitted\n" + "\n" ":return: A data channel configuration with the specified value", py::arg("max_retransmits")) .def_static( @@ -104,6 +113,7 @@ void opentera::initDataChannelConfigurationPython(py::module& m) ":param ordered: Indicates if the message order must be preserved\n" ":param max_retransmits: Indicates the maximum number of time a " "message can be retransmitted\n" + "\n" ":return: A data channel configuration with the specified values", py::arg("ordered"), py::arg("max_retransmits")) @@ -115,6 +125,7 @@ void opentera::initDataChannelConfigurationPython(py::module& m) ":param max_retransmits: Indicates the maximum number of time a " "message can be retransmitted\n" ":param protocol: The data channel protocol\n" + "\n" ":return: A data channel configuration with the specified values", py::arg("max_retransmits"), py::arg("protocol")) @@ -127,6 +138,7 @@ void opentera::initDataChannelConfigurationPython(py::module& m) ":param max_retransmits: Indicates the maximum number of time a " "message can be retransmitted\n" ":param protocol: The data channel protocol\n" + "\n" ":return: A data channel configuration with the specified values", py::arg("ordered"), py::arg("max_retransmits"), @@ -136,20 +148,24 @@ void opentera::initDataChannelConfigurationPython(py::module& m) "ordered", &DataChannelConfiguration::ordered, "Indicates if the message order must be preserved.\n" + "\n" ":return: True if the message order must be preserved") .def_property_readonly( "max_packet_life_time", &DataChannelConfiguration::maxPacketLifeTime, "Returns the maximum number of time a message can be retransmitted.\n" + "\n" ":return: The maximum number of time a message can be retransmitted") .def_property_readonly( "max_retransmits", &DataChannelConfiguration::maxRetransmits, "Returns the maximum number of time a message can be retransmitted.\n" + "\n" ":return: The maximum number of time a message can be retransmitted") .def_property_readonly( "protocol", &DataChannelConfiguration::protocol, "Returns the data channel protocol.\n" + "\n" ":return: The data channel protocol"); } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/SignalingServerConfigurationPython.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/SignalingServerConfigurationPython.cpp index 46549e0c..8eaf8455 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/SignalingServerConfigurationPython.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/SignalingServerConfigurationPython.cpp @@ -44,6 +44,7 @@ void opentera::initSignalingServerConfigurationPython(pybind11::module& m) ":param url: The signaling server URL\n" ":param client_name: The client name\n" ":param room: The room name\n" + "\n" ":return: A signaling server configuration with the specified values", py::arg("url"), py::arg("client_name"), @@ -53,11 +54,12 @@ void opentera::initSignalingServerConfigurationPython(pybind11::module& m) py::overload_cast(&create), "Creates an signaling server configuration with the specified " "values.\n" - " *\n" + "\n" ":param url: The signaling server URL\n" ":param client_name: The client name\n" ":param client_data: The client data\n" ":param room: The room name\n" + "\n" ":return: A signaling server configuration with the specified values", py::arg("url"), py::arg("client_name"), @@ -73,6 +75,7 @@ void opentera::initSignalingServerConfigurationPython(pybind11::module& m) ":param client_name: The client name\n" ":param room: The room name\n" ":param password: The signaling server password\n" + "\n" ":return: A signaling server configuration with the specified values", py::arg("url"), py::arg("client_name"), @@ -89,6 +92,7 @@ void opentera::initSignalingServerConfigurationPython(pybind11::module& m) ":param client_data: The client data\n" ":param room: The room name\n" ":param password: The signaling server password\n" + "\n" ":return: A signaling server configuration with the specified values", py::arg("url"), py::arg("client_name"), @@ -100,25 +104,30 @@ void opentera::initSignalingServerConfigurationPython(pybind11::module& m) "url", &SignalingServerConfiguration::url, "Returns the signaling server URL.\n" + "\n" ":return: The signaling server URL") .def_property_readonly( "client_name", &SignalingServerConfiguration::clientName, "Returns the client name.\n" + "\n" ":return: The client name") .def_property_readonly( "client_data", [](const SignalingServerConfiguration& self) { return sioMessageToPyObject(self.clientData()); }, "Returns the client data.\n" + "\n" ":return: The client data") .def_property_readonly( "room", &SignalingServerConfiguration::room, "Returns the room name.\n" + "\n" ":return: The room name") .def_property_readonly( "password", &SignalingServerConfiguration::password, "Returns the signaling server password.\n" + "\n" ":return: The signaling server password"); } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/VideoSourceConfigurationPython.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/VideoSourceConfigurationPython.cpp index ed0ef25d..77be1dab 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/VideoSourceConfigurationPython.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/VideoSourceConfigurationPython.cpp @@ -20,6 +20,7 @@ void opentera::initVideoSourceConfigurationPython(py::module& m) "\n" ":param needs_denoising: Indicates if this source needs denoising\n" ":param is_screencast: Indicates if this source is screencast\n" + "\n" ":return: A video source configuration with the specified values", py::arg("needs_denoising"), py::arg("is_screencast")) @@ -28,10 +29,12 @@ void opentera::initVideoSourceConfigurationPython(py::module& m) "needs_denoising", &VideoSourceConfiguration::needsDenoising, "Indicates if this source needs denoising.\n" + "\n" ":return: True if this source needs denoising") .def_property_readonly( "is_screencast", &VideoSourceConfiguration::isScreencast, "Indicates if this source is screencast.\n" + "\n" ":return: True if this source is a screencast"); } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/VideoStreamConfigurationPython.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/VideoStreamConfigurationPython.cpp index e29b500d..45771ff4 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/VideoStreamConfigurationPython.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/VideoStreamConfigurationPython.cpp @@ -28,6 +28,7 @@ void opentera::initVideoStreamConfigurationPython(py::module& m) "Creates a video stream configuration with the specified value.\n" "\n" ":param forced_codecs: Indicates the codecs that must be used. An empty set means all codecs.\n" + "\n" ":return: A video stream configuration with the specified value", py::arg("forced_codecs")) .def_static( @@ -40,6 +41,7 @@ void opentera::initVideoStreamConfigurationPython(py::module& m) "has no effect when the library is not built with GStreamer.\n" ":param use_gstreamer_software_encoder_decoder: Indicates to use GStreamer software codecs instead of " "WebRTC ones. It has no effect when the library is not built with GStreamer.\n" + "\n" ":return: A video stream configuration with the specified values", py::arg("forced_codecs"), py::arg("force_gstreamer_hardware_acceleration"), @@ -49,15 +51,18 @@ void opentera::initVideoStreamConfigurationPython(py::module& m) "forced_codecs", &VideoStreamConfiguration::forcedCodecs, "Returns the codecs that must be used. An empty set means all codecs.\n" + "\n" ":return: The codecs that must be used") .def_property_readonly( "force_gstreamer_hardware_acceleration", &VideoStreamConfiguration::forceGStreamerHardwareAcceleration, "Indicates that hardware accelerated codecs must be used.\n" + "\n" ":return: True if only hardware accelerated codecs can be used.") .def_property_readonly( "use_gstreamer_software_encoder_decoder", &VideoStreamConfiguration::useGStreamerSoftwareEncoderDecoder, "Indicates to use GStreamer software codecs instead of WebRTC ones.\n" + "\n" ":return: True if GStreamer software codecs must be used instead of WebRTC ones"); } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/WebrtcConfigurationPython.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/WebrtcConfigurationPython.cpp index 13cdadcd..c4f1d840 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/WebrtcConfigurationPython.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Configurations/WebrtcConfigurationPython.cpp @@ -16,13 +16,16 @@ void opentera::initWebrtcConfigurationPython(pybind11::module& m) py::overload_cast<>(&WebrtcConfiguration::create), "Creates a WebRTC peer connection configuration with default " "values.\n" + "\n" ":return: A WebRTC peer connection configuration with default values") .def_static( "create", py::overload_cast>(&WebrtcConfiguration::create), "Creates a WebRTC peer connection configuration with the specified " "value.\n" + "\n" ":param ice_servers: The ice servers\n" + "\n" ":return: A WebRTC peer connection configuration with the specified " "value", py::arg("ice_servers")) @@ -31,5 +34,6 @@ void opentera::initWebrtcConfigurationPython(pybind11::module& m) "ice_servers", &WebrtcConfiguration::iceServers, "Returns the ice servers.\n" + "\n" ":return: The ice servers"); } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/SignalingClientPython.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/SignalingClientPython.cpp index b3ffb7cc..b7b2cca0 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/SignalingClientPython.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/SignalingClientPython.cpp @@ -34,24 +34,28 @@ void opentera::initSignalingClientPython(pybind11::module& m) "is_connected", GilScopedRelease::guard(&SignalingClient::isConnected), "Indicates if the client is connected to the signaling server.\n" + "\n" ":return: True if the client is connected to the signaling server") .def_property_readonly( "is_rtc_connected", GilScopedRelease::guard(&SignalingClient::isRtcConnected), "Indicates if the client is connected to a least " "one client (RTCPeerConnection).\n" + "\n" ":return: True if the client is connected to a " "least one client (RTCPeerConnection)") .def_property_readonly( "id", GilScopedRelease::guard(&SignalingClient::id), "Returns the client id.\n" + "\n" ":return: The client id") .def_property_readonly( "connected_room_client_ids", GilScopedRelease::guard(&SignalingClient::getConnectedRoomClientIds), "Returns the connected room client ids.\n" + "\n" ":return: The connected room client ids") .def( @@ -63,12 +67,14 @@ void opentera::initSignalingClientPython(pybind11::module& m) "returned.\n" "\n" ":param id: The room client id\n" + "\n" ":return: The room client that matches with the specified id", py::arg("id")) .def_property_readonly( "room_clients", GilScopedRelease::guard(&SignalingClient::getRoomClients), "Returns the room clients\n" + "\n" ":return: The room clients") .def_property( @@ -215,5 +221,6 @@ void opentera::initSignalingClientPython(pybind11::module& m) &SignalingClient::setTlsVerificationEnabled, "Enable or disable the TLS verification. By default, the " "TLS verification is enabled.\n" + "\n" ":param: is_enabled"); } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Sources/AudioSourcePython.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Sources/AudioSourcePython.cpp index 5f157d57..2838fb75 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Sources/AudioSourcePython.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Sources/AudioSourcePython.cpp @@ -71,6 +71,7 @@ void opentera::initAudioSourcePython(pybind11::module& m) &sendFrame, py::call_guard(), "Send an audio frame\n" + "\n" ":param frame: The audio frame", py::arg("frame")) .def( @@ -78,6 +79,7 @@ void opentera::initAudioSourcePython(pybind11::module& m) &sendFrame, py::call_guard(), "Send an audio frame\n" + "\n" ":param frame: The audio frame", py::arg("frame")) .def( @@ -85,6 +87,7 @@ void opentera::initAudioSourcePython(pybind11::module& m) &sendFrame, py::call_guard(), "Send an audio frame\n" + "\n" ":param frame: The audio frame", py::arg("frame")) .def( @@ -92,6 +95,7 @@ void opentera::initAudioSourcePython(pybind11::module& m) &sendFrameWithIsTyping, py::call_guard(), "Send an audio frame\n" + "\n" ":param frame: The audio frame\n", ":param is_typing: Indicates if the frame contains typing sound." "This is only useful with the typing detection option.", @@ -102,6 +106,7 @@ void opentera::initAudioSourcePython(pybind11::module& m) &sendFrameWithIsTyping, py::call_guard(), "Send an audio frame\n" + "\n" ":param frame: The audio frame\n" ":param is_typing: Indicates if the frame contains typing sound." "This is only useful with the typing detection option.", @@ -112,6 +117,7 @@ void opentera::initAudioSourcePython(pybind11::module& m) &sendFrameWithIsTyping, py::call_guard(), "Send an audio frame\n" + "\n" ":param frame: The audio frame\n" ":param is_typing: Indicates if the frame contains typing sound." "This is only useful with the typing detection option.", diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/StreamClientPython.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/StreamClientPython.cpp index 65bb7377..32283115 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/StreamClientPython.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/StreamClientPython.cpp @@ -164,8 +164,7 @@ void opentera::initStreamClientPython(pybind11::module& m) ":param signaling_server_configuration: The configuration to " "connect to the signaling server\n" ":param webrtc_configuration: The WebRTC configuration\n" - ":param video_stream_configuration: The video stream configuration\n" - " */", + ":param video_stream_configuration: The video stream configuration\n", py::arg("signaling_server_configuration"), py::arg("webrtc_configuration"), py::arg("video_stream_configuration")) diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Utils/ClientPython.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Utils/ClientPython.cpp index 9c3e5f8d..12bd1af6 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Utils/ClientPython.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Utils/ClientPython.cpp @@ -36,16 +36,19 @@ void opentera::initClientPython(pybind11::module& m) "id", &Client::id, "Returns the client id.\n" + "\n" ":return: The client id") .def_property_readonly( "name", &Client::name, "Returns the client name.\n" + "\n" ":return: The client name") .def_property_readonly( "data", [](const Client& self) { return sioMessageToPyObject(self.data()); }, "Returns the client data.\n" + "\n" ":return: The client data"); py::class_(m, "RoomClient") @@ -77,20 +80,24 @@ void opentera::initClientPython(pybind11::module& m) "id", &RoomClient::id, "Returns the client id.\n" + "\n" ":return: The client id") .def_property_readonly( "name", &RoomClient::name, "Returns the client name.\n" + "\n" ":return: The client name") .def_property_readonly( "data", [](const RoomClient& self) { return sioMessageToPyObject(self.data()); }, "Returns the client data.\n" + "\n" ":return: The client data") .def_property_readonly( "is_connected", &RoomClient::isConnected, "Indicates if the client is connected (RTCPeerConnection).\n" + "\n" ":return: True if the client is connected (RTCPeerConnection)"); } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Utils/IceServerPython.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Utils/IceServerPython.cpp index bc576dca..ce8d4bd5 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Utils/IceServerPython.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Utils/IceServerPython.cpp @@ -48,16 +48,19 @@ void opentera::initIceServerPython(pybind11::module& m) "urls", &IceServer::urls, "Returns the ice server urls.\n" + "\n" ":return: The ice server urls") .def_property_readonly( "username", &IceServer::username, "Returns the ice server username.\n" + "\n" ":return: The ice server username") .def_property_readonly( "credential", &IceServer::credential, "Returns the ice server credential.\n" + "\n" ":return: The ice server credential") .def_static( @@ -75,9 +78,10 @@ void opentera::initIceServerPython(pybind11::module& m) } }, "Fetches the ice servers from the signaling server.\n" - " *\n" + "\n" ":param url: The signaling server url\n" ":param password: The signaling server username\n" + "\n" ":return: The fetched ice servers", py::arg("url"), py::arg("password")) @@ -96,11 +100,12 @@ void opentera::initIceServerPython(pybind11::module& m) } }, "Fetches the ice servers from the signaling server.\n" - " *\n" + "\n" ":param url: The signaling server url\n" ":param password: The signaling server username\n" ":param verify_certificate: Indicates to verify the certificate or " "not\n" + "\n" ":return: The fetched ice servers", py::arg("url"), py::arg("password"), @@ -122,6 +127,7 @@ void opentera::initIceServerPython(pybind11::module& m) "Gets ice servers from a JSON\n" "\n" ":param json: The JSON to parse\n" + "\n" ":return The parsed ice servers", py::arg("json")); } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/test/src/StreamClientTests.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/test/src/StreamClientTests.cpp index 42b0ed19..2f18dc0a 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/test/src/StreamClientTests.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/test/src/StreamClientTests.cpp @@ -535,7 +535,7 @@ void onAudioFrameReceived( void checkReceivedAudio(const vector& receivedAudio, int16_t amplitude) { - constexpr int AbsError = 3000; + constexpr int AbsError = 7000; ASSERT_FALSE(receivedAudio.empty()); int16_t min1 = *min_element(receivedAudio.begin() + receivedAudio.size() / 2, receivedAudio.end()); @@ -547,7 +547,7 @@ void checkReceivedAudio(const vector& receivedAudio, int16_t amplitude) TEST_P(StreamClientTests, audioStream_bidirectional_shouldBeSentAndReceived) { // Initialize the clients - constexpr int16_t Amplitude1 = 15000; + constexpr int16_t Amplitude1 = 10000; constexpr int16_t Amplitude2 = 25000; shared_ptr audioSource1 = make_shared(Amplitude1); shared_ptr audioSource2 = make_shared(Amplitude2); @@ -695,7 +695,7 @@ TEST_P(StreamClientTests, audioStream_bidirectional_shouldBeSentAndReceived) TEST_P(StreamClientTests, audioStream_muted_shouldBeSentAndReceived) { // Initialize the clients - constexpr int16_t Amplitude1 = 15000; + constexpr int16_t Amplitude1 = 10000; constexpr int16_t Amplitude2 = 25000; shared_ptr audioSource1 = make_shared(Amplitude1); shared_ptr audioSource2 = make_shared(Amplitude2); diff --git a/signaling-server/_source/theme/requirements.txt b/signaling-server/_source/theme/requirements.txt index 5babfe38..a60a173e 100644 --- a/signaling-server/_source/theme/requirements.txt +++ b/signaling-server/_source/theme/requirements.txt @@ -1 +1,4 @@ -sphinx-rtd-theme==1.0.0 +sphinx-rtd-theme==1.1.1 +charset-normalizer<3.0,>=2.0 +sphinx==5.3.0 +urllib3<2.0