diff --git a/.github/.ci.conf b/.github/.ci.conf new file mode 100755 index 00000000..4a9b2ec2 --- /dev/null +++ b/.github/.ci.conf @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +PRE_TEST_HOOK=_install_gstreamer_hook +PRE_LINT_HOOK=_install_gstreamer_hook + +function _install_gstreamer_hook(){ + set -e + + sudo apt-get update + sudo apt-get purge -y libunwind-14-dev + sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev + +} diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 00000000..c3421a1a --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +.goassets diff --git a/.github/fetch-scripts.sh b/.github/fetch-scripts.sh new file mode 100755 index 00000000..f333841e --- /dev/null +++ b/.github/fetch-scripts.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# +# DO NOT EDIT THIS FILE +# +# It is automatically copied from https://github.com/pion/.goassets repository. +# +# If you want to update the shared CI config, send a PR to +# https://github.com/pion/.goassets instead of this repository. +# +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +set -eu + +SCRIPT_PATH="$(realpath "$(dirname "$0")")" +GOASSETS_PATH="${SCRIPT_PATH}/.goassets" + +GOASSETS_REF=${GOASSETS_REF:-master} + +if [ -d "${GOASSETS_PATH}" ]; then + if ! git -C "${GOASSETS_PATH}" diff --exit-code; then + echo "${GOASSETS_PATH} has uncommitted changes" >&2 + exit 1 + fi + git -C "${GOASSETS_PATH}" fetch origin + git -C "${GOASSETS_PATH}" checkout ${GOASSETS_REF} + git -C "${GOASSETS_PATH}" reset --hard origin/${GOASSETS_REF} +else + git clone -b ${GOASSETS_REF} https://github.com/pion/.goassets.git "${GOASSETS_PATH}" +fi diff --git a/.github/install-hooks.sh b/.github/install-hooks.sh new file mode 100755 index 00000000..8aa34be9 --- /dev/null +++ b/.github/install-hooks.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# +# DO NOT EDIT THIS FILE +# +# It is automatically copied from https://github.com/pion/.goassets repository. +# +# If you want to update the shared CI config, send a PR to +# https://github.com/pion/.goassets instead of this repository. +# +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +SCRIPT_PATH="$(realpath "$(dirname "$0")")" + +. ${SCRIPT_PATH}/fetch-scripts.sh + +cp "${GOASSETS_PATH}/hooks/commit-msg.sh" "${SCRIPT_PATH}/../.git/hooks/commit-msg" +cp "${GOASSETS_PATH}/hooks/pre-commit.sh" "${SCRIPT_PATH}/../.git/hooks/pre-commit" +cp "${GOASSETS_PATH}/hooks/pre-push.sh" "${SCRIPT_PATH}/../.git/hooks/pre-push" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..ea9b825e --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,28 @@ +# +# DO NOT EDIT THIS FILE +# +# It is automatically copied from https://github.com/pion/.goassets repository. +# If this repository should have package specific CI config, +# remove the repository name from .goassets/.github/workflows/assets-sync.yml. +# +# If you want to update the shared CI config, send a PR to +# https://github.com/pion/.goassets instead of this repository. +# +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +name: CodeQL + +on: + workflow_dispatch: + schedule: + - cron: '23 5 * * 0' + pull_request: + branches: + - master + paths: + - '**.go' + +jobs: + analyze: + uses: pion/.goassets/.github/workflows/codeql-analysis.reusable.yml@master diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index e26b0313..5dd3a993 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,67 +1,20 @@ +# +# DO NOT EDIT THIS FILE +# +# It is automatically copied from https://github.com/pion/.goassets repository. +# If this repository should have package specific CI config, +# remove the repository name from .goassets/.github/workflows/assets-sync.yml. +# +# If you want to update the shared CI config, send a PR to +# https://github.com/pion/.goassets instead of this repository. +# +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + name: Lint on: - push: - branches: - - master pull_request: - branches: - - master - schedule: - - cron: "0 0 * * 1" - jobs: - lint-commit-message: - name: Metadata - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Checkout .goassets - uses: actions/checkout@v3 - with: - repository: pion/.goassets - path: ${{ github.workspace }}/.github/.goassets - ref: ${{ inputs.goassets-ref }} - - - name: Commit Message - run: .github/.goassets/scripts/lint-commit-message.sh - - - name: File names - run: .github/.goassets/scripts/lint-filename.sh - - - name: Logging messages should not have trailing newlines - run: .github/.goassets/scripts/lint-no-trailing-newline-in-log-messages.sh - - - name: Go version in go.mod - run: .github/.goassets/scripts/lint-go-mod-version.sh - - lint-go: - name: Go - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: read - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-go@v4 - with: - go-version: 'stable' - - - name: Update packages - run: sudo apt-get update - - - name: Install GStreamer - run: | - sudo apt-get purge -y libunwind-14-dev - sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev - - - name: Build data-channels - run: cd c-data-channels && make - - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: v1.52.2 + lint: + uses: pion/.goassets/.github/workflows/lint.reusable.yml@master diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..01227e2a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +# +# DO NOT EDIT THIS FILE +# +# It is automatically copied from https://github.com/pion/.goassets repository. +# If this repository should have package specific CI config, +# remove the repository name from .goassets/.github/workflows/assets-sync.yml. +# +# If you want to update the shared CI config, send a PR to +# https://github.com/pion/.goassets instead of this repository. +# +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +name: Release +on: + push: + tags: + - 'v*' + +jobs: + release: + uses: pion/.goassets/.github/workflows/release.reusable.yml@master + with: + go-version: '1.20' # auto-update/latest-go-version diff --git a/.github/workflows/renovate-go-sum-fix.yaml b/.github/workflows/renovate-go-sum-fix.yaml new file mode 100644 index 00000000..b7bb1b4f --- /dev/null +++ b/.github/workflows/renovate-go-sum-fix.yaml @@ -0,0 +1,24 @@ +# +# DO NOT EDIT THIS FILE +# +# It is automatically copied from https://github.com/pion/.goassets repository. +# If this repository should have package specific CI config, +# remove the repository name from .goassets/.github/workflows/assets-sync.yml. +# +# If you want to update the shared CI config, send a PR to +# https://github.com/pion/.goassets instead of this repository. +# +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +name: Fix go.sum +on: + push: + branches: + - renovate/* + +jobs: + fix: + uses: pion/.goassets/.github/workflows/renovate-go-sum-fix.reusable.yml@master + secrets: + token: ${{ secrets.PIONBOT_PRIVATE_KEY }} diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml new file mode 100644 index 00000000..8633a12a --- /dev/null +++ b/.github/workflows/reuse.yml @@ -0,0 +1,22 @@ +# +# DO NOT EDIT THIS FILE +# +# It is automatically copied from https://github.com/pion/.goassets repository. +# If this repository should have package specific CI config, +# remove the repository name from .goassets/.github/workflows/assets-sync.yml. +# +# If you want to update the shared CI config, send a PR to +# https://github.com/pion/.goassets instead of this repository. +# +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +name: REUSE Compliance Check + +on: + push: + pull_request: + +jobs: + lint: + uses: pion/.goassets/.github/workflows/reuse.reusable.yml@master diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..31aada4a --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,43 @@ +# +# DO NOT EDIT THIS FILE +# +# It is automatically copied from https://github.com/pion/.goassets repository. +# If this repository should have package specific CI config, +# remove the repository name from .goassets/.github/workflows/assets-sync.yml. +# +# If you want to update the shared CI config, send a PR to +# https://github.com/pion/.goassets instead of this repository. +# +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +name: Test +on: + push: + branches: + - master + pull_request: + +jobs: + test: + uses: pion/.goassets/.github/workflows/test.reusable.yml@master + strategy: + matrix: + go: ['1.20', '1.19'] # auto-update/supported-go-version-list + fail-fast: false + with: + go-version: ${{ matrix.go }} + + test-i386: + uses: pion/.goassets/.github/workflows/test-i386.reusable.yml@master + strategy: + matrix: + go: ['1.20', '1.19'] # auto-update/supported-go-version-list + fail-fast: false + with: + go-version: ${{ matrix.go }} + + test-wasm: + uses: pion/.goassets/.github/workflows/test-wasm.reusable.yml@master + with: + go-version: '1.20' # auto-update/latest-go-version diff --git a/.github/workflows/tidy-check.yaml b/.github/workflows/tidy-check.yaml new file mode 100644 index 00000000..4d346d4f --- /dev/null +++ b/.github/workflows/tidy-check.yaml @@ -0,0 +1,25 @@ +# +# DO NOT EDIT THIS FILE +# +# It is automatically copied from https://github.com/pion/.goassets repository. +# If this repository should have package specific CI config, +# remove the repository name from .goassets/.github/workflows/assets-sync.yml. +# +# If you want to update the shared CI config, send a PR to +# https://github.com/pion/.goassets instead of this repository. +# +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +name: Go mod tidy +on: + pull_request: + push: + branches: + - master + +jobs: + tidy: + uses: pion/.goassets/.github/workflows/tidy-check.reusable.yml@master + with: + go-version: '1.20' # auto-update/latest-go-version diff --git a/.gitignore b/.gitignore index d8784262..6e2f206a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,28 @@ -sfu-ws/cert.pem -sfu-ws/key.pem +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT -*.ogg +### JetBrains IDE ### +##################### +.idea/ + +### Emacs Temporary Files ### +############################# +*~ + +### Folders ### +############### +bin/ +vendor/ +node_modules/ + +### Files ### +############# *.ivf -*.h264 +*.ogg +tags +cover.out +*.sw[poe] +*.wasm +examples/sfu-ws/cert.pem +examples/sfu-ws/key.pem +wasm_exec.js diff --git a/.golangci.yml b/.golangci.yml index ef8f2214..6dd80c80 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,6 +6,8 @@ linters-settings: check-shadowing: true misspell: locale: US + exhaustive: + default-signifies-exhaustive: true gomodguard: blocked: modules: @@ -14,11 +16,11 @@ linters-settings: - errors forbidigo: forbid: + - ^fmt.Print(f|ln)?$ + - ^log.(Panic|Fatal|Print)(f|ln)?$ + - ^os.Exit$ + - ^panic$ - ^print(ln)?$ - revive: - rules: - - name: package-comments - disabled: true linters: enable: @@ -27,19 +29,25 @@ linters: - bodyclose # checks whether HTTP response body is closed successfully - contextcheck # check the function whether use a non-inherited context - decorder # check declaration order and count of types, constants, variables and functions - - depguard # Go linter that checks if package imports are in a list of acceptable packages - dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) - dupl # Tool for code clone detection - durationcheck # check for two durations multiplied together - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases - errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occations, where the check for the returned error can be omitted. - errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`. + - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. + - exhaustive # check exhaustiveness of enum switch statements - exportloopref # checks for pointers to enclosing loop variables - forbidigo # Forbids identifiers + - forcetypeassert # finds forced type assertions - gci # Gci control golang package import order and make it always deterministic. + - gochecknoglobals # Checks that no globals are present in Go code + - gochecknoinits # Checks that no init functions are present in Go code + - gocognit # Computes and checks the cognitive complexity of functions - goconst # Finds repeated strings that could be replaced by a constant - gocritic # The most opinionated Go source code linter - godox # Tool for detection of FIXME, TODO and other comment keywords + - goerr113 # Golang linter to check the errors handling expressions - gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification - gofumpt # Gofumpt checks whether code was gofumpt-ed. - goheader # Checks is file header matches to pattern @@ -54,7 +62,6 @@ linters: - importas # Enforces consistent import aliases - ineffassign # Detects when assignments to existing variables are not used - misspell # Finds commonly misspelled English words in comments - - nakedret # Finds naked returns in functions greater than a specified function length - nilerr # Finds the code that returns nil even if it checks that the error is not nil. - nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value. - noctx # noctx finds sending http request without context.Context @@ -72,6 +79,7 @@ linters: - wastedassign # wastedassign finds wasted assignment statements - whitespace # Tool for detection of leading and trailing whitespace disable: + - depguard # Go linter that checks if package imports are in a list of acceptable packages - containedctx # containedctx is a linter that detects struct contained context.Context field - cyclop # checks function and package cyclomatic complexity - exhaustivestruct # Checks if all struct's fields are initialized @@ -85,6 +93,7 @@ linters: - maintidx # maintidx measures the maintainability index of each function. - makezero # Finds slice declarations with non-zero initial length - maligned # Tool to detect Go structs that would take less memory if their fields were sorted + - nakedret # Finds naked returns in functions greater than a specified function length - nestif # Reports deeply nested if statements - nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity - nolintlint # Reports ill-formed or insufficient nolint directives @@ -102,28 +111,16 @@ linters: issues: exclude-use-default: false exclude-rules: - # Allow complex tests, better to be self contained - - path: _test\.go + # Allow complex tests and examples, better to be self contained + - path: (examples|main\.go|_test\.go) linters: - - gocognit - forbidigo - - # Allow complex main function in examples - - path: examples - text: "of func `main` is high" - linters: - gocognit - # Allow forbidden identifiers in examples - - path: examples - linters: - - forbidigo - # Allow forbidden identifiers in CLI commands - path: cmd linters: - forbidigo run: - skip-dirs: - - c-data-channels + skip-dirs-use-default: false diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..30093e9d --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +builds: +- skip: true diff --git a/.reuse/dep5 b/.reuse/dep5 new file mode 100644 index 00000000..7bb60710 --- /dev/null +++ b/.reuse/dep5 @@ -0,0 +1,7 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Pion +Source: https://github.com/pion/ + +Files: README.md DESIGN.md **/README.md renovate.json go.mod go.sum **/go.mod **/go.sum .eslintrc.json package.json examples.json **/.gitignore **/pubspec.yaml c-data-channels/webrtc.h +Copyright: 2023 The Pion community +License: MIT diff --git a/LICENSE b/LICENSE index 8b23445f..491caf6b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,9 @@ MIT License -Copyright (c) 2019 +Copyright (c) 2023 The Pion community -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt new file mode 100644 index 00000000..2071b23b --- /dev/null +++ b/LICENSES/MIT.txt @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/c-data-channels/Makefile b/c-data-channels/Makefile index 6807af71..057d38d5 100644 --- a/c-data-channels/Makefile +++ b/c-data-channels/Makefile @@ -1,8 +1,11 @@ +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + c-data-channels: webrtc.so data-channels.c gcc -o $@ data-channels.c ./webrtc.so -webrtc.so: webrtc.go bridge.go +webrtc.so: webrtc.go bridge.go go build -o $@ -buildmode=c-shared $^ clean: - rm webrtc.so webrtc.h c-data-channels \ No newline at end of file + rm webrtc.so webrtc.h c-data-channels diff --git a/c-data-channels/bridge.go b/c-data-channels/bridge.go index e2b24d72..0eb47e85 100644 --- a/c-data-channels/bridge.go +++ b/c-data-channels/bridge.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package main /* diff --git a/c-data-channels/data-channels.c b/c-data-channels/data-channels.c index 73f030e6..d9e6e5c3 100644 --- a/c-data-channels/data-channels.c +++ b/c-data-channels/data-channels.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + #include "webrtc.h" #include #include @@ -66,4 +69,4 @@ char *rand_seq(int n) } b[n] = '\0'; return b; -} \ No newline at end of file +} diff --git a/c-data-channels/webrtc.go b/c-data-channels/webrtc.go index b87a9697..2d30241b 100644 --- a/c-data-channels/webrtc.go +++ b/c-data-channels/webrtc.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package main import ( diff --git a/c-data-channels/webrtc.h b/c-data-channels/webrtc.h new file mode 100644 index 00000000..c0486064 --- /dev/null +++ b/c-data-channels/webrtc.h @@ -0,0 +1,122 @@ +/* Code generated by cmd/cgo; DO NOT EDIT. */ + +/* package command-line-arguments */ + + +#line 1 "cgo-builtin-export-prolog" + +#include + +#ifndef GO_CGO_EXPORT_PROLOGUE_H +#define GO_CGO_EXPORT_PROLOGUE_H + +#ifndef GO_CGO_GOSTRING_TYPEDEF +typedef struct { const char *p; ptrdiff_t n; } _GoString_; +#endif + +#endif + +/* Start of preamble from import "C" comments. */ + + +#line 6 "bridge.go" + +#include +#include +typedef struct GoDataChannelMessage +{ + // bool in cgo is really weird, so it's simpler to just use classic int as bool + int is_string; + void *data; + size_t data_len; +} GoDataChannelMessage; + +typedef uint16_t GoDataChannel; +typedef void (*GoOnDataChannelFunc)(GoDataChannel); +typedef void (*GoOnOpenFunc)(GoDataChannel); +typedef void (*GoOnMessageFunc)(GoDataChannel, GoDataChannelMessage); + +// Calling C function pointers is currently not supported, however you can +// declare Go variables which hold C function pointers and pass them back +// and forth between Go and C. C code may call function pointers received from Go. +// Reference: https://golang.org/cmd/cgo/#hdr-Go_references_to_C +inline void bridge_on_data_channel(GoOnDataChannelFunc cb, GoDataChannel d) +{ + cb(d); +} + +inline void bridge_on_open(GoOnOpenFunc cb, GoDataChannel d) +{ + cb(d); +} + +inline void bridge_on_message(GoOnMessageFunc cb, GoDataChannel d, GoDataChannelMessage msg) +{ + cb(d, msg); +} + +#line 1 "cgo-generated-wrapper" + + +/* End of preamble from import "C" comments. */ + + +/* Start of boilerplate cgo prologue. */ +#line 1 "cgo-gcc-export-header-prolog" + +#ifndef GO_CGO_PROLOGUE_H +#define GO_CGO_PROLOGUE_H + +typedef signed char GoInt8; +typedef unsigned char GoUint8; +typedef short GoInt16; +typedef unsigned short GoUint16; +typedef int GoInt32; +typedef unsigned int GoUint32; +typedef long long GoInt64; +typedef unsigned long long GoUint64; +typedef GoInt64 GoInt; +typedef GoUint64 GoUint; +typedef size_t GoUintptr; +typedef float GoFloat32; +typedef double GoFloat64; +#ifdef _MSC_VER +#include +typedef _Fcomplex GoComplex64; +typedef _Dcomplex GoComplex128; +#else +typedef float _Complex GoComplex64; +typedef double _Complex GoComplex128; +#endif + +/* + static assertion to make sure the file is being used on architecture + at least with matching size of GoInt. +*/ +typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1]; + +#ifndef GO_CGO_GOSTRING_TYPEDEF +typedef _GoString_ GoString; +#endif +typedef void *GoMap; +typedef void *GoChan; +typedef struct { void *t; void *v; } GoInterface; +typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; + +#endif + +/* End of boilerplate cgo prologue. */ + +#ifdef __cplusplus +extern "C" { +#endif + +extern void GoRun(GoOnDataChannelFunc f); +extern void GoOnOpen(GoDataChannel d, GoOnOpenFunc f); +extern void GoOnMessage(GoDataChannel d, GoOnMessageFunc f); +extern void GoSendText(GoDataChannel d, char* t); +extern char* GoLabel(GoDataChannel d); + +#ifdef __cplusplus +} +#endif diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..263e4d45 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,22 @@ +# +# DO NOT EDIT THIS FILE +# +# It is automatically copied from https://github.com/pion/.goassets repository. +# +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +coverage: + status: + project: + default: + # Allow decreasing 2% of total coverage to avoid noise. + threshold: 2% + patch: + default: + target: 70% + only_pulls: true + +ignore: + - "examples/*" + - "examples/**/*" diff --git a/example.html b/example.html index dcc3e5c9..bd445fb9 100644 --- a/example.html +++ b/example.html @@ -1,4 +1,8 @@ + @@ -17,7 +21,7 @@

{{ .Title }}

-

< Home

+

< Home

{{ template "demo.html" }} diff --git a/examples.go b/examples.go index ba172a3a..18fa9af9 100644 --- a/examples.go +++ b/examples.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package main import ( diff --git a/gocv-receive/jsfiddle/demo.css b/gocv-receive/jsfiddle/demo.css index 9e43d340..17524fc4 100644 --- a/gocv-receive/jsfiddle/demo.css +++ b/gocv-receive/jsfiddle/demo.css @@ -1,4 +1,9 @@ +/* + SPDX-FileCopyrightText: 2023 The Pion community + SPDX-License-Identifier: MIT +*/ + textarea { width: 500px; min-height: 75px; -} \ No newline at end of file +} diff --git a/gocv-receive/jsfiddle/demo.details b/gocv-receive/jsfiddle/demo.details index 94c4b55e..c9602308 100644 --- a/gocv-receive/jsfiddle/demo.details +++ b/gocv-receive/jsfiddle/demo.details @@ -1,5 +1,8 @@ --- - name: gocv-receive - description: Example of using Pion WebRTC with GoCV to do motion detection - authors: - - Sean DuBois +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +name: gocv-receive +description: Example of using Pion WebRTC with GoCV to do motion detection +authors: + - Sean DuBois diff --git a/gocv-receive/jsfiddle/demo.html b/gocv-receive/jsfiddle/demo.html index cba0be07..84036858 100644 --- a/gocv-receive/jsfiddle/demo.html +++ b/gocv-receive/jsfiddle/demo.html @@ -1,3 +1,8 @@ + + Browser base64 Session Description

diff --git a/gocv-receive/jsfiddle/demo.js b/gocv-receive/jsfiddle/demo.js index 9bf6c39a..f3bfe564 100644 --- a/gocv-receive/jsfiddle/demo.js +++ b/gocv-receive/jsfiddle/demo.js @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + /* eslint-env browser */ let pc = new RTCPeerConnection({ diff --git a/gocv-receive/main.go b/gocv-receive/main.go index 5f7994ab..f1386bca 100644 --- a/gocv-receive/main.go +++ b/gocv-receive/main.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + //go:build gocv // +build gocv diff --git a/gstreamer-receive/jsfiddle/demo.css b/gstreamer-receive/jsfiddle/demo.css index 9e43d340..17524fc4 100644 --- a/gstreamer-receive/jsfiddle/demo.css +++ b/gstreamer-receive/jsfiddle/demo.css @@ -1,4 +1,9 @@ +/* + SPDX-FileCopyrightText: 2023 The Pion community + SPDX-License-Identifier: MIT +*/ + textarea { width: 500px; min-height: 75px; -} \ No newline at end of file +} diff --git a/gstreamer-receive/jsfiddle/demo.details b/gstreamer-receive/jsfiddle/demo.details index 3a3ab37e..05b7527f 100644 --- a/gstreamer-receive/jsfiddle/demo.details +++ b/gstreamer-receive/jsfiddle/demo.details @@ -1,5 +1,8 @@ --- - name: gstreamer-receive - description: Example of using pion-WebRTC to play video using GStreamer - authors: - - Sean DuBois +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +name: gstreamer-receive +description: Example of using pion-WebRTC to play video using GStreamer +authors: + - Sean DuBois diff --git a/gstreamer-receive/jsfiddle/demo.html b/gstreamer-receive/jsfiddle/demo.html index 7612e161..978fe7f2 100644 --- a/gstreamer-receive/jsfiddle/demo.html +++ b/gstreamer-receive/jsfiddle/demo.html @@ -1,3 +1,7 @@ + Browser base64 Session Description

diff --git a/gstreamer-receive/jsfiddle/demo.js b/gstreamer-receive/jsfiddle/demo.js index a7b3f711..8aac62cc 100644 --- a/gstreamer-receive/jsfiddle/demo.js +++ b/gstreamer-receive/jsfiddle/demo.js @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + /* eslint-env browser */ let pc = new RTCPeerConnection({ diff --git a/gstreamer-receive/main.go b/gstreamer-receive/main.go index c403cb1a..2d505266 100644 --- a/gstreamer-receive/main.go +++ b/gstreamer-receive/main.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package main import ( diff --git a/gstreamer-send-offer/main.go b/gstreamer-send-offer/main.go index 88f44fe0..9e3dd583 100644 --- a/gstreamer-send-offer/main.go +++ b/gstreamer-send-offer/main.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package main import ( diff --git a/gstreamer-send/jsfiddle/demo.css b/gstreamer-send/jsfiddle/demo.css index 9e43d340..17524fc4 100644 --- a/gstreamer-send/jsfiddle/demo.css +++ b/gstreamer-send/jsfiddle/demo.css @@ -1,4 +1,9 @@ +/* + SPDX-FileCopyrightText: 2023 The Pion community + SPDX-License-Identifier: MIT +*/ + textarea { width: 500px; min-height: 75px; -} \ No newline at end of file +} diff --git a/gstreamer-send/jsfiddle/demo.details b/gstreamer-send/jsfiddle/demo.details index dccded8e..c70937bd 100644 --- a/gstreamer-send/jsfiddle/demo.details +++ b/gstreamer-send/jsfiddle/demo.details @@ -1,5 +1,8 @@ --- - name: gstreamer-send - description: Example of using pion-WebRTC to send video to your browser using GStreamer - authors: - - Sean DuBois +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +name: gstreamer-send +description: Example of using pion-WebRTC to send video to your browser using GStreamer +authors: + - Sean DuBois diff --git a/gstreamer-send/jsfiddle/demo.html b/gstreamer-send/jsfiddle/demo.html index 6dbbf255..8f26937e 100644 --- a/gstreamer-send/jsfiddle/demo.html +++ b/gstreamer-send/jsfiddle/demo.html @@ -1,3 +1,8 @@ + + Browser base64 Session Description

diff --git a/gstreamer-send/jsfiddle/demo.js b/gstreamer-send/jsfiddle/demo.js index 90d5e6b8..20ffb395 100644 --- a/gstreamer-send/jsfiddle/demo.js +++ b/gstreamer-send/jsfiddle/demo.js @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + /* eslint-env browser */ let pc = new RTCPeerConnection({ diff --git a/gstreamer-send/main.go b/gstreamer-send/main.go index c5b040b4..2d8b8677 100644 --- a/gstreamer-send/main.go +++ b/gstreamer-send/main.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package main import ( diff --git a/index.html b/index.html index 79b38232..7192f0e4 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,8 @@ + @@ -10,13 +14,13 @@ font-weight: 400; margin: 4em 10%; } - + .container { display: flex; flex-wrap: wrap; justify-content: center; } - + .card { box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2); transition: 0.3s; @@ -24,16 +28,16 @@ flex-grow: 1; max-width: 500px; } - + .card:hover { box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); } - + .content { line-height: 1.2em; padding: 0 16px; } - + .header { color:#ffffff; background-image: linear-gradient(225deg, #eb6562 0%, #E53935 100%); @@ -46,11 +50,11 @@

Pion WebRTC examples

-
+
{{range .}}
-

{{ .Title }}

+

{{ .Title }}

{{ .Description }}

diff --git a/internal/gstreamer-sink/gst.c b/internal/gstreamer-sink/gst.c index 322c507f..8c6a0b73 100644 --- a/internal/gstreamer-sink/gst.c +++ b/internal/gstreamer-sink/gst.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + #include "gst.h" #include diff --git a/internal/gstreamer-sink/gst.go b/internal/gstreamer-sink/gst.go index d5c9e342..86b56a6c 100644 --- a/internal/gstreamer-sink/gst.go +++ b/internal/gstreamer-sink/gst.go @@ -1,3 +1,9 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + +//go:build !js +// +build !js + // Package gst provides an easy API to create an appsrc pipeline package gst diff --git a/internal/gstreamer-sink/gst.h b/internal/gstreamer-sink/gst.h index 35a14f85..7e5c5e79 100644 --- a/internal/gstreamer-sink/gst.h +++ b/internal/gstreamer-sink/gst.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + #ifndef GST_H #define GST_H diff --git a/internal/gstreamer-src/gst.c b/internal/gstreamer-src/gst.c index 64d4cfa5..369bf486 100644 --- a/internal/gstreamer-src/gst.c +++ b/internal/gstreamer-src/gst.c @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + #include "gst.h" #include diff --git a/internal/gstreamer-src/gst.go b/internal/gstreamer-src/gst.go index 1b76e50d..e6fc0bbd 100644 --- a/internal/gstreamer-src/gst.go +++ b/internal/gstreamer-src/gst.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + // Package gst provides an easy API to create an appsink pipeline package gst diff --git a/internal/gstreamer-src/gst.h b/internal/gstreamer-src/gst.h index dcdc6baf..ae15ee34 100644 --- a/internal/gstreamer-src/gst.h +++ b/internal/gstreamer-src/gst.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + #ifndef GST_H #define GST_H @@ -6,7 +9,8 @@ #include #include -extern void goHandlePipelineBuffer(void *buffer, int bufferLen, int samples, int pipelineId); +extern void goHandlePipelineBuffer(void *buffer, int bufferLen, int samples, + int pipelineId); GstElement *gstreamer_send_create_pipeline(char *pipeline); void gstreamer_send_start_pipeline(GstElement *pipeline, int pipelineId); diff --git a/internal/gstreamer-src/js.go b/internal/gstreamer-src/js.go new file mode 100644 index 00000000..d2e82eca --- /dev/null +++ b/internal/gstreamer-src/js.go @@ -0,0 +1,18 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + +//go:build js && wasm +// +build js,wasm + +package gst + +import "github.com/pion/webrtc/v3" + +type Pipeline struct{} + +func CreatePipeline(codecName string, tracks []*webrtc.TrackLocalStaticSample, pipelineSrc string) *Pipeline { + return &Pipeline{} +} + +func (p *Pipeline) Start() {} +func (p *Pipeline) Stop() {} diff --git a/internal/signal/http.go b/internal/signal/http.go index f024c2f0..aad9657a 100644 --- a/internal/signal/http.go +++ b/internal/signal/http.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package signal import ( diff --git a/internal/signal/signal.go b/internal/signal/signal.go index 67f6a57c..3c6bce94 100644 --- a/internal/signal/signal.go +++ b/internal/signal/signal.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + // Package signal contains helpers to exchange the SDP session // description between examples. package signal diff --git a/janus-gateway/streaming/main.go b/janus-gateway/streaming/main.go index 0894ff46..0292c132 100644 --- a/janus-gateway/streaming/main.go +++ b/janus-gateway/streaming/main.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package main import ( diff --git a/janus-gateway/video-room/main.go b/janus-gateway/video-room/main.go index e6ab4a39..ae322e66 100644 --- a/janus-gateway/video-room/main.go +++ b/janus-gateway/video-room/main.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package main import ( diff --git a/play-from-disk-h264/jsfiddle/demo.css b/play-from-disk-h264/jsfiddle/demo.css index 9e43d340..17524fc4 100644 --- a/play-from-disk-h264/jsfiddle/demo.css +++ b/play-from-disk-h264/jsfiddle/demo.css @@ -1,4 +1,9 @@ +/* + SPDX-FileCopyrightText: 2023 The Pion community + SPDX-License-Identifier: MIT +*/ + textarea { width: 500px; min-height: 75px; -} \ No newline at end of file +} diff --git a/play-from-disk-h264/jsfiddle/demo.details b/play-from-disk-h264/jsfiddle/demo.details index 271b5d68..75cd6c99 100644 --- a/play-from-disk-h264/jsfiddle/demo.details +++ b/play-from-disk-h264/jsfiddle/demo.details @@ -1,5 +1,8 @@ --- - name: play-from-disk-h264 - description: play-from-disk-h264 demonstrates how to send video to your browser from a file saved to disk. - authors: - - Sean DuBois +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +name: play-from-disk-h264 +description: play-from-disk-h264 demonstrates how to send video to your browser from a file saved to disk. +authors: + - Sean DuBois diff --git a/play-from-disk-h264/jsfiddle/demo.html b/play-from-disk-h264/jsfiddle/demo.html index 6dbbf255..8f26937e 100644 --- a/play-from-disk-h264/jsfiddle/demo.html +++ b/play-from-disk-h264/jsfiddle/demo.html @@ -1,3 +1,8 @@ + + Browser base64 Session Description

diff --git a/play-from-disk-h264/jsfiddle/demo.js b/play-from-disk-h264/jsfiddle/demo.js index c1531219..55e3f9bd 100644 --- a/play-from-disk-h264/jsfiddle/demo.js +++ b/play-from-disk-h264/jsfiddle/demo.js @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + /* eslint-env browser */ let pc = new RTCPeerConnection({ diff --git a/play-from-disk-h264/main.go b/play-from-disk-h264/main.go index a5756ad9..7f1cd23f 100644 --- a/play-from-disk-h264/main.go +++ b/play-from-disk-h264/main.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + //go:build !js // +build !js diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..f1bb98c6 --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>pion/renovate-config" + ] +} diff --git a/rtmp-to-webrtc/main.go b/rtmp-to-webrtc/main.go index d661aa0d..eefcb436 100644 --- a/rtmp-to-webrtc/main.go +++ b/rtmp-to-webrtc/main.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + //go:build !js // +build !js diff --git a/save-to-webm/jsfiddle/demo.css b/save-to-webm/jsfiddle/demo.css index 9e43d340..17524fc4 100644 --- a/save-to-webm/jsfiddle/demo.css +++ b/save-to-webm/jsfiddle/demo.css @@ -1,4 +1,9 @@ +/* + SPDX-FileCopyrightText: 2023 The Pion community + SPDX-License-Identifier: MIT +*/ + textarea { width: 500px; min-height: 75px; -} \ No newline at end of file +} diff --git a/save-to-webm/jsfiddle/demo.details b/save-to-webm/jsfiddle/demo.details index ebf86708..82ae0ef5 100644 --- a/save-to-webm/jsfiddle/demo.details +++ b/save-to-webm/jsfiddle/demo.details @@ -1,5 +1,8 @@ --- - name: save-to-webm - description: Example of using Pion WebRTC to save video to disk in an WebM container - authors: - - Sean DuBois +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +name: save-to-webm +description: Example of using Pion WebRTC to save video to disk in an WebM container +authors: + - Sean DuBois diff --git a/save-to-webm/jsfiddle/demo.html b/save-to-webm/jsfiddle/demo.html index cba0be07..84036858 100644 --- a/save-to-webm/jsfiddle/demo.html +++ b/save-to-webm/jsfiddle/demo.html @@ -1,3 +1,8 @@ + + Browser base64 Session Description

diff --git a/save-to-webm/jsfiddle/demo.js b/save-to-webm/jsfiddle/demo.js index f40aae86..8c671a03 100644 --- a/save-to-webm/jsfiddle/demo.js +++ b/save-to-webm/jsfiddle/demo.js @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + /* eslint-env browser */ let pc = new RTCPeerConnection({ diff --git a/save-to-webm/main.go b/save-to-webm/main.go index 08e24d12..a84f8838 100644 --- a/save-to-webm/main.go +++ b/save-to-webm/main.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package main import ( diff --git a/sfu-ws/flutter/lib/main.dart b/sfu-ws/flutter/lib/main.dart index 7c7855a8..5d127c5b 100644 --- a/sfu-ws/flutter/lib/main.dart +++ b/sfu-ws/flutter/lib/main.dart @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + import 'dart:async'; import 'dart:convert'; import 'package:flutter_webrtc/flutter_webrtc.dart'; diff --git a/sfu-ws/index.html b/sfu-ws/index.html index 48b498ee..ee062edd 100644 --- a/sfu-ws/index.html +++ b/sfu-ws/index.html @@ -1,5 +1,10 @@ + + diff --git a/sfu-ws/main.go b/sfu-ws/main.go index e173cc9c..6fcd2923 100644 --- a/sfu-ws/main.go +++ b/sfu-ws/main.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package main import ( diff --git a/sip-over-websocket-to-webrtc/main.go b/sip-over-websocket-to-webrtc/main.go index e7eca06e..bf67468c 100644 --- a/sip-over-websocket-to-webrtc/main.go +++ b/sip-over-websocket-to-webrtc/main.go @@ -1,10 +1,13 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package main import ( "flag" "fmt" - "github.com/pion/example-webrtc-applications/v3/sip-to-webrtc/softphone" + "github.com/pion/example-webrtc-applications/v3/sip-over-websocket-to-webrtc/softphone" "github.com/pion/sdp/v2" "github.com/pion/webrtc/v3" "github.com/pion/webrtc/v3/pkg/media/oggwriter" diff --git a/sip-over-websocket-to-webrtc/softphone/constants.go b/sip-over-websocket-to-webrtc/softphone/constants.go index 4e7419d0..dff2e7d0 100644 --- a/sip-over-websocket-to-webrtc/softphone/constants.go +++ b/sip-over-websocket-to-webrtc/softphone/constants.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package softphone var responseCodes = map[int]string{ diff --git a/sip-over-websocket-to-webrtc/softphone/inboundcall.go b/sip-over-websocket-to-webrtc/softphone/inboundcall.go index fa4bd877..4ce73312 100644 --- a/sip-over-websocket-to-webrtc/softphone/inboundcall.go +++ b/sip-over-websocket-to-webrtc/softphone/inboundcall.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package softphone import ( diff --git a/sip-over-websocket-to-webrtc/softphone/invite.go b/sip-over-websocket-to-webrtc/softphone/invite.go index 9fccbb8b..90a92121 100644 --- a/sip-over-websocket-to-webrtc/softphone/invite.go +++ b/sip-over-websocket-to-webrtc/softphone/invite.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package softphone import ( diff --git a/sip-over-websocket-to-webrtc/softphone/rcmessage.go b/sip-over-websocket-to-webrtc/softphone/rcmessage.go index c592fcc7..3bfdc6c9 100644 --- a/sip-over-websocket-to-webrtc/softphone/rcmessage.go +++ b/sip-over-websocket-to-webrtc/softphone/rcmessage.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package softphone import "encoding/xml" diff --git a/sip-over-websocket-to-webrtc/softphone/register.go b/sip-over-websocket-to-webrtc/softphone/register.go index 9a388c1d..68389374 100644 --- a/sip-over-websocket-to-webrtc/softphone/register.go +++ b/sip-over-websocket-to-webrtc/softphone/register.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package softphone import ( diff --git a/sip-over-websocket-to-webrtc/softphone/sipmessage.go b/sip-over-websocket-to-webrtc/softphone/sipmessage.go index 5b80f8a6..b717708f 100644 --- a/sip-over-websocket-to-webrtc/softphone/sipmessage.go +++ b/sip-over-websocket-to-webrtc/softphone/sipmessage.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package softphone import ( diff --git a/sip-over-websocket-to-webrtc/softphone/softphone.go b/sip-over-websocket-to-webrtc/softphone/softphone.go index 24b6050d..71537bf4 100644 --- a/sip-over-websocket-to-webrtc/softphone/softphone.go +++ b/sip-over-websocket-to-webrtc/softphone/softphone.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + // Package softphone provides abstractions for SIP over Websocket package softphone diff --git a/sip-over-websocket-to-webrtc/softphone/utils.go b/sip-over-websocket-to-webrtc/softphone/utils.go index 4220c1d9..620543c0 100644 --- a/sip-over-websocket-to-webrtc/softphone/utils.go +++ b/sip-over-websocket-to-webrtc/softphone/utils.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package softphone import ( diff --git a/snapshot/index.html b/snapshot/index.html index 4ca33bde..7c4a1974 100644 --- a/snapshot/index.html +++ b/snapshot/index.html @@ -1,4 +1,9 @@ + + snapshot diff --git a/snapshot/main.go b/snapshot/main.go index c9268df3..3d575946 100644 --- a/snapshot/main.go +++ b/snapshot/main.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package main import ( diff --git a/twitch/main.go b/twitch/main.go index 8e3d3ab7..bfbca29d 100644 --- a/twitch/main.go +++ b/twitch/main.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package main import ( diff --git a/unreal-pixel-streaming/main.go b/unreal-pixel-streaming/main.go index 71028513..b9cc7df4 100644 --- a/unreal-pixel-streaming/main.go +++ b/unreal-pixel-streaming/main.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2023 The Pion community +// SPDX-License-Identifier: MIT + package main import (