├── plugins ├── gsoap │ ├── .gitignore │ ├── fix_generated_files.sh │ └── check_gsoap_control.cpp ├── webrtc │ ├── requirements.txt │ ├── deployment_diagram.jpg │ ├── util │ │ └── generate_cert.sh │ ├── web │ │ ├── server.py │ │ ├── index.js │ │ ├── index.css │ │ ├── README.md │ │ └── index.html │ ├── signaling │ │ ├── Signaling.md │ │ └── README.md │ ├── connect_room.py │ ├── CMakeLists.txt │ ├── check_webrtc.cpp │ └── README.md ├── glfw │ ├── fonts │ │ ├── OpenSans-Bold.ttf │ │ ├── OpenSans-Light.ttf │ │ └── OpenSans-Regular.ttf │ ├── check_swcam_display.sh │ └── external │ │ └── CMakeLists.txt ├── pjsip │ ├── build_scripts │ │ ├── build.sh.in │ │ ├── configure.sh.in │ │ └── patch.sh.in │ ├── more_codecs.patch │ ├── pj-media-endpt.hpp │ ├── pj-media-endpt.cpp │ └── check_pjsip.cpp ├── vrpn │ ├── utils │ │ ├── debug-server.cpp │ │ └── debug-client.cpp │ ├── vrpn-sink-plugin.cpp │ ├── vrpn-source-plugin.cpp │ ├── source │ │ └── devices │ │ │ ├── properties │ │ │ └── property-base.cpp │ │ │ └── source-device.cpp │ ├── shared │ │ ├── device.cpp │ │ └── connection │ │ │ ├── vrpn-server-connection.hpp │ │ │ ├── vrpn-client-connection.hpp │ │ │ └── vrpn-connection.hpp │ ├── tests │ │ └── check_vrpn_plugin.cpp │ └── sink │ │ └── devices │ │ ├── sink-device.cpp │ │ ├── sink-device.hpp │ │ └── button │ │ └── vrpn-button-server.cpp ├── nvenc │ ├── encoder │ │ ├── check_decode.json │ │ ├── nvenc-api.cpp │ │ └── nvenc-api.hpp │ └── cuda │ │ └── cu-res.hpp ├── ladspa │ ├── check_ladspa.json │ └── CMakeLists.txt ├── samplerate │ ├── check_resample.json │ └── CMakeLists.txt ├── video_snapshot │ ├── check_shmshot.sh │ └── CMakeLists.txt ├── rtmp │ ├── CMakeLists.txt │ └── check_rtmp.cpp ├── watcher │ ├── CMakeLists.txt │ └── check_watcher.cpp ├── jack │ ├── check_shmdata2jack.sh │ └── check-quid-conf-and-two-jack-servers.py ├── protocol_mapper │ ├── protocol-curl.json │ ├── protocol-osc.json │ ├── CMakeLists.txt │ ├── protocol-mapper.hpp │ └── protocol-curl.hpp ├── avrecplay │ ├── CMakeLists.txt │ └── check_avrecplay.cpp ├── crashtest │ ├── CMakeLists.txt │ └── crashtest.hpp ├── cropper │ ├── CMakeLists.txt │ └── check_cropper.cpp ├── systemusage │ ├── CMakeLists.txt │ └── check_systemusage_plugin.cpp ├── vnc │ └── CMakeLists.txt ├── v4l2 │ ├── CMakeLists.txt │ └── check_v4l2_plugin.cpp ├── executor │ ├── CMakeLists.txt │ └── check_executor.cpp ├── osc │ ├── CMakeLists.txt │ └── check_osc.cpp ├── pulse │ ├── CMakeLists.txt │ └── check_pulsesrc.cpp ├── CMakeLists.txt ├── portmidi │ └── CMakeLists.txt └── example │ ├── check_gst_plugin.cpp │ ├── signal-quid.hpp │ └── method-quid.hpp ├── wrappers ├── switcherio │ ├── tests │ │ └── __init__.py │ ├── .gitignore │ ├── requirements.txt │ ├── clients │ │ └── node │ │ │ └── package.json │ └── CMakeLists.txt ├── CMakeLists.txt └── python │ ├── examples │ ├── 16-register-sip.py │ ├── 18-switcher-session-read-write.py │ ├── 17-quiddities.py │ ├── 05-save.py │ └── 02-introspection.py │ ├── bundles.py │ ├── ungiled.hpp │ └── props.py ├── tests ├── oie.mp3 ├── check_configuration.json ├── check_gst_pipeline.cpp ├── check_manager.cpp ├── check_scope_guard.cpp └── check_test_full.cpp ├── doc ├── doxygen │ └── pages │ │ └── mainpage.md ├── mapper_prop_osc.png ├── logo │ ├── eps │ │ ├── Switcher-black.eps │ │ ├── Switcher-color.eps │ │ ├── Switcher-white.eps │ │ ├── Switcher-black-vertical.eps │ │ ├── Switcher-white-vertical.eps │ │ ├── Switcher-black-horizontal.eps │ │ ├── Switcher-white-horizontal.eps │ │ ├── Switcher-color-horizontal-black-text.eps │ │ ├── Switcher-color-horizontal-white-text.eps │ │ ├── Switcher-color-vertical-black-text.eps │ │ └── Switcher-color-vertical-white-text.eps │ ├── png │ │ ├── Switcher-black.png │ │ ├── Switcher-color.png │ │ ├── Switcher-white.png │ │ ├── Switcher-black-vertical.png │ │ ├── Switcher-white-vertical.png │ │ ├── Switcher-black-horizontal.png │ │ ├── Switcher-white-horizontal.png │ │ ├── Switcher-color-horizontal-black-text.png │ │ ├── Switcher-color-horizontal-white-text.png │ │ ├── Switcher-color-vertical-black-text.png │ │ └── Switcher-color-vertical-white-text.png │ └── graphic-charter │ │ └── img │ │ ├── graphic-grid.png │ │ ├── minimum-size.png │ │ ├── protection-space.png │ │ ├── protection-space2.png │ │ ├── very-clear-photo.png │ │ ├── plain-and-dark-background.png │ │ ├── plain-and-clear-background.png │ │ └── Switcher-white-with-black-background.png └── custom-quiddity-path.md ├── deps ├── pip3-ubuntu20.04 ├── apt-build-nvidia-deps-ubuntu-20.04 ├── apt-build-nvidia-deps-ubuntu-22.04 ├── pip3-ubuntu22.04 ├── pip3-ubuntu23.04 ├── apt-runtime-nvidia-deps-ubuntu-20.04 ├── apt-runtime-nvidia-deps-ubuntu-22.04 ├── apt-runtime-ubuntu-20.04 ├── apt-runtime-ubuntu-22.04 ├── apt-build-ubuntu-20.04 ├── apt-build-ubuntu-22.04 ├── apt-build-ubuntu-23.04 ├── apt-runtime-ubuntu-23.04 ├── apt-runtime-all-ubuntu-20.04 ├── apt-runtime-all-ubuntu-22.04 ├── apt-build-all-ubuntu-20.04 └── apt-build-all-ubuntu-22.04 ├── .dockerignore ├── .clang-format ├── .gitignore ├── cmake ├── PackageSourceTest.cmake └── PackageSourceTest.sh.in ├── tox.ini ├── LAST_RELEASE.md ├── .gitmodules ├── AUTHORS.md ├── .gitlab └── issue_templates │ ├── feature_request.md │ ├── bug_report.md │ └── rfc.md ├── switcher ├── switcher.pc.in ├── utils │ ├── safe-bool-idiom.cpp │ ├── safe-bool-idiom.hpp │ ├── serialize-string.cpp │ ├── bool-any.cpp │ ├── templated-sequence.hpp │ ├── bool-log.cpp │ ├── bool-any.hpp │ ├── bool-log.hpp │ ├── safe-bool-log.hpp │ ├── is-specialization-of.hpp │ ├── counter-map.cpp │ ├── net-utils.hpp │ ├── counter-map.hpp │ ├── creator.hpp │ └── scope-exit.hpp ├── configuration │ ├── configurable.cpp │ └── configurable.hpp ├── quiddity │ ├── quid-id-t.hpp │ ├── kind-printer.hpp │ ├── property │ │ ├── gprop-to-prop.hpp │ │ └── group.hpp │ ├── qrox.cpp │ ├── signal │ │ ├── sig.cpp │ │ └── sig.hpp │ ├── qrox.hpp │ ├── config.hpp │ ├── basic-test.hpp │ ├── doc.hpp │ ├── plugin-loader.hpp │ └── doc.cpp ├── logger │ └── logger.cpp ├── quiddities │ ├── empty-quiddity.hpp │ ├── empty-quiddity.cpp │ ├── gst-audio-encoder.hpp │ ├── gst-video-encoder.hpp │ ├── external-shmdata-writer.hpp │ └── dummy-sink.hpp ├── gst │ ├── initialized.hpp │ ├── rtppayloader-finder.hpp │ ├── initialized.cpp │ ├── rtp-session.hpp │ ├── glibmainloop.hpp │ └── rtp-session.cpp ├── shmdata │ ├── caps │ │ └── utils.hpp │ └── stat.hpp └── infotree │ └── key-val-serializer.hpp ├── src ├── check_switcher.sh └── check_switcher_ctrl.sh ├── tools └── CMakeLists.txt ├── scripts └── make_authors_from_git.sh ├── CMakeUninstall.cmake.in └── dockerfiles ├── Dockerfile-deps-Ubuntu-22.04 └── Dockerfile-deps-Ubuntu-20.04 /plugins/gsoap/.gitignore: -------------------------------------------------------------------------------- 1 | generated/ -------------------------------------------------------------------------------- /wrappers/switcherio/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /plugins/webrtc/requirements.txt: -------------------------------------------------------------------------------- 1 | websockets==9.1 2 | PyOpenSSL 3 | -------------------------------------------------------------------------------- /wrappers/switcherio/.gitignore: -------------------------------------------------------------------------------- 1 | env 2 | clients/node/node_modules 3 | -------------------------------------------------------------------------------- /tests/oie.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/tests/oie.mp3 -------------------------------------------------------------------------------- /doc/doxygen/pages/mainpage.md: -------------------------------------------------------------------------------- 1 | This is a documentation in construction, more will come soon. 2 | -------------------------------------------------------------------------------- /doc/mapper_prop_osc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/mapper_prop_osc.png -------------------------------------------------------------------------------- /deps/pip3-ubuntu20.04: -------------------------------------------------------------------------------- 1 | -r ../plugins/webrtc/requirements.txt 2 | -r ../wrappers/switcherio/requirements.txt -------------------------------------------------------------------------------- /deps/apt-build-nvidia-deps-ubuntu-20.04: -------------------------------------------------------------------------------- 1 | nvidia-cuda-dev 2 | nvidia-kernel-source-460 3 | libnvidia-encode-460 4 | -------------------------------------------------------------------------------- /deps/apt-build-nvidia-deps-ubuntu-22.04: -------------------------------------------------------------------------------- 1 | nvidia-cuda-dev 2 | nvidia-kernel-source-515 3 | libnvidia-encode-515 4 | -------------------------------------------------------------------------------- /deps/pip3-ubuntu22.04: -------------------------------------------------------------------------------- 1 | -r ../plugins/webrtc/requirements.txt 2 | -r ../wrappers/switcherio/requirements.txt 3 | -------------------------------------------------------------------------------- /deps/pip3-ubuntu23.04: -------------------------------------------------------------------------------- 1 | -r ../plugins/webrtc/requirements.txt 2 | -r ../wrappers/switcherio/requirements.txt 3 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | **/build 2 | **/scripts 3 | **/.idea 4 | 5 | *.gitignore 6 | *.dockerignore 7 | *.gitlab-ci.yml 8 | -------------------------------------------------------------------------------- /doc/logo/eps/Switcher-black.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/eps/Switcher-black.eps -------------------------------------------------------------------------------- /doc/logo/eps/Switcher-color.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/eps/Switcher-color.eps -------------------------------------------------------------------------------- /doc/logo/eps/Switcher-white.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/eps/Switcher-white.eps -------------------------------------------------------------------------------- /doc/logo/png/Switcher-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/png/Switcher-black.png -------------------------------------------------------------------------------- /doc/logo/png/Switcher-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/png/Switcher-color.png -------------------------------------------------------------------------------- /doc/logo/png/Switcher-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/png/Switcher-white.png -------------------------------------------------------------------------------- /wrappers/switcherio/requirements.txt: -------------------------------------------------------------------------------- 1 | aiohttp[speedups] 2 | python-socketio 3 | requests 4 | 5 | websocket-client 6 | -------------------------------------------------------------------------------- /plugins/glfw/fonts/OpenSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/plugins/glfw/fonts/OpenSans-Bold.ttf -------------------------------------------------------------------------------- /plugins/glfw/fonts/OpenSans-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/plugins/glfw/fonts/OpenSans-Light.ttf -------------------------------------------------------------------------------- /plugins/webrtc/deployment_diagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/plugins/webrtc/deployment_diagram.jpg -------------------------------------------------------------------------------- /doc/logo/eps/Switcher-black-vertical.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/eps/Switcher-black-vertical.eps -------------------------------------------------------------------------------- /doc/logo/eps/Switcher-white-vertical.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/eps/Switcher-white-vertical.eps -------------------------------------------------------------------------------- /doc/logo/png/Switcher-black-vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/png/Switcher-black-vertical.png -------------------------------------------------------------------------------- /doc/logo/png/Switcher-white-vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/png/Switcher-white-vertical.png -------------------------------------------------------------------------------- /plugins/glfw/fonts/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/plugins/glfw/fonts/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /plugins/gsoap/fix_generated_files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for i in $(grep -rl '(,' generated/); do sed -i 's/(,/(/' $i; done 4 | 5 | -------------------------------------------------------------------------------- /plugins/pjsip/build_scripts/build.sh.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | CFLAGS="-fPIC" make -j dep 4 | CFLAGS="-fPIC" make -j 5 | -------------------------------------------------------------------------------- /doc/logo/eps/Switcher-black-horizontal.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/eps/Switcher-black-horizontal.eps -------------------------------------------------------------------------------- /doc/logo/eps/Switcher-white-horizontal.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/eps/Switcher-white-horizontal.eps -------------------------------------------------------------------------------- /doc/logo/png/Switcher-black-horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/png/Switcher-black-horizontal.png -------------------------------------------------------------------------------- /doc/logo/png/Switcher-white-horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/png/Switcher-white-horizontal.png -------------------------------------------------------------------------------- /doc/logo/graphic-charter/img/graphic-grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/graphic-charter/img/graphic-grid.png -------------------------------------------------------------------------------- /doc/logo/graphic-charter/img/minimum-size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/graphic-charter/img/minimum-size.png -------------------------------------------------------------------------------- /plugins/glfw/check_swcam_display.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # the script will fail if one command fails 4 | set -e 5 | 6 | swcam-display -l 7 | 8 | -------------------------------------------------------------------------------- /plugins/vrpn/utils/debug-server.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() { 4 | std::cout << "Unimplemented" << std::endl; 5 | return 1; 6 | } -------------------------------------------------------------------------------- /plugins/webrtc/util/generate_cert.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes 4 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: Google 2 | BinPackArguments: false 3 | BinPackParameters: false 4 | DerivePointerAlignment: false 5 | ColumnLimit: 100 6 | -------------------------------------------------------------------------------- /doc/logo/graphic-charter/img/protection-space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/graphic-charter/img/protection-space.png -------------------------------------------------------------------------------- /doc/logo/graphic-charter/img/protection-space2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/graphic-charter/img/protection-space2.png -------------------------------------------------------------------------------- /doc/logo/graphic-charter/img/very-clear-photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/graphic-charter/img/very-clear-photo.png -------------------------------------------------------------------------------- /doc/logo/eps/Switcher-color-horizontal-black-text.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/eps/Switcher-color-horizontal-black-text.eps -------------------------------------------------------------------------------- /doc/logo/eps/Switcher-color-horizontal-white-text.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/eps/Switcher-color-horizontal-white-text.eps -------------------------------------------------------------------------------- /doc/logo/eps/Switcher-color-vertical-black-text.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/eps/Switcher-color-vertical-black-text.eps -------------------------------------------------------------------------------- /doc/logo/eps/Switcher-color-vertical-white-text.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/eps/Switcher-color-vertical-white-text.eps -------------------------------------------------------------------------------- /doc/logo/png/Switcher-color-horizontal-black-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/png/Switcher-color-horizontal-black-text.png -------------------------------------------------------------------------------- /doc/logo/png/Switcher-color-horizontal-white-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/png/Switcher-color-horizontal-white-text.png -------------------------------------------------------------------------------- /doc/logo/png/Switcher-color-vertical-black-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/png/Switcher-color-vertical-black-text.png -------------------------------------------------------------------------------- /doc/logo/png/Switcher-color-vertical-white-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/png/Switcher-color-vertical-white-text.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pem 2 | *.switcher 3 | *.swp 4 | .idea/workspace.xml 5 | .vscode/* 6 | __pycache__ 7 | build/ 8 | cmake-build-*/ 9 | html/ 10 | .env 11 | -------------------------------------------------------------------------------- /deps/apt-runtime-nvidia-deps-ubuntu-20.04: -------------------------------------------------------------------------------- 1 | nvidia-cuda-toolkit 2 | nvidia-dkms-460 3 | nvidia-driver-460 4 | nvidia-kernel-common-460 5 | libnvidia-encode-460 6 | -------------------------------------------------------------------------------- /deps/apt-runtime-nvidia-deps-ubuntu-22.04: -------------------------------------------------------------------------------- 1 | nvidia-cuda-toolkit 2 | nvidia-dkms-515 3 | nvidia-driver-515 4 | nvidia-kernel-common-515 5 | libnvidia-encode-515 6 | -------------------------------------------------------------------------------- /plugins/pjsip/build_scripts/configure.sh.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | ./aconfigure CFLAGS="@PJPROJECT_CFLAGS_STR@" @PJPROJECT_CONFIGURE_OPTIONS_STR@ 4 | -------------------------------------------------------------------------------- /doc/logo/graphic-charter/img/plain-and-dark-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/graphic-charter/img/plain-and-dark-background.png -------------------------------------------------------------------------------- /doc/logo/graphic-charter/img/plain-and-clear-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/graphic-charter/img/plain-and-clear-background.png -------------------------------------------------------------------------------- /doc/logo/graphic-charter/img/Switcher-white-with-black-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicobou/switcher/HEAD/doc/logo/graphic-charter/img/Switcher-white-with-black-background.png -------------------------------------------------------------------------------- /cmake/PackageSourceTest.cmake: -------------------------------------------------------------------------------- 1 | configure_file("cmake/PackageSourceTest.sh.in" "PackageSourceTest.sh" @ONLY) 2 | add_custom_target(package_source_test COMMAND ${CMAKE_CURRENT_BINARY_DIR}/PackageSourceTest.sh) -------------------------------------------------------------------------------- /wrappers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | link_libraries( 2 | ${SWITCHER_LIBRARY} 3 | ) 4 | 5 | include_directories( 6 | ${SWITCHER_DIR} 7 | ) 8 | 9 | add_subdirectory(python) 10 | add_subdirectory(switcherio) 11 | 12 | -------------------------------------------------------------------------------- /deps/apt-runtime-ubuntu-20.04: -------------------------------------------------------------------------------- 1 | gsoap 2 | gstreamer1.0-plugins-base 3 | gstreamer1.0-plugins-good 4 | gstreamer1.0-plugins-ugly 5 | libcgsi-gsoap1 6 | libjson-glib-1.0-0 7 | libpython3.8 8 | libsamplerate0 9 | libspdlog1 10 | python3 11 | -------------------------------------------------------------------------------- /deps/apt-runtime-ubuntu-22.04: -------------------------------------------------------------------------------- 1 | gsoap 2 | gstreamer1.0-plugins-base 3 | gstreamer1.0-plugins-good 4 | gstreamer1.0-plugins-ugly 5 | libcgsi-gsoap1 6 | libjson-glib-1.0-0 7 | libpython3.10 8 | libsamplerate0 9 | libspdlog1 10 | python3 11 | -------------------------------------------------------------------------------- /deps/apt-build-ubuntu-20.04: -------------------------------------------------------------------------------- 1 | build-essential 2 | cmake 3 | git 4 | gstreamer1.0-tools 5 | libcgsi-gsoap-dev 6 | libgstreamer1.0-dev 7 | libjson-glib-dev 8 | libsamplerate0-dev 9 | libspdlog-dev 10 | python3-dev 11 | python3-pip 12 | libfmt-dev 13 | -------------------------------------------------------------------------------- /deps/apt-build-ubuntu-22.04: -------------------------------------------------------------------------------- 1 | build-essential 2 | cmake 3 | git 4 | gstreamer1.0-tools 5 | libcgsi-gsoap-dev 6 | libgstreamer1.0-dev 7 | libjson-glib-dev 8 | libsamplerate0-dev 9 | libspdlog-dev 10 | python3-dev 11 | python3-pip 12 | libfmt-dev 13 | -------------------------------------------------------------------------------- /deps/apt-build-ubuntu-23.04: -------------------------------------------------------------------------------- 1 | build-essential 2 | cmake 3 | git 4 | gstreamer1.0-tools 5 | libcgsi-gsoap-dev 6 | libgstreamer1.0-dev 7 | libjson-glib-dev 8 | libsamplerate0-dev 9 | libspdlog-dev 10 | python3-dev 11 | python3-pip 12 | libfmt-dev 13 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [flake8] 2 | # H101: Use TODO(NAME) 3 | # E402: module level import not at top of file. (The pyquid import has to be preceded by a sys.append) 4 | ignore = H101,E402 5 | max-line-length = 120 6 | exclude = 7 | *.md, 8 | build/*, 9 | plugins/*, 10 | scripts/* 11 | -------------------------------------------------------------------------------- /deps/apt-runtime-ubuntu-23.04: -------------------------------------------------------------------------------- 1 | gsoap 2 | gstreamer1.0-plugins-base 3 | gstreamer1.0-plugins-good 4 | gstreamer1.0-plugins-ugly 5 | libcgsi-gsoap1 6 | libjson-glib-1.0-0 7 | libpython3.11 8 | libsamplerate0 9 | libspdlog1.10 10 | python3 11 | python3-aiohttp 12 | python3-requests 13 | python3-socketio 14 | python3-websocket 15 | -------------------------------------------------------------------------------- /plugins/glfw/external/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Disable warnings for external libraries 2 | add_definitions(-w) 3 | 4 | # GLFW 5 | set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) 6 | set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) 7 | set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) 8 | set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) 9 | add_subdirectory(glfw EXCLUDE_FROM_ALL) 10 | -------------------------------------------------------------------------------- /wrappers/switcherio/clients/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "socket.io-client": "^4.4.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /plugins/pjsip/more_codecs.patch: -------------------------------------------------------------------------------- 1 | --- ./pjmedia/include/pjmedia/codec.h 2012-10-05 06:04:54.000000000 -0400 2 | +++ ./pjmedia/include/pjmedia/codec128.h 2014-05-07 12:24:28.594106978 -0400 3 | @@ -621,7 +621,7 @@ 4 | /** 5 | * Declare maximum codecs 6 | */ 7 | -#define PJMEDIA_CODEC_MGR_MAX_CODECS 32 8 | +#define PJMEDIA_CODEC_MGR_MAX_CODECS 128 9 | 10 | 11 | /** 12 | -------------------------------------------------------------------------------- /plugins/webrtc/web/server.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from http.server import HTTPServer, SimpleHTTPRequestHandler 4 | import ssl 5 | 6 | httpd = HTTPServer(("", 8000), SimpleHTTPRequestHandler) 7 | 8 | httpd.socket = ssl.wrap_socket (httpd.socket, 9 | keyfile="key.pem", 10 | certfile='cert.pem', 11 | server_side=True) 12 | 13 | httpd.serve_forever() 14 | -------------------------------------------------------------------------------- /plugins/nvenc/encoder/check_decode.json: -------------------------------------------------------------------------------- 1 | { 2 | "bundle" : { 3 | "nvencdecoder" : { 4 | "pipeline" : "videotestsrc name=source = 1.0, json-glib-1.0, glib-2.0, samplerate, spdlog, shmdata-@SHMDATA_REQUIRED_VERSION@ 12 | Libs: -L${libdir} -lsamplerate -lswitcher-@SWITCHER_API_VERSION@ 13 | Cflags: -std=c++@CMAKE_CXX_STANDARD@ -I${includedir}/switcher-@SWITCHER_API_VERSION@ 14 | -------------------------------------------------------------------------------- /deps/apt-runtime-all-ubuntu-22.04: -------------------------------------------------------------------------------- 1 | gsoap 2 | gstreamer1.0-libav 3 | gstreamer1.0-nice 4 | gstreamer1.0-plugins-bad 5 | gstreamer1.0-plugins-base 6 | gstreamer1.0-plugins-good 7 | gstreamer1.0-plugins-rtp 8 | gstreamer1.0-plugins-ugly 9 | jackd2 10 | libcgsi-gsoap1 11 | libcurl4 12 | libjson-glib-1.0-0 13 | liblo7 14 | libltc11 15 | libportmidi0 16 | libpulse-mainloop-glib0 17 | libpython3.10 18 | libsamplerate0 19 | libsoup2.4-1 20 | libspdlog1 21 | libssl3 22 | libvncclient1 23 | libvncserver1 24 | libxcursor1 25 | libxi6 26 | libxinerama1 27 | libxrandr2 28 | libxxf86vm1 29 | pulseaudio 30 | python3 31 | -------------------------------------------------------------------------------- /plugins/video_snapshot/check_shmshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # the script will fail if one command fails 4 | set -e 5 | 6 | gst-launch-1.0 -e --gst-plugin-path=/usr/local/lib/gstreamer-1.0/:/usr/lib/gstreamer-1.0/ videotestsrc pattern=18 ! shmdatasink socket-path=/tmp/check_shmshot & 7 | gstpipe=$! 8 | 9 | sleep 0.1 10 | 11 | # non interactive mode 12 | shmshot --shmpath /tmp/check_shmshot --folder /tmp/ --name check_shmshot_file 13 | 14 | if [ -f /tmp/check_shmshot_file.jpg ] 15 | then 16 | rm /tmp/check_shmshot_file.jpg 17 | else 18 | exit 1 19 | fi 20 | 21 | kill -s SIGTERM $gstpipe 22 | -------------------------------------------------------------------------------- /deps/apt-build-all-ubuntu-20.04: -------------------------------------------------------------------------------- 1 | build-essential 2 | cmake 3 | git 4 | gstreamer1.0-tools 5 | libcgsi-gsoap-dev 6 | libcurl4-gnutls-dev 7 | libgstreamer-plugins-bad1.0-dev 8 | libgstreamer-plugins-base1.0-dev 9 | libgstreamer1.0-dev 10 | libjack-jackd2-dev 11 | libjson-glib-dev 12 | liblo-dev 13 | libltc-dev 14 | libportmidi-dev 15 | libpulse-dev 16 | libsamplerate0-dev 17 | libsoup2.4-dev 18 | libspdlog-dev 19 | libssl-dev 20 | libvncserver-dev 21 | libxcursor-dev 22 | libxi-dev 23 | libxinerama-dev 24 | libxrandr-dev 25 | libxxf86vm-dev 26 | python3-dev 27 | python3-pip 28 | swh-plugins 29 | libfmt-dev 30 | -------------------------------------------------------------------------------- /deps/apt-build-all-ubuntu-22.04: -------------------------------------------------------------------------------- 1 | build-essential 2 | cmake 3 | git 4 | gstreamer1.0-tools 5 | libcgsi-gsoap-dev 6 | libcurl4-gnutls-dev 7 | libgstreamer-plugins-bad1.0-dev 8 | libgstreamer-plugins-base1.0-dev 9 | libgstreamer1.0-dev 10 | libjack-jackd2-dev 11 | libjson-glib-dev 12 | liblo-dev 13 | libltc-dev 14 | libportmidi-dev 15 | libpulse-dev 16 | libsamplerate0-dev 17 | libsoup2.4-dev 18 | libspdlog-dev 19 | libssl-dev 20 | libvncserver-dev 21 | libxcursor-dev 22 | libxi-dev 23 | libxinerama-dev 24 | libxrandr-dev 25 | libxxf86vm-dev 26 | python3-dev 27 | python3-pip 28 | swh-plugins 29 | libfmt-dev 30 | -------------------------------------------------------------------------------- /wrappers/python/examples/16-register-sip.py: -------------------------------------------------------------------------------- 1 | from pyquid import Switcher, InfoTree 2 | 3 | import json 4 | 5 | host = "my-host" 6 | user = 'my-user' 7 | pswd = "my-pass" 8 | 9 | sw = Switcher("test") 10 | sip_config = { 11 | "port": "5060", 12 | "user": user, 13 | "pass": pswd, 14 | "stun": host, 15 | "turn": host, 16 | "turn_user": user, 17 | "turn_pass": pswd 18 | } 19 | 20 | sip_quid = sw.create( 21 | "sip", "sip_quid", InfoTree(json.dumps(sip_config))) 22 | 23 | address = f"{user}@{host}" 24 | reg = sip_quid.invoke("register", [address, pswd]) 25 | print(reg) 26 | 27 | sip_quid.invoke("unregister") 28 | -------------------------------------------------------------------------------- /wrappers/switcherio/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | 3 | # Search for Python3 4 | find_package(Python3 3.8 COMPONENTS Interpreter Development REQUIRED) 5 | 6 | # cmake option for the enabling of Switcherio 7 | option(WITH_SWITCHERIO "Switcherio Wrapper" ${WITH_PYTHON}) # default is ON if Python3_FOUND 8 | add_feature_info("wrapper-switcherio" WITH_SWITCHERIO "Switcher-io Wrapper") 9 | 10 | if (WITH_SWITCHERIO) 11 | if(Python3_FOUND) 12 | add_test(NAME pyquid_switcherio COMMAND ${Python3_EXECUTABLE} -m unittest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) 13 | endif() # python3 found 14 | endif() # WITH_SWITCHERIO 15 | 16 | -------------------------------------------------------------------------------- /plugins/rtmp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | set(PLUGIN_NAME "plugin-rtmp") 4 | set(PLUGIN_DESCRIPTION "RTMP Plugin") 5 | 6 | option(PLUGIN_RTMP "${PLUGIN_DESCRIPTION}" ${ENABLED}) 7 | add_feature_info("${PLUGIN_NAME}" PLUGIN_RTMP "${PLUGIN_DESCRIPTION}") 8 | 9 | if (PLUGIN_RTMP) 10 | 11 | add_library(rtmp SHARED 12 | rtmp.cpp 13 | ) 14 | 15 | add_dependencies(rtmp ${SWITCHER_LIBRARY}) 16 | 17 | # TEST 18 | 19 | add_executable(check_rtmp check_rtmp.cpp) 20 | add_test(check_rtmp check_rtmp) 21 | 22 | # INSTALL 23 | 24 | install(TARGETS rtmp LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 25 | 26 | endif () 27 | -------------------------------------------------------------------------------- /plugins/watcher/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | set(PLUGIN_NAME "plugin-watcher") 4 | set(PLUGIN_DESCRIPTION "Watcher Plugin") 5 | 6 | option(PLUGIN_WATCHER "${PLUGIN_DESCRIPTION}" TRUE) 7 | add_feature_info("${PLUGIN_NAME}" PLUGIN_WATCHER "${PLUGIN_DESCRIPTION}") 8 | 9 | if (PLUGIN_WATCHER) 10 | 11 | add_library(watcher SHARED 12 | watcher.cpp 13 | ) 14 | 15 | add_dependencies(watcher ${SWITCHER_LIBRARY}) 16 | 17 | # TEST 18 | 19 | add_executable(check_watcher check_watcher.cpp) 20 | add_test(check_watcher check_watcher) 21 | 22 | # INSTALL 23 | 24 | install(TARGETS watcher LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 25 | 26 | endif () 27 | -------------------------------------------------------------------------------- /.gitlab/issue_templates/rfc.md: -------------------------------------------------------------------------------- 1 | ## Summary 2 | 3 | (Summarize the request for comments.) 4 | 5 | ## Motivation 6 | 7 | (Explain here the motivation for the current request for comment.) 8 | 9 | ## Proposal 10 | 11 | (Describe here the proposal: changes in code behaviour, specification, documentation, API, or any other applicable document in the repository.) 12 | 13 | ## Impact on already existing code 14 | 15 | (Describe the changes that will be needed to be addressed by other parallel or future developments.) 16 | 17 | ## Roadmap 18 | 19 | (Enumerate here the steps required to achieve the work.) 20 | 21 | ## More details 22 | 23 | (Provide here more details if any.) 24 | 25 | /label ~rfc 26 | -------------------------------------------------------------------------------- /plugins/ladspa/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | set(PLUGIN_NAME "plugin-ladspa") 4 | set(PLUGIN_DESCRIPTION "LADSPA Plugin") 5 | 6 | option(PLUGIN_LADSPA "${PLUGIN_DESCRIPTION}" ON) 7 | add_feature_info("${PLUGIN_NAME}" PLUGIN_LADSPA "${PLUGIN_DESCRIPTION}") 8 | 9 | if (PLUGIN_LADSPA) 10 | 11 | add_library(ladspa SHARED 12 | ladspa.cpp 13 | check_ladspa.cpp) 14 | 15 | add_dependencies(ladspa ${SWITCHER_LIBRARY}) 16 | 17 | # TEST 18 | 19 | add_executable(check_ladspa check_ladspa.cpp) 20 | configure_file(check_ladspa.json check_ladspa.json COPYONLY) 21 | add_test(check_ladspa check_ladspa) 22 | 23 | # INSTALL 24 | 25 | install(TARGETS ladspa LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 26 | 27 | endif () 28 | -------------------------------------------------------------------------------- /src/check_switcher.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # the script will fail if one command fails 4 | set -e 5 | 6 | # print version 7 | switcher --version 8 | 9 | # list quiddity kinds 10 | switcher --list-kinds 11 | 12 | # print kinds documentation, JSON-formated 13 | switcher --kinds-doc 14 | 15 | # print documentation for a given kind (here the "dummy" quiddity kind) 16 | switcher --kind-doc dummy 17 | 18 | # run a quiet switcher 19 | switcher --quiet --extra-plugin-dir ../plugins/gsoap/& 20 | ret=$! 21 | sleep 1 22 | kill -s SIGQUIT $ret 23 | 24 | # run switcher with several parameters 25 | switcher --server-name checkswitcher --port-number 23232 --debug --extra-plugin-dir ../plugins/gsoap/ & 26 | ret=$! 27 | sleep 1 28 | kill -s SIGQUIT $ret 29 | 30 | exit 0 31 | -------------------------------------------------------------------------------- /plugins/jack/check_shmdata2jack.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # the script will fail if one command fails 4 | set -e 5 | 6 | # run dummy jack in background 7 | jackd --no-realtime --name check_shmdata2jack -d dummy -r 48000 & jackserv=$! 8 | 9 | # produce an audio shmdata in background 10 | gst-launch-1.0 --gst-plugin-path=/usr/local/lib/gstreamer-1.0/:/usr/lib/gstreamer-1.0/ audiotestsrc ! shmdatasink socket-path=/tmp/check_shmdata2jack & gstpipe=$! 11 | 12 | # run shmdata2jack 13 | shmdata2jack -v -s check_shmdata2jack -n check_shmdata2jack_client --connect-all-to-first /tmp/check_shmdata2jack & shmdata2jack=$! 14 | 15 | # wait 16 | sleep 1 17 | 18 | # kill processes 19 | kill -s SIGTERM $shmdata2jack 20 | kill -s SIGTERM $gstpipe 21 | kill -s SIGTERM $jackserv 22 | 23 | -------------------------------------------------------------------------------- /plugins/protocol_mapper/protocol-curl.json: -------------------------------------------------------------------------------- 1 | { 2 | "protocol" : "curl", 3 | "continuous": "true", 4 | "commands": { 5 | "continuous_message" : { 6 | "url" : "http://www.google.com", 7 | "continuous": "true", 8 | "name": "continuous", 9 | "descr": "generates a continuous message" 10 | }, 11 | "bang" : { 12 | "url" : "http://www.google.com", 13 | "name": "bang", 14 | "descr": "generates a bang" 15 | }, 16 | "wrong_url" : { 17 | "url" : "http://www.google.comcomcom", 18 | "name": "wrong url", 19 | "descr": "site does not exist, should just fail" 20 | }, 21 | "test_timeout" : { 22 | "url" : "http://10.42.0.66", 23 | "name": "timeout", 24 | "descr": "should timeout" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /cmake/PackageSourceTest.sh.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # Clean before, in case of a previous failed test 5 | rm -f @PACKAGE_NAME@-@PACKAGE_VERSION@-Source.tar.gz 6 | rm -rf @PACKAGE_NAME@-@PACKAGE_VERSION@-Source 7 | 8 | # Create the source package 9 | make package_source 10 | 11 | # Extract and rebuild + test 12 | tar -zxvf @PACKAGE_NAME@-@PACKAGE_VERSION@-Source.tar.gz 13 | cd @PACKAGE_NAME@-@PACKAGE_VERSION@-Source 14 | mkdir build 15 | cd build 16 | cmake -DENABLE_GPL=ON .. 17 | make -j${nproc} 18 | SWITCHER_PLUGIN_PATH=$(pwd)/plugins/ PATH=$PATH:$(pwd)/../tools/:$(pwd)/src/ PYTHONPATH=$PYTHONPATH:$(pwd)/wrappers/python/ make test 19 | 20 | # Cleanup after 21 | cd ../.. 22 | rm -f @PACKAGE_NAME@-@PACKAGE_VERSION@-Source.tar.gz 23 | rm -rf @PACKAGE_NAME@-@PACKAGE_VERSION@-Source 24 | -------------------------------------------------------------------------------- /plugins/avrecplay/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | set(PLUGIN_NAME "plugin-av") 4 | set(PLUGIN_DESCRIPTION "AV recorder/player Plugin") 5 | 6 | option(PLUGIN_AV "${PLUGIN_DESCRIPTION}" ON) 7 | add_feature_info("${PLUGIN_NAME}" PLUGIN_AV "${PLUGIN_DESCRIPTION}") 8 | 9 | if (PLUGIN_AV) 10 | 11 | add_library(avrec SHARED 12 | avrec.cpp 13 | ) 14 | 15 | add_dependencies(avrec ${SWITCHER_LIBRARY}) 16 | 17 | add_library(avplayer SHARED 18 | avplayer.cpp 19 | ) 20 | 21 | add_dependencies(avrec ${SWITCHER_LIBRARY}) 22 | 23 | # TEST 24 | 25 | add_executable(check_av check_avrecplay.cpp) 26 | add_test(check_av check_av) 27 | 28 | # INSTALL 29 | 30 | install(TARGETS avrec avplayer LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 31 | 32 | endif () -------------------------------------------------------------------------------- /plugins/crashtest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | set(PLUGIN_NAME "plugin-crashtest") 4 | set(PLUGIN_DESCRIPTION "Crash test Plugin") 5 | 6 | if(UNIX AND NOT OSX) 7 | set(ENABLED TRUE) 8 | endif() 9 | 10 | option(PLUGIN_CRASHTEST "${PLUGIN_DESCRIPTION}" ${ENABLED}) 11 | add_feature_info("${PLUGIN_NAME}" PLUGIN_CRASHTEST "${PLUGIN_DESCRIPTION}") 12 | 13 | if (PLUGIN_CRASHTEST) 14 | 15 | add_library(crashtest SHARED 16 | crashtest.cpp 17 | ) 18 | 19 | add_dependencies(crashtest ${SWITCHER_LIBRARY}) 20 | 21 | # TEST 22 | 23 | add_executable(check_crashtest_plugin check_crashtest_plugin.cpp) 24 | add_test(check_crashtest_plugin check_crashtest_plugin) 25 | 26 | # INSTALL 27 | 28 | install(TARGETS crashtest LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 29 | 30 | endif () 31 | -------------------------------------------------------------------------------- /plugins/cropper/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | set(PLUGIN_NAME "plugin-cropper") 4 | set(PLUGIN_DESCRIPTION "Video Cropper Plugin") 5 | 6 | option(PLUGIN_CROPPER "${PLUGIN_DESCRIPTION}" TRUE) 7 | add_feature_info("${PLUGIN_NAME}" PLUGIN_CROPPER "${PLUGIN_DESCRIPTION}") 8 | 9 | if (PLUGIN_CROPPER) 10 | 11 | add_library(cropper SHARED 12 | cropper.cpp 13 | ) 14 | 15 | add_dependencies(cropper ${SWITCHER_LIBRARY}) 16 | 17 | # TEST 18 | 19 | add_executable(check_cropper check_cropper.cpp) 20 | add_test(check_cropper check_cropper) 21 | 22 | add_executable(check_cropper_caps check_cropper_caps.cpp) 23 | add_test(check_cropper_caps check_cropper_caps) 24 | 25 | # INSTALL 26 | 27 | install(TARGETS cropper LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 28 | 29 | endif () 30 | -------------------------------------------------------------------------------- /plugins/systemusage/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | set(PLUGIN_NAME "plugin-systemusage") 4 | set(PLUGIN_DESCRIPTION "System Usage Plugin") 5 | 6 | if(UNIX AND NOT OSX) 7 | set(ENABLED TRUE) 8 | endif() 9 | 10 | option(PLUGIN_SYSTEMUSAGE "${PLUGIN_DESCRIPTION}" ${ENABLED}) 11 | add_feature_info("${PLUGIN_NAME}" PLUGIN_SYSTEMUSAGE "${PLUGIN_DESCRIPTION}") 12 | 13 | if (PLUGIN_SYSTEMUSAGE) 14 | 15 | add_library(systemusage SHARED 16 | systemusage.cpp 17 | ) 18 | 19 | add_dependencies(systemusage ${SWITCHER_LIBRARY}) 20 | 21 | # TEST 22 | 23 | add_executable(check_systemusage_plugin check_systemusage_plugin.cpp) 24 | add_test(check_systemusage_plugin check_systemusage_plugin) 25 | 26 | # INSTALL 27 | 28 | install(TARGETS systemusage LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 29 | 30 | endif () -------------------------------------------------------------------------------- /plugins/vnc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | pkg_check_modules(VNC libvncclient) 4 | 5 | set(PLUGIN_NAME "plugin-vnc") 6 | set(PLUGIN_DESCRIPTION "VNC Plugin") 7 | 8 | option(PLUGIN_VNC "${PLUGIN_DESCRIPTION}" ${VNC_FOUND}) 9 | add_feature_info("${PLUGIN_NAME}" PLUGIN_VNC "${PLUGIN_DESCRIPTION}") 10 | 11 | if (PLUGIN_VNC) 12 | 13 | pkg_check_modules(VNC REQUIRED libvncclient) 14 | 15 | add_compile_options(${VNC_CFLAGS}) 16 | 17 | include_directories( 18 | ${VNC_INCLUDE_DIRS} 19 | ) 20 | 21 | link_libraries( 22 | ${VNC_LIBRARIES} 23 | ) 24 | 25 | add_library(vncplugin SHARED 26 | vnc_client.cpp 27 | ) 28 | 29 | add_dependencies(vncplugin ${SWITCHER_LIBRARY}) 30 | 31 | # TEST 32 | 33 | # INSTALL 34 | 35 | install(TARGETS vncplugin LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 36 | 37 | endif () -------------------------------------------------------------------------------- /plugins/v4l2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | find_path(VIDEODEV2 linux/videodev2.h) 4 | set(ENABLED FALSE) 5 | if (VIDEODEV2) 6 | set(ENABLED TRUE) 7 | endif() 8 | 9 | set(PLUGIN_NAME "plugin-v4l2") 10 | set(PLUGIN_DESCRIPTION "Video for Linux 2 Plugin") 11 | 12 | cmake_dependent_option(PLUGIN_V4L2 "${PLUGIN_DESCRIPTION}" ${ENABLED} 13 | "ENABLE_GPL" OFF) 14 | add_feature_info("${PLUGIN_NAME}" PLUGIN_V4L2 "${PLUGIN_DESCRIPTION}") 15 | 16 | if (PLUGIN_V4L2) 17 | 18 | add_library(v4l2src SHARED 19 | v4l2src.cpp 20 | ) 21 | 22 | add_dependencies(v4l2src ${SWITCHER_LIBRARY}) 23 | 24 | # TEST 25 | 26 | add_executable(check_v4l2_plugin check_v4l2_plugin.cpp) 27 | add_test(check_v4l2_plugin check_v4l2_plugin) 28 | 29 | # INSTALL 30 | 31 | install(TARGETS v4l2src LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 32 | 33 | endif () 34 | -------------------------------------------------------------------------------- /plugins/executor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | set(PLUGIN_NAME "plugin-executor") 4 | set(PLUGIN_DESCRIPTION "Executor Plugin") 5 | 6 | option(PLUGIN_EXECUTOR "${PLUGIN_DESCRIPTION}" TRUE) 7 | add_feature_info("${PLUGIN_NAME}" PLUGIN_EXECUTOR "${PLUGIN_DESCRIPTION}") 8 | 9 | if (PLUGIN_EXECUTOR) 10 | 11 | add_definitions(-Wno-error=missing-field-initializers) 12 | 13 | add_library(executor SHARED 14 | executor.cpp 15 | ) 16 | 17 | add_dependencies(executor ${SWITCHER_LIBRARY}) 18 | 19 | # TEST 20 | 21 | add_executable(check_executor check_executor.cpp) 22 | add_test(check_executor check_executor) 23 | 24 | add_executable(check_executor_caps check_executor_caps.cpp) 25 | add_test(check_executor_caps check_executor_caps) 26 | 27 | # INSTALL 28 | 29 | install(TARGETS executor LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 30 | 31 | endif () 32 | -------------------------------------------------------------------------------- /plugins/pjsip/build_scripts/patch.sh.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | patch -tp0 < @CMAKE_CURRENT_SOURCE_DIR@/more_codecs.patch 5 | 6 | # We change the TARGET_NAME to switcher (or anything really) so that it stays the same on every system 7 | # Might become a problem later if we end up doing cross compilation 8 | sed -iold 's/TARGET_NAME := \@target\@/TARGET_NAME := switcher/' build.mak.in 9 | 10 | sed -iold 's/isblank/MACROIsBlank/' pjlib/include/pj/compat/ctype.h 11 | sed -iold 's/isblank/MACROIsBlank/' pjlib/include/pj/ctype.h 12 | sed -iold 's/pj_ioqueue_create(icedemo.pool, 16/pj_ioqueue_create(icedemo.pool, 128/' pjsip-apps/src/samples/icedemo.c 13 | sed -iold 's/buffer\[1000\]/buffer\[1000000\]/' pjsip-apps/src/samples/icedemo.c 14 | sed -iold 's/REGC_TSX_TIMEOUT\t33000/REGC_TSX_TIMEOUT 3000/' pjsip/src/pjsip-ua/sip_reg.c 15 | # changing PJ_IOQUEUE_MAX_HANDLES 16 | sed -iold 's/(64)/(512)/' pjlib/include/pj/config.h -------------------------------------------------------------------------------- /plugins/webrtc/web/index.js: -------------------------------------------------------------------------------- 1 | function showUserList() { 2 | document.getElementById("userList").style.width = "250px"; 3 | } 4 | 5 | function hideUserList() { 6 | document.getElementById("userList").style.width = "0"; 7 | } 8 | 9 | function showLog() { 10 | document.getElementById("logView").style.width = "750px"; 11 | } 12 | 13 | function hideLog() { 14 | document.getElementById("logView").style.width = "0"; 15 | } 16 | 17 | function addUser(username) { 18 | const element = `${username}`; 19 | var cont = document.getElementById("ULCloseBtn"); 20 | cont.insertAdjacentHTML("afterend", element); 21 | } 22 | 23 | function removeUser(username) { 24 | removeElement(`user-${username}`); 25 | } 26 | 27 | function addLog(text) { 28 | const element = `${text}`; 29 | var cont = document.getElementById("logCloseBtn"); 30 | cont.insertAdjacentHTML("afterend", element); 31 | } 32 | -------------------------------------------------------------------------------- /plugins/webrtc/web/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: "Lato", sans-serif; 3 | } 4 | 5 | .sidepanel { 6 | width: 0; 7 | position: fixed; 8 | z-index: 1; 9 | height: 250px; 10 | top: 0; 11 | left: 0; 12 | background-color: #111; 13 | overflow-x: hidden; 14 | transition: 0.5s; 15 | padding-top: 60px; 16 | } 17 | 18 | .sidepanel a { 19 | padding: 8px 8px 8px 32px; 20 | text-decoration: none; 21 | font-size: 25px; 22 | color: #818181; 23 | display: block; 24 | transition: 0.3s; 25 | } 26 | 27 | .sidepanel a:hover { 28 | color: #f1f1f1; 29 | } 30 | 31 | .sidepanel .closebtn { 32 | position: absolute; 33 | top: 0; 34 | right: 25px; 35 | font-size: 36px; 36 | } 37 | 38 | .openbtn { 39 | font-size: 20px; 40 | cursor: pointer; 41 | background-color: #111; 42 | color: white; 43 | padding: 10px 15px; 44 | border: none; 45 | } 46 | 47 | .openbtn:hover { 48 | background-color:#444; 49 | } 50 | -------------------------------------------------------------------------------- /tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | pkg_check_modules(PYTHON python3) 2 | 3 | option(WITH_TOOLS "Tools made with pyquid" ${PYTHON_FOUND}) 4 | add_feature_info("Tools" WITH_TOOLS "Tools based on pyquid") 5 | 6 | if (WITH_TOOLS) 7 | install(DIRECTORY . DESTINATION bin 8 | COMPONENT lib 9 | FILES_MATCHING PATTERN "swquid*" 10 | PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ 11 | GROUP_EXECUTE GROUP_READ 12 | WORLD_EXECUTE WORLD_READ) 13 | 14 | install(DIRECTORY . DESTINATION bin 15 | COMPONENT dev 16 | FILES_MATCHING PATTERN "swquid*" 17 | PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ 18 | GROUP_EXECUTE GROUP_READ 19 | WORLD_EXECUTE WORLD_READ) 20 | 21 | install(DIRECTORY . DESTINATION bin 22 | COMPONENT dbg 23 | FILES_MATCHING PATTERN "swquid*" 24 | PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ 25 | GROUP_EXECUTE GROUP_READ 26 | WORLD_EXECUTE WORLD_READ) 27 | 28 | 29 | endif () 30 | -------------------------------------------------------------------------------- /plugins/webrtc/signaling/Signaling.md: -------------------------------------------------------------------------------- 1 | ## Negotiation 2 | Once a call has been setup with the signaling server, the peers must 3 | negotiate SDP and ICE candidates with each other. 4 | 5 | The calling side must create an SDP offer and send it to the peer as a JSON object: 6 | 7 | ```json 8 | { 9 | "sdp": { 10 | "sdp": "o=- [....]", 11 | "type": "offer" 12 | } 13 | } 14 | ``` 15 | 16 | The callee must then reply with an answer: 17 | 18 | ```json 19 | { 20 | "sdp": { 21 | "sdp": "o=- [....]", 22 | "type": "answer" 23 | } 24 | } 25 | ``` 26 | 27 | ICE candidates must be exchanged similarly by exchanging JSON objects: 28 | 29 | 30 | ```json 31 | { 32 | "ice": { 33 | "candidate": ..., 34 | "sdpMLineIndex": ..., 35 | ... 36 | } 37 | } 38 | ``` 39 | 40 | These structures are as specified by WebRTC. Read the WebRTC spec for more 41 | information on that. 42 | -------------------------------------------------------------------------------- /plugins/webrtc/web/README.md: -------------------------------------------------------------------------------- 1 | ## Overview 2 | 3 | This directory contains a simple javascript WebRTC client with the 4 | accompanying python3 web server. 5 | 6 | ## Usage 7 | 8 | Copy the certificates to be used by the server in this directory or generate 9 | them here with the following command. 10 | 11 | ```sh 12 | ../util/generate_cert.sh 13 | ``` 14 | 15 | 16 | Start the web server with 17 | 18 | ```sh 19 | ./server.py # or python server.py 20 | ``` 21 | 22 | Visit the webpage at `https://localhost:8000`. The webpage is also available 23 | on the local network. 24 | 25 | ## Possible issues 26 | 27 | **Permissions** 28 | 29 | The user accessing the website must have the permissions to access the camera 30 | and the microphone on the computer they are using. 31 | 32 | **Certificate** 33 | 34 | You will be prompted to access the certificate. 35 | 36 | **Security** 37 | 38 | If the website is accessed with secure http, the client won't be able to access 39 | the camera or the microphone. 40 | -------------------------------------------------------------------------------- /wrappers/python/bundles.py: -------------------------------------------------------------------------------- 1 | # This program is free software; you can redistribute it and/or 2 | # modify it under the terms of the GNU Lesser General Public License 3 | # as published by the Free Software Foundation; either version 2.1 4 | # of the License, or (at your option) any later version. 5 | 6 | # This program is distributed in the hope that it will be useful, 7 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 9 | # GNU Lesser General Public License for more details. 10 | 11 | import json 12 | from dataclasses import dataclass 13 | 14 | 15 | @dataclass 16 | class Bundle: 17 | name: str 18 | pipeline: str 19 | doc: dict 20 | 21 | def __repr__(self): 22 | return f"" 23 | 24 | def __str__(self): 25 | return json.dumps({ 26 | self.name: { 27 | "pipeline": self.pipeline, 28 | "doc": self.doc 29 | } 30 | }) 31 | -------------------------------------------------------------------------------- /switcher/utils/safe-bool-idiom.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include "./safe-bool-idiom.hpp" 21 | 22 | namespace switcher { 23 | SafeBoolIdiom::operator bool() const { return safe_bool_idiom(); } 24 | } // namespace switcher 25 | -------------------------------------------------------------------------------- /scripts/make_authors_from_git.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AUTHORS="../AUTHORS.md" 4 | if ! [ -f "$AUTHORS" ] 5 | then 6 | AUTHORS="./AUTHORS.md" 7 | if ! [ -f "$AUTHORS" ] 8 | then 9 | echo "no authors file found, exiting" 10 | exit 11 | fi 12 | fi 13 | 14 | # order by number of commits 15 | git log --format='%aN' | \ 16 | sed 's/Aurélien$/Aurélien Perronneau (OpSocket)/' | \ 17 | sed 's/Francois/François/' | \ 18 | sed 's/François/François/' | \ 19 | sed 's/Jeremie Soria/Jérémie Soria/' | \ 20 | sed 's/Marie-Eve$/Marie-Eve Dumas/' | \ 21 | sed 's/Michal Seta/Michał Seta/' | \ 22 | sed 's/Nina/Nicolas Bouillot/' | \ 23 | sed 's/OpSocket$/Aurélien Perronneau (OpSocket)/' | \ 24 | sed 's/nicolas/Nicolas Bouillot/' | \ 25 | sed 's/ubald/François Ubald Brien/' | \ 26 | sed 's/vanshitaverma$/Vanshita Verma/' | \ 27 | sed 's/vlaurent/Valentin Laurent/' | \ 28 | grep -v metalab | \ 29 | grep -v 4d3d3d3 | \ 30 | sort | \ 31 | uniq -c | sort -bgr | \ 32 | sed 's/\ *[0-9]*\ /\* /' > ${AUTHORS} 33 | 34 | -------------------------------------------------------------------------------- /plugins/video_snapshot/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | set(PLUGIN_NAME "plugin-video-snapshot") 4 | set(PLUGIN_DESCRIPTION "Plugin for video snapshot") 5 | 6 | option(PLUGIN_VIDEO_SNAPSHOT "${PLUGIN_DESCRIPTION}" ON) 7 | add_feature_info("${PLUGIN_NAME}" PLUGIN_VIDEO_SNAPSHOT "${PLUGIN_DESCRIPTION}") 8 | 9 | if (PLUGIN_VIDEO_SNAPSHOT) 10 | 11 | # PLUGIN 12 | 13 | add_library(video_snapshot SHARED 14 | video_snapshot.cpp 15 | ) 16 | add_dependencies(video_snapshot ${SWITCHER_LIBRARY}) 17 | 18 | # TEST 19 | 20 | add_executable(check_video_snapshot check_video_snapshot.cpp) 21 | add_test(check_video_snapshot check_video_snapshot) 22 | add_test(NAME check_shmshot COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/check_shmshot.sh) 23 | 24 | # INSTALL 25 | 26 | install(TARGETS video_snapshot LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 27 | install(DIRECTORY . 28 | DESTINATION bin 29 | FILES_MATCHING PATTERN "shmshot" 30 | PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ 31 | GROUP_EXECUTE GROUP_READ 32 | WORLD_EXECUTE WORLD_READ 33 | ) 34 | 35 | endif () 36 | -------------------------------------------------------------------------------- /switcher/configuration/configurable.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include "./configurable.hpp" 21 | 22 | namespace switcher { 23 | namespace configuration { 24 | 25 | Configurable::Configurable(std::function on_reloaded) : conf_(on_reloaded) {} 26 | 27 | } // namespace configuration 28 | } // namespace switcher 29 | -------------------------------------------------------------------------------- /switcher/quiddity/quid-id-t.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_QUID_ID_T_H__ 21 | #define __SWITCHER_QUID_ID_T_H__ 22 | 23 | #include "../utils/ids.hpp" 24 | 25 | namespace switcher { 26 | namespace quiddity { 27 | using qid_t = Ids::id_t; 28 | } // namespace quiddity 29 | } // namespace switcher 30 | #endif 31 | -------------------------------------------------------------------------------- /doc/custom-quiddity-path.md: -------------------------------------------------------------------------------- 1 | # Switcher quiddity plugins 2 | 3 | Most Quiddities are compiled as shared object files and loaded by switcher during instantiation. When the switcher library is loaded, plugins are loaded from the default plugin path, where switcher installation copies these shared object files. These files are usually located at `/usr/local/switcher-./plugins/`, where major and minor depends on the switcher version. For instance, with switcher version 2.1.23, major is 2 and minor is 1. 4 | 5 | # Loading quiddity plugins from custom path 6 | 7 | Custom path can be given to switcher using the `SWITCHER_PLUGIN_PATH` environment variable. Multiple paths can be specified, and must be separated with a `:`. Here follows some examples: 8 | 9 | ```bash 10 | # tell switcher to scan directory and sub-directories for switcher plugins 11 | SWITCHER_PLUGIN_PATH=/tmp/my_switcher_plugins/ switcher 12 | 13 | # give several sub-directories 14 | SWITCHER_PLUGIN_PATH=/tmp/first_folder/:/tmp/second_folder/ switcher 15 | 16 | # This work also with your python scripts 17 | SWITCHER_PLUGIN_PATH=/tmp/my_switcher_plugins/ python3 ./my_switcher_script.py 18 | ``` 19 | -------------------------------------------------------------------------------- /plugins/samplerate/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | set(PLUGIN_NAME "plugin-resample") 4 | set(PLUGIN_DESCRIPTION "Libsamplerate") 5 | 6 | cmake_dependent_option(PLUGIN_RESAMPLE "${PLUGIN_DESCRIPTION}" ${LIBSAMPLERATE_FOUND} 7 | "ENABLE_GPL" OFF) 8 | add_feature_info("${PLUGIN_NAME}" PLUGIN_RESAMPLE "${PLUGIN_DESCRIPTION}") 9 | 10 | if (PLUGIN_RESAMPLE) 11 | 12 | pkg_check_modules(LIBSAMPLERATE REQUIRED samplerate) 13 | 14 | add_compile_options(${LIBSAMPLERATE_CFLAGS}) 15 | 16 | include_directories( 17 | ${LIBSAMPLERATE_INCLUDE_DIRS} 18 | ) 19 | 20 | link_libraries( 21 | ${LIBSAMPLERATE_LIBRARIES} 22 | ) 23 | 24 | 25 | # Resample Quid 26 | 27 | add_library(resample SHARED 28 | resample.cpp 29 | ) 30 | add_dependencies(resample ${SWITCHER_LIBRARY}) 31 | 32 | # TEST 33 | 34 | add_executable(check_resample check_resample.cpp) 35 | configure_file(check_resample.json check_resample.json COPYONLY) 36 | add_test(check_resample check_resample) 37 | 38 | # INSTALL 39 | 40 | install(TARGETS resample LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 41 | 42 | endif () 43 | -------------------------------------------------------------------------------- /CMakeUninstall.cmake.in: -------------------------------------------------------------------------------- 1 | if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 2 | message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 3 | endif (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | 5 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 6 | string(REGEX REPLACE "\n" ";" files "${files}") 7 | foreach (file ${files}) 8 | message(STATUS "Uninstalling $ENV{DESTDIR}${file}") 9 | if (IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 10 | exec_program( 11 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 12 | OUTPUT_VARIABLE rm_out 13 | RETURN_VALUE rm_retval 14 | ) 15 | if (NOT "${rm_retval}" STREQUAL 0) 16 | message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") 17 | endif (NOT "${rm_retval}" STREQUAL 0) 18 | else (IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 19 | message(STATUS "File $ENV{DESTDIR}${file} does not exist.") 20 | endif (IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 21 | endforeach (file) -------------------------------------------------------------------------------- /plugins/webrtc/connect_room.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This program is free software; you can redistribute it and/or 4 | # modify it under the terms of the GNU Lesser General Public License 5 | # as published by the Free Software Foundation; either version 2.1 6 | # of the License, or (at your option) any later version. 7 | 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Lesser General Public License for more details. 12 | 13 | import pyquid 14 | import time 15 | 16 | sw = pyquid.Switcher('webrtc', debug=True) 17 | w = sw.create("webrtc", "WebrtcClient") 18 | w.set("room", "RHtest") 19 | 20 | vid = sw.create('videotestsrc', 'vid') 21 | vid.set("resolution", 5) 22 | vid.set("started", True) 23 | 24 | aud = sw.create('audiotestsrc', 'aud') 25 | aud.set('volume', '0.1') 26 | aud.set("wave", 6) 27 | aud.set("started", True) 28 | 29 | w.invoke('connect-quid', [vid.id(), 'video']) 30 | w.invoke('connect-quid', [aud.id(), 'audio']) 31 | time.sleep(1) 32 | w.set("started", True) 33 | 34 | while(True): 35 | time.sleep(1) 36 | -------------------------------------------------------------------------------- /tests/check_gst_pipeline.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of switcher. 3 | * 4 | * switcher is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * switcher is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with switcher. If not, see . 16 | */ 17 | 18 | #undef NDEBUG // get assert in release mode 19 | 20 | #include "switcher/gst/glibmainloop.hpp" 21 | #include "switcher/gst/pipe.hpp" 22 | 23 | int main() { 24 | using namespace switcher; 25 | 26 | gst_init(nullptr, nullptr); 27 | { 28 | auto ml = std::make_unique(); 29 | auto gp = std::make_unique(ml->get_main_context(), nullptr, nullptr); 30 | } 31 | gst_deinit(); 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /plugins/avrecplay/check_avrecplay.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of switcher-myplugin. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #undef NDEBUG // get assert in release mode 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include "switcher/quiddity/basic-test.hpp" 27 | #include "switcher/quiddity/property/pbag.hpp" 28 | #include "switcher/switcher.hpp" 29 | 30 | int main() { return 0; } 31 | -------------------------------------------------------------------------------- /plugins/osc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | pkg_check_modules(LIBLO liblo) 4 | 5 | set(PLUGIN_NAME "plugin-osc") 6 | set(PLUGIN_DESCRIPTION "OSC Plugin") 7 | 8 | option(PLUGIN_OSC "${PLUGIN_DESCRIPTION}" ${LIBLO_FOUND}) 9 | add_feature_info("${PLUGIN_NAME}" PLUGIN_OSC "${PLUGIN_DESCRIPTION}") 10 | 11 | if (PLUGIN_OSC) 12 | 13 | pkg_check_modules(LIBLO REQUIRED liblo) 14 | 15 | add_compile_options(${LIBLO_CFLAGS}) 16 | 17 | include_directories( 18 | ${LIBLO_INCLUDE_DIRS} 19 | ) 20 | 21 | link_libraries( 22 | ${LIBLO_LIBRARIES} 23 | ) 24 | 25 | # OSC-to-SHM 26 | 27 | add_library(osc_to_shmdata SHARED 28 | osc-to-shmdata.cpp 29 | ) 30 | 31 | add_dependencies(osc_to_shmdata ${SWITCHER_LIBRARY}) 32 | 33 | # SHM-to-OSC 34 | 35 | add_library(shmdata_to_osc SHARED 36 | shmdata-to-osc.cpp 37 | ) 38 | 39 | add_dependencies(shmdata_to_osc ${SWITCHER_LIBRARY}) 40 | 41 | # TEST 42 | 43 | add_executable(check_osc check_osc.cpp) 44 | add_test(check_osc check_osc) 45 | 46 | # INSTALL 47 | 48 | install(TARGETS osc_to_shmdata shmdata_to_osc LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 49 | 50 | endif () 51 | -------------------------------------------------------------------------------- /plugins/pulse/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | pkg_check_modules(PULSE libpulse-mainloop-glib) 4 | 5 | set(PLUGIN_NAME "plugin-pulse") 6 | set(PLUGIN_DESCRIPTION "Pulse Plugin") 7 | 8 | option(PLUGIN_PULSE "${PLUGIN_DESCRIPTION}" ${PULSE_FOUND}) 9 | add_feature_info("${PLUGIN_NAME}" PLUGIN_PULSE "${PLUGIN_DESCRIPTION}") 10 | 11 | if (PLUGIN_PULSE) 12 | 13 | pkg_check_modules(PULSE REQUIRED libpulse-mainloop-glib) 14 | 15 | add_compile_options(${PULSE_CFLAGS}) 16 | 17 | include_directories( 18 | ${PULSE_INCLUDE_DIRS} 19 | ) 20 | 21 | link_libraries( 22 | ${PULSE_LIBRARIES} 23 | ) 24 | 25 | # SRC 26 | 27 | add_library(pulsesrc SHARED 28 | pulsesrc.cpp 29 | ) 30 | 31 | add_dependencies(pulsesrc ${SWITCHER_LIBRARY}) 32 | 33 | # SINK 34 | 35 | add_library(pulsesink SHARED 36 | pulsesink.cpp 37 | ) 38 | 39 | add_dependencies(pulsesink ${SWITCHER_LIBRARY}) 40 | 41 | # TEST 42 | 43 | add_executable(check_pulsesrc check_pulsesrc.cpp) 44 | add_test(check_pulsesrc check_pulsesrc) 45 | 46 | # INSTALL 47 | 48 | install(TARGETS pulsesrc pulsesink LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 49 | 50 | endif () -------------------------------------------------------------------------------- /tests/check_manager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #undef NDEBUG // get assert in release mode 21 | 22 | #include 23 | #include "switcher/switcher.hpp" 24 | 25 | using namespace switcher; 26 | 27 | int main() { 28 | { 29 | int c = 10; 30 | while (--c > 0) Switcher::ptr manager = Switcher::make_switcher("test-manager"); 31 | } 32 | gst_deinit(); 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | option(WITH_OPTIONAL_PLUGINS "Optional Plugins" ON) 3 | add_feature_info("plugins-optional" WITH_OPTIONAL_PLUGINS "Optional Plugins") 4 | 5 | link_libraries( 6 | ${SWITCHER_LIBRARY} 7 | ) 8 | 9 | include_directories( 10 | ${SWITCHER_DIR} 11 | ) 12 | 13 | # Required plugins 14 | add_subdirectory(gsoap) 15 | add_subdirectory(pjsip) 16 | add_subdirectory(systemusage) 17 | 18 | # Optional plugins 19 | if (WITH_OPTIONAL_PLUGINS) 20 | add_subdirectory(avrecplay) 21 | add_subdirectory(crashtest) 22 | add_subdirectory(cropper) 23 | add_subdirectory(example) 24 | add_subdirectory(executor) 25 | add_subdirectory(glfw) 26 | add_subdirectory(jack) 27 | add_subdirectory(ladspa) 28 | add_subdirectory(nvenc) 29 | add_subdirectory(osc) 30 | add_subdirectory(portmidi) 31 | add_subdirectory(protocol_mapper) 32 | add_subdirectory(pulse) 33 | add_subdirectory(rtmp) 34 | add_subdirectory(samplerate) 35 | add_subdirectory(timecode) 36 | add_subdirectory(v4l2) 37 | add_subdirectory(video_snapshot) 38 | add_subdirectory(vnc) 39 | add_subdirectory(vrpn) 40 | add_subdirectory(watcher) 41 | add_subdirectory(webrtc) 42 | endif () 43 | -------------------------------------------------------------------------------- /switcher/utils/safe-bool-idiom.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_SAFE_BOOL_IDIOM_H__ 21 | #define __SWITCHER_SAFE_BOOL_IDIOM_H__ 22 | 23 | namespace switcher { 24 | class SafeBoolIdiom { 25 | public: 26 | virtual ~SafeBoolIdiom() {} 27 | explicit operator bool() const; 28 | 29 | private: 30 | virtual bool safe_bool_idiom() const = 0; 31 | }; 32 | } // namespace switcher 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /plugins/vrpn/vrpn-sink-plugin.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of switcher-vrpn. 3 | * 4 | * switcher-vrpn is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_VRPN_SINK_PLUGIN_H__ 21 | #define __SWITCHER_VRPN_SINK_PLUGIN_H__ 22 | 23 | #include "./sink/vrpn-sink.hpp" 24 | 25 | namespace switcher { 26 | namespace quiddities { 27 | namespace vrpn { 28 | SWITCHER_DECLARE_PLUGIN(VRPNSink); 29 | } // namespace vrpn 30 | } // namespace quiddities 31 | } // namespace switcher 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /plugins/vrpn/vrpn-source-plugin.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of switcher-vrpn. 3 | * 4 | * switcher-vrpn is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_VRPN_SOURCE_PLUGIN_H__ 21 | #define __SWITCHER_VRPN_SOURCE_PLUGIN_H__ 22 | 23 | #include "./source/vrpn-source.hpp" 24 | 25 | namespace switcher { 26 | namespace quiddities { 27 | namespace vrpn { 28 | SWITCHER_DECLARE_PLUGIN(VRPNSource); 29 | } // namespace vrpn 30 | } // namespace quiddities 31 | } // namespace switcher 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /plugins/webrtc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(PLUGIN_NAME "plugin-werbtc") 2 | set(PLUGIN_DESCRIPTION "WebRTC Plugin") 3 | 4 | option(PLUGIN_WEBRTC "${PLUGIN_DESCRIPTION}" ON) 5 | add_feature_info("${PLUGIN_NAME}" PLUGIN_WEBRTC "${PLUGIN_DESCRIPTION}") 6 | 7 | if (PLUGIN_WEBRTC) 8 | 9 | pkg_check_modules(LIBSOUP REQUIRED libsoup-2.4) 10 | if(LIBSOUP_FOUND) 11 | include_directories(${LIBSOUP_INCLUDE_DIRS}) 12 | link_libraries(${LIBSOUP_LIBRARIES}) 13 | endif() 14 | 15 | pkg_check_modules(LIBGSTWEBRTC REQUIRED gstreamer-webrtc-1.0) 16 | if(LIBGSTWEBRTC_FOUND) 17 | include_directories(${LIBGSTWEBRTC_INCLUDE_DIRS}) 18 | link_libraries(${LIBGSTWEBRTC_LIBRARIES}) 19 | endif() 20 | 21 | add_library(webrtc SHARED webrtc.cpp) 22 | 23 | add_executable(check_webrtc check_webrtc.cpp) 24 | add_test(check_webrtc check_webrtc) 25 | 26 | pkg_check_modules(PYTHON python3) 27 | option(WITH_PYTHON "Python Wrapper" ${PYTHON_FOUND}) 28 | if(WITH_PYTHON) 29 | add_test(pyquid_quid_webrtc ${CMAKE_CURRENT_SOURCE_DIR}/check_quid_webrtc.py) 30 | add_test(pyquid_webrtc_multireceiv ${CMAKE_CURRENT_SOURCE_DIR}/check_multi_receiv.py) 31 | endif() 32 | 33 | install(TARGETS webrtc LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 34 | endif () 35 | -------------------------------------------------------------------------------- /switcher/utils/serialize-string.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include "./serialize-string.hpp" 21 | #include "./string-utils.hpp" 22 | 23 | namespace switcher { 24 | namespace serialize { 25 | std::string esc_for_tuple(const std::string& str) { 26 | return stringutils::replace_string(str, ",", tuple_comma_esc_string); 27 | } 28 | void append_targs(std::string*, size_t) {} 29 | } // namespace serialize 30 | } // namespace switcher 31 | -------------------------------------------------------------------------------- /tests/check_scope_guard.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of switcher. 3 | * 4 | * switcher is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * switcher is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with switcher. If not, see . 16 | */ 17 | 18 | #undef NDEBUG // get assert in release mode 19 | 20 | #include "switcher/utils/scope-exit.hpp" 21 | 22 | // note: do not write multiple "On_scope_exit" call in the same line 23 | int main() { 24 | int counter = 0; 25 | { 26 | counter = 1; 27 | On_scope_exit { counter = 2; }; 28 | On_scope_exit{}; // ensuring multiple calls in the same scope 29 | } 30 | 31 | On_scope_exit { counter = 3; }; // should be assigned after "main" 32 | 33 | if (2 == counter) return 0; 34 | return 1; 35 | } 36 | -------------------------------------------------------------------------------- /plugins/osc/check_osc.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of switcher-myplugin. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #undef NDEBUG // get assert in release mode 21 | 22 | #include 23 | #include "switcher/quiddity/basic-test.hpp" 24 | 25 | int main() { 26 | { 27 | using namespace switcher; 28 | Switcher::ptr manager = Switcher::make_switcher("test_manager"); 29 | 30 | 31 | assert(quiddity::test::full(manager, "OSCsink")); 32 | } // end of scope is releasing the manager 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /plugins/vrpn/source/devices/properties/property-base.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of switcher-vrpn. 3 | * 4 | * switcher-vrpn is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include "./property-base.hpp" 21 | 22 | namespace switcher { 23 | namespace quiddities { 24 | namespace vrpn { 25 | 26 | property::prop_id_t PropertyBase::getPropId() const { return prop_id_; }; 27 | void PropertyBase::setPropId(property::prop_id_t prop_id) { prop_id_ = prop_id; }; 28 | 29 | } // namespace vrpn 30 | } // namespace quiddities 31 | } // namespace switcher 32 | -------------------------------------------------------------------------------- /switcher/logger/logger.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include "./logger.hpp" 21 | 22 | namespace switcher { 23 | namespace logger { 24 | 25 | Logger::Logger(const std::string& logger_name, switcher::Configuration* conf, bool debug) 26 | : log_(std::make_unique(logger_name, conf, debug)), logger_(log_->get_logger()) {} 27 | 28 | Logger::Logger(const Logger& obj) : logger_(obj.logger_) {} 29 | 30 | } // namespace logger 31 | } // namespace switcher 32 | -------------------------------------------------------------------------------- /plugins/portmidi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # PLUGIN 2 | 3 | find_library(PORTMIDI portmidi) 4 | 5 | set(ENABLED FALSE) 6 | if (PORTMIDI) 7 | set(ENABLED TRUE) 8 | endif () 9 | 10 | set(PLUGIN_NAME "plugin-midi") 11 | set(PLUGIN_DESCRIPTION "MIDI Plugin") 12 | 13 | option(PLUGIN_MIDI "${PLUGIN_DESCRIPTION}" ${ENABLED}) 14 | add_feature_info("${PLUGIN_NAME}" PLUGIN_MIDI "${PLUGIN_DESCRIPTION}") 15 | 16 | if (PLUGIN_MIDI) 17 | 18 | if (NOT PORTMIDI) 19 | message(FATAL_ERROR "portmidi not found") 20 | endif () 21 | 22 | link_libraries( 23 | ${PORTMIDI} 24 | ) 25 | 26 | # SRC 27 | 28 | add_library(portmidisrc SHARED 29 | portmidi-devices.cpp 30 | portmidi-source.cpp 31 | ) 32 | 33 | add_dependencies(portmidisrc ${SWITCHER_LIBRARY}) 34 | 35 | # SINK 36 | 37 | add_library(portmidisink SHARED 38 | portmidi-devices.cpp 39 | portmidi-sink.cpp 40 | ) 41 | 42 | add_dependencies(portmidisink ${SWITCHER_LIBRARY}) 43 | 44 | # TEST 45 | 46 | add_executable(check_midi_plugins check_midi_plugins.cpp) 47 | add_test(check_midi_plugins check_midi_plugins) 48 | 49 | # INSTALL 50 | 51 | install(TARGETS portmidisrc portmidisink LIBRARY DESTINATION ${SWITCHER_LIBRARY}/plugins) 52 | 53 | endif () -------------------------------------------------------------------------------- /switcher/quiddities/empty-quiddity.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_EMPTY_QUIDDITY_H__ 21 | #define __SWITCHER_EMPTY_QUIDDITY_H__ 22 | 23 | #include "../quiddity/quiddity.hpp" 24 | 25 | namespace switcher { 26 | namespace quiddities { 27 | using namespace quiddity; 28 | class EmptyQuiddity : public Quiddity { 29 | public: 30 | EmptyQuiddity(quiddity::Config&&); 31 | }; 32 | 33 | } // namespace quiddities 34 | } // namespace switcher 35 | #endif 36 | -------------------------------------------------------------------------------- /switcher/utils/bool-any.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include "./bool-any.hpp" 21 | 22 | namespace switcher { 23 | BoolAny::BoolAny() : BoolLog(), any_(){}; 24 | 25 | BoolAny::BoolAny(Any&& any) : BoolLog(true), any_(std::move(any)) {} 26 | 27 | BoolAny::BoolAny(Any&& any, bool is_valid, const std::string& msg) 28 | : BoolLog(is_valid, msg), any_(std::move(any)) {} 29 | 30 | const Any& BoolAny::any() const { return any_; } 31 | 32 | } // namespace switcher 33 | -------------------------------------------------------------------------------- /switcher/utils/templated-sequence.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_TEMPLATED_SEQUENCE_H__ 21 | #define __SWITCHER_TEMPLATED_SEQUENCE_H__ 22 | 23 | namespace switcher { 24 | 25 | template 26 | struct tseq {}; 27 | 28 | template 29 | struct gens : gens {}; 30 | 31 | template 32 | struct gens<0, S...> { 33 | virtual ~gens(){}; 34 | typedef tseq type; 35 | }; 36 | 37 | } // namespace switcher 38 | #endif 39 | -------------------------------------------------------------------------------- /switcher/quiddity/kind-printer.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_INFORMATION_TREE_QUIDDITY_KIND_PRINTER_H__ 21 | #define __SWITCHER_INFORMATION_TREE_QUIDDITY_KIND_PRINTER_H__ 22 | 23 | #include 24 | #include "../infotree/information-tree.hpp" 25 | 26 | namespace switcher { 27 | namespace quiddity { 28 | namespace kindprinter { 29 | std::string print(InfoTree::ptrc); 30 | } // namespace kindprinter 31 | } // namespace quiddity 32 | } // namespace switcher 33 | #endif 34 | -------------------------------------------------------------------------------- /plugins/nvenc/cuda/cu-res.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of switcher-nvenc. 3 | * 4 | * switcher-myplugin is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_CU_RES_H__ 21 | #define __SWITCHER_CU_RES_H__ 22 | 23 | #include 24 | 25 | namespace switcher { 26 | namespace quiddities { 27 | struct CuRes { 28 | CuRes() = delete; 29 | explicit CuRes(CUresult ret) : ret_(ret) {} 30 | explicit operator bool() const { return CUDA_SUCCESS == ret_; } 31 | const CUresult ret_; 32 | }; 33 | 34 | } // namespace quiddities 35 | } // namespace switcher 36 | #endif 37 | -------------------------------------------------------------------------------- /switcher/utils/bool-log.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include "./bool-log.hpp" 21 | 22 | namespace switcher { 23 | BoolLog::BoolLog() : is_valid_(false), msg_(){}; 24 | 25 | BoolLog::BoolLog(bool is_valid) : is_valid_(is_valid), msg_() {} 26 | 27 | BoolLog::BoolLog(bool is_valid, const std::string& msg) : is_valid_(is_valid), msg_(msg) {} 28 | 29 | BoolLog::operator bool() const { return is_valid_; }; 30 | 31 | std::string BoolLog::msg() const { return msg_; } 32 | 33 | } // namespace switcher 34 | -------------------------------------------------------------------------------- /switcher/utils/bool-any.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_BOOL_ANY_H__ 21 | #define __SWITCHER_BOOL_ANY_H__ 22 | 23 | #include "./any.hpp" 24 | #include "./bool-log.hpp" 25 | 26 | namespace switcher { 27 | class BoolAny : public BoolLog { 28 | public: 29 | BoolAny(); 30 | BoolAny(Any&& any); 31 | BoolAny(Any&& any, bool is_valid, const std::string& msg); 32 | const Any& any() const; 33 | 34 | private: 35 | Any any_; 36 | }; 37 | 38 | } // namespace switcher 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /switcher/gst/initialized.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_GST_INITIALIZED_H__ 21 | #define __SWITCHER_GST_INITIALIZED_H__ 22 | 23 | #include 24 | #include 25 | 26 | namespace switcher { 27 | namespace gst { 28 | class Initialized { 29 | public: 30 | Initialized(); 31 | bool set_plugin_as_primary(const std::string& plugin, int priority); 32 | 33 | private: 34 | GstRegistry* registry_; 35 | }; 36 | } // namespace gst 37 | } // namespace switcher 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /switcher/utils/bool-log.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_BOOL_LOG_H__ 21 | #define __SWITCHER_BOOL_LOG_H__ 22 | 23 | #include 24 | 25 | namespace switcher { 26 | class BoolLog { 27 | public: 28 | BoolLog(); 29 | BoolLog(bool is_valid); 30 | BoolLog(bool is_valid, const std::string& msg); 31 | operator bool() const; 32 | std::string msg() const; 33 | 34 | protected: 35 | bool is_valid_; 36 | std::string msg_; 37 | }; 38 | 39 | } // namespace switcher 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /dockerfiles/Dockerfile-deps-Ubuntu-22.04: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 AS build 2 | LABEL MAINTAINER="Metalab " 3 | 4 | # Set switcher paths, we want the commands to run 5 | # from the root switcher sources directory 6 | WORKDIR "/opt/switcher" 7 | COPY . "/opt/switcher" 8 | 9 | # Install common dependencies 10 | RUN apt update -y \ 11 | # install shmdata 12 | && DEBIAN_FRONTEND=noninteractive apt install -y -qq \ 13 | git cmake build-essential \ 14 | libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev python3-dev \ 15 | && git clone https://gitlab.com/sat-mtl/tools/shmdata.git \ 16 | && cd shmdata && mkdir build && cd build \ 17 | && cmake -DCMAKE_BUILD_TYPE=Release .. \ 18 | && make -j$(nproc) && make install && ldconfig && cd ../.. \ 19 | # install switcher dependencies 20 | && DEBIAN_FRONTEND=noninteractive apt install -y -qq \ 21 | $(cat deps/apt-build-ubuntu-22.04) \ 22 | $(cat deps/apt-runtime-ubuntu-22.04) \ 23 | # install python dependencies 24 | && python3 -m pip install -U pip \ 25 | && apt-get remove -y --purge python3-pip \ 26 | && pip3 install -r deps/pip3-ubuntu22.04 \ 27 | # Clean apt cache 28 | && apt-get clean \ 29 | && apt-get autoclean \ 30 | && apt-get autoremove -y \ 31 | && rm -rf /var/lib/{apt,dpkg,cache,log}/ 32 | -------------------------------------------------------------------------------- /plugins/example/check_gst_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of switcher-plugin-example. 3 | * 4 | * switcher-plugin-example is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #undef NDEBUG // get assert in release mode 21 | 22 | #include 23 | #include 24 | #include "switcher/quiddity/basic-test.hpp" 25 | #include "switcher/switcher.hpp" 26 | 27 | int main() { 28 | using namespace switcher; 29 | using namespace quiddity; 30 | 31 | Switcher::ptr manager = Switcher::make_switcher("test_manager"); 32 | assert(quiddity::test::full(manager, "gst")); 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /plugins/cropper/check_cropper.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of switcher-cropper. 3 | * 4 | * switcher-cropper is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #undef NDEBUG // get assert in release mode 21 | 22 | #include 23 | #include "switcher/quiddity/basic-test.hpp" 24 | #include "switcher/switcher.hpp" 25 | 26 | int main() { 27 | { 28 | using namespace switcher; 29 | 30 | Switcher::ptr manager = Switcher::make_switcher("test_manager"); 31 | 32 | assert(quiddity::test::full(manager, "cropper")); 33 | 34 | } // end of scope is releasing the manager 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /plugins/watcher/check_watcher.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of switcher-executor. 3 | * 4 | * switcher-watcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #undef NDEBUG // get assert in release mode 21 | 22 | #include 23 | #include "switcher/quiddity/basic-test.hpp" 24 | #include "switcher/switcher.hpp" 25 | 26 | int main() { 27 | { 28 | using namespace switcher; 29 | 30 | Switcher::ptr manager = Switcher::make_switcher("test_manager"); 31 | 32 | assert(quiddity::test::full(manager, "watcher")); 33 | 34 | } // end of scope is releasing the manager 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /switcher/quiddity/property/gprop-to-prop.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_GPROP_TO_PROP_H__ 21 | #define __SWITCHER_GPROP_TO_PROP_H__ 22 | 23 | #include 24 | #include 25 | #include "./property.hpp" 26 | 27 | namespace switcher { 28 | namespace quiddity { 29 | namespace property { 30 | 31 | std::unique_ptr to_prop(GObject* object, const std::string& gprop_name); 32 | 33 | } // namespace property 34 | } // namespace quiddity 35 | } // namespace switcher 36 | #endif 37 | -------------------------------------------------------------------------------- /plugins/executor/check_executor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of switcher-executor. 3 | * 4 | * switcher-executor is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #undef NDEBUG // get assert in release mode 21 | 22 | #include 23 | #include "switcher/quiddity/basic-test.hpp" 24 | #include "switcher/switcher.hpp" 25 | 26 | int main() { 27 | { 28 | using namespace switcher; 29 | 30 | Switcher::ptr manager = Switcher::make_switcher("test_manager"); 31 | 32 | assert(quiddity::test::full(manager, "executor")); 33 | 34 | } // end of scope is releasing the manager 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /switcher/gst/rtppayloader-finder.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_GST_RTPPAYLOADER_FINDER_H__ 21 | #define __SWITCHER_GST_RTPPAYLOADER_FINDER_H__ 22 | 23 | #include 24 | #include 25 | 26 | namespace switcher { 27 | namespace gst { 28 | namespace rtppayloaderfinder { 29 | 30 | GstElementFactory* get_factory(const std::string& caps_str); 31 | GstElementFactory* get_factory_by_caps(GstCaps* caps); 32 | 33 | } // namespace rtppayloaderfinder 34 | } // namespace gst 35 | } // namespace switcher 36 | #endif 37 | -------------------------------------------------------------------------------- /switcher/utils/safe-bool-log.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_SAFE_BOOL_LOG_H__ 21 | #define __SWITCHER_SAFE_BOOL_LOG_H__ 22 | 23 | #include 24 | #include "./safe-bool-idiom.hpp" 25 | 26 | namespace switcher { 27 | 28 | class SafeBoolLog : public SafeBoolIdiom { 29 | public: 30 | std::string msg() const { return msg_; }; 31 | 32 | protected: 33 | void set_safe_bool_log_msg(const std::string& msg) { msg_ = msg; } 34 | 35 | private: 36 | std::string msg_; 37 | }; 38 | 39 | } // namespace switcher 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /plugins/vrpn/shared/device.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of switcher-vrpn. 3 | * 4 | * switcher-vrpn is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include "./device.hpp" 21 | 22 | namespace switcher { 23 | namespace quiddities { 24 | namespace vrpn { 25 | 26 | Device::Device(const std::string& name) : name_(name) {} 27 | 28 | std::string Device::getName() const { return name_; }; 29 | 30 | InfoTree::ptr Device::getTree() const { 31 | InfoTree::ptr tree = InfoTree::make(); 32 | tree->graft("name", InfoTree::make(name_)); 33 | return tree; 34 | } 35 | } // namespace vrpn 36 | } // namespace quiddities 37 | } // namespace switcher 38 | -------------------------------------------------------------------------------- /switcher/utils/is-specialization-of.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of libswitcher. 3 | * 4 | * libswitcher is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __SWITCHER_IS_SPECIALIZATION_OF_H__ 21 | #define __SWITCHER_IS_SPECIALIZATION_OF_H__ 22 | 23 | #include 24 | 25 | namespace switcher { 26 | 27 | template