-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import of Selkies JS Interposer for WebRTC to Linux Joystick support
- LD_PRELOAD syscall interposer to emulate gamepads. - Intercepts open() requests to /dev/input/jsX devices. - Interposer connects to selkies unix domain socket. - Interposer writes log to /tmp/selkies_js.log - Selkies WebRTC app sends Javascript gamepad events to socket. - Up to 4 simultaneous gamepads supported from WebRTC. - Build as debian package and installed to /usr/local/lib/selkies-js-interposer/joystick_interposer.so - Dev container updated to auto-load interposer. - Update to github workflow to build and publish image and release asset. - Add joystick interposer to example Dockerfile
- Loading branch information
Showing
27 changed files
with
1,671 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,18 @@ jobs: | |
version_suffix: -ubuntu22.04 | ||
build_args: UBUNTU_RELEASE=22.04 | ||
source_directory: addons/gstreamer | ||
|
||
- name: js-interposer | ||
version_suffix: -ubuntu20.04 | ||
build_args: DISTRIB_RELEASE=20.04;DEBFULLNAME="$GITHUB_ACTOR";DEBEMAIL="[email protected]";PKG_NAME=selkies-js-interposer;PKG_VERSION=0.0.0 | ||
source_directory: addons/js-interposer | ||
dockerfile: Dockerfile.ubuntu_debpkg | ||
|
||
- name: js-interposer | ||
version_suffix: -ubuntu22.04 | ||
build_args: DISTRIB_RELEASE=22.04;DEBFULLNAME="$GITHUB_ACTOR";DEBEMAIL="[email protected]";PKG_NAME=selkies-js-interposer;PKG_VERSION=0.0.0 | ||
source_directory: addons/js-interposer | ||
dockerfile: Dockerfile.ubuntu_debpkg | ||
|
||
- name: infra-gcp-installer | ||
source_directory: infra/gce/installer-image | ||
|
@@ -59,6 +71,7 @@ jobs: | |
image_name: ${{ matrix.name }} | ||
image_source_directory: ${{ matrix.source_directory }} | ||
image_version_1: $GITHUB_REF_NAME${{ matrix.version_suffix }} | ||
dockerfile: ${{ matrix.dockerfile || 'Dockerfile' }} | ||
|
||
# Note: When modifying this job, copy modifications to all other workflows' image jobs. | ||
all_example_images: | ||
|
@@ -69,13 +82,13 @@ jobs: | |
include: | ||
- name: gst-py-example | ||
version_suffix: -ubuntu20.04 | ||
build_args: PACKAGE_VERSION=0.0.0.dev0;UBUNTU_RELEASE=20.04;GSTREAMER_BASE_IMAGE_RELEASE=${{ github.ref_name }};PY_BUILD_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/py-build:${{ github.ref_name }};WEB_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/gst-web:${{ github.ref_name }} | ||
build_args: PACKAGE_VERSION=0.0.0.dev0;UBUNTU_RELEASE=20.04;GSTREAMER_BASE_IMAGE_RELEASE=${{ github.ref_name }};PY_BUILD_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/py-build:${{ github.ref_name }};WEB_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/gst-web:${{ github.ref_name }};JS_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/js-interposer:${{ github.ref_name }} | ||
dockerfile: Dockerfile.example | ||
source_directory: . | ||
|
||
- name: gst-py-example | ||
version_suffix: -ubuntu22.04 | ||
build_args: PACKAGE_VERSION=0.0.0.dev0;UBUNTU_RELEASE=22.04;GSTREAMER_BASE_IMAGE_RELEASE=${{ github.ref_name }};PY_BUILD_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/py-build:${{ github.ref_name }};WEB_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/gst-web:${{ github.ref_name }} | ||
build_args: PACKAGE_VERSION=0.0.0.dev0;UBUNTU_RELEASE=22.04;GSTREAMER_BASE_IMAGE_RELEASE=${{ github.ref_name }};PY_BUILD_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/py-build:${{ github.ref_name }};WEB_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/gst-web:${{ github.ref_name }};JS_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/js-interposer:${{ github.ref_name }} | ||
dockerfile: Dockerfile.example | ||
source_directory: . | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,16 @@ jobs: | |
build_args: UBUNTU_RELEASE=22.04 | ||
source_directory: addons/gstreamer | ||
source_files_for_diff: addons/gstreamer | ||
|
||
- name: js-interposer | ||
version_suffix: -ubuntu20.04 | ||
build_args: DISTRIB_RELEASE=20.04;DEBFULLNAME="$GITHUB_ACTOR";DEBEMAIL="[email protected]";PKG_NAME=selkies-js-interposer;PKG_VERSION=0.0.0 | ||
source_directory: addons/js-interposer | ||
|
||
- name: js-interposer | ||
version_suffix: -ubuntu22.04 | ||
build_args: DISTRIB_RELEASE=22.04;DEBFULLNAME="$GITHUB_ACTOR";DEBEMAIL="[email protected]";PKG_NAME=selkies-js-interposer;PKG_VERSION=0.0.0 | ||
source_directory: addons/js-interposer | ||
|
||
- name: infra-gcp-installer | ||
source_directory: infra/gce/installer-image | ||
|
@@ -95,7 +105,7 @@ jobs: | |
- name: gst-py-example | ||
version_suffix: -ubuntu20.04 | ||
push_image: "false" | ||
build_args: PACKAGE_VERSION=0.0.0.dev0;UBUNTU_RELEASE=20.04;GSTREAMER_BASE_IMAGE_RELEASE=pr;PY_BUILD_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/py-build:pr;WEB_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/gst-web:pr | ||
build_args: PACKAGE_VERSION=0.0.0.dev0;UBUNTU_RELEASE=20.04;GSTREAMER_BASE_IMAGE_RELEASE=pr${{ matrix.version_suffix }};PY_BUILD_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/py-build:pr${{ matrix.version_suffix }};WEB_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/gst-web:pr${{ matrix.version_suffix }};JS_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/js-interposer:pr${{ matrix.version_suffix }} | ||
dockerfile: Dockerfile.example | ||
source_directory: . | ||
source_files_for_diff: | | ||
|
@@ -110,7 +120,7 @@ jobs: | |
- name: gst-py-example | ||
version_suffix: -ubuntu22.04 | ||
push_image: "false" | ||
build_args: PACKAGE_VERSION=0.0.0.dev0;UBUNTU_RELEASE=22.04;GSTREAMER_BASE_IMAGE_RELEASE=pr;PY_BUILD_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/py-build:pr;WEB_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/gst-web:pr | ||
build_args: PACKAGE_VERSION=0.0.0.dev0;UBUNTU_RELEASE=22.04;GSTREAMER_BASE_IMAGE_RELEASE=pr${{ matrix.version_suffix }};PY_BUILD_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/py-build:pr${{ matrix.version_suffix }};WEB_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/gst-web:pr${{ matrix.version_suffix }};JS_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/js-interposer:pr${{ matrix.version_suffix }} | ||
dockerfile: Dockerfile.example | ||
source_directory: . | ||
source_files_for_diff: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,16 @@ jobs: | |
version_suffix: -ubuntu22.04 | ||
build_args: UBUNTU_RELEASE=22.04 | ||
source_directory: addons/gstreamer | ||
|
||
- name: js-interposer | ||
version_suffix: -ubuntu20.04 | ||
build_args: DISTRIB_RELEASE=20.04;DEBFULLNAME="$GITHUB_ACTOR";DEBEMAIL="[email protected]";PKG_NAME=selkies-js-interposer;PKG_VERSION=${{ needs.get_semver.outputs.semver }} | ||
source_directory: addons/js-interposer | ||
|
||
- name: js-interposer | ||
version_suffix: -ubuntu22.04 | ||
build_args: DISTRIB_RELEASE=22.04;DEBFULLNAME="$GITHUB_ACTOR";DEBEMAIL="[email protected]";PKG_NAME=selkies-js-interposer;PKG_VERSION=${{ needs.get_semver.outputs.semver }} | ||
source_directory: addons/js-interposer | ||
|
||
- name: infra-gcp-installer | ||
source_directory: infra/gce/installer-image | ||
|
@@ -86,13 +96,13 @@ jobs: | |
include: | ||
- name: gst-py-example | ||
version_suffix: -ubuntu20.04 | ||
build_args: PACKAGE_VERSION=${{ needs.get_semver.outputs.semver }};UBUNTU_RELEASE=20.04;GSTREAMER_BASE_IMAGE_RELEASE=$GITHUB_REF_NAME;PY_BUILD_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/py-build:$GITHUB_REF_NAME;WEB_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/gst-web:$GITHUB_REF_NAME | ||
build_args: PACKAGE_VERSION=${{ needs.get_semver.outputs.semver }};UBUNTU_RELEASE=20.04;GSTREAMER_BASE_IMAGE_RELEASE=$GITHUB_REF_NAME;PY_BUILD_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/py-build:$GITHUB_REF_NAME;WEB_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/gst-web:$GITHUB_REF_NAME;JS_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/js-interposer:$GITHUB_REF_NAME | ||
dockerfile: Dockerfile.example | ||
source_directory: . | ||
|
||
- name: gst-py-example | ||
version_suffix: -ubuntu22.04 | ||
build_args: PACKAGE_VERSION=${{ needs.get_semver.outputs.semver }};UBUNTU_RELEASE=22.04;GSTREAMER_BASE_IMAGE_RELEASE=$GITHUB_REF_NAME;PY_BUILD_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/py-build:$GITHUB_REF_NAME;WEB_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/gst-web:$GITHUB_REF_NAME | ||
build_args: PACKAGE_VERSION=${{ needs.get_semver.outputs.semver }};UBUNTU_RELEASE=22.04;GSTREAMER_BASE_IMAGE_RELEASE=$GITHUB_REF_NAME;PY_BUILD_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/py-build:$GITHUB_REF_NAME;WEB_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/gst-web:$GITHUB_REF_NAME;JS_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/js-interposer:$GITHUB_REF_NAME | ||
dockerfile: Dockerfile.example | ||
source_directory: . | ||
|
||
|
@@ -126,6 +136,14 @@ jobs: | |
gst22_mimetype: ${{ steps.extract.outputs.gst22_mimetype }} | ||
gst22_name: ${{ steps.extract.outputs.gst22_name }} | ||
gst22_path: ${{ steps.extract.outputs.gst22_path }} | ||
js20_cache_key: ${{ steps.extract.outputs.js20_cache_key }} | ||
js20_mimetype: ${{ steps.extract.outputs.js20_mimetype }} | ||
js20_name: ${{ steps.extract.outputs.js20_name }} | ||
js20_path: ${{ steps.extract.outputs.js20_path }} | ||
js22_cache_key: ${{ steps.extract.outputs.js22_cache_key }} | ||
js22_mimetype: ${{ steps.extract.outputs.js22_mimetype }} | ||
js22_name: ${{ steps.extract.outputs.js22_name }} | ||
js22_path: ${{ steps.extract.outputs.js22_path }} | ||
py_cache_key: ${{ steps.extract.outputs.py_cache_key }} | ||
py_mimetype: ${{ steps.extract.outputs.py_mimetype }} | ||
py_name: ${{ steps.extract.outputs.py_name }} | ||
|
@@ -156,6 +174,26 @@ jobs: | |
target_directory: /tmp | ||
target_name: selkies-gstreamer-${{ github.ref_name }}-ubuntu22.04.tgz | ||
upload_bucket_path: gs://selkies-project-releases/selkies-gstreamer/${{ github.ref_name }}/ | ||
|
||
- id: js20 | ||
cache_key: js-interposer-asset-ubuntu2004 | ||
description: JS Interposr Ubuntu 20.04 | ||
image_tag: ghcr.io/selkies-project/selkies-gstreamer/js-interposer:${{ github.ref_name }}-ubuntu20.04 | ||
mimetype: application/octet-stream | ||
source_path: /opt/selkies-js-interposer_${{ needs.get_semver.outputs.semver }}.deb | ||
target_directory: /tmp | ||
target_name: selkies-js-interposer-${{ github.ref_name }}-ubuntu20.04.deb | ||
upload_bucket_path: gs://selkies-project-releases/selkies-gstreamer/${{ github.ref_name }}/ | ||
|
||
- id: js22 | ||
cache_key: js-interposer-asset-ubuntu2204 | ||
description: JS Interposr Ubuntu 22.04 | ||
image_tag: ghcr.io/selkies-project/selkies-gstreamer/js-interposer:${{ github.ref_name }}-ubuntu22.04 | ||
mimetype: application/octet-stream | ||
source_path: /opt/selkies-js-interposer_${{ needs.get_semver.outputs.semver }}.deb | ||
target_directory: /tmp | ||
target_name: selkies-js-interposer-${{ github.ref_name }}-ubuntu22.04.deb | ||
upload_bucket_path: gs://selkies-project-releases/selkies-gstreamer/${{ github.ref_name }}/ | ||
|
||
- id: py | ||
cache_key: gst-py-asset | ||
|
@@ -226,6 +264,18 @@ jobs: | |
key: ${{ needs.all_assets.outputs.gst20_cache_key }} | ||
path: ${{ needs.all_assets.outputs.gst20_path }} | ||
|
||
- name: Ubuntu 22.04 cache read | ||
uses: actions/cache@v3 | ||
with: | ||
key: ${{ needs.all_assets.outputs.gst22_cache_key }} | ||
path: ${{ needs.all_assets.outputs.gst22_path }} | ||
|
||
- name: JS Interposer Ubuntu 20.04 cache read | ||
uses: actions/cache@v3 | ||
with: | ||
key: ${{ needs.all_assets.outputs.js20_cache_key }} | ||
path: ${{ needs.all_assets.outputs.js20_path }} | ||
|
||
- name: Ubuntu 22.04 cache read | ||
uses: actions/cache@v3 | ||
with: | ||
|
@@ -261,6 +311,24 @@ jobs: | |
file: ${{ needs.all_assets.outputs.gst22_path }} | ||
asset_name: ${{ needs.all_assets.outputs.gst22_name }} | ||
overwrite: true | ||
|
||
- name: JS Interceptor Ubuntu 20.04 upload | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ github.ref }} | ||
file: ${{ needs.all_assets.outputs.js20_path }} | ||
asset_name: ${{ needs.all_assets.outputs.js20_name }} | ||
overwrite: true | ||
|
||
- name: JS Interceptor Ubuntu 22.04 upload | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ github.ref }} | ||
file: ${{ needs.all_assets.outputs.js22_path }} | ||
asset_name: ${{ needs.all_assets.outputs.js22_name }} | ||
overwrite: true | ||
|
||
- name: Python upload | ||
uses: svenstaro/upload-release-action@v2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ addons/_archive | |
dist | ||
coturn_env | ||
src/*.egg-info | ||
NOTES.md | ||
NOTES.md | ||
**/__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"env": { | ||
"myDefaultIncludePath": [ | ||
"/usr/include/**", | ||
"${workspaceFolder}/**", | ||
] | ||
}, | ||
"configurations": [ | ||
{ | ||
"name": "Dev", | ||
"includePath": [ | ||
"${myDefaultIncludePath}" | ||
], | ||
"browse": { | ||
"path": [ | ||
"${myDefaultIncludePath}" | ||
], | ||
"limitSymbolsToIncludedHeaders": true, | ||
"databaseFilename": "" | ||
} | ||
} | ||
], | ||
"version": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.python" | ||
}, | ||
"python.formatting.provider": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.