Changes of Revision 4

obs-backgroundremoval.changes Changed
x
 
1
@@ -1,4 +1,9 @@
2
 -------------------------------------------------------------------
3
+Sun Aug 27 16:29:34 UTC 2023 - Kaito Udagawa <umireon@gmail.com>
4
+
5
+1.1.5- 
6
+
7
+-------------------------------------------------------------------
8
 Mon Jun 26 17:51:23 UTC 2023 - Kaito Udagawa <umireon@gmail.com>
9
 
10
 Build only x86_64
11
obs-backgroundremoval.spec Changed
38
 
1
@@ -17,20 +17,20 @@
2
 
3
 
4
 Name:           obs-backgroundremoval
5
-Version:        1.0.3
6
+Version:        1.1.5
7
 Release:        0
8
 Summary:        OBS Plugin for Background Removal
9
 License:        GPL-2.0
10
 URL:            https://github.com/royshil/obs-backgroundremoval
11
 Source:         %{name}-%{version}.tar.gz
12
 Source1:        %{name}-rpmlintrc
13
-Source2:        opencv-4.7.0.tar.gz
14
+Source2:        opencv-linux-Release-4.8.0-1.tar.gz
15
 Source3:        onnxruntime-linux-x64-gpu-1.15.1.tgz
16
 BuildRequires:  cmake
17
 BuildRequires:  gcc-c++
18
 BuildRequires:  obs-studio
19
 BuildRequires:  cmake(libobs)
20
-Requires:       obs-studio >= 28.0.0
21
+Requires:       obs-studio >= 29.0.0
22
 ExclusiveArch:  x86_64
23
 
24
 %global __requires_exclude_from ^.*libonnxruntime.*$
25
@@ -42,9 +42,9 @@
26
 %autosetup
27
 
28
 %build
29
-%cmake -DLINUX_PORTABLE=OFF \
30
-  -DOPENCV_URL=%{SOURCE2} \
31
-  -DOPENCV_MD5=13e13244cb0cc6ec4f01eacd38d05d17 \
32
+%cmake \
33
+  -DCUSTOM_OPENCV_URL=%{SOURCE2} \
34
+  -DCUSTOM_OPENCV_HASH=MD5=7a668fbc3ac536812643c6b8c8f96be9 \
35
   -DCUSTOM_ONNXRUNTIME_URL=%{SOURCE3} \
36
   -DCUSTOM_ONNXRUNTIME_MD5=8d2f5ee9f449bdecb10a45715fe74c53
37
 %cmake_build
38
obs-backgroundremoval-1.0.3.tar.gz/.github/actions/build-plugin/action.yml Deleted
81
 
1
@@ -1,79 +0,0 @@
2
-name: 'Setup and build plugin'
3
-description: 'Builds the plugin for specified architecture and build config.'
4
-inputs:
5
-  target:
6
-    description: 'Build target for dependencies'
7
-    required: true
8
-  config:
9
-    description: 'Build configuration'
10
-    required: false
11
-    default: 'Release'
12
-  codesign:
13
-    description: 'Enable codesigning (macOS only)'
14
-    required: false
15
-    default: 'false'
16
-  codesignIdent:
17
-    description: 'Developer ID for application codesigning (macOS only)'
18
-    required: false
19
-    default: '-'
20
-  visualStudio:
21
-    description: 'Visual Studio version (Windows only)'
22
-    required: false
23
-    default: 'Visual Studio 16 2019'
24
-  workingDirectory:
25
-    description: 'Working directory for packaging'
26
-    required: false
27
-    default: ${{ github.workspace }}
28
-runs:
29
-  using: 'composite'
30
-  steps:
31
-    - name: Run macOS Build
32
-      if: ${{ runner.os == 'macOS' }}
33
-      shell: zsh {0}
34
-      env:
35
-        CODESIGN_IDENT: ${{ inputs.codesignIdent }}
36
-      run: |
37
-        set -e
38
-
39
-        build_args=(
40
-          -c ${{ inputs.config }}
41
-          -t macos-${{ inputs.target }}
42
-        )
43
-
44
-        if  '${{ inputs.codesign }}' == 'true'  build_args+=(-s)
45
-        if (( ${+CI} && ${+RUNNER_DEBUG} )) build_args+=(--debug)
46
-
47
-        ${{ inputs.workingDirectory }}/.github/scripts/build-macos.zsh ${build_args}
48
-
49
-    - name: Run Linux Build
50
-      if: ${{ runner.os == 'Linux' }}
51
-      shell: bash
52
-      run: |
53
-        build_args=(
54
-          -c ${{ inputs.config }}
55
-          -t linux-${{ inputs.target }}
56
-        )
57
-
58
-        if  -n "${CI}" && -n "${RUNNER_DEBUG}" ; then
59
-          build_args+=(--debug)
60
-        fi
61
-
62
-        ${{ inputs.workingDirectory }}/.github/scripts/build-linux.sh "${build_args@}"
63
-
64
-    - name: Run Windows Build
65
-      if: ${{ runner.os == 'Windows' }}
66
-      shell: pwsh
67
-      run: |
68
-        $BuildArgs = @{
69
-          Target = '${{ inputs.target }}'
70
-          Configuration = '${{ inputs.config }}'
71
-          CMakeGenerator = '${{ inputs.visualStudio }}'
72
-        }
73
-
74
-        if ( ( Test-Path env:CI ) -and ( Test-Path env:RUNNER_DEBUG ) ) {
75
-          $BuildArgs += @{
76
-            Debug = $true
77
-          }
78
-        }
79
-
80
-        ${{ inputs.workingDirectory }}/.github/scripts/Build-Windows.ps1 @BuildArgs
81
obs-backgroundremoval-1.0.3.tar.gz/.github/actions/package-plugin/action.yml Deleted
101
 
1
@@ -1,99 +0,0 @@
2
-name: 'Package plugin'
3
-description: 'Packages the plugin for specified architecture and build config.'
4
-inputs:
5
-  target:
6
-    description: 'Build target for dependencies'
7
-    required: true
8
-  config:
9
-    description: 'Build configuration'
10
-    required: false
11
-    default: 'Release'
12
-  codesign:
13
-    description: 'Enable codesigning (macOS only)'
14
-    required: false
15
-    default: 'false'
16
-  notarize:
17
-    description: 'Enable notarization (macOS only)'
18
-    required: false
19
-    default: 'false'
20
-  codesignIdent:
21
-    description: 'Developer ID for application codesigning (macOS only)'
22
-    required: false
23
-    default: '-'
24
-  installerIdent:
25
-    description: 'Developer ID for installer package codesigning (macOS only)'
26
-    required: false
27
-    default: ''
28
-  codesignUser:
29
-    description: 'Apple ID username for notarization (macOS only)'
30
-    required: false
31
-    default: ''
32
-  codesignPass:
33
-    description: 'Apple ID password for notarization (macOS only)'
34
-    required: false
35
-    default: ''
36
-  createInstaller:
37
-    description: 'Create InnoSetup installer (Windows only)'
38
-    required: false
39
-    default: 'false'
40
-  workingDirectory:
41
-    description: 'Working directory for packaging'
42
-    required: false
43
-    default: ${{ github.workspace }}
44
-runs:
45
-  using: 'composite'
46
-  steps:
47
-    - name: Run macOS packaging
48
-      if: ${{ runner.os == 'macOS' }}
49
-      shell: zsh {0}
50
-      env:
51
-        CODESIGN_IDENT: ${{ inputs.codesignIdent }}
52
-        CODESIGN_IDENT_INSTALLER: ${{ inputs.installerIdent }}
53
-        CODESIGN_IDENT_USER: ${{ inputs.codesignUser }}
54
-        CODESIGN_IDENT_PASS: ${{ inputs.codesignPass }}
55
-      run: |
56
-        package_args=(
57
-          -c ${{ inputs.config }}
58
-          -t macos-${{ inputs.target }}
59
-        )
60
-
61
-        if  '${{ inputs.codesign }}' == 'true'  package_args+=(-s)
62
-        if  '${{ inputs.notarize }}' == 'true'  package_args+=(-n)
63
-        if (( ${+CI} && ${+RUNNER_DEBUG} )) build_args+=(--debug)
64
-
65
-        ${{ inputs.workingDirectory }}/.github/scripts/package-macos.zsh ${package_args}
66
-
67
-    - name: Run Linux packaging
68
-      if: ${{ runner.os == 'Linux' }}
69
-      shell: bash
70
-      run: |
71
-        package_args=(
72
-          -c ${{ inputs.config }}
73
-          -t linux-${{ inputs.target }}
74
-        )
75
-        if  -n "${CI}" && -n "${RUNNER_DEBUG}" ; then
76
-          build_args+=(--debug)
77
-        fi
78
-
79
-        ${{ inputs.workingDirectory }}/.github/scripts/package-linux.sh "${package_args@}"
80
-
81
-    - name: Run Windows packaging
82
-      if: ${{ runner.os == 'Windows' }}
83
-      shell: pwsh
84
-      run: |
85
-        $PackageArgs = @{
86
-          Target = '${{ inputs.target }}'
87
-          Configuration = '${{ inputs.config }}'
88
-        }
89
-
90
-        if ( '${{ inputs.createInstaller }}' -eq 'true' ) {
91
-          $PackageArgs += @{BuildInstaller = $true}
92
-        }
93
-
94
-        if ( ( Test-Path env:CI ) -and ( Test-Path env:RUNNER_DEBUG ) ) {
95
-          $BuildArgs += @{
96
-            Debug = $true
97
-          }
98
-        }
99
-
100
-        ${{ inputs.workingDirectory }}/.github/scripts/Package-Windows.ps1 @PackageArgs
101
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/build-linux.sh Deleted
15
 
1
@@ -1,13 +0,0 @@
2
-#!/bin/sh
3
-
4
-if ! type zsh > /dev/null 2>&1; then
5
-    echo ' => Installing script dependency Zsh.'
6
-
7
-    sudo apt-get -y update
8
-    sudo apt-get -y install zsh
9
-fi
10
-
11
-SCRIPT=$(readlink -f "${0}")
12
-SCRIPT_DIR=$(dirname "${SCRIPT}")
13
-
14
-zsh ${SCRIPT_DIR}/build-linux.zsh "${@}"
15
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/build-linux.zsh Deleted
2
 
1
-(symlink to .build.zsh)
2
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/build-macos.zsh Deleted
2
 
1
-(symlink to .build.zsh)
2
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/check-changes.sh Deleted
14
 
1
@@ -1,11 +0,0 @@
2
-#!/bin/bash
3
-dirty=$(git ls-files --modified)
4
-
5
-set +x
6
-if  $dirty ; then
7
-   echo "================================="
8
-    echo "Files were not formatted properly"
9
-    echo "$dirty"
10
-    echo "================================="
11
-    exit 1
12
-fi
13
\ No newline at end of file
14
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/check-cmake.sh Deleted
55
 
1
@@ -1,53 +0,0 @@
2
-#!/usr/bin/env bash
3
-
4
-set -o errexit
5
-set -o pipefail
6
-
7
-if  ${#} -eq 1 -a "${1}" = "VERBOSE" ; then
8
-    VERBOSITY="-l debug"
9
-else
10
-    VERBOSITY=""
11
-fi
12
-
13
-if  "${CI}" ; then
14
-    MODE="--check"
15
-else
16
-    MODE="-i"
17
-fi
18
-
19
-# Runs the formatter in parallel on the code base.
20
-# Return codes:
21
-#  - 1 there are files to be formatted
22
-#  - 0 everything looks fine
23
-
24
-# Get CPU count
25
-OS=$(uname)
26
-NPROC=1
27
-if  ${OS} = "Linux"  ; then
28
-    NPROC=$(nproc)
29
-elif  ${OS} = "Darwin"  ; then
30
-    NPROC=$(sysctl -n hw.physicalcpu)
31
-fi
32
-
33
-# Discover clang-format
34
-if ! type cmake-format 2> /dev/null ; then
35
-    echo "Required cmake-format not found"
36
-    exit 1
37
-fi
38
-
39
-find . -type d \( \
40
-    -path ./\*build\* -o \
41
-    -path ./release -o \
42
-    -path ./deps/jansson -o \
43
-    -path ./plugins/decklink/\*/decklink-sdk -o \
44
-    -path ./plugins/enc-amf -o \
45
-    -path ./plugins/mac-syphon/syphon-framework -o \
46
-    -path ./plugins/obs-outputs/ftl-sdk -o \
47
-    -path ./plugins/obs-vst -o \
48
-    -path ./plugins/obs-browser -o \
49
-    -path ./plugins/win-dshow/libdshowcapture -o \
50
-    -path ./plugins/obs-websocket/deps \
51
-\) -prune -false -type f -o \
52
-    -name 'CMakeLists.txt' -or \
53
-    -name '*.cmake' \
54
- | xargs -L10 -P ${NPROC} cmake-format ${MODE} ${VERBOSITY}
55
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/check-format.sh Deleted
62
 
1
@@ -1,60 +0,0 @@
2
-#!/usr/bin/env bash
3
-# Original source https://github.com/Project-OSRM/osrm-backend/blob/master/scripts/format.sh
4
-
5
-set -o errexit
6
-set -o pipefail
7
-set -o nounset
8
-
9
-if  ${#} -eq 1 ; then
10
-    VERBOSITY="--verbose"
11
-else
12
-    VERBOSITY=""
13
-fi
14
-
15
-# Runs the Clang Formatter in parallel on the code base.
16
-# Return codes:
17
-#  - 1 there are files to be formatted
18
-#  - 0 everything looks fine
19
-
20
-# Get CPU count
21
-OS=$(uname)
22
-NPROC=1
23
-if  ${OS} = "Linux"  ; then
24
-    NPROC=$(nproc)
25
-elif  ${OS} = "Darwin"  ; then
26
-    NPROC=$(sysctl -n hw.physicalcpu)
27
-fi
28
-
29
-# Discover clang-format
30
-if type clang-format-13 2> /dev/null ; then
31
-    CLANG_FORMAT=clang-format-13
32
-elif type clang-format 2> /dev/null ; then
33
-    # Clang format found, but need to check version
34
-    CLANG_FORMAT=clang-format
35
-    V=$(clang-format --version)
36
-    if  $V != *"version 13.0"* ; then
37
-        echo "clang-format is not 13.0 (returned ${V})"
38
-        exit 1
39
-    fi
40
-else
41
-    echo "No appropriate clang-format found (expected clang-format-13.0.0, or clang-format)"
42
-    exit 1
43
-fi
44
-
45
-find . -type d \( \
46
-    -path ./\*build\* -o \
47
-    -path ./release -o \
48
-    -path ./cmake -o \
49
-    -path ./plugins/decklink/\*/decklink-sdk -o \
50
-    -path ./plugins/enc-amf -o \
51
-    -path ./plugins/mac-syphon/syphon-framework -o \
52
-    -path ./plugins/obs-outputs/ftl-sdk -o \
53
-    -path ./plugins/obs-websocket/deps \
54
-\) -prune -false -type f -o \
55
-    -name '*.h' -or \
56
-    -name '*.hpp' -or \
57
-    -name '*.m' -or \
58
-    -name '*.mm' -or \
59
-    -name '*.c' -or \
60
-    -name '*.cpp' \
61
- | xargs -L100 -P ${NPROC} "${CLANG_FORMAT}" ${VERBOSITY} -i -style=file -fallback-style=none
62
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/package-linux.sh Deleted
15
 
1
@@ -1,13 +0,0 @@
2
-#!/bin/sh
3
-
4
-if ! type zsh > /dev/null 2>&1; then
5
-    echo ' => Installing script dependency Zsh.'
6
-
7
-    sudo apt-get update
8
-    sudo apt-get install zsh
9
-fi
10
-
11
-SCRIPT=$(readlink -f "${0}")
12
-SCRIPT_DIR=$(dirname "${SCRIPT}")
13
-
14
-zsh ${SCRIPT_DIR}/package-linux.zsh "${@}"
15
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/package-linux.zsh Deleted
2
 
1
-(symlink to .package.zsh)
2
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/package-macos.zsh Deleted
2
 
1
-(symlink to .package.zsh)
2
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.pwsh/Check-Git.ps1 Deleted
27
 
1
@@ -1,25 +0,0 @@
2
-function Check-Git {
3
-    <#
4
-        .SYNOPSIS
5
-            Ensures available git executable on host system.
6
-        .DESCRIPTION
7
-            Checks whether a git command is available on the host system. If none is found,
8
-            Git is installed via winget.
9
-        .EXAMPLE
10
-            Check-Git
11
-    #>
12
-
13
-    if ( ! ( Test-Path function:Log-Info ) ) {
14
-        . $PSScriptRoot/Logger.ps1
15
-    }
16
-
17
-    Log-Information 'Checking for Git executable...'
18
-
19
-    if ( ! ( Get-Command git ) ) {
20
-        Log-Warning 'No Git executable found. Will try to install via winget.'
21
-        winget install git
22
-    } else {
23
-        Log-Debug "Git found at $(Get-Command git)."
24
-        Log-Status "Git found."
25
-    }
26
-}
27
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.pwsh/Invoke-GitCheckout.ps1 Deleted
119
 
1
@@ -1,117 +0,0 @@
2
-function Set-GitConfig {
3
-    <#
4
-        .SYNOPSIS
5
-            Sets a git config value.
6
-        .DESCRIPTION
7
-            Allows setting single or multiple config values in a PowerShell-friendly fashion.
8
-        .EXAMPLE
9
-            Set-GitConfig advice.detachedHead false
10
-    #>
11
-
12
-    if ( $args.Count -lt 2 ) {
13
-        throw 'Set-GitConfig called without required arguments <OPTION> <VALUE>.'
14
-    }
15
-
16
-    Invoke-External git config @args
17
-}
18
-
19
-function Invoke-GitCheckout {
20
-    <#
21
-        .SYNOPSIS
22
-            Checks out a specified git repository.
23
-        .DESCRIPTION
24
-            Wraps the git executable with PowerShell syntax to check out
25
-            a specified Git repository with a given commit hash and branch,
26
-            or a GitHub pull request ID.
27
-        .EXAMPLE
28
-            Invoke-GitCheckout -Uri "My-Repo-Uri" -Commit "My-Commit-Hash"
29
-            Invoke-GitCheckout -Uri "My-Repo-Uri" -Commit "My-Commit-Hash" -Branch "main"
30
-            Invoke-GitCheckout -Uri "My-Repo-Uri" -Commit "My-Commit-Hash" -PullRequest 250
31
-    #>
32
-
33
-    param(
34
-        Parameter(Mandatory)
35
-        string $Uri,
36
-        Parameter(Mandatory)
37
-        string $Commit,
38
-        string $Path,
39
-        string $Branch = "master",
40
-        string $PullRequest
41
-    )
42
-
43
-    if ( ! ( $Uri -like "*github.com*" ) -and ( $PullRequest -ne "" ) ) {
44
-        throw 'Fetching pull requests is only supported with GitHub-based repositories.'
45
-    }
46
-
47
-    if ( ! ( Test-Path function:Log-Information ) ) {
48
-        . $PSScriptRoot/Logger.ps1
49
-    }
50
-
51
-    if ( ! ( Test-Path function:Invoke-External ) ) {
52
-        . $PSScriptRoot/Invoke-External.ps1
53
-    }
54
-
55
-    $RepositoryName = System.IO.Path::GetFileNameWithoutExtension($Uri)
56
-
57
-    if ( $Path -eq "" ) {
58
-        $Path = "$(Get-Location | Convert-Path)\${RepositoryName}"
59
-    }
60
-
61
-    Push-Location -Stack GitCheckoutTemp
62
-
63
-    if ( Test-Path $Path/.git ) {
64
-        Write-Information "Repository ${RepositoryName} found in ${Path}"
65
-
66
-        Set-Location $Path
67
-
68
-        Set-GitConfig advice.detachedHead false
69
-        Set-GitConfig remote.origin.url $Uri
70
-        Set-GitConfig remote.origin.tapOpt --no-tags
71
-
72
-        $Ref = "+refs/heads/{0}:refs/remotes/origin/{0}" -f $Branch
73
-
74
-        Set-GitConfig --replace-all remote.origin.fetch $Ref
75
-
76
-        if ( $PullRequest -ne "" ) {
77
-            try {
78
-                Invoke-External git show-ref --quiet --verify refs/heads/pr-$PullRequest
79
-            } catch {
80
-                Invoke-External git fetch origin $("pull/{0}/head:pull-{0}" -f $PullRequest)
81
-            } finally {
82
-                Invoke-External git checkout -f "pull-${PullRequest}"
83
-            }
84
-        }
85
-
86
-        try {
87
-            $null = Invoke-External git rev-parse -q --verify "${Commit}^{commit}"
88
-        } catch {
89
-            Invoke-External git fetch origin
90
-        }
91
-
92
-        Invoke-External git checkout -f $Commit -- | Log-Information
93
-    } else {
94
-        Invoke-External git clone $Uri $Path
95
-
96
-        Set-Location $Path
97
-
98
-        Set-GitConfig advice.detachedHead false
99
-
100
-        if ( $PullRequest -ne "" ) {
101
-            $Ref = "pull/{0}/head:pull-{0}" -f $PullRequest
102
-            $Branch = "pull-${PullRequest}"
103
-            Invoke-External git fetch origin $Ref
104
-            Invoke-External git checkout $Branch
105
-        }
106
-
107
-        Invoke-External git checkout -f $Commit
108
-    }
109
-
110
-    Log-Information "Checked out commit ${Commit} on branch ${Branch}"
111
-
112
-    if ( Test-Path ${Path}/.gitmodules ) {
113
-        Invoke-External git submodule foreach --recursive git submodule sync
114
-        Invoke-External git submodule update --init --recursive
115
-    }
116
-
117
-    Pop-Location -Stack GitCheckoutTemp
118
-}
119
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.pwsh/Setup-Host.ps1 Deleted
105
 
1
@@ -1,103 +0,0 @@
2
-function Setup-Host {
3
-    if ( ! ( Test-Path function:Log-Output ) ) {
4
-        . $PSScriptRoot/Logger.ps1
5
-    }
6
-
7
-    if ( ! ( Test-Path function:Ensure-Location ) ) {
8
-        . $PSScriptRoot/Ensure-Location.ps1
9
-    }
10
-
11
-    if ( ! ( Test-Path function:Install-BuildDependencies ) ) {
12
-        . $PSScriptRoot/Install-BuildDependencies.ps1
13
-    }
14
-
15
-    if ( ! ( Test-Path function:Expand-ArchiveExt ) ) {
16
-        . $PSScriptRoot/Expand-ArchiveExt.ps1
17
-    }
18
-
19
-    Install-BuildDependencies -WingetFile "${ScriptHome}/.Wingetfile"
20
-
21
-    if ( $script:Target -eq '' ) { $script:Target = $script:HostArchitecture }
22
-
23
-    $script:QtVersion = $BuildSpec.platformConfig."windows-${script:Target}".qtVersion
24
-    $script:VisualStudioVersion = $BuildSpec.platformConfig."windows-${script:Target}".visualStudio
25
-    $script:PlatformSDK = $BuildSpec.platformConfig."windows-${script:Target}".platformSDK
26
-
27
-    if ( ! ( ( $script:SkipAll ) -or ( $script:SkipDeps ) ) ) {
28
-        ('prebuilt', "qt${script:QtVersion}") | ForEach-Object {
29
-            $_Dependency = $_
30
-            $_Version = $BuildSpec.dependencies."${_Dependency}".version
31
-            $_BaseUrl = $BuildSpec.dependencies."${_Dependency}".baseUrl
32
-            $_Label = $BuildSpec.dependencies."${_Dependency}".label
33
-            $_Hash = $BuildSpec.dependencies."${_Dependency}".hashes."windows-${script:Target}"
34
-
35
-            if ( $BuildSpec.dependencies."${_Dependency}".PSobject.Properties.Name -contains "pdb-hashes" ) {
36
-                $_PdbHash = $BuildSpec.dependencies."${_Dependency}".'pdb-hashes'."$windows-${script:Target}"
37
-            }
38
-
39
-            if ( $_Version -eq '' ) {
40
-                throw "No ${_Dependency} spec found in ${script:BuildSpecFile}."
41
-            }
42
-
43
-            Log-Information "Setting up ${_Label}..."
44
-
45
-            Push-Location -Stack BuildTemp
46
-            Ensure-Location -Path "$(Resolve-Path -Path "${ProjectRoot}/..")/obs-build-dependencies"
47
-
48
-            switch -wildcard ( $_Dependency ) {
49
-                prebuilt {
50
-                    $_Filename = "windows-deps-${_Version}-${script:Target}.zip"
51
-                    $_Uri = "${_BaseUrl}/${_Version}/${_Filename}"
52
-                    $_Target = "plugin-deps-${_Version}-qt${script:QtVersion}-${script:Target}"
53
-                    $script:DepsVersion = ${_Version}
54
-                }
55
-                "qt*" {
56
-                    $_Filename = "windows-deps-qt${script:QtVersion}-${_Version}-${script:Target}.zip"
57
-                    $_Uri = "${_BaseUrl}/${_Version}/${_Filename}"
58
-                    $_Target = "plugin-deps-${_Version}-qt${script:QtVersion}-${script:Target}"
59
-                }
60
-            }
61
-
62
-            if ( ! ( Test-Path -Path $_Filename ) ) {
63
-                $Params = @{
64
-                    UserAgent = 'NativeHost'
65
-                    Uri = $_Uri
66
-                    OutFile = $_Filename
67
-                    UseBasicParsing = $true
68
-                    ErrorAction = 'Stop'
69
-                }
70
-
71
-                Invoke-WebRequest @Params
72
-                Log-Status "Downloaded ${_Label} for ${script:Target}."
73
-            } else {
74
-                Log-Status "Found downloaded ${_Label}."
75
-            }
76
-
77
-            $_FileHash = Get-FileHash -Path $_Filename -Algorithm SHA256
78
-
79
-            if ( $_FileHash.Hash.ToLower() -ne $_Hash ) {
80
-                throw "Checksum of downloaded ${_Label} does not match specification. Expected '${_Hash}', 'found $(${_FileHash}.Hash.ToLower())'"
81
-            }
82
-            Log-Status "Checksum of downloaded ${_Label} matches."
83
-
84
-            if ( ! ( ( $script:SkipAll ) -or ( $script:SkipUnpack ) ) ) {
85
-                Push-Location -Stack BuildTemp
86
-                Ensure-Location -Path $_Target
87
-
88
-                Expand-ArchiveExt -Path "../${_Filename}" -DestinationPath . -Force
89
-
90
-                Pop-Location -Stack BuildTemp
91
-            }
92
-            Pop-Location -Stack BuildTemp
93
-        }
94
-    }
95
-}
96
-
97
-function Get-HostArchitecture {
98
-    $Host64Bit = System.Environment::Is64BitOperatingSystem
99
-    $HostArchitecture = ('x86', 'x64')$Host64Bit
100
-
101
-    return $HostArchitecture
102
-}
103
-
104
-$script:HostArchitecture = Get-HostArchitecture
105
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.pwsh/Setup-Obs.ps1 Deleted
86
 
1
@@ -1,84 +0,0 @@
2
-function Setup-Obs {
3
-    if ( ! ( Test-Path function:Log-Output ) ) {
4
-        . $PSScriptRoot/Logger.ps1
5
-    }
6
-
7
-    if ( ! ( Test-Path function:Check-Git ) ) {
8
-        . $PSScriptRoot/Check-Git.ps1
9
-    }
10
-
11
-    Check-Git
12
-
13
-    if ( ! ( Test-Path function:Ensure-Location ) ) {
14
-        . $PSScriptRoot/Ensure-Location.ps1
15
-    }
16
-
17
-    if ( ! ( Test-Path function:Invoke-GitCheckout ) ) {
18
-        . $PSScriptRoot/Invoke-GitCheckout.ps1
19
-    }
20
-
21
-    if ( ! ( Test-Path function:Invoke-External ) ) {
22
-        . $PSScriptRoot/Invoke-External.ps1
23
-    }
24
-
25
-    Log-Information 'Setting up OBS Studio...'
26
-
27
-    $ObsVersion = $BuildSpec.dependencies.'obs-studio'.version
28
-    $ObsRepository = $BuildSpec.dependencies.'obs-studio'.repository
29
-    $ObsBranch = $BuildSpec.dependencies.'obs-studio'.branch
30
-    $ObsHash = $BuildSpec.dependencies.'obs-studio'.hash
31
-
32
-    if ( $ObsVersion -eq '' ) {
33
-        throw 'No obs-studio version found in buildspec.json.'
34
-    }
35
-
36
-    Push-Location -Stack BuildTemp
37
-    Ensure-Location -Path "$(Resolve-Path -Path "${ProjectRoot}/../")/obs-studio"
38
-
39
-    if ( ! ( ( $script:SkipAll ) -or ( $script:SkipUnpack ) ) ) {
40
-        Invoke-GitCheckout -Uri $ObsRepository -Commit $ObsHash -Path . -Branch $ObsBranch
41
-    }
42
-
43
-    if ( ! ( ( $script:SkipAll ) -or ( $script:SkipBuild ) ) ) {
44
-        Log-Information 'Configuring OBS Studio...'
45
-
46
-        $NumProcessors = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
47
-
48
-        if ( $NumProcessors -gt 1 ) {
49
-            $env:UseMultiToolTask = $true
50
-            $env:EnforceProcessCountAcrossBuilds = $true
51
-        }
52
-
53
-        $DepsPath = "plugin-deps-${script:DepsVersion}-qt${script:QtVersion}-${script:Target}"
54
-
55
-        $CmakeArgs = @(
56
-            '-G', $CmakeGenerator
57
-            "-DCMAKE_SYSTEM_VERSION=${script:PlatformSDK}"
58
-            "-DCMAKE_GENERATOR_PLATFORM=$(if (${script:Target} -eq "x86") { "Win32" } else { "x64" })"
59
-            "-DCMAKE_BUILD_TYPE=${script:Configuration}"
60
-            "-DQT_VERSION=${script:QtVersion}"
61
-            '-DENABLE_PLUGINS=OFF'
62
-            '-DENABLE_UI=OFF'
63
-            '-DENABLE_SCRIPTING=OFF'
64
-            "-DCMAKE_INSTALL_PREFIX:PATH=$(Resolve-Path -Path "${ProjectRoot}/../obs-build-dependencies/${DepsPath}")"
65
-            "-DCMAKE_PREFIX_PATH:PATH=$(Resolve-Path -Path "${ProjectRoot}/../obs-build-dependencies/${DepsPath}")"
66
-        )
67
-
68
-        Log-Debug "Attempting to configure OBS with CMake arguments: $($CmakeArgs | Out-String)"
69
-        Log-Information "Configuring OBS..."
70
-        Invoke-External cmake -S . -B plugin_build_${script:Target} @CmakeArgs
71
-
72
-        Log-Information 'Building libobs and obs-frontend-api...'
73
-        $CmakeArgs = @(
74
-            '--config', "$( if ( $script:Configuration -eq '' ) { 'RelWithDebInfo' } else { $script:Configuration })"
75
-        )
76
-
77
-        if ( $VerbosePreference -eq 'Continue' ) {
78
-            $CmakeArgs+=('--verbose')
79
-        }
80
-
81
-        Invoke-External cmake --build plugin_build_${script:Target} @CmakeArgs -t obs-frontend-api
82
-        Invoke-External cmake --install plugin_build_${script:Target} @CmakeArgs --component obs_libraries
83
-    }
84
-    Pop-Location -Stack BuildTemp
85
-}
86
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.zsh/setup_macos Deleted
129
 
1
@@ -1,127 +0,0 @@
2
-autoload -Uz log_error log_status log_info mkcd
3
-
4
-if (( ! ${+commandscurl} )) {
5
-  log_error 'curl not found. Please install curl.'
6
-  return 2
7
-}
8
-
9
-if (( ! ${+commandsjq} )) {
10
-  log_error 'jq not found. Please install jq.'
11
-  return 2
12
-}
13
-
14
-if (( ! ${+project_root} )) {
15
-  log_error "'project_root' not set. Please set before running ${0}."
16
-  return 2
17
-}
18
-
19
-if (( ! ${+target} )) {
20
-  log_error "'target' not set. Please set before running ${0}."
21
-  return 2
22
-}
23
-
24
-local -a curl_opts=()
25
-if (( ! ${+CI} )) {
26
-    curl_opts+=(--progress-bar)
27
-} else {
28
-    curl_opts+=(--show-error --silent)
29
-}
30
-curl_opts+=(--location -O ${@})
31
-
32
-pushd ${project_root}
33
-
34
-local _qt_version
35
-local _deployment_target
36
-read -r _qt_version _deployment_target <<< \
37
-  "$(jq -r --arg target "${target}" \
38
-    '.platformConfig$target | { qtVersion, deploymentTarget } | join (" ")' \
39
-    ${buildspec_file})"
40
-
41
-typeset -g QT_VERSION=${_qt_version}
42
-typeset -g DEPLOYMENT_TARGET=${_deployment_target}
43
-
44
-if (( ! (${skips(Ie)all}  + ${skips(Ie)deps}) )) {
45
-  mkdir -p ${project_root:h}/obs-build-dependencies
46
-
47
-  local dependency
48
-  local deps_version
49
-  local deps_baseurl
50
-  local deps_label
51
-  local deps_hash
52
-  local _filename
53
-  local _url
54
-  local _target
55
-  local artifact_checksum
56
-
57
-  for dependency ('prebuilt' "qt${QT_VERSION}") {
58
-    IFS=';' read -r deps_version deps_baseurl deps_label deps_hash <<< \
59
-      "$(jq -r --arg dependency "${dependency}" --arg target "${target}" \
60
-        '.dependencies$dependency | {version, baseUrl, "label", "hash": .hashes$target} | join(";")' \
61
-        ${buildspec_file})"
62
-
63
-    if  -z "${deps_version}"  {
64
-      log_error "No ${dependency} spec found in ${buildspec_file}."
65
-      return 2
66
-    }
67
-    log_info "Setting up ${deps_label}..."
68
-
69
-    pushd ${project_root:h}/obs-build-dependencies
70
-
71
-    case ${dependency} {
72
-      prebuilt)
73
-        _filename="macos-deps-${deps_version}-${target##*-}.tar.xz"
74
-        _url="${deps_baseurl}/${deps_version}/${_filename}"
75
-        _target="plugin-deps-${deps_version}-qt${QT_VERSION}-${target##*-}"
76
-        typeset -g OBS_DEPS_VERSION=${deps_version}
77
-        ;;
78
-      qt*)
79
-        if (( ${+CI} )) {
80
-          _filename="macos-deps-qt${QT_VERSION}-${deps_version}-universal.tar.xz"
81
-          deps_hash="$(jq -r --arg dependency "${dependency}" \
82
-            '.dependencies$dependency.hashes"macos-universal"' \
83
-            ${buildspec_file})"
84
-        } else {
85
-          _filename="macos-deps-qt${QT_VERSION}-${deps_version}-${target##*-}.tar.xz"
86
-        }
87
-        _url="${deps_baseurl}/${deps_version}/${_filename}"
88
-        _target="plugin-deps-${deps_version}-qt${QT_VERSION}-${target##*-}"
89
-        ;;
90
-    }
91
-
92
-    if  ! -f ${_filename}  {
93
-      log_debug "Running curl ${curl_opts} ${_url}"
94
-      curl ${curl_opts} ${_url} && \
95
-      log_status "Downloaded ${deps_label} for ${target}."
96
-    } else {
97
-      log_status "Found downloaded ${deps_label}"
98
-    }
99
-
100
-    read -r artifact_checksum _ <<< "$(sha256sum ${_filename})"
101
-    if  ${deps_hash} != ${artifact_checksum}  {
102
-      log_error "Checksum of downloaded ${deps_label} does not match specification.
103
-  Expected : ${deps_hash}
104
-  Actual   : ${artifact_checksum}"
105
-      return 2
106
-    }
107
-    log_status "Checksum of downloaded ${deps_label} matches."
108
-
109
-    if (( ! (${skips(Ie)all} + ${skips(Ie)unpack}) )) {
110
-      mkdir -p ${_target} && pushd ${_target}
111
-
112
-      XZ_OPT=-T0 tar -xzf ../${_filename} && log_status "${deps_label} extracted."
113
-      popd
114
-    }
115
-  }
116
-
117
-  popd
118
-  pushd ${project_root:h}/obs-build-dependencies
119
-  xattr -r -d com.apple.quarantine *
120
-  log_status 'Removed quarantine flag from downloaded dependencies...'
121
-  popd
122
-} else {
123
-  local deps_version
124
-  read -r deps_version <<< \
125
-    "$(jq -r '.dependencies.prebuilt.version' ${buildspec_file})"
126
-
127
-  typeset -g OBS_DEPS_VERSION=${deps_version}
128
-}
129
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.zsh/setup_obs Deleted
124
 
1
@@ -1,122 +0,0 @@
2
-autoload -Uz log_error log_info log_status
3
-
4
-if (( ! ${+buildspec_file} )) {
5
-  log_error "'buildspec_file' not set. Please set before running ${0}."
6
-  return 2
7
-}
8
-
9
-if (( ! ${+commandsgit} )) {
10
-  log_error 'git not found. Please install git.'
11
-  return 2
12
-}
13
-
14
-if (( ! ${+commandsjq} )) {
15
-  log_error 'jq not found. Please install jq.'
16
-  return 2
17
-}
18
-
19
-if (( ! ${+project_root} )) {
20
-  log_error "'project_root' not set. Please set before running ${0}."
21
-  return 2
22
-}
23
-
24
-if (( ! ${+target} )) {
25
-  log_error "'target' not set. Please set before running ${0}."
26
-  return 2
27
-}
28
-
29
-log_info 'Setting up OBS-Studio...'
30
-
31
-local obs_version
32
-local obs_repo
33
-local obs_branch
34
-local obs_hash
35
-
36
-read -r obs_version obs_repo obs_branch obs_hash <<< \
37
-  "$(jq -r --arg key "obs-studio" \
38
-     '.dependencies$key | {version, repository, branch, hash} | join(" ")' \
39
-     ${buildspec_file})"
40
-
41
-if  -z ${obs_version}  {
42
-  log_error "No obs-studio version found in buildspec.json"
43
-  return 2
44
-}
45
-
46
-pushd
47
-mkcd ${project_root:h}/obs-studio
48
-
49
-if (( ! (${skips(Ie)all} + ${skips(Ie)unpack}) )) {
50
-  if  -d .git  {
51
-    git config advice.detachedHead false
52
-    git config remote.pluginbuild.url "${obs_repo:-https://github.com/obsproject/obs-studio.git}"
53
-    git config remote.pluginbuild.fetch "+refs/heads/${obs_branch:-master}:refs/remotes/origin/${obs_branch:-master}"
54
-
55
-    git rev-parse -q --verify "${obs_hash}^{commit}" > /dev/null || git fetch pluginbuild
56
-    git checkout ${obs_branch:-master} -B ${product_name}
57
-    git reset --hard "${obs_hash}"
58
-    log_status 'Found existing obs-studio repository.'
59
-  } else {
60
-    git clone "${obs_repo:-https://github.com/obsproject/obs-studio.git}" "${PWD}"
61
-    git config advice.detachedHead false
62
-    git checkout -f "${obs_hash}" --
63
-    git checkout ${obs_branch:-master} -b ${product_name}
64
-    log_status 'obs-studio checked out.'
65
-  }
66
-
67
-  git submodule foreach --recursive git submodule sync
68
-  git submodule update --init --recursive
69
-}
70
-
71
-if (( ! (${skips(Ie)all} + ${skips(Ie)build}) )) {
72
-  log_info 'Configuring obs-studio...'
73
-
74
-  local -a cmake_args=(
75
-    -DCMAKE_BUILD_TYPE=${BUILD_CONFIG:-Release}
76
-    -DQT_VERSION=${QT_VERSION}
77
-    -DENABLE_PLUGINS=OFF
78
-    -DENABLE_UI=OFF
79
-    -DENABLE_SCRIPTING=OFF
80
-    -DCMAKE_INSTALL_PREFIX="${project_root:h}/obs-build-dependencies/plugin-deps-${OBS_DEPS_VERSION}-qt${QT_VERSION}-${target##*-}"
81
-    -DCMAKE_PREFIX_PATH="${project_root:h}/obs-build-dependencies/plugin-deps-${OBS_DEPS_VERSION}-qt${QT_VERSION}-${target##*-}"
82
-  )
83
-
84
-  if (( _loglevel == 0 )) cmake_args+=(-Wno_deprecated -Wno-dev --log-level=ERROR)
85
-  if (( _loglevel > 2 )) cmake_args+=(--debug-output)
86
-
87
-  local num_procs
88
-
89
-  case ${target} {
90
-    macos-*)
91
-      autoload -Uz read_codesign
92
-      if (( ${+CODESIGN} )) {
93
-        read_codesign
94
-      }
95
-
96
-      cmake_args+=(
97
-        -DCMAKE_OSX_ARCHITECTURES=${${target##*-}//universal/x86_64;arm64}
98
-        -DCMAKE_OSX_DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET:-10.15}
99
-        -DOBS_CODESIGN_LINKER=ON
100
-        -DOBS_BUNDLE_CODESIGN_IDENTITY="${CODESIGN_IDENT:--}"
101
-      )
102
-      num_procs=$(( $(sysctl -n hw.ncpu) + 1 ))
103
-      ;;
104
-    linux-*)
105
-      cmake_args+=(
106
-        -DENABLE_PIPEWIRE=OFF
107
-      )
108
-      num_procs=$(( $(nproc) + 1 ))
109
-      ;;
110
-  }
111
-
112
-  log_debug "Attempting to configure OBS with CMake arguments: ${cmake_args}"
113
-  cmake -S . -B plugin_build_${target##*-} -G ${generator} ${cmake_args}
114
-
115
-  log_info 'Building libobs and obs-frontend-api...'
116
-  local -a cmake_args=()
117
-  if (( _loglevel > 1 )) cmake_args+=(--verbose)
118
-  if  ${generator} == 'Unix Makefiles'  cmake_args+=(--parallel ${num_procs})
119
-  cmake --build plugin_build_${target##*-} --config ${BUILD_CONFIG:-Release} ${cmake_args} -t obs-frontend-api
120
-  cmake --install plugin_build_${target##*-} --config ${BUILD_CONFIG:-Release} --component obs_libraries ${cmake_args}
121
-}
122
-
123
-popd
124
obs-backgroundremoval-1.0.3.tar.gz/.github/workflows/docker.yml Deleted
28
 
1
@@ -1,26 +0,0 @@
2
-name: "Docker Build"
3
-
4
-on:
5
-  push:
6
-    branches:
7
-      - "main"
8
-  pull_request:
9
-    branches:
10
-      - "main"
11
-
12
-jobs:
13
-  ArchLinux:
14
-    runs-on: "ubuntu-latest"
15
-    container:
16
-      image: "archlinux:base-devel"
17
-    steps:
18
-      - name: "Create an user"
19
-        run: "useradd -m user"
20
-      - uses: "actions/checkout@v3"
21
-      - name: "Chown files"
22
-        run: "chown -R user:user ."
23
-      - name: "Install build dependencies"
24
-        run: "pacman --noconfirm -Syu && pacman --noconfirm -S cmake obs-studio opencv"
25
-      - name: "Make the package"
26
-        working-directory: "scripts"
27
-        run: "sudo -u user -- makepkg"
28
obs-backgroundremoval-1.0.3.tar.gz/.github/workflows/flatpak.yml Deleted
56
 
1
@@ -1,54 +0,0 @@
2
-# This is a basic workflow that is manually triggered
3
-
4
-name: Build flatpak
5
-
6
-# Controls when the action will run. Workflow runs when manually triggered using the UI
7
-# or API.
8
-on:
9
-  workflow_dispatch: {}
10
-
11
-# A workflow run is made up of one or more jobs that can run sequentially or in parallel
12
-jobs:
13
-  # This workflow contains a single job called "greet"
14
-  build:
15
-    name: Build flatpak
16
-    runs-on: ubuntu-latest
17
-    strategy:
18
-      matrix:
19
-        arch: x86_64
20
-    container:
21
-      image: bilelmoussaoui/flatpak-github-actions:kde-6.4
22
-      options: --privileged
23
-    steps:
24
-      - name: Checkout
25
-        uses: actions/checkout@v3
26
-        with:
27
-          submodules: 'recursive'
28
-
29
-      - name: 'Setup build environment'
30
-        id: setup
31
-        run: |
32
-          git config --global --add safe.directory $GITHUB_WORKSPACE
33
-          echo "commitHash=$(git rev-parse --short=9 HEAD)" >> $GITHUB_OUTPUT
34
-
35
-      - name: Build Flatpak Manifest
36
-        uses: flatpak/flatpak-github-actions/flatpak-builder@v5
37
-        with:
38
-          arch: ${{ matrix.arch }}
39
-          bundle: obs-studio-plugin-background-removal-${{ steps.setup.outputs.commitHash }}.flatpak
40
-          build-bundle: false
41
-          manifest-path: ci/flatpak/com.obsproject.Studio.Plugin.backgroundremoval.yaml
42
-          cache-key: flatpak-builder-${{ hashFiles('ci/flatpak/com.obsproject.Studio.Plugin.backgroundremoval.yaml') }}
43
-          branch: stable
44
-
45
-      # /__w/obs-backgroundremoval/obs-backgroundremoval/
46
-      - name: Build Bundle
47
-        shell: bash
48
-        run: |
49
-          flatpak build-bundle --runtime repo com.obs.Studio.Plugin.backgroundremoval-${{ steps.setup.outputs.commitHash }}.flatpak com.obsproject.Studio.Plugin.backgroundremoval stable
50
-
51
-      - name: Upload Artifacts
52
-        uses: actions/upload-artifact@v3
53
-        with:
54
-          name: com.obs.Studio.Plugin.backgroundremoval-${{ steps.setup.outputs.commitHash }}.flatpak
55
-          path: com.obs.Studio.Plugin.backgroundremoval-${{ steps.setup.outputs.commitHash }}.flatpak
56
obs-backgroundremoval-1.0.3.tar.gz/.github/workflows/main.yml Deleted
201
 
1
@@ -1,539 +0,0 @@
2
-name: Plugin Build
3
-
4
-on:
5
-  push:
6
-    paths-ignore:
7
-      - '**.md'
8
-    branches:
9
-      - master
10
-      - main
11
-    tags:
12
-      - '*'
13
-  pull_request:
14
-    paths-ignore:
15
-      - '**.md'
16
-    branches:
17
-      - master
18
-      - main
19
-
20
-env:
21
-  PLUGIN_NAME: 'obs-backgroundremoval'
22
-
23
-jobs:
24
-  clang_check:
25
-    name: 01 - Code Format Check
26
-    runs-on: ubuntu-22.04
27
-    steps:
28
-      - name: Checkout
29
-        uses: actions/checkout@v3
30
-        with:
31
-          submodules: recursive
32
-
33
-      - name: Install clang-format
34
-        run: sudo apt-get install -y clang-format-13
35
-
36
-      - name: Run clang-format
37
-        run: ./.github/scripts/check-format.sh && ./.github/scripts/check-changes.sh
38
-
39
-      - name: Install cmake-format
40
-        run: sudo pip install cmakelang
41
-
42
-      - name: Run cmake-format
43
-        run: ./.github/scripts/check-cmake.sh
44
-
45
-  macos_build:
46
-    name: 02 - macOS
47
-    runs-on: macos-12
48
-    strategy:
49
-      fail-fast: true
50
-      matrix:
51
-        arch: x86_64, arm64
52
-    if: always()
53
-    needs: clang_check
54
-    outputs:
55
-      commitHash: ${{ steps.setup.outputs.commitHash }}
56
-    env:
57
-      CODESIGN_IDENT: '-'
58
-      CODESIGN_IDENT_INSTALLER: ''
59
-      MACOSX_DEPLOYMENT_TARGET: '10.15'
60
-    defaults:
61
-      run:
62
-        shell: zsh {0}
63
-    steps:
64
-      - name: Checkout
65
-        uses: actions/checkout@v3
66
-        with:
67
-          path: plugin
68
-          submodules: recursive
69
-
70
-      - name: Checkout obs-studio
71
-        uses: actions/checkout@v3
72
-        with:
73
-          repository: 'obsproject/obs-studio'
74
-          path: obs-studio
75
-          fetch-depth: 0
76
-          submodules: recursive
77
-
78
-      - name: Setup Environment
79
-        id: setup
80
-        working-directory: ${{ github.workspace }}/plugin
81
-        run: |
82
-          ## SETUP ENVIRONMENT SCRIPT
83
-          print '::group::Clean Homebrew Environment'
84
-          typeset -a to_remove=()
85
-
86
-          for formula (speexdsp curl php) {
87
-            if  -d ${HOMEBREW_PREFIX}/opt/${formula}  to_remove+=(${formula})
88
-          }
89
-
90
-          if (( #to_remove > 0 )) brew uninstall --ignore-dependencies ${to_remove}
91
-          print '::endgroup::'
92
-
93
-          print '::group::Set up code signing'
94
-          if  '${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}' != '' && \
95
-                '${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}' != '' && \
96
-                '${{ secrets.MACOS_SIGNING_CERT }}' != ''  {
97
-            echo 'haveCodesignIdent=true' >> "$GITHUB_OUTPUT"
98
-            echo "found signing information"
99
-          } else {
100
-            echo 'haveCodesignIdent=false' >> "$GITHUB_OUTPUT"
101
-            echo "signing information not found"
102
-          }
103
-
104
-          if  '${{ secrets.MACOS_NOTARIZATION_USERNAME }}' != '' && \
105
-                '${{ secrets.MACOS_NOTARIZATION_PASSWORD }}' != ''  {
106
-            echo 'haveNotarizationUser=true' >> "$GITHUB_OUTPUT"
107
-            echo "found notarization user"
108
-          } else {
109
-            echo 'haveNotarizationUser=false' >> "$GITHUB_OUTPUT"
110
-            echo "notarization user not found"
111
-          }
112
-          print '::endgroup::'
113
-
114
-          print "ccacheDate=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT
115
-          print "commitHash=${"$(git rev-parse HEAD)"0,9}" >> $GITHUB_OUTPUT
116
-
117
-      - name: Restore Compilation Cache
118
-        id: ccache-cache
119
-        uses: actions/cache@v3
120
-        with:
121
-          path: ${{ github.workspace }}/.ccache
122
-          key: macos-${{ matrix.arch }}-ccache-plugin-${{ hashFiles('plugin/CMakeLists.txt', 'plugin/cmake/*.cmake') }}
123
-
124
-      - name: Install Apple Developer Certificate
125
-        if: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
126
-        uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
127
-        with:
128
-          keychain-password: ${{ github.run_id }}
129
-          p12-file-base64: ${{ secrets.MACOS_SIGNING_CERT }}
130
-          p12-password: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }}
131
-
132
-      - name: Set Signing Identity
133
-        if: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
134
-        run: |
135
-          print "CODESIGN_IDENT=${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}" >> $GITHUB_ENV
136
-          print "CODESIGN_IDENT_INSTALLER=${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}" >> $GITHUB_ENV
137
-
138
-      - name: Build Plugin
139
-        uses: ./plugin/.github/actions/build-plugin
140
-        with:
141
-          workingDirectory: ${{ github.workspace }}/plugin
142
-          target: ${{ matrix.arch }}
143
-          config: RelWithDebInfo
144
-          codesign: 'true'
145
-          codesignIdent: ${{ env.CODESIGN_IDENT }}
146
-
147
-      - name: Archive Artifact
148
-        working-directory: ${{ github.workspace }}/plugin/release/
149
-        run: tar -cf ${{ env.PLUGIN_NAME }}-macos-${{ matrix.arch }}.tar.gz ${{ env.PLUGIN_NAME }}.plugin
150
-
151
-      - name: Upload Build Artifact
152
-        uses: actions/upload-artifact@v3
153
-        with:
154
-          name: ${{ env.PLUGIN_NAME }}-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
155
-          path: |
156
-            ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-macos-${{ matrix.arch }}.tar.gz
157
-            ${{ github.workspace }}/plugin/build_${{ matrix.arch }}/installer-macos.generated.pkgproj
158
-
159
-  macos_package:
160
-    name: 02 - macOS (package)
161
-    runs-on: macos-12
162
-    needs: macos_build
163
-    outputs:
164
-      commitHash: ${{ steps.setup.outputs.commitHash }}
165
-    env:
166
-      CODESIGN_IDENT: '-'
167
-      CODESIGN_IDENT_INSTALLER: ''
168
-      MACOSX_DEPLOYMENT_TARGET: '10.15'
169
-    defaults:
170
-      run:
171
-        shell: zsh {0}
172
-    steps:
173
-      - name: Checkout
174
-        uses: actions/checkout@v3
175
-        with:
176
-          path: plugin
177
-          submodules: recursive
178
-
179
-      - name: Setup Environment
180
-        id: setup
181
-        working-directory: ${{ github.workspace }}/plugin
182
-        run: |
183
-          ## SETUP ENVIRONMENT SCRIPT
184
-          print '::group::Clean Homebrew Environment'
185
-          typeset -a to_remove=()
186
-
187
-          for formula (speexdsp curl php) {
188
-            if  -d ${HOMEBREW_PREFIX}/opt/${formula}  to_remove+=(${formula})
189
-          }
190
-
191
-          if (( #to_remove > 0 )) brew uninstall --ignore-dependencies ${to_remove}
192
-          print '::endgroup::'
193
-
194
-          print '::group::Set up code signing'
195
-          if  '${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}' != '' && \
196
-                '${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}' != '' && \
197
-                '${{ secrets.MACOS_SIGNING_CERT }}' != ''  {
198
-            print 'haveCodesignIdent=true' >> $GITHUB_OUTPUT
199
-          } else {
200
-            print 'haveCodesignIdent=false' >> $GITHUB_OUTPUT
201
obs-backgroundremoval-1.0.3.tar.gz/ci Deleted
2
 
1
-(directory)
2
obs-backgroundremoval-1.0.3.tar.gz/ci/flatpak Deleted
2
 
1
-(directory)
2
obs-backgroundremoval-1.0.3.tar.gz/ci/flatpak/com.obsproject.Studio.Plugin.backgroundremoval.metainfo.xml Deleted
13
 
1
@@ -1,10 +0,0 @@
2
-<?xml version="1.0" encoding="UTF-8"?>
3
-<component type="addon">
4
-  <id>com.obsproject.Studio.Plugin.backgroundremoval</id>
5
-  <extends>com.obsproject.Studio</extends>
6
-  <name>obs-backgroundremoval Plugin</name>
7
-  <summary> An OBS plugin for removing background in portrait images (video), making it easy to replace the background when screen recording.</summary>
8
-  <url type="homepage">https://github.com/royshil/obs-backgroundremoval</url>
9
-  <metadata_license>CC0-1.0</metadata_license>
10
-  <project_license>GPL-2.0</project_license>
11
-</component>
12
\ No newline at end of file
13
obs-backgroundremoval-1.0.3.tar.gz/ci/flatpak/com.obsproject.Studio.Plugin.backgroundremoval.yaml Deleted
62
 
1
@@ -1,60 +0,0 @@
2
-# build into folder "build-dir":
3
-# $ flatpak-builder build-dir com.obsproject.Studio.Plugin.backgroundremoval.yaml --force-clean
4
-#
5
-# install:
6
-# $ flatpak-builder --user --install --force-clean build-dir com.obsproject.Studio.Plugin.backgroundremoval.yaml
7
-id: com.obsproject.Studio.Plugin.backgroundremoval
8
-runtime: com.obsproject.Studio
9
-runtime-version: stable
10
-sdk: org.kde.Sdk/x86_64/6.4
11
-build-extension: true
12
-separate-locales: false
13
-appstream-compose: false
14
-build-options:
15
-  prefix: /app/plugins/backgroundremoval
16
-modules:
17
-  # onnxruntime has a bash+python+cmake build script - just download/use pre-compiled library
18
-  # https://onnxruntime.ai/docs/build/inferencing.html
19
-  - name: onnxruntime
20
-    buildsystem: simple
21
-    sources:
22
-      - type: archive
23
-        url: https://github.com/microsoft/onnxruntime/releases/download/v1.11.1/onnxruntime-linux-x64-1.11.1.tgz
24
-        sha256: ddc03b5ae325c675ff76a6f18786ce7d310be6eb6f320087f7a0e9228115f24d
25
-    build-commands:
26
-      - mkdir -p ${FLATPAK_DEST}/include ${FLATPAK_DEST}/lib
27
-      - mv include/* ${FLATPAK_DEST}/include
28
-      - mv lib/* ${FLATPAK_DEST}/lib
29
-  # https://docs.opencv.org/4.x/db/d05/tutorial_config_reference.html
30
-  - name: opencv
31
-    buildsystem: cmake
32
-    config-opts:
33
-      - "-DCMAKE_BUILD_TYPE=Release"
34
-      - "-DBUILD_LIST=imgproc"
35
-    cleanup:
36
-    - "/bin"
37
-    builddir: true
38
-    sources:
39
-      - type: archive
40
-        url: https://github.com/opencv/opencv/archive/refs/tags/4.5.5.tar.gz
41
-        sha256: a1cfdcf6619387ca9e232687504da996aaa9f7b5689986b8331ec02cb61d28ad
42
-  - name: obs-backgroundremoval
43
-    buildsystem: cmake
44
-    builddir: true
45
-    config-opts:
46
-      - -DLIBOBS_INCLUDE_DIR=/app/include/obs
47
-      - -DOnnxruntime_INCLUDE_DIR=/app/plugins/backgroundremoval/include
48
-      - -DOnnxruntime_LIBRARIES=/app/plugins/backgroundremoval/lib/libonnxruntime.so
49
-    sources:
50
-      - type: git
51
-        url: https://github.com/royshil/obs-backgroundremoval.git
52
-        tag: v0.4.0
53
-        commit: 4f0348a15103cd4e516d94b629851208280cd4d4
54
-  - name: appdata
55
-    buildsystem: simple
56
-    build-commands:
57
-      - install -Dm644 --target-directory=${FLATPAK_DEST}/share/metainfo ${FLATPAK_ID}.metainfo.xml
58
-      - appstream-compose --basename=${FLATPAK_ID} --prefix=${FLATPAK_DEST} --origin=flatpak ${FLATPAK_ID}
59
-    sources:
60
-      - type: file
61
-        path: com.obsproject.Studio.Plugin.backgroundremoval.metainfo.xml
62
obs-backgroundremoval-1.0.3.tar.gz/ci/flatpak/flathub.json Deleted
7
 
1
@@ -1,4 +0,0 @@
2
-{
3
-    "skip-icons-check": true,
4
-    "only-arches": "x86_64"
5
-}
6
\ No newline at end of file
7
obs-backgroundremoval-1.0.3.tar.gz/cmake/BuildMyOpenCV.cmake Deleted
172
 
1
@@ -1,170 +0,0 @@
2
-include(ExternalProject)
3
-
4
-set(OPENCV_URL
5
-    https://github.com/opencv/opencv/archive/refs/tags/4.7.0.tar.gz
6
-    CACHE STRING "URL of an OpenCV tarball")
7
-
8
-set(OPENCV_MD5
9
-    13e13244cb0cc6ec4f01eacd38d05d17
10
-    CACHE STRING "MD5 Hash of an OpenCV tarball")
11
-
12
-string(REPLACE ";" "$<SEMICOLON>" CMAKE_OSX_ARCHITECTURES_ "${CMAKE_OSX_ARCHITECTURES}")
13
-
14
-if(MSVC)
15
-  find_program(OpenCV_CCACHE_EXE ccache)
16
-  if(${CMAKE_GENERATOR_PLATFORM} STREQUAL x64
17
-     AND ${MSVC_VERSION} GREATER_EQUAL 1910
18
-     AND ${MSVC_VERSION} LESS_EQUAL 1939)
19
-    set(OpenCV_LIB_PATH x64/vc17/staticlib)
20
-    set(OpenCV_LIB_PATH_3RD x64/vc17/staticlib)
21
-    set(OpenCV_LIB_SUFFIX 470)
22
-    if(OpenCV_CCACHE_EXE)
23
-      set(OpenCV_INSTALL_CCACHE ${CMAKE_COMMAND} -E copy ${OpenCV_CCACHE_EXE} <BINARY_DIR>/cl.exe)
24
-      set(OpenCV_PLATFORM_CMAKE_ARGS
25
-          -DCMAKE_VS_GLOBALS=CLToolExe=cl.exe$<SEMICOLON>CLToolPath=<BINARY_DIR>$<SEMICOLON>TrackFileAccess=false$<SEMICOLON>UseMultiToolTask=true$<SEMICOLON>DebugInformationFormat=OldStyle
26
-      )
27
-    endif()
28
-  else()
29
-    message(FATAL_ERROR "Unsupported MSVC!")
30
-  endif()
31
-else()
32
-  set(OpenCV_LIB_PATH lib)
33
-  set(OpenCV_LIB_PATH_3RD lib/opencv4/3rdparty)
34
-  set(OpenCV_LIB_SUFFIX "")
35
-  set(OpenCV_INSTALL_CCACHE ":")
36
-  set(OpenCV_PLATFORM_CMAKE_ARGS -DOPENCV_LIB_INSTALL_PATH=lib)
37
-endif()
38
-
39
-if(${CMAKE_BUILD_TYPE} STREQUAL Release OR ${CMAKE_BUILD_TYPE} STREQUAL RelWithDebInfo)
40
-  set(OpenCV_BUILD_TYPE Release)
41
-else()
42
-  set(OpenCV_BUILD_TYPE Debug)
43
-endif()
44
-
45
-ExternalProject_Add(
46
-  OpenCV_Build
47
-  DOWNLOAD_EXTRACT_TIMESTAMP true
48
-  URL ${OPENCV_URL}
49
-  URL_HASH MD5=${OPENCV_MD5}
50
-  PATCH_COMMAND ${OpenCV_INSTALL_CCACHE}
51
-  BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config ${OpenCV_BUILD_TYPE}
52
-  BUILD_BYPRODUCTS
53
-    <INSTALL_DIR>/${OpenCV_LIB_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}opencv_core${OpenCV_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
54
-    <INSTALL_DIR>/${OpenCV_LIB_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}opencv_imgproc${OpenCV_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
55
-    <INSTALL_DIR>/${OpenCV_LIB_PATH_3RD}/${CMAKE_STATIC_LIBRARY_PREFIX}libpng${CMAKE_STATIC_LIBRARY_SUFFIX}
56
-    <INSTALL_DIR>/${OpenCV_LIB_PATH_3RD}/${CMAKE_STATIC_LIBRARY_PREFIX}zlib${CMAKE_STATIC_LIBRARY_SUFFIX}
57
-  CMAKE_GENERATOR ${CMAKE_GENERATOR}
58
-  INSTALL_COMMAND ${CMAKE_COMMAND} --install <BINARY_DIR> --config ${OpenCV_BUILD_TYPE}
59
-  CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
60
-             -DCMAKE_BUILD_TYPE=${OpenCV_BUILD_TYPE}
61
-             -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
62
-             -DENABLE_CCACHE=ON
63
-             -DOPENCV_FORCE_3RDPARTY_BUILD=ON
64
-             -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13
65
-             -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_}
66
-             -DBUILD_SHARED_LIBS=OFF
67
-             -DBUILD_opencv_apps=OFF
68
-             -DBUILD_opencv_js=OFF
69
-             -DBUILD_ANDROID_PROJECTS=OFF
70
-             -DBUILD_ANDROID_EXAMPLES=OFF
71
-             -DBUILD_DOCS=OFF
72
-             -DBUILD_EXAMPLES=OFF
73
-             -DBUILD_PACKAGE=OFF
74
-             -DBUILD_PERF_TESTS=OFF
75
-             -DBUILD_TESTS=OFF
76
-             -DBUILD_WITH_DEBUG_INFO=OFF
77
-             -DBUILD_WITH_STATIC_CRT=OFF
78
-             -DBUILD_WITH_DYNAMIC_IPP=OFF
79
-             -DBUILD_FAT_JAVA_LIB=OFF
80
-             -DBUILD_ANDROID_SERVICE=OFF
81
-             -DBUILD_CUDA_STUBS=OFF
82
-             -DBUILD_JAVA=OFF
83
-             -DBUILD_OBJC=OFF
84
-             -DBUILD_opencv_python3=OFF
85
-             -DINSTALL_CREATE_DISTRIB=OFF
86
-             -DINSTALL_BIN_EXAMPLES=OFF
87
-             -DINSTALL_C_EXAMPLES=OFF
88
-             -DINSTALL_PYTHON_EXAMPLES=OFF
89
-             -DINSTALL_ANDROID_EXAMPLES=OFF
90
-             -DINSTALL_TO_MANGLED_PATHS=OFF
91
-             -DINSTALL_TESTS=OFF
92
-             -DBUILD_opencv_calib3d=OFF
93
-             -DBUILD_opencv_core=ON
94
-             -DBUILD_opencv_dnn=OFF
95
-             -DBUILD_opencv_features2d=OFF
96
-             -DBUILD_opencv_flann=OFF
97
-             -DBUILD_opencv_gapi=OFF
98
-             -DBUILD_opencv_highgui=OFF
99
-             -DBUILD_opencv_imgcodecs=OFF
100
-             -DBUILD_opencv_imgproc=ON
101
-             -DBUILD_opencv_ml=OFF
102
-             -DBUILD_opencv_objdetect=OFF
103
-             -DBUILD_opencv_photo=OFF
104
-             -DBUILD_opencv_stitching=OFF
105
-             -DBUILD_opencv_video=OFF
106
-             -DBUILD_opencv_videoio=OFF
107
-             -DWITH_PNG=OFF
108
-             -DWITH_JPEG=OFF
109
-             -DWITH_TIFF=OFF
110
-             -DWITH_WEBP=OFF
111
-             -DWITH_OPENJPEG=OFF
112
-             -DWITH_JASPER=OFF
113
-             -DWITH_OPENEXR=OFF
114
-             -DWITH_FFMPEG=OFF
115
-             -DWITH_GSTREAMER=OFF
116
-             -DWITH_1394=OFF
117
-             -DWITH_PROTOBUF=OFF
118
-             -DBUILD_PROTOBUF=OFF
119
-             -DWITH_CAROTENE=OFF
120
-             -DWITH_EIGEN=OFF
121
-             -DWITH_OPENVX=OFF
122
-             -DWITH_CLP=OFF
123
-             -DWITH_DIRECTX=OFF
124
-             -DWITH_VA=OFF
125
-             -DWITH_LAPACK=OFF
126
-             -DWITH_QUIRC=OFF
127
-             -DWITH_ADE=OFF
128
-             -DWITH_ITT=OFF
129
-             -DWITH_OPENCL=OFF
130
-             -DWITH_IPP=OFF
131
-             ${OpenCV_PLATFORM_CMAKE_ARGS})
132
-
133
-ExternalProject_Get_Property(OpenCV_Build INSTALL_DIR)
134
-if(MSVC)
135
-  set(OpenCV_INCLUDE_PATH ${INSTALL_DIR}/include)
136
-else()
137
-  set(OpenCV_INCLUDE_PATH ${INSTALL_DIR}/include/opencv4)
138
-endif(MSVC)
139
-
140
-add_library(OpenCV::Imgproc STATIC IMPORTED)
141
-set_target_properties(
142
-  OpenCV::Imgproc
143
-  PROPERTIES
144
-    IMPORTED_LOCATION
145
-    ${INSTALL_DIR}/${OpenCV_LIB_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}opencv_imgproc${OpenCV_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
146
-)
147
-
148
-add_library(OpenCV::Core STATIC IMPORTED)
149
-set_target_properties(
150
-  OpenCV::Core
151
-  PROPERTIES
152
-    IMPORTED_LOCATION
153
-    ${INSTALL_DIR}/${OpenCV_LIB_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}opencv_core${OpenCV_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
154
-)
155
-
156
-add_library(OpenCV::Zlib STATIC IMPORTED)
157
-set_target_properties(
158
-  OpenCV::Zlib
159
-  PROPERTIES
160
-    IMPORTED_LOCATION
161
-    ${INSTALL_DIR}/${OpenCV_LIB_PATH_3RD}/${CMAKE_STATIC_LIBRARY_PREFIX}zlib${CMAKE_STATIC_LIBRARY_SUFFIX}
162
-)
163
-
164
-add_library(OpenCV INTERFACE)
165
-add_dependencies(OpenCV OpenCV_Build)
166
-target_link_libraries(OpenCV INTERFACE OpenCV::Imgproc OpenCV::Core OpenCV::Zlib)
167
-set_target_properties(OpenCV::Core OpenCV::Imgproc PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
168
-                                                              ${OpenCV_INCLUDE_PATH})
169
-if(APPLE)
170
-  target_link_libraries(OpenCV INTERFACE "-framework Accelerate")
171
-endif(APPLE)
172
obs-backgroundremoval-1.0.3.tar.gz/cmake/ObsPluginHelpers.cmake Deleted
201
 
1
@@ -1,697 +0,0 @@
2
-if(POLICY CMP0087)
3
-  cmake_policy(SET CMP0087 NEW)
4
-endif()
5
-
6
-set(OBS_STANDALONE_PLUGIN_DIR ${CMAKE_SOURCE_DIR}/release)
7
-
8
-include(GNUInstallDirs)
9
-if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
10
-  set(OS_MACOS ON)
11
-  set(OS_POSIX ON)
12
-elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD")
13
-  set(OS_POSIX ON)
14
-  string(TOUPPER "${CMAKE_SYSTEM_NAME}" _SYSTEM_NAME_U)
15
-  set(OS_${_SYSTEM_NAME_U} ON)
16
-elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
17
-  set(OS_WINDOWS ON)
18
-  set(OS_POSIX OFF)
19
-endif()
20
-
21
-# Old-Style plugin detected, find "modern" libobs variant instead and set global include directories
22
-# to fix "bad" plugin behavior
23
-if(DEFINED LIBOBS_INCLUDE_DIR AND NOT TARGET OBS::libobs)
24
-  message(
25
-    DEPRECATION
26
-      "You are using an outdated method of adding 'libobs' to your project. Refer to the updated wiki on how to build and export 'libobs' and use it in your plugin projects."
27
-  )
28
-  find_package(libobs REQUIRED)
29
-  if(TARGET OBS::libobs)
30
-    set_target_properties(OBS::libobs PROPERTIES IMPORTED_GLOBAL TRUE)
31
-    message(STATUS "OBS: Using modern libobs target")
32
-
33
-    add_library(libobs ALIAS OBS::libobs)
34
-    if(OS_WINDOWS)
35
-      add_library(w32-pthreads ALIAS OBS::w32-pthreads)
36
-    endif()
37
-  endif()
38
-endif()
39
-
40
-# Set macOS and Windows specific if default value is used
41
-if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND (OS_WINDOWS OR OS_MACOS))
42
-  set(CMAKE_INSTALL_PREFIX
43
-      ${OBS_STANDALONE_PLUGIN_DIR}
44
-      CACHE STRING "Directory to install OBS plugin after building" FORCE)
45
-endif()
46
-
47
-# Set default build type to RelWithDebInfo and specify allowed alternative values
48
-if(NOT CMAKE_BUILD_TYPE)
49
-  set(CMAKE_BUILD_TYPE
50
-      "RelWithDebInfo"
51
-      CACHE STRING "OBS build type Release, RelWithDebInfo, Debug, MinSizeRel" FORCE)
52
-  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Release RelWithDebInfo Debug MinSizeRel)
53
-endif()
54
-
55
-# Set default Qt version to AUTO, preferring an available Qt6 with a fallback to Qt5
56
-if(NOT QT_VERSION)
57
-  set(QT_VERSION
58
-      AUTO
59
-      CACHE STRING "OBS Qt version AUTO, 6, 5" FORCE)
60
-  set_property(CACHE QT_VERSION PROPERTY STRINGS AUTO 6 5)
61
-endif()
62
-
63
-# Macro to find best possible Qt version for use with the project:
64
-#
65
-# * Use QT_VERSION value as a hint for desired Qt version
66
-# * If "AUTO" was specified, prefer Qt6 over Qt5
67
-# * Creates versionless targets of desired component if none had been created by Qt itself (Qt
68
-#   versions < 5.15)
69
-#
70
-macro(find_qt)
71
-  set(multiValueArgs COMPONENTS COMPONENTS_WIN COMPONENTS_MAC COMPONENTS_LINUX)
72
-  cmake_parse_arguments(FIND_QT "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
73
-
74
-  # Do not use versionless targets in the first step to avoid Qt::Core being clobbered by later
75
-  # opportunistic find_package runs
76
-  set(QT_NO_CREATE_VERSIONLESS_TARGETS ON)
77
-
78
-  # Loop until _QT_VERSION is set or FATAL_ERROR aborts script execution early
79
-  while(NOT _QT_VERSION)
80
-    if(QT_VERSION STREQUAL AUTO AND NOT _QT_TEST_VERSION)
81
-      set(_QT_TEST_VERSION 6)
82
-    elseif(NOT QT_VERSION STREQUAL AUTO)
83
-      set(_QT_TEST_VERSION ${QT_VERSION})
84
-    endif()
85
-
86
-    find_package(
87
-      Qt${_QT_TEST_VERSION}
88
-      COMPONENTS Core
89
-      QUIET)
90
-
91
-    if(TARGET Qt${_QT_TEST_VERSION}::Core)
92
-      set(_QT_VERSION
93
-          ${_QT_TEST_VERSION}
94
-          CACHE INTERNAL "")
95
-      message(STATUS "Qt version found: ${_QT_VERSION}")
96
-      unset(_QT_TEST_VERSION)
97
-      break()
98
-    elseif(QT_VERSION STREQUAL AUTO)
99
-      if(_QT_TEST_VERSION EQUAL 6)
100
-        message(WARNING "Qt6 was not found, falling back to Qt5")
101
-        set(_QT_TEST_VERSION 5)
102
-        continue()
103
-      endif()
104
-    endif()
105
-    message(FATAL_ERROR "Neither Qt6 nor Qt5 found.")
106
-  endwhile()
107
-
108
-  # Enable versionless targets for the remaining Qt components
109
-  set(QT_NO_CREATE_VERSIONLESS_TARGETS OFF)
110
-
111
-  set(_QT_COMPONENTS ${FIND_QT_COMPONENTS})
112
-  if(OS_WINDOWS)
113
-    list(APPEND _QT_COMPONENTS ${FIND_QT_COMPONENTS_WIN})
114
-  elseif(OS_MACOS)
115
-    list(APPEND _QT_COMPONENTS ${FIND_QT_COMPONENTS_MAC})
116
-  else()
117
-    list(APPEND _QT_COMPONENTS ${FIND_QT_COMPONENTS_LINUX})
118
-  endif()
119
-
120
-  find_package(
121
-    Qt${_QT_VERSION}
122
-    COMPONENTS ${_QT_COMPONENTS}
123
-    REQUIRED)
124
-
125
-  list(APPEND _QT_COMPONENTS Core)
126
-
127
-  if("Gui" IN_LIST FIND_QT_COMPONENTS_LINUX)
128
-    list(APPEND _QT_COMPONENTS "GuiPrivate")
129
-  endif()
130
-
131
-  # Check for versionless targets of each requested component and create if necessary
132
-  foreach(_COMPONENT IN LISTS _QT_COMPONENTS)
133
-    if(NOT TARGET Qt::${_COMPONENT} AND TARGET Qt${_QT_VERSION}::${_COMPONENT})
134
-      add_library(Qt::${_COMPONENT} INTERFACE IMPORTED)
135
-      set_target_properties(Qt::${_COMPONENT} PROPERTIES INTERFACE_LINK_LIBRARIES
136
-                                                         Qt${_QT_VERSION}::${_COMPONENT})
137
-    endif()
138
-  endforeach()
139
-endmacro()
140
-
141
-# Set relative path variables for file configurations
142
-file(RELATIVE_PATH RELATIVE_INSTALL_PATH ${CMAKE_SOURCE_DIR} ${CMAKE_INSTALL_PREFIX})
143
-file(RELATIVE_PATH RELATIVE_BUILD_PATH ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
144
-
145
-if(OS_POSIX)
146
-  # Set default GCC/clang compile options:
147
-  #
148
-  # * Treat warnings as errors
149
-  # * Enable extra warnings, https://clang.llvm.org/docs/DiagnosticsReference.html#wextra
150
-  # * Warning about usage of variable length array,
151
-  #   https://clang.llvm.org/docs/DiagnosticsReference.html#wvla
152
-  # * Warning about bad format specifiers,
153
-  #   https://clang.llvm.org/docs/DiagnosticsReference.html#wformat
154
-  # * Warning about non-strings used as format strings,
155
-  #   https://clang.llvm.org/docs/DiagnosticsReference.html#wformat-security
156
-  # * Warning about non-exhaustive switch blocks,
157
-  #   https://clang.llvm.org/docs/DiagnosticsReference.html#wswitch
158
-  # * Warning about unused parameters,
159
-  #   https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-parameter
160
-  # * DISABLE warning about unused functions,
161
-  #   https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-function
162
-  # * DISABLE warning about missing field initializers,
163
-  #   https://clang.llvm.org/docs/DiagnosticsReference.html#wmissing-field-initializers
164
-  # * DISABLE strict aliasing optimisations
165
-  # * C ONLY - treat implicit function declarations (use before declare) as errors,
166
-  #   https://clang.llvm.org/docs/DiagnosticsReference.html#wimplicit-function-declaration
167
-  # * C ONLY - DISABLE warning about missing braces around subobject initalizers,
168
-  #   https://clang.llvm.org/docs/DiagnosticsReference.html#wmissing-braces
169
-  # * C ONLY, Clang ONLY - Warning about implicit conversion of NULL to another type,
170
-  #   https://clang.llvm.org/docs/DiagnosticsReference.html#wnull-conversion
171
-  # * C & C++, Clang ONLY - Disable warning about integer conversion losing precision,
172
-  #   https://clang.llvm.org/docs/DiagnosticsReference.html#wshorten-64-to-32
173
-  # * C++, GCC ONLY - Warning about implicit conversion of NULL to another type
174
-  # * Enable color diagnostics on Clang (CMAKE_COLOR_DIAGNOSTICS available in CMake 3.24)
175
-  target_compile_options(
176
-    ${CMAKE_PROJECT_NAME}
177
-    PRIVATE
178
-      -Werror
179
-      -Wextra
180
-      -Wvla
181
-      -Wformat
182
-      -Wformat-security
183
-      -Wswitch
184
-      -Wunused-parameter
185
-      -Wno-unused-function
186
-      -Wno-missing-field-initializers
187
-      -fno-strict-aliasing
188
-      "$<$<COMPILE_LANGUAGE:C>:-Werror-implicit-function-declaration;-Wno-missing-braces>"
189
-      "$<$<COMPILE_LANG_AND_ID:C,AppleClang,Clang>:-Wnull-conversion;-Wno-error=shorten-64-to-32;-fcolor-diagnostics>"
190
-      "$<$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang>:-Wnull-conversion;-Wno-error=shorten-64-to-32;-fcolor-diagnostics>"
191
-      "$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wconversion-null>"
192
-      "$<$<CONFIG:DEBUG>:-DDEBUG=1;-D_DEBUG=1>")
193
-
194
-  # GCC 12.1.0 has a regression bug which trigger maybe-uninitialized warnings where there is not.
195
-  # (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105562)
196
-  if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "12.1.0")
197
-    target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wno-error=maybe-uninitialized)
198
-  endif()
199
-
200
-  if(NOT CCACHE_SET)
201
obs-backgroundremoval-1.0.3.tar.gz/cmake/bundle Deleted
2
 
1
-(directory)
2
obs-backgroundremoval-1.0.3.tar.gz/cmake/bundle/macos Deleted
2
 
1
-(directory)
2
obs-backgroundremoval-1.0.3.tar.gz/cmake/bundle/macos/Plugin-Info.plist.in Deleted
28
 
1
@@ -1,26 +0,0 @@
2
-<?xml version="1.0" encoding="UTF-8"?>
3
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
4
-<plist version="1.0">
5
-<dict>
6
-   <key>CFBundleName</key>
7
-   <string>${MACOSX_PLUGIN_BUNDLE_NAME}</string>
8
-   <key>CFBundleIdentifier</key>
9
-   <string>${MACOSX_PLUGIN_GUI_IDENTIFIER}</string>
10
-   <key>CFBundleVersion</key>
11
-   <string>${MACOSX_PLUGIN_BUNDLE_VERSION}</string>
12
-   <key>CFBundleShortVersionString</key>
13
-   <string>${MACOSX_PLUGIN_SHORT_VERSION_STRING}</string>
14
-   <key>CFBundleInfoDictionaryVersion</key>
15
-   <string>6.0</string>
16
-   <key>CFBundleExecutable</key>
17
-   <string>${MACOSX_PLUGIN_EXECUTABLE_NAME}</string>
18
-   <key>CFBundlePackageType</key>
19
-   <string>${MACOSX_PLUGIN_BUNDLE_TYPE}</string>
20
-   <key>CFBundleSupportedPlatforms</key>
21
-   <array>
22
-       <string>MacOSX</string>
23
-   </array>
24
-   <key>LSMinimumSystemVersion</key>
25
-   <string>10.13</string>
26
-</dict>
27
-</plist>
28
obs-backgroundremoval-1.0.3.tar.gz/cmake/bundle/macos/entitlements.plist Deleted
19
 
1
@@ -1,17 +0,0 @@
2
-<!--?xml version="1.0" encoding="UTF-8"?-->
3
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
4
-<plist version="1.0">
5
-    <dict>
6
-        <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
7
-        <true/>
8
-        <key>com.apple.security.device.camera</key>
9
-        <true/>
10
-        <key>com.apple.security.device.audio-input</key>
11
-        <true/>
12
-        <key>com.apple.security.cs.disable-library-validation</key>
13
-        <true/>
14
-        <!-- Allows @executable_path to load libaries from within the .app bundle. -->
15
-        <key>com.apple.security.cs.allow-dyld-environment-variables</key>
16
-        <true/>
17
-    </dict>
18
-</plist>
19
obs-backgroundremoval-1.0.3.tar.gz/cmake/bundle/macos/installer-macos.pkgproj.in Deleted
201
 
1
@@ -1,920 +0,0 @@
2
-<?xml version="1.0" encoding="UTF-8"?>
3
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
4
-<plist version="1.0">
5
-<dict>
6
-   <key>PACKAGES</key>
7
-   <array>
8
-       <dict>
9
-           <key>MUST-CLOSE-APPLICATION-ITEMS</key>
10
-           <array/>
11
-           <key>MUST-CLOSE-APPLICATIONS</key>
12
-           <false/>
13
-           <key>PACKAGE_FILES</key>
14
-           <dict>
15
-               <key>DEFAULT_INSTALL_LOCATION</key>
16
-               <string>/</string>
17
-               <key>HIERARCHY</key>
18
-               <dict>
19
-                   <key>CHILDREN</key>
20
-                   <array>
21
-                       <dict>
22
-                           <key>CHILDREN</key>
23
-                           <array/>
24
-                           <key>GID</key>
25
-                           <integer>80</integer>
26
-                           <key>PATH</key>
27
-                           <string>Applications</string>
28
-                           <key>PATH_TYPE</key>
29
-                           <integer>0</integer>
30
-                           <key>PERMISSIONS</key>
31
-                           <integer>509</integer>
32
-                           <key>TYPE</key>
33
-                           <integer>1</integer>
34
-                           <key>UID</key>
35
-                           <integer>0</integer>
36
-                       </dict>
37
-                       <dict>
38
-                           <key>CHILDREN</key>
39
-                           <array>
40
-                               <dict>
41
-                                   <key>CHILDREN</key>
42
-                                   <array>
43
-                                       <dict>
44
-                                           <key>CHILDREN</key>
45
-                                           <array>
46
-                                               <dict>
47
-                                                   <key>CHILDREN</key>
48
-                                                   <array>
49
-                                                       <dict>
50
-                                                           <key>BUNDLE_CAN_DOWNGRADE</key>
51
-                                                           <false/>
52
-                                                           <key>BUNDLE_POSTINSTALL_PATH</key>
53
-                                                           <dict>
54
-                                                               <key>PATH_TYPE</key>
55
-                                                               <integer>0</integer>
56
-                                                           </dict>
57
-                                                           <key>BUNDLE_PREINSTALL_PATH</key>
58
-                                                           <dict>
59
-                                                               <key>PATH_TYPE</key>
60
-                                                               <integer>0</integer>
61
-                                                           </dict>
62
-                                                           <key>CHILDREN</key>
63
-                                                           <array/>
64
-                                                           <key>GID</key>
65
-                                                           <integer>80</integer>
66
-                                                           <key>PATH</key>
67
-                                                           <string>../@RELATIVE_INSTALL_PATH@/@CMAKE_PROJECT_NAME@.plugin</string>
68
-                                                           <key>PATH_TYPE</key>
69
-                                                           <integer>1</integer>
70
-                                                           <key>PERMISSIONS</key>
71
-                                                           <integer>493</integer>
72
-                                                           <key>TYPE</key>
73
-                                                           <integer>3</integer>
74
-                                                           <key>UID</key>
75
-                                                           <integer>0</integer>
76
-                                                       </dict>
77
-                                                   </array>
78
-                                                   <key>GID</key>
79
-                                                   <integer>80</integer>
80
-                                                   <key>PATH</key>
81
-                                                   <string>plugins</string>
82
-                                                   <key>PATH_TYPE</key>
83
-                                                   <integer>2</integer>
84
-                                                   <key>PERMISSIONS</key>
85
-                                                   <integer>509</integer>
86
-                                                   <key>TYPE</key>
87
-                                                   <integer>2</integer>
88
-                                                   <key>UID</key>
89
-                                                   <integer>0</integer>
90
-                                               </dict>
91
-                                           </array>
92
-                                           <key>GID</key>
93
-                                           <integer>80</integer>
94
-                                           <key>PATH</key>
95
-                                           <string>obs-studio</string>
96
-                                           <key>PATH_TYPE</key>
97
-                                           <integer>2</integer>
98
-                                           <key>PERMISSIONS</key>
99
-                                           <integer>509</integer>
100
-                                           <key>TYPE</key>
101
-                                           <integer>2</integer>
102
-                                           <key>UID</key>
103
-                                           <integer>0</integer>
104
-                                       </dict>
105
-                                   </array>
106
-                                   <key>GID</key>
107
-                                   <integer>80</integer>
108
-                                   <key>PATH</key>
109
-                                   <string>Application Support</string>
110
-                                   <key>PATH_TYPE</key>
111
-                                   <integer>0</integer>
112
-                                   <key>PERMISSIONS</key>
113
-                                   <integer>493</integer>
114
-                                   <key>TYPE</key>
115
-                                   <integer>1</integer>
116
-                                   <key>UID</key>
117
-                                   <integer>0</integer>
118
-                               </dict>
119
-                               <dict>
120
-                                   <key>CHILDREN</key>
121
-                                   <array/>
122
-                                   <key>GID</key>
123
-                                   <integer>0</integer>
124
-                                   <key>PATH</key>
125
-                                   <string>Automator</string>
126
-                                   <key>PATH_TYPE</key>
127
-                                   <integer>0</integer>
128
-                                   <key>PERMISSIONS</key>
129
-                                   <integer>493</integer>
130
-                                   <key>TYPE</key>
131
-                                   <integer>1</integer>
132
-                                   <key>UID</key>
133
-                                   <integer>0</integer>
134
-                               </dict>
135
-                               <dict>
136
-                                   <key>CHILDREN</key>
137
-                                   <array/>
138
-                                   <key>GID</key>
139
-                                   <integer>0</integer>
140
-                                   <key>PATH</key>
141
-                                   <string>Documentation</string>
142
-                                   <key>PATH_TYPE</key>
143
-                                   <integer>0</integer>
144
-                                   <key>PERMISSIONS</key>
145
-                                   <integer>493</integer>
146
-                                   <key>TYPE</key>
147
-                                   <integer>1</integer>
148
-                                   <key>UID</key>
149
-                                   <integer>0</integer>
150
-                               </dict>
151
-                               <dict>
152
-                                   <key>CHILDREN</key>
153
-                                   <array/>
154
-                                   <key>GID</key>
155
-                                   <integer>0</integer>
156
-                                   <key>PATH</key>
157
-                                   <string>Extensions</string>
158
-                                   <key>PATH_TYPE</key>
159
-                                   <integer>0</integer>
160
-                                   <key>PERMISSIONS</key>
161
-                                   <integer>493</integer>
162
-                                   <key>TYPE</key>
163
-                                   <integer>1</integer>
164
-                                   <key>UID</key>
165
-                                   <integer>0</integer>
166
-                               </dict>
167
-                               <dict>
168
-                                   <key>CHILDREN</key>
169
-                                   <array/>
170
-                                   <key>GID</key>
171
-                                   <integer>0</integer>
172
-                                   <key>PATH</key>
173
-                                   <string>Filesystems</string>
174
-                                   <key>PATH_TYPE</key>
175
-                                   <integer>0</integer>
176
-                                   <key>PERMISSIONS</key>
177
-                                   <integer>493</integer>
178
-                                   <key>TYPE</key>
179
-                                   <integer>1</integer>
180
-                                   <key>UID</key>
181
-                                   <integer>0</integer>
182
-                               </dict>
183
-                               <dict>
184
-                                   <key>CHILDREN</key>
185
-                                   <array/>
186
-                                   <key>GID</key>
187
-                                   <integer>0</integer>
188
-                                   <key>PATH</key>
189
-                                   <string>Frameworks</string>
190
-                                   <key>PATH_TYPE</key>
191
-                                   <integer>0</integer>
192
-                                   <key>PERMISSIONS</key>
193
-                                   <integer>493</integer>
194
-                                   <key>TYPE</key>
195
-                                   <integer>1</integer>
196
-                                   <key>UID</key>
197
-                                   <integer>0</integer>
198
-                               </dict>
199
-                               <dict>
200
-                                   <key>CHILDREN</key>
201
obs-backgroundremoval-1.0.3.tar.gz/cmake/bundle/macos/scripts Deleted
2
 
1
-(directory)
2
obs-backgroundremoval-1.0.3.tar.gz/cmake/bundle/windows Deleted
2
 
1
-(directory)
2
obs-backgroundremoval-1.0.3.tar.gz/cmake/bundle/windows/installer-Windows.iss.in Deleted
66
 
1
@@ -1,64 +0,0 @@
2
-#define MyAppName "@CMAKE_PROJECT_NAME@"
3
-#define MyAppVersion "@CMAKE_PROJECT_VERSION@"
4
-#define MyAppPublisher "@PLUGIN_AUTHOR@"
5
-#define MyAppURL "@PLUGIN_HOME_URL@"
6
-
7
-Setup
8
-; NOTE: The value of AppId uniquely identifies this application.
9
-; Do not use the same AppId value in installers for other applications.
10
-; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
11
-AppId={{CD703FE5-1F2C-4837-BD3D-DD840D83C3E3}
12
-AppName={#MyAppName}
13
-AppVersion={#MyAppVersion}
14
-AppPublisher={#MyAppPublisher}
15
-AppPublisherURL={#MyAppURL}
16
-AppSupportURL={#MyAppURL}
17
-AppUpdatesURL={#MyAppURL}
18
-DefaultDirName={code:GetDirName}
19
-DefaultGroupName={#MyAppName}
20
-OutputBaseFilename={#MyAppName}-{#MyAppVersion}-Windows-Installer
21
-Compression=lzma
22
-SolidCompression=yes
23
-DirExistsWarning=no
24
-
25
-Languages
26
-Name: "english"; MessagesFile: "compiler:Default.isl"
27
-
28
-Files
29
-Source: "..\release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
30
-Source: "..\LICENSE"; Flags: dontcopy
31
-; NOTE: Don't use "Flags: ignoreversion" on any shared system files
32
-
33
-Icons
34
-Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
35
-Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
36
-
37
-Code
38
-procedure InitializeWizard();
39
-var
40
-  GPLText: AnsiString;
41
-  Page: TOutputMsgMemoWizardPage;
42
-begin
43
-  ExtractTemporaryFile('LICENSE');
44
-  LoadStringFromFile(ExpandConstant('{tmp}\LICENSE'), GPLText);
45
-  Page := CreateOutputMsgMemoPage(wpWelcome,
46
-    'License Information', 'Please review the license terms before installing {#MyAppName}',
47
-    'Press Page Down to see the rest of the agreement. Once you are aware of your rights, click Next to continue.',
48
-    String(GPLText)
49
-  );
50
-end;
51
-
52
-// credit where it's due :
53
-// following function come from https://github.com/Xaymar/obs-studio_amf-encoder-plugin/blob/master/%23Resources/Installer.in.iss#L45
54
-function GetDirName(Value: string): string;
55
-var
56
-  InstallPath: string;
57
-begin
58
-  // initialize default path, which will be returned when the following registry
59
-  // key queries fail due to missing keys or for some different reason
60
-  Result := '{autopf}\obs-studio';
61
-  // query the first registry value; if this succeeds, return the obtained value
62
-  if RegQueryStringValue(HKLM32, 'SOFTWARE\OBS Studio', '', InstallPath) then
63
-    Result := InstallPath
64
-end;
65
-
66
obs-backgroundremoval-1.0.3.tar.gz/cmake/bundle/windows/resource.rc.in Deleted
34
 
1
@@ -1,32 +0,0 @@
2
-1 VERSIONINFO
3
- FILEVERSION ${PROJECT_VERSION_MAJOR},${PROJECT_VERSION_MINOR},${PROJECT_VERSION_PATCH},0
4
- PRODUCTVERSION ${PROJECT_VERSION_MAJOR},${PROJECT_VERSION_MINOR},${PROJECT_VERSION_PATCH},0
5
- FILEFLAGSMASK 0x0L
6
-#ifdef _DEBUG
7
- FILEFLAGS 0x1L
8
-#else
9
- FILEFLAGS 0x0L
10
-#endif
11
- FILEOS 0x0L
12
- FILETYPE 0x2L
13
- FILESUBTYPE 0x0L
14
-BEGIN
15
-    BLOCK "StringFileInfo"
16
-    BEGIN
17
-        BLOCK "040904b0"
18
-        BEGIN
19
-            VALUE "CompanyName", "${PLUGIN_AUTHOR}"
20
-            VALUE "FileDescription", "${PROJECT_NAME}"
21
-            VALUE "FileVersion", "${PROJECT_VERSION}"
22
-            VALUE "InternalName", "${PROJECT_NAME}"
23
-            VALUE "LegalCopyright", "(C) ${PLUGIN_AUTHOR}"
24
-            VALUE "OriginalFilename", "${PROJECT_NAME}"
25
-            VALUE "ProductName", "${PROJECT_NAME}"
26
-            VALUE "ProductVersion", "${PROJECT_VERSION}"
27
-        END
28
-    END
29
-    BLOCK "VarFileInfo"
30
-    BEGIN
31
-        VALUE "Translation", 0x409, 1200
32
-    END
33
-END
34
obs-backgroundremoval-1.0.3.tar.gz/scripts Deleted
2
 
1
-(directory)
2
obs-backgroundremoval-1.0.3.tar.gz/scripts/.gitignore Deleted
6
 
1
@@ -1,4 +0,0 @@
2
-pkg
3
-src
4
-*.tar.*
5
-*.tgz
6
obs-backgroundremoval-1.0.3.tar.gz/scripts/PKGBUILD Deleted
24
 
1
@@ -1,22 +0,0 @@
2
-pkgname=obs-backgroundremoval
3
-pkgver=0.5.17
4
-pkgrel=1
5
-pkgdesc="Background removal plugin for OBS studio"
6
-arch=(x86_64)
7
-url='https://github.com/royshil/obs-backgroundremoval'
8
-license=(GPL2)
9
-depends=(obs-studio opencv)
10
-makedepends=(cmake)
11
-source=("https://github.com/royshil/$pkgname/archive/refs/tags/v$pkgver.tar.gz")
12
-sha256sums=('7e44c352f2b1d082f7904fea4773caadf52cc666e8c64ed954a69a57c31c855b')
13
-
14
-build() {
15
-  cd "$pkgname-$pkgver"
16
-  cmake -B build -DLINUX_PORTABLE=OFF -DUSE_SYSTEM_OPENCV=ON
17
-  cmake --build build
18
-}
19
-
20
-package() {
21
-  cd "$pkgname-$pkgver"
22
-  cmake --install build --prefix "$pkgdir/usr"
23
-}
24
obs-backgroundremoval-1.0.3.tar.gz/scripts/makeOnnxruntime_osx.sh Deleted
111
 
1
@@ -1,109 +0,0 @@
2
-#!/bin/bash
3
-
4
-set -eax
5
-
6
-# get script directory
7
-SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE0}" )" &> /dev/null && pwd )"
8
-WORK_DIR="${SCRIPT_DIR}/../build"
9
-CURRENT_DIR=$(pwd)
10
-OUTPUT_DIR=$WORK_DIR/onnxruntime
11
-
12
-function verify_onnxruntime_exists() {
13
-    # check that onnxruntime libraries and include files exist
14
-    if  ! -d $OUTPUT_DIR ; then
15
-        echo "onnxruntime not found in $OUTPUT_DIR"
16
-        return 1
17
-    fi
18
-    if  ! -d $OUTPUT_DIR/include ; then
19
-        echo "onnxruntime include files not found in $OUTPUT_DIR/include"
20
-        return 1
21
-    fi
22
-    if  ! -d $OUTPUT_DIR/lib ; then
23
-        echo "onnxruntime libraries not found in $OUTPUT_DIR/lib"
24
-        return 1
25
-    fi
26
-    if  ! -f $OUTPUT_DIR/lib/libonnx.a ; then
27
-        echo "onnxruntime library not found in $OUTPUT_DIR/lib/libonnx.a"
28
-        return 1
29
-    fi
30
-    if  ! -f $OUTPUT_DIR/include/onnxruntime/core/session/onnxruntime_c_api.h ; then
31
-        echo "onnxruntime includes not found in $OUTPUT_DIR/include/onnxruntime/core/session/onnxruntime_c_api.h"
32
-        return 1
33
-    fi
34
-    echo "onnxruntime found in $OUTPUT_DIR"
35
-    return 0
36
-}
37
-
38
-# check if onnxruntime is already built using verify_onnxruntime_exists
39
-if verify_onnxruntime_exists; then
40
-    echo "onnxruntime already built"
41
-    exit 0
42
-fi
43
-
44
-# try to download onnxruntime from s3 if not already downloaded, use wget if available
45
-# https://obs-backgroundremoval-build.s3.amazonaws.com/onnxruntime-1.14.0-x86_64.tar.gz
46
-if  ! $( which wget ) ; then
47
-    echo "wget is not available, please install it e.g. `$ brew install wget`"
48
-    exit 1
49
-fi
50
-
51
-if  ! -d $WORK_DIR ; then
52
-    echo "creating work directory $WORK_DIR"
53
-    mkdir -p $WORK_DIR
54
-fi
55
-
56
-ONNXRT_TAR_FILENAME="onnxruntime-1.14.0-x86_64.tar.gz"
57
-ONNXRT_TAR_LOCATION="${WORK_DIR}/${ONNXRT_TAR_FILENAME}"
58
-if  ! -f $ONNXRT_TAR_LOCATION ; then
59
-    echo "onnxruntime tar file not found in $ONNXRT_TAR_LOCATION, downloading from s3"
60
-    wget -q -O $ONNXRT_TAR_LOCATION https://obs-backgroundremoval-build.s3.amazonaws.com/$ONNXRT_TAR_FILENAME
61
-fi
62
-if  ! -f $ONNXRT_TAR_LOCATION ; then
63
-    echo "onnxruntime tar file not found in $ONNXRT_TAR_LOCATION"
64
-    exit 1
65
-fi
66
-echo "onnxruntime tar file found in $ONNXRT_TAR_LOCATION"
67
-
68
-cd "${WORK_DIR}/.."
69
-echo "extracting onnxruntime tar file"
70
-tar -xzf $ONNXRT_TAR_LOCATION
71
-rm $ONNXRT_TAR_LOCATION
72
-cd $CURRENT_DIR
73
-
74
-# verify onnxruntime exists
75
-if verify_onnxruntime_exists; then
76
-    echo "onnxruntime successfully downloaded and extracted"
77
-    exit 0
78
-fi
79
-
80
-# build onnxruntime from source
81
-echo "building onnxruntime from source"
82
-
83
-if  -d $OUTPUT_DIR ; then
84
-    rm -rf $OUTPUT_DIR
85
-fi
86
-
87
-cd $WORK_DIR
88
-
89
-ONNXRT_VER=1.14.0
90
-ONNXRT_DIR=$WORK_DIR/onnxruntime-$ONNXRT_VER
91
-
92
-if  ! -d $ONNXRT_DIR ; then
93
-    git clone --single-branch -b v$ONNXRT_VER https://github.com/microsoft/onnxruntime $ONNXRT_DIR
94
-fi
95
-
96
-cd $ONNXRT_DIR
97
-
98
-./build.sh --config RelWithDebInfo --parallel --skip_tests
99
-
100
-cd build/MacOS/RelWithDebInfo
101
-
102
-cmake $WORK_DIR/onnxruntime-$ONNXRT_VER/cmake -DCMAKE_INSTALL_PREFIX=$OUTPUT_DIR && \
103
-    cmake --build . --target install
104
-
105
-mkdir -p $OUTPUT_DIR/lib
106
-for f in $( find . -name "lib*.a" ); do
107
-    cp $f $OUTPUT_DIR/lib
108
-done
109
-
110
-cd $CURRENT_DIR
111
obs-backgroundremoval-1.0.3.tar.gz/scripts/makeOpenCV_osx.sh Deleted
180
 
1
@@ -1,178 +0,0 @@
2
-#!/bin/bash
3
-
4
-set -e
5
-
6
-SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE0}" )" &> /dev/null && pwd )"
7
-WORK_DIR="${SCRIPT_DIR}/../build"
8
-CURRENT_DIR=$(pwd)
9
-OUTPUT_DIR=$WORK_DIR/opencv
10
-
11
-function verify_opencv_exists() {
12
-    # check that opencv libraries and include files exist
13
-    if  ! -d $OUTPUT_DIR ; then
14
-        echo "opencv not found in $OUTPUT_DIR"
15
-        return 1
16
-    fi
17
-    if  ! -d $OUTPUT_DIR/include ; then
18
-        echo "opencv include files not found in $OUTPUT_DIR/include"
19
-        return 1
20
-    fi
21
-    if  ! -d $OUTPUT_DIR/lib ; then
22
-        echo "opencv libraries not found in $OUTPUT_DIR/lib"
23
-        return 1
24
-    fi
25
-    if  ! -f $OUTPUT_DIR/lib/libopencv_core.a ; then
26
-        echo "opencv core library not found in $OUTPUT_DIR/lib/libopencv_core.a"
27
-        return 1
28
-    fi
29
-    if  ! -f $OUTPUT_DIR/lib/libopencv_imgproc.a ; then
30
-        echo "opencv imgproc library not found in $OUTPUT_DIR/lib/libopencv_imgproc.a"
31
-        return 1
32
-    fi
33
-    if  ! -f $OUTPUT_DIR/include/opencv4/opencv2/opencv.hpp ; then
34
-        echo "opencv includes not found in $OUTPUT_DIR/include/opencv4/opencv2/opencv.hpp"
35
-        return 1
36
-    fi
37
-    echo "opencv found in $OUTPUT_DIR"
38
-    return 0
39
-}
40
-
41
-# check if opencv is already built using verify_opencv_exists
42
-if verify_opencv_exists; then
43
-    echo "opencv already built"
44
-    exit 0
45
-fi
46
-
47
-# try to download opencv from s3 if not already downloaded, use wget if available
48
-echo "downloading opencv from s3"
49
-if  ! $( which wget ) ; then
50
-    echo "wget is not available, please install it e.g. `$ brew install wget`"
51
-    exit 1
52
-fi
53
-
54
-if  ! -d $WORK_DIR ; then
55
-    echo "creating work directory $WORK_DIR"
56
-    mkdir -p $WORK_DIR
57
-fi
58
-
59
-OPENCV_TAR_FILENAME="opencv-4.5.2-x86_64.tar.gz"
60
-OPENCV_TAR_LOCATION="${WORK_DIR}/${OPENCV_TAR_FILENAME}"
61
-wget -q https://obs-backgroundremoval-build.s3.amazonaws.com/opencv-4.5.2-x86_64.tar.gz -O ${OPENCV_TAR_LOCATION}
62
-
63
-if  ! -f $OPENCV_TAR_LOCATION ; then
64
-    echo "failed to download opencv from s3"
65
-    exit 1
66
-fi
67
-
68
-# extract opencv if downloaded
69
-echo "extracting opencv"
70
-cd "${SCRIPT_DIR}/../"
71
-tar xzf ${OPENCV_TAR_LOCATION}
72
-rm ${OPENCV_TAR_LOCATION}
73
-cd "${CURRENT_DIR}"
74
-
75
-if verify_opencv_exists; then
76
-    echo "opencv successfully downloaded from s3"
77
-    exit 0
78
-fi
79
-
80
-# build opencv from source
81
-echo "building opencv from source"
82
-
83
-if  -d $OUTPUT_DIR ; then
84
-    rm -rf $OUTPUT_DIR
85
-fi
86
-
87
-cd $WORK_DIR
88
-
89
-# download opencv if not already downloaded
90
-if  ! -d opencv-4.5.2 ; then
91
-    if  ! $( which wget ) ; then
92
-        echo "wget is not available, please install it e.g. `$ brew install wget`"
93
-        exit 1
94
-    fi
95
-    wget https://github.com/opencv/opencv/archive/refs/tags/4.5.2.tar.gz
96
-    tar xzf 4.5.2.tar.gz
97
-    rm 4.5.2.tar.gz
98
-fi
99
-
100
-cd opencv-4.5.2/
101
-
102
-if  ! -d build ; then
103
-    mkdir build
104
-else
105
-    rm -f build/CMakeCache.txt
106
-fi
107
-
108
-cd build
109
-
110
-# build opencv minimal (just core and imgproc)
111
-cmake .. \
112
-    -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
113
-    -DBUILD_SHARED_LIBS=OFF \
114
-    -DBUILD_opencv_apps=OFF \
115
-    -DBUILD_opencv_js=OFF \
116
-    -DBUILD_ANDROID_PROJECTS=OFF \
117
-    -DBUILD_ANDROID_EXAMPLES=OFF \
118
-    -DBUILD_DOCS=OFF \
119
-    -DBUILD_EXAMPLES=OFF \
120
-    -DBUILD_PACKAGE=OFF \
121
-    -DBUILD_PERF_TESTS=OFF \
122
-    -DBUILD_TESTS=OFF \
123
-    -DBUILD_WITH_DEBUG_INFO=OFF \
124
-    -DBUILD_WITH_STATIC_CRT=OFF \
125
-    -DBUILD_WITH_DYNAMIC_IPP=OFF \
126
-    -DBUILD_FAT_JAVA_LIB=OFF \
127
-    -DBUILD_ANDROID_SERVICE=OFF \
128
-    -DBUILD_CUDA_STUBS=OFF \
129
-    -DBUILD_JAVA=OFF \
130
-    -DBUILD_OBJC=OFF \
131
-    -DBUILD_opencv_python3=OFF \
132
-    -DINSTALL_CREATE_DISTRIB=OFF \
133
-    -DINSTALL_BIN_EXAMPLES=OFF \
134
-    -DINSTALL_C_EXAMPLES=OFF \
135
-    -DINSTALL_PYTHON_EXAMPLES=OFF \
136
-    -DINSTALL_ANDROID_EXAMPLES=OFF \
137
-    -DINSTALL_TO_MANGLED_PATHS=OFF \
138
-    -DINSTALL_TESTS=OFF \
139
-    -DBUILD_opencv_calib3d=OFF \
140
-    -DBUILD_opencv_core=ON \
141
-    -DBUILD_opencv_dnn=OFF \
142
-    -DBUILD_opencv_features2d=OFF \
143
-    -DBUILD_opencv_flann=OFF \
144
-    -DBUILD_opencv_gapi=OFF \
145
-    -DBUILD_opencv_highgui=OFF \
146
-    -DBUILD_opencv_imgcodecs=OFF \
147
-    -DBUILD_opencv_imgproc=ON \
148
-    -DBUILD_opencv_ml=OFF \
149
-    -DBUILD_opencv_objdetect=OFF \
150
-    -DBUILD_opencv_photo=OFF \
151
-    -DBUILD_opencv_stitching=OFF \
152
-    -DBUILD_opencv_video=OFF \
153
-    -DBUILD_opencv_videoio=OFF \
154
-   -DWITH_PNG=OFF \
155
-   -DWITH_JPEG=OFF \
156
-   -DWITH_TIFF=OFF \
157
-   -DWITH_WEBP=OFF \
158
-    -DWITH_OPENJPEG=OFF \
159
-    -DWITH_JASPER=OFF \
160
-   -DWITH_OPENEXR=OFF \
161
-    -DWITH_FFMPEG=OFF \
162
-    -DWITH_GSTREAMER=OFF \
163
-    -DWITH_1394=OFF \
164
-    -DCMAKE_INSTALL_PREFIX=$OUTPUT_DIR \
165
-    -DWITH_PROTOBUF=OFF \
166
-    -DBUILD_PROTOBUF=OFF \
167
-    -DWITH_CAROTENE=OFF \
168
-    -DWITH_EIGEN=OFF \
169
-    -DWITH_OPENVX=OFF \
170
-    -DWITH_CLP=OFF \
171
-    -DWITH_DIRECTX=OFF \
172
-    -DWITH_VA=OFF \
173
-    -DWITH_LAPACK=OFF \
174
-    -DWITH_QUIRC=OFF \
175
-    -DWITH_ADE=OFF \
176
-    && \
177
-    cmake --build . --target install -- -j8
178
-
179
-cd "$CURRENT_DIR"
180
obs-backgroundremoval-1.0.3.tar.gz/src/plugin-macros.h.in Deleted
29
 
1
@@ -1,27 +0,0 @@
2
-/*
3
-@PLUGIN_PRETTY_NAME@
4
-Copyright (C) 2021 @PLUGIN_AUTHOR@ @LINUX_MAINTAINER_EMAIL@
5
-
6
-This program is free software; you can redistribute it and/or modify
7
-it under the terms of the GNU General Public License as published by
8
-the Free Software Foundation; either version 2 of the License, or
9
-(at your option) any later version.
10
-
11
-This program is distributed in the hope that it will be useful,
12
-but WITHOUT ANY WARRANTY; without even the implied warranty of
13
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
-GNU General Public License for more details.
15
-
16
-You should have received a copy of the GNU General Public License along
17
-with this program. If not, see <https://www.gnu.org/licenses/>
18
-*/
19
-
20
-#ifndef PLUGINNAME_H
21
-#define PLUGINNAME_H
22
-
23
-#define PLUGIN_NAME "@CMAKE_PROJECT_NAME@"
24
-#define PLUGIN_VERSION "@CMAKE_PROJECT_VERSION@"
25
-
26
-#define blog(level, msg, ...) blog(level, "" PLUGIN_NAME " " msg, ##__VA_ARGS__)
27
-
28
-#endif // PLUGINNAME_H
29
obs-backgroundremoval-1.0.3.tar.gz/.clang-format -> obs-backgroundremoval-1.1.5.tar.gz/.clang-format Changed
50
 
1
@@ -44,29 +44,30 @@
2
 BreakBeforeTernaryOperators: true
3
 BreakConstructorInitializers: BeforeColon
4
 BreakStringLiterals: false  # apparently unpredictable
5
-ColumnLimit: 100
6
+ColumnLimit: 80
7
 CompactNamespaces: false
8
 ConstructorInitializerAllOnOneLineOrOnePerLine: true
9
-ConstructorInitializerIndentWidth: 2
10
-ContinuationIndentWidth: 2
11
+ConstructorInitializerIndentWidth: 8
12
+ContinuationIndentWidth: 8
13
 Cpp11BracedListStyle: true
14
 DerivePointerAlignment: false
15
 DisableFormat: false
16
 FixNamespaceComments: false
17
-ForEachMacros:
18
+ForEachMacros: 
19
   - 'json_object_foreach'
20
   - 'json_object_foreach_safe'
21
   - 'json_array_foreach'
22
+  - 'HASH_ITER'
23
 IncludeBlocks: Preserve
24
 IndentCaseLabels: false
25
 IndentPPDirectives: None
26
-IndentWidth: 2
27
+IndentWidth: 8
28
 IndentWrappedFunctionNames: false
29
 KeepEmptyLinesAtTheStartOfBlocks: true
30
 MaxEmptyLinesToKeep: 1
31
 NamespaceIndentation: None
32
 #ObjCBinPackProtocolList: Auto  # requires clang-format 7
33
-ObjCBlockIndentWidth: 2
34
+ObjCBlockIndentWidth: 8
35
 ObjCSpaceAfterProperty: true
36
 ObjCSpaceBeforeProtocolList: true
37
 
38
@@ -99,9 +100,9 @@
39
 SpacesInSquareBrackets: false
40
 #StatementMacros:  # requires clang-format 8
41
 #  - 'Q_OBJECT'
42
-TabWidth: 2
43
+TabWidth: 8
44
 #TypenameMacros:  # requires clang-format 9
45
 #  - 'DARRAY'
46
-UseTab: Never
47
+UseTab: ForContinuationAndIndentation
48
 ---
49
 Language: ObjC
50
obs-backgroundremoval-1.0.3.tar.gz/.cmake-format.json -> obs-backgroundremoval-1.1.5.tar.gz/.cmake-format.json Changed
43
 
1
@@ -1,4 +1,10 @@
2
 {
3
+  "format": {
4
+    "line_width": 120,
5
+    "tab_size": 2,
6
+    "enable_sort": true,
7
+    "autosort": true
8
+  },
9
   "additional_commands": {
10
     "find_qt": {
11
       "flags": ,
12
@@ -8,9 +14,27 @@
13
         "COMPONENTS_MACOS": "+",
14
         "COMPONENTS_LINUX": "+"
15
       }
16
+    },
17
+    "set_target_properties_obs": {
18
+      "pargs": 1,
19
+      "flags": ,
20
+      "kwargs": {
21
+        "PROPERTIES": {
22
+          "kwargs": {
23
+            "PREFIX": 1,
24
+            "OUTPUT_NAME": 1,
25
+            "FOLDER": 1,
26
+            "VERSION": 1,
27
+            "SOVERSION": 1,
28
+            "AUTOMOC": 1,
29
+            "AUTOUIC": 1,
30
+            "AUTORCC": 1,
31
+            "AUTOUIC_SEARCH_PATHS": 1,
32
+            "BUILD_RPATH": 1,
33
+            "INSTALL_RPATH": 1
34
+          }
35
+        }
36
+      }
37
     }
38
-  },
39
-  "format": {
40
-    "line_width": 100
41
   }
42
 }
43
obs-backgroundremoval-1.1.5.tar.gz/.github/actions/build-plugin/action.yaml Added
108
 
1
@@ -0,0 +1,106 @@
2
+name: 'Set up and build plugin'
3
+description: 'Builds the plugin for specified architecture and build config'
4
+inputs:
5
+  target:
6
+    description: 'Target architecture for dependencies'
7
+    required: true
8
+  config:
9
+    description: 'Build configuration'
10
+    required: false
11
+    default: 'RelWithDebInfo'
12
+  codesign:
13
+    description: 'Enable codesigning (macOS only)'
14
+    required: false
15
+    default: 'false'
16
+  codesignIdent:
17
+    description: 'Developer ID for application codesigning (macOS only)'
18
+    required: false
19
+    default: '-'
20
+  workingDirectory:
21
+    description: 'Working directory for packaging'
22
+    required: false
23
+    default: ${{ github.workspace }}
24
+runs:
25
+  using: composite
26
+  steps:
27
+    - name: Run macOS Build
28
+      if: runner.os == 'macOS'
29
+      shell: zsh --no-rcs --errexit --pipefail {0}
30
+      working-directory: ${{ inputs.workingDirectory }}
31
+      env:
32
+        CODESIGN_IDENT: ${{ inputs.codesignIdent }}
33
+        CODESIGN_TEAM: ${{ inputs.codesignTeam }}
34
+      run: |
35
+        : Run macOS Build
36
+
37
+        local -a build_args=(--config ${{ inputs.config }})
38
+        if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
39
+
40
+        if  '${{ inputs.codesign }}' == 'true'  build_args+=(--codesign)
41
+
42
+        .github/scripts/build-macos ${build_args}
43
+
44
+    - name: Install Dependencies 🛍️
45
+      if: runner.os == 'Linux'
46
+      shell: bash
47
+      run: |
48
+        : Install Dependencies 🛍️
49
+        echo ::group::Install Dependencies
50
+        eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
51
+        echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
52
+        brew install --quiet zsh
53
+        echo ::endgroup::
54
+
55
+    - name: Run Ubuntu Build
56
+      if: runner.os == 'Linux'
57
+      shell: zsh --no-rcs --errexit --pipefail {0}
58
+      working-directory: ${{ inputs.workingDirectory }}
59
+      run: |
60
+        : Run Ubuntu Build
61
+
62
+        local -a build_args=(
63
+          --target linux-${{ inputs.target }}
64
+          --config ${{ inputs.config }}
65
+        )
66
+        if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
67
+
68
+        .github/scripts/build-linux ${build_args}
69
+
70
+    - name: Run Windows Build
71
+      if: runner.os == 'Windows'
72
+      shell: pwsh
73
+      run: |
74
+        # Run Windows Build
75
+        if ( $Env:RUNNER_DEBUG -ne $null ) {
76
+          Set-PSDebug -Trace 1
77
+        }
78
+
79
+        $BuildArgs = @{
80
+          Target = '${{ inputs.target }}'
81
+          Configuration = '${{ inputs.config }}'
82
+        }
83
+
84
+        .github/scripts/Build-Windows.ps1 @BuildArgs
85
+
86
+    - name: Create Summary 📊
87
+      if: contains(fromJSON('"Linux", "macOS"'),runner.os)
88
+      shell: zsh --no-rcs --errexit --pipefail {0}
89
+      env:
90
+        CCACHE_CONFIGPATH: ${{ inputs.workingDirectory }}/.ccache.conf
91
+      run: |
92
+        : Create Summary 📊
93
+
94
+        local -a ccache_data
95
+        if (( ${+RUNNER_DEBUG} )) {
96
+          setopt XTRACE
97
+          ccache_data=("${(fA)$(ccache -s -vv)}")
98
+        } else {
99
+          ccache_data=("${(fA)$(ccache -s)}")
100
+        }
101
+
102
+        print '### ${{ runner.os }} Ccache Stats (${{ inputs.target }})' >> $GITHUB_STEP_SUMMARY
103
+        print '```' >> $GITHUB_STEP_SUMMARY
104
+        for line (${ccache_data}) {
105
+          print ${line} >> $GITHUB_STEP_SUMMARY
106
+        }
107
+        print '```' >> $GITHUB_STEP_SUMMARY
108
obs-backgroundremoval-1.1.5.tar.gz/.github/actions/package-plugin/action.yaml Added
119
 
1
@@ -0,0 +1,117 @@
2
+name: 'Package plugin'
3
+description: 'Packages the plugin for specified architecture and build config.'
4
+inputs:
5
+  target:
6
+    description: 'Build target for dependencies'
7
+    required: true
8
+  config:
9
+    description: 'Build configuration'
10
+    required: false
11
+    default: 'RelWithDebInfo'
12
+  codesign:
13
+    description: 'Enable codesigning (macOS only)'
14
+    required: false
15
+    default: 'false'
16
+  notarize:
17
+    description: 'Enable notarization (macOS only)'
18
+    required: false
19
+    default: 'false'
20
+  codesignIdent:
21
+    description: 'Developer ID for application codesigning (macOS only)'
22
+    required: false
23
+    default: '-'
24
+  installerIdent:
25
+    description: 'Developer ID for installer package codesigning (macOS only)'
26
+    required: false
27
+    default: ''
28
+  codesignTeam:
29
+    description: 'Developer team for codesigning (macOS only)'
30
+    required: false
31
+    default: ''
32
+  codesignUser:
33
+    description: 'Apple ID username for notarization (macOS only)'
34
+    required: false
35
+    default: ''
36
+  codesignPass:
37
+    description: 'Apple ID password for notarization (macOS only)'
38
+    required: false
39
+    default: ''
40
+  package:
41
+    description: 'Create Windows or macOS installation package'
42
+    required: false
43
+    default: 'false'
44
+  workingDirectory:
45
+    description: 'Working directory for packaging'
46
+    required: false
47
+    default: ${{ github.workspace }}
48
+runs:
49
+  using: composite
50
+  steps:
51
+    - name: Run macOS Packaging
52
+      if: runner.os == 'macOS'
53
+      shell: zsh --no-rcs --errexit --pipefail {0}
54
+      working-directory: ${{ inputs.workingDirectory }}
55
+      env:
56
+        CODESIGN_IDENT: ${{ inputs.codesignIdent }}
57
+        CODESIGN_IDENT_INSTALLER: ${{ inputs.installerIdent }}
58
+        CODESIGN_TEAM: ${{ inputs.codesignTeam }}
59
+        CODESIGN_IDENT_USER: ${{ inputs.codesignUser }}
60
+        CODESIGN_IDENT_PASS: ${{ inputs.codesignPass }}
61
+      run: |
62
+        : Run macOS Packaging
63
+
64
+        local -a package_args=(--config ${{ inputs.config }})
65
+        if (( ${+RUNNER_DEBUG} )) package_args+=(--debug)
66
+
67
+        if  '${{ inputs.codesign }}' == 'true'  package_args+=(--codesign)
68
+        if  '${{ inputs.notarize }}' == 'true'  package_args+=(--notarize)
69
+        if  '${{ inputs.package }}' == 'true'  package_args+=(--package)
70
+
71
+        .github/scripts/package-macos ${package_args}
72
+
73
+    - name: Install Dependencies 🛍️
74
+      if: runner.os == 'Linux'
75
+      shell: bash
76
+      run: |
77
+        : Install Dependencies 🛍️
78
+        echo ::group::Install Dependencies
79
+        eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
80
+        echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
81
+        brew install --quiet zsh
82
+        echo ::endgroup::
83
+
84
+    - name: Run Ubuntu Packaging
85
+      if: runner.os == 'Linux'
86
+      shell: zsh --no-rcs --errexit --pipefail {0}
87
+      working-directory: ${{ inputs.workingDirectory }}
88
+      run: |
89
+        : Run Ubuntu Packaging
90
+        package_args=(
91
+          --target linux-${{ inputs.target }}
92
+          --config ${{ inputs.config }}
93
+        )
94
+        if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
95
+
96
+        if  '${{ inputs.package }}' == 'true'  package_args+=(--package)
97
+
98
+        .github/scripts/package-linux ${package_args}
99
+
100
+    - name: Run Windows Packaging
101
+      if: runner.os == 'Windows'
102
+      shell: pwsh
103
+      run: |
104
+        # Run Windows Packaging
105
+        if ( $Env:RUNNER_DEBUG -ne $null ) {
106
+          Set-PSDebug -Trace 1
107
+        }
108
+
109
+        $PackageArgs = @{
110
+          Target = '${{ inputs.target }}'
111
+          Configuration = '${{ inputs.config }}'
112
+        }
113
+
114
+        if ( '${{ inputs.package }}' -eq 'true' ) {
115
+          $PackageArgs += @{BuildInstaller = $true}
116
+        }
117
+
118
+        .github/scripts/Package-Windows.ps1 @PackageArgs
119
obs-backgroundremoval-1.1.5.tar.gz/.github/actions/run-clang-format Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/.github/actions/run-clang-format/action.yaml Added
63
 
1
@@ -0,0 +1,61 @@
2
+name: Run clang-format
3
+description: Runs clang-format and checks for any changes introduced by it
4
+inputs:
5
+  failCondition:
6
+    description: Controls whether failed checks also fail the workflow run
7
+    required: false
8
+    default: 'never'
9
+  workingDirectory:
10
+    description: Working directory for checks
11
+    required: false
12
+    default: ${{ github.workspace }}
13
+runs:
14
+  using: composite
15
+  steps:
16
+    - name: Check Runner Operating System 🏃♂️
17
+      if: runner.os == 'Windows'
18
+      shell: bash
19
+      run: |
20
+        : Check Runner Operating System 🏃♂️
21
+        echo "::notice::run-clang-format action requires a macOS-based or Linux-based runner."
22
+        exit 2
23
+
24
+    - name: Install Dependencies 🛍️
25
+      if: runner.os == 'Linux'
26
+      shell: bash
27
+      run: |
28
+        : Install Dependencies 🛍️
29
+        echo ::group::Install Dependencies
30
+        eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
31
+        echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
32
+        echo "/home/linuxbrew/.linuxbrew/opt/clang-format@13/bin" >> $GITHUB_PATH
33
+        brew install --quiet zsh
34
+        echo ::endgroup::
35
+
36
+    - name: Run clang-format 🐉
37
+      id: result
38
+      shell: zsh --no-rcs --errexit --pipefail {0}
39
+      working-directory: ${{ inputs.workingDirectory }}
40
+      env:
41
+        GITHUB_EVENT_FORCED: ${{ github.event.forced }}
42
+        GITHUB_REF_BEFORE: ${{ github.event.before }}
43
+      run: |
44
+        : Run clang-format 🐉
45
+        if (( ${+RUNNER_DEBUG} )) setopt XTRACE
46
+
47
+        local -a changes=($(git diff --name-only HEAD~1 HEAD))
48
+        case ${GITHUB_EVENT_NAME} {
49
+          pull_request) changes=($(git diff --name-only origin/${GITHUB_BASE_REF} HEAD)) ;;
50
+          push) if  ${GITHUB_EVENT_FORCED} != true  changes=($(git diff --name-only ${GITHUB_REF_BEFORE} HEAD)) ;;
51
+          *) ;;
52
+        }
53
+
54
+        if (( ${changes(I)(*.c|*.h|*.cpp|*.hpp|*.m|*.mm)} )) {
55
+          echo ::group::Install clang-format-13
56
+          brew install --quiet obsproject/tools/clang-format@13
57
+          echo ::endgroup::
58
+
59
+          echo ::group::Run clang-format-13
60
+          ./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check
61
+          echo ::endgroup::
62
+        }
63
obs-backgroundremoval-1.1.5.tar.gz/.github/actions/run-cmake-format Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/.github/actions/run-cmake-format/action.yaml Added
61
 
1
@@ -0,0 +1,59 @@
2
+name: Run cmake-format
3
+description: Runs cmake-format and checks for any changes introduced by it
4
+inputs:
5
+  failCondition:
6
+    description: Controls whether failed checks also fail the workflow run
7
+    required: false
8
+    default: 'never'
9
+  workingDirectory:
10
+    description: Working directory for checks
11
+    required: false
12
+    default: ${{ github.workspace }}
13
+runs:
14
+  using: composite
15
+  steps:
16
+    - name: Check Runner Operating System 🏃♂️
17
+      if: runner.os == 'Windows'
18
+      shell: bash
19
+      run: |
20
+        : Check Runner Operating System 🏃♂️
21
+        echo "::notice::run-cmake-format action requires a macOS-based or Linux-based runner."
22
+        exit 2
23
+
24
+    - name: Install Dependencies 🛍️
25
+      if: runner.os == 'Linux'
26
+      shell: bash
27
+      run: |
28
+        : Install Dependencies 🛍️
29
+        echo ::group::Install Dependencies
30
+        eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
31
+        echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
32
+        brew install --quiet zsh
33
+        echo ::endgroup::
34
+
35
+    - name: Run cmake-format 🎛️
36
+      id: result
37
+      shell: zsh --no-rcs --errexit --pipefail {0}
38
+      working-directory: ${{ github.workspace }}
39
+      env:
40
+        GITHUB_EVENT_FORCED: ${{ github.event.forced }}
41
+        GITHUB_REF_BEFORE: ${{ github.event.before }}
42
+      run: |
43
+        : Run cmake-format 🎛️
44
+        if (( ${+RUNNER_DEBUG} )) setopt XTRACE
45
+
46
+        local -a changes=($(git diff --name-only HEAD~1 HEAD))
47
+        case ${GITHUB_EVENT_NAME} {
48
+          pull_request) changes=($(git diff --name-only origin/${GITHUB_BASE_REF} HEAD)) ;;
49
+          push) if  ${GITHUB_EVENT_FORCED} != true  changes=($(git diff --name-only ${GITHUB_REF_BEFORE} HEAD)) ;;
50
+          *) ;;
51
+        }
52
+
53
+        if (( ${changes(I)*.cmake|*CMakeLists.txt} )) {
54
+          echo ::group::Install cmakelang
55
+          pip3 install cmakelang
56
+          echo ::endgroup::
57
+          echo ::group::Run cmake-format
58
+          ./build-aux/run-cmake-format --fail-${{ inputs.failCondition }} --check
59
+          echo ::endgroup::
60
+        }
61
obs-backgroundremoval-1.1.5.tar.gz/.github/actions/setup-macos-codesigning Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/.github/actions/setup-macos-codesigning/action.yaml Added
156
 
1
@@ -0,0 +1,154 @@
2
+name: Set up macOS codesigning
3
+description: Sets up code signing certificates, provisioning profiles, and notarization information
4
+inputs:
5
+  codesignIdentity:
6
+    description: Codesigning identity
7
+    required: true
8
+  installerIdentity:
9
+    description: Codesigning identity for package installer
10
+    required: false
11
+  codesignCertificate:
12
+    description: PKCS12 certificate in base64 format
13
+    required: true
14
+  certificatePassword:
15
+    description: Password required to install PKCS12 certificate
16
+    required: true
17
+  keychainPassword:
18
+    description: Password to use for temporary keychain
19
+    required: false
20
+  notarizationUser:
21
+    description: Apple ID to use for notarization
22
+    required: false
23
+  notarizationPassword:
24
+    description: Application password for notarization
25
+  provisioningProfile:
26
+    description: Provisioning profile in base64 format
27
+    required: false
28
+outputs:
29
+  haveCodesignIdent:
30
+    description: True if necessary codesigning credentials were found
31
+    value: ${{ steps.codesign.outputs.haveCodesignIdent }}
32
+  haveProvisioningProfile:
33
+    description: True if necessary provisioning profile credentials were found
34
+    value: ${{ steps.provisioning.outputs.haveProvisioningProfile }}
35
+  haveNotarizationUser:
36
+    description: True if necessary notarization credentials were found
37
+    value: ${{ steps.notarization.outputs.haveNotarizationUser }}
38
+  codesignIdent:
39
+    description: Codesigning identity
40
+    value: ${{ steps.codesign.outputs.codesignIdent }}
41
+  installerIdent:
42
+    description: Codesigning identity for package installer
43
+    value: ${{ steps.codesign.outputs.installerIdent }}
44
+  codesignTeam:
45
+    description: Codesigning team
46
+    value: ${{ steps.codesign.outputs.codesignTeam }}
47
+runs:
48
+  using: composite
49
+  steps:
50
+    - name: Check Runner Operating System 🏃♂️
51
+      if: runner.os != 'macOS'
52
+      shell: bash
53
+      run: |
54
+        : Check Runner Operating System 🏃♂️
55
+        echo "setup-macos-codesigning action requires a macOS-based runner."
56
+        exit 2
57
+
58
+    - name: macOS Codesigning ✍️
59
+      shell: zsh --no-rcs --errexit --pipefail {0}
60
+      id: codesign
61
+      env:
62
+        MACOS_SIGNING_IDENTITY: ${{ inputs.codesignIdentity }}
63
+        MACOS_SIGNING_IDENTITY_INSTALLER: ${{ inputs.installerIdentity}}
64
+        MACOS_SIGNING_CERT: ${{ inputs.codesignCertificate }}
65
+        MAOCS_SIGNING_CERT_PASSWORD: ${{ inputs.certificatePassword }}
66
+        MACOS_KEYCHAIN_PASSWORD: ${{ inputs.keychainPassword }}
67
+      run: |
68
+        : macOS Codesigning ✍️
69
+        if (( ${+RUNNER_DEBUG} )) setopt XTRACE
70
+
71
+        if  ${MACOS_SIGNING_IDENTITY} && ${MACOS_SIGNING_IDENTITY_INSTALLER} && ${MACOS_SIGNING_CERT}  {
72
+          print 'haveCodesignIdent=true' >> $GITHUB_OUTPUT
73
+
74
+          local -r certificate_path="${RUNNER_TEMP}/build_certificate.p12"
75
+          local -r keychain_path="${RUNNER_TEMP}/app-signing.keychain-db"
76
+
77
+          print -n "${MACOS_SIGNING_CERT}" | base64 --decode --output="${certificate_path}"
78
+
79
+          : "${MACOS_KEYCHAIN_PASSWORD:="$(print ${RANDOM} | sha1sum | head -c 32)"}"
80
+
81
+          print '::group::Keychain setup'
82
+          security create-keychain -p "${MACOS_KEYCHAIN_PASSWORD}" ${keychain_path}
83
+          security set-keychain-settings -lut 21600 ${keychain_path}
84
+          security unlock-keychain -p "${MACOS_KEYCHAIN_PASSWORD}" ${keychain_path}
85
+
86
+          security import "${certificate_path}" -P "${MAOCS_SIGNING_CERT_PASSWORD}" -A \
87
+            -t cert -f pkcs12 -k ${keychain_path} \
88
+            -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/xcrun
89
+
90
+          security set-key-partition-list -S 'apple-tool:,apple:' -k "${MACOS_KEYCHAIN_PASSWORD}" \
91
+            ${keychain_path} &> /dev/null
92
+
93
+          security list-keychain -d user -s ${keychain_path} 'login-keychain'
94
+          print '::endgroup::'
95
+
96
+          local -r team_id="${${MACOS_SIGNING_IDENTITY##* }//(\(|\))/}"
97
+
98
+          print "codesignIdent=${MACOS_SIGNING_IDENTITY}" >> $GITHUB_OUTPUT
99
+          print "installerIdent=${MACOS_SIGNING_IDENTITY_INSTALLER}" >> $GITHUB_OUTPUT
100
+          print "MACOS_KEYCHAIN_PASSWORD=${MACOS_KEYCHAIN_PASSWORD}" >> $GITHUB_ENV
101
+          print "codesignTeam=${team_id}" >> $GITHUB_OUTPUT
102
+        } else {
103
+          print 'haveCodesignIdent=false' >> $GITHUB_OUTPUT
104
+        }
105
+
106
+    - name: Provisioning Profile 👤
107
+      shell: zsh --no-rcs --errexit --pipefail {0}
108
+      id: provisioning
109
+      if: ${{ fromJSON(steps.codesign.outputs.haveCodesignIdent) }}
110
+      env:
111
+          MACOS_SIGNING_PROVISIONING_PROFILE: ${{ inputs.provisioningProfile }}
112
+      run: |
113
+        : Provisioning Profile 👤
114
+        if (( ${+RUNNER_DEBUG} )) setopt XTRACE
115
+
116
+        if  ${MACOS_SIGNING_PROVISIONING_PROFILE}  {
117
+          print 'haveProvisioningProfile=true' >> $GITHUB_OUTPUT
118
+
119
+          local -r profile_path="${RUNNER_TEMP}/build_profile.provisionprofile"
120
+          print -n "${MACOS_SIGNING_PROVISIONING_PROFILE}" \
121
+            | base64 --decode --output ${profile_path}
122
+
123
+          print '::group::Provisioning Profile Setup'
124
+          mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
125
+          security cms -D -i ${profile_path} -o ${RUNNER_TEMP}/build_profile.plist
126
+          local -r uuid="$(plutil -extract UUID raw ${RUNNER_TEMP}/build_profile.plist)"
127
+          local -r team_id="$(plutil -extract TeamIdentifier.0 raw -expect string ${RUNNER_TEMP}/build_profile.plist)"
128
+
129
+          if  ${team_id} != '${{ steps.codesign.codesignTeam }}'  {
130
+            print '::notice::Code Signing team in provisioning profile does not match certificate.'
131
+          }
132
+
133
+          cp ${profile_path} ~/Library/MobileDevice/Provisioning\ Profiles/${uuid}.provisionprofile
134
+          print "provisioningProfileUUID=${uuid}" >> $GITHUB_OUTPUT
135
+          print '::endgroup::'
136
+        } else {
137
+          print 'haveProvisioningProfile=false' >> $GITHUB_OUTPUT
138
+        }
139
+
140
+    - name: Notarization 🧑💼
141
+      shell: zsh --no-rcs --errexit --pipefail {0}
142
+      id: notarization
143
+      if: ${{ fromJSON(steps.codesign.outputs.haveCodesignIdent) }}
144
+      env:
145
+          MACOS_NOTARIZATION_USERNAME: ${{ inputs.notarizationUser }}
146
+          MACOS_NOTARIZATION_PASSWORD: ${{ inputs.notarizationPassword }}
147
+      run: |
148
+        : Notarization 🧑💼
149
+        if (( ${+RUNNER_DEBUG} )) setopt XTRACE
150
+
151
+        if  ${MACOS_NOTARIZATION_USERNAME} && ${MACOS_NOTARIZATION_PASSWORD}  {
152
+          print 'haveNotarizationUser=true' >> $GITHUB_OUTPUT
153
+        } else {
154
+          print 'haveNotarizationUser=false' >> $GITHUB_OUTPUT
155
+        }
156
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/.Aptfile -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/.Aptfile Changed
11
 
1
@@ -1,9 +1,6 @@
2
 package 'cmake'
3
 package 'ccache'
4
-package 'curl'
5
 package 'git'
6
 package 'jq'
7
 package 'ninja-build', bin: 'ninja'
8
 package 'pkg-config'
9
-package 'clang'
10
-package 'clang-format-13'
11
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/.Brewfile -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/.Brewfile Changed
7
 
1
@@ -3,4 +3,4 @@
2
 brew "cmake"
3
 brew "git"
4
 brew "jq"
5
-brew "ninja"
6
+brew "xcbeautify"
7
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/.Wingetfile -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/.Wingetfile Changed
5
 
1
@@ -1,3 +1,2 @@
2
-package '7zip.7zip', path: '7-zip', bin: '7z'
3
 package 'cmake', path: 'Cmake\bin', bin: 'cmake'
4
 package 'innosetup', path: 'Inno Setup 6', bin: 'iscc'
5
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/.build.zsh -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/.build.zsh Changed
201
 
1
@@ -17,56 +17,76 @@
2
 # setopt XTRACE
3
 
4
 autoload -Uz is-at-least && if ! is-at-least 5.2; then
5
-  print -u2 -PR "%F{1}${funcstack1##*/}:%f Running on Zsh version %B${ZSH_VERSION}%b, but Zsh %B5.2%b is the minimum supported version. Upgrade Zsh to fix this issue."
6
+  print -u2 -PR "${CI:+::error::}%F{1}${funcstack1##*/}:%f Running on Zsh version %B${ZSH_VERSION}%b, but Zsh %B5.2%b is the minimum supported version. Upgrade Zsh to fix this issue."
7
   exit 1
8
 fi
9
 
10
-_trap_error() {
11
-  print -u2 -PR '%F{1}    ✖︎ script execution error%f'
12
-  print -PR -e "
13
+TRAPEXIT() {
14
+  local return_value=$?
15
+
16
+  if (( ${+CI} )) unset NSUnbufferedIO
17
+
18
+  return ${return_value}
19
+}
20
+
21
+TRAPZERR() {
22
+  if (( ${_loglevel:-3} > 2 )) {
23
+    print -u2 -PR "${CI:+::error::}%F{1}    ✖︎ script execution error%f"
24
+    print -PR -e "
25
     Callstack:
26
     ${(j:\n     :)funcfiletrace}
27
-  "
28
+    "
29
+  }
30
+
31
   exit 2
32
 }
33
 
34
 build() {
35
   if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h}
36
   local host_os=${${(s:-:)ZSH_ARGZERO:t:r}2}
37
-  local target="${host_os}-${CPUTYPE}"
38
   local project_root=${SCRIPT_HOME:A:h:h}
39
-  local buildspec_file="${project_root}/buildspec.json"
40
-
41
-  trap '_trap_error' ZERR
42
+  local buildspec_file=${project_root}/buildspec.json
43
 
44
   fpath=("${SCRIPT_HOME}/utils.zsh" ${fpath})
45
-  autoload -Uz log_info log_error log_output set_loglevel check_${host_os} setup_${host_os} setup_obs setup_ccache
46
+  autoload -Uz log_group log_info log_error log_output set_loglevel check_${host_os} setup_ccache
47
 
48
   if  ! -r ${buildspec_file}  {
49
     log_error \
50
-      'No buildspec.json found. Please create a build specification for your project.' \
51
-      'A buildspec.json.template file is provided in the repository to get you started.'
52
+      'No buildspec.json found. Please create a build specification for your project.'
53
     return 2
54
   }
55
 
56
   typeset -g -a skips=()
57
-  local -i _verbosity=1
58
-  local -r _version='1.0.0'
59
+  local -i verbosity=1
60
+  local -r _version='2.0.0'
61
   local -r -a _valid_targets=(
62
-    macos-x86_64
63
-    macos-arm64
64
     macos-universal
65
     linux-x86_64
66
     linux-aarch64
67
   )
68
+  local target
69
+  local config='RelWithDebInfo'
70
   local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel)
71
-  if  ${host_os} == 'macos'  {
72
-    local -r -a _valid_generators=(Xcode Ninja 'Unix Makefiles')
73
-    local generator="${${CI:+Ninja}:-Xcode}"
74
-  } else {
75
+  local -i codesign=0
76
+
77
+  if  ${host_os} == linux  {
78
     local -r -a _valid_generators=(Ninja 'Unix Makefiles')
79
     local generator='Ninja'
80
+    local -r _usage_host="
81
+%F{yellow} Additional options for Linux builds%f
82
+ -----------------------------------------------------------------------------
83
+  %B--generator%b                       Specify build system to generate
84
+                                    Available generators:
85
+                                      - Ninja
86
+                                      - Unix Makefiles"
87
+  } elif  ${host_os} == macos  {
88
+    local -r _usage_host="
89
+%F{yellow} Additional options for macOS builds%f
90
+ -----------------------------------------------------------------------------
91
+  %B-s | --codesign%b                   Enable codesigning (macOS only)"
92
   }
93
+
94
+  local -i print_config=0
95
   local -r _usage="
96
 Usage: %B${functrace1%:*}%b <option> <options>
97
 
98
@@ -74,26 +94,21 @@
99
 
100
 %F{yellow} Build configuration options%f
101
  -----------------------------------------------------------------------------
102
-  %B-t | --target%b                     Specify target - default: %B%F{green}${host_os}-${CPUTYPE}%f%b
103
-  %B-c | --config%b                     Build configuration - default: %B%F{green}RelWithDebInfo%f%b
104
-  %B-s | --codesign%b                   Enable codesigning (macOS only)
105
-  %B--generator%b                       Specify build system to generate - default: %B%F{green}Ninja%f%b
106
-                                    Available generators:
107
-                                      - Ninja
108
-                                      - Unix Makefiles
109
-                                      - Xcode (macOS only)
110
+  %B-t | --target%b                     Specify target
111
+  %B-c | --config%b                     Build configuration
112
+  %B--skip-all|build|deps%b           Skip all|building|checking for dependencies
113
 
114
 %F{yellow} Output options%f
115
  -----------------------------------------------------------------------------
116
   %B-q | --quiet%b                      Quiet (error output only)
117
   %B-v | --verbose%b                    Verbose (more detailed output)
118
-  %B--skip-all|build|deps|unpack%b    Skip all|building OBS|checking for dependencies|unpacking dependencies
119
   %B--debug%b                           Debug (very detailed and added output)
120
 
121
 %F{yellow} General options%f
122
  -----------------------------------------------------------------------------
123
   %B-h | --help%b                       Print this usage help
124
-  %B-V | --version%b                    Print script version information"
125
+  %B-V | --version%b                    Print script version information
126
+${_usage_host:-}"
127
 
128
   local -a args
129
   while (( # )) {
130
@@ -127,27 +142,30 @@
131
           log_output ${_usage}
132
           exit 2
133
         }
134
-        BUILD_CONFIG=${2}
135
+        config=${2}
136
         shift 2
137
         ;;
138
-      -s|--codesign) CODESIGN=1; shift ;;
139
-      -q|--quiet) (( _verbosity -= 1 )) || true; shift ;;
140
-      -v|--verbose) (( _verbosity += 1 )); shift ;;
141
+      -s|--codesign) codesign=1; shift ;;
142
+      -q|--quiet) (( verbosity -= 1 )) || true; shift ;;
143
+      -v|--verbose) (( verbosity += 1 )); shift ;;
144
       -h|--help) log_output ${_usage}; exit 0 ;;
145
       -V|--version) print -Pr "${_version}"; exit 0 ;;
146
-      --debug) _verbosity=3; shift ;;
147
+      --debug) verbosity=3; shift ;;
148
       --generator)
149
-        if (( ! ${_valid_generators(Ie)${2}} )) {
150
-          log_error "Invalid value %B${2}%b for option %B${1}%b"
151
-          log_output ${_usage}
152
-          exit 2
153
+        if  ${host_os} == linux  {
154
+          if (( ! ${_valid_generators(Ie)${2}} )) {
155
+            log_error "Invalid value %B${2}%b for option %B${1}%b"
156
+            log_output ${_usage}
157
+            exit 2
158
+          }
159
+          generator=${2}
160
         }
161
-        generator=${2}
162
         shift 2
163
         ;;
164
+      --print-config) print_config=1; skips+=(deps); shift ;;
165
       --skip-*)
166
-        local _skip="${${(s:-:)1}-1}"
167
-        local _check=(all deps unpack build)
168
+        local -r _skip="${${(s:-:)1}-1}"
169
+        local -r -a _check=(all build deps)
170
         (( ${_check(Ie)${_skip}} )) || log_warning "Invalid skip mode %B${_skip}%b supplied"
171
         typeset -g -a skips=(${skips} ${_skip})
172
         shift
173
@@ -156,92 +174,120 @@
174
     }
175
   }
176
 
177
+  : "${target:="${host_os}-${CPUTYPE}"}"
178
+
179
   set -- ${(@)args}
180
-  set_loglevel ${_verbosity}
181
+  set_loglevel ${verbosity}
182
 
183
-  check_${host_os}
184
-  setup_ccache
185
+  if (( ! (${skips(Ie)all} + ${skips(Ie)deps}) )) {
186
+    check_${host_os}
187
+    setup_ccache
188
+  }
189
 
190
-  typeset -g QT_VERSION
191
-  typeset -g DEPLOYMENT_TARGET
192
-  typeset -g OBS_DEPS_VERSION
193
-  setup_${host_os}
194
+  if  ${host_os} == linux  {
195
+    autoload -Uz setup_linux && setup_linux
196
+  }
197
 
198
   local product_name
199
   local product_version
200
   read -r product_name product_version <<< \
201
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/.package.zsh -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/.package.zsh Changed
201
 
1
@@ -17,40 +17,70 @@
2
 # setopt XTRACE
3
 
4
 autoload -Uz is-at-least && if ! is-at-least 5.2; then
5
-  print -u2 -PR "%F{1}${funcstack1##*/}:%f Running on Zsh version %B${ZSH_VERSION}%b, but Zsh %B5.2%b is the minimum supported version. Upgrade Zsh to fix this issue."
6
+  print -u2 -PR "${CI:+::error::}%F{1}${funcstack1##*/}:%f Running on Zsh version %B${ZSH_VERSION}%b, but Zsh %B5.2%b is the minimum supported version. Upgrade Zsh to fix this issue."
7
   exit 1
8
 fi
9
 
10
-_trap_error() {
11
-  print -u2 -PR '%F{1}    ✖︎ script execution error%f'
12
-  print -PR -e "
13
+TRAPEXIT() {
14
+  local return_value=$?
15
+
16
+  if (( ${+CI} )) {
17
+    unset NSUnbufferedIO
18
+  }
19
+
20
+  return ${return_value}
21
+}
22
+
23
+TRAPZERR() {
24
+  if (( ${_loglevel:-3} > 2 )) {
25
+    print -u2 -PR "${CI:+::error::}%F{1}    ✖︎ script execution error%f"
26
+    print -PR -e "
27
     Callstack:
28
     ${(j:\n     :)funcfiletrace}
29
-  "
30
+    "
31
+  }
32
+
33
   exit 2
34
 }
35
 
36
 package() {
37
   if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h}
38
   local host_os=${${(s:-:)ZSH_ARGZERO:t:r}2}
39
-  local target="${host_os}-${CPUTYPE}"
40
   local project_root=${SCRIPT_HOME:A:h:h}
41
-  local buildspec_file="${project_root}/buildspec.json"
42
-  trap '_trap_error' ZERR
43
+  local buildspec_file=${project_root}/buildspec.json
44
 
45
   fpath=("${SCRIPT_HOME}/utils.zsh" ${fpath})
46
-  autoload -Uz set_loglevel log_info log_error log_output check_${host_os}
47
+  autoload -Uz set_loglevel log_info log_group log_error log_output check_${host_os}
48
+
49
+  if  ! -r ${buildspec_file}  {
50
+    log_error \
51
+      'No buildspec.json found. Please create a build specification for your project.'
52
+    return 2
53
+  }
54
 
55
-  local -i _verbosity=1
56
-  local -r _version='1.0.0'
57
+  local -i verbosity=1
58
+  local -r _version='2.0.0'
59
   local -r -a _valid_targets=(
60
-    macos-x86_64
61
-    macos-arm64
62
     macos-universal
63
     linux-x86_64
64
-    linux-aarch64
65
   )
66
+  local target
67
+  local config='RelWithDebInfo'
68
   local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel)
69
+  local -i codesign=0
70
+  local -i notarize=0
71
+  local -i package=0
72
+  local -i skip_deps=0
73
+
74
+  if  ${host_os} == macos  {
75
+    local -r _usage_host="
76
+%F{yellow} Additional options for macOS builds%f
77
+ -----------------------------------------------------------------------------
78
+  %B-s | --codesign%b                   Enable codesigning (macOS only)
79
+  %B-n | --notarize%b                   Enable notarization (macOS only)
80
+  %B-p | --package%b                    Create package installer (macOS only)"
81
+  }
82
+
83
   local -r _usage="
84
 Usage: %B${functrace1%:*}%b <option> <options>
85
 
86
@@ -58,10 +88,9 @@
87
 
88
 %F{yellow} Package configuration options%f
89
  -----------------------------------------------------------------------------
90
-  %B-t | --target%b                     Specify target - default: %B%F{green}${host_os}-${CPUTYPE}%f%b
91
-  %B-c | --config%b                     Build configuration - default: %B%F{green}RelWithDebInfo%f%b
92
-  %B-s | --codesign%b                   Enable codesigning (macOS only)
93
-  %B-n | --notarize%b                   Enable notarization (macOS only)
94
+  %B-t | --target%b                     Specify target
95
+  %B-c | --config%b                     Build configuration
96
+  %B--skip-deps%b                       Skip checking for dependencies
97
 
98
 %F{yellow} Output options%f
99
  -----------------------------------------------------------------------------
100
@@ -72,7 +101,8 @@
101
 %F{yellow} General options%f
102
  -----------------------------------------------------------------------------
103
   %B-h | --help%b                       Print this usage help
104
-  %B-V | --version%b                    Print script version information"
105
+  %B-V | --version%b                    Print script version information
106
+${_usage_host:-}"
107
 
108
   local -a args
109
   while (( # )) {
110
@@ -101,97 +131,150 @@
111
         shift 2
112
         ;;
113
       -c|--config)
114
-        if (( ! ${_valid_configs(Ie)${2}} )) {
115
+        if (( !${_valid_configs(Ie)${2}} )) {
116
           log_error "Invalid value %B${2}%b for option %B${1}%b"
117
           log_output ${_usage}
118
           exit 2
119
         }
120
-        BUILD_CONFIG=${2}
121
+        config=${2}
122
         shift 2
123
         ;;
124
-      -s|--codesign) typeset -g CODESIGN=1; shift ;;
125
-      -n|--notarize) typeset -g NOTARIZE=1; typeset -g CODESIGN=1; shift ;;
126
-      -q|--quiet) (( _verbosity -= 1 )) || true; shift ;;
127
-      -v|--verbose) (( _verbosity += 1 )); shift ;;
128
+      -s|--codesign) typeset -g codesign=1; shift ;;
129
+      -n|--notarize) typeset -g notarize=1; typeset -g codesign=1; shift ;;
130
+      -p|--package) typeset -g package=1; shift ;;
131
+      --skip-deps) typeset -g skip_deps=1; shift ;;
132
+      -q|--quiet) (( verbosity -= 1 )) || true; shift ;;
133
+      -v|--verbose) (( verbosity += 1 )); shift ;;
134
       -h|--help) log_output ${_usage}; exit 0 ;;
135
       -V|--version) print -Pr "${_version}"; exit 0 ;;
136
-      --debug) _verbosity=3; shift ;;
137
+      --debug) verbosity=3; shift ;;
138
       *) log_error "Unknown option: %B${1}%b"; log_output ${_usage}; exit 2 ;;
139
     }
140
   }
141
 
142
+  : "${target:="${host_os}-${CPUTYPE}"}"
143
+
144
   set -- ${(@)args}
145
-  set_loglevel ${_verbosity}
146
+  set_loglevel ${verbosity}
147
 
148
-  check_${host_os}
149
+  if (( ! skip_deps )) {
150
+    check_${host_os}
151
+  }
152
 
153
   local product_name
154
   local product_version
155
   read -r product_name product_version <<< \
156
-    "$(jq -r '. | {name, version} | join(" ")' ${project_root}/buildspec.json)"
157
+    "$(jq -r '. | {name, version} | join(" ")' ${buildspec_file})"
158
 
159
-  if  ${host_os} == 'macos'  {
160
+  if  ${host_os} == macos  {
161
     autoload -Uz check_packages read_codesign read_codesign_installer read_codesign_pass
162
 
163
-    local output_name="${product_name}-${product_version}-${host_os}-${target##*-}.pkg"
164
+    local output_name="${product_name}-${product_version}-${host_os}-universal"
165
 
166
-    if  ! -d ${project_root}/release/${product_name}.plugin  {
167
+    if  ! -d ${project_root}/release/${config}/${product_name}.plugin  {
168
       log_error 'No release artifact found. Run the build script or the CMake install procedure first.'
169
       return 2
170
     }
171
 
172
-    if  ! -f ${project_root}/build_${target##*-}/installer-macos.generated.pkgproj  {
173
-      log_error 'Packages project file not found. Run the build script or the CMake build and install procedures first.'
174
-      return 2
175
-    }
176
-
177
-    log_info "Packaging ${product_name}..."
178
-    pushd ${project_root}
179
-    pkgbuild \
180
-      --component "${project_root}/release/obs-backgroundremoval.plugin" \
181
-      --install-location "/Library/Application Support/obs-studio/plugins" \
182
-      --scripts "${project_root}/cmake/bundle/macos/scripts" \
183
-       "${project_root}/release/${product_name}-flat.pkg"
184
-    productbuild \
185
-      --distribution "${project_root}/cmake/bundle/macos/Distribution.xml" \
186
-      --package-path "${project_root}/release" \
187
-      "${project_root}/release/${product_name}.pkg"
188
-    rm "${project_root}/release/${product_name}-flat.pkg"
189
-
190
-    if (( ${+CODESIGN} )) {
191
-      read_codesign_installer
192
-      productsign \
193
-        --sign "${CODESIGN_IDENT_INSTALLER}" \
194
-        "${project_root}/release/${product_name}.pkg" \
195
-        "${project_root}/release/${output_name}"
196
-
197
-      rm "${project_root}/release/${product_name}.pkg"
198
-    } else {
199
-      mv "${project_root}/release/${product_name}.pkg" \
200
-        "${project_root}/release/${output_name}"
201
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/Build-Windows.ps1 -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/Build-Windows.ps1 Changed
133
 
1
@@ -1,15 +1,12 @@
2
 CmdletBinding()
3
 param(
4
+    ValidateSet('x64')
5
+    string $Target = 'x64',
6
     ValidateSet('Debug', 'RelWithDebInfo', 'Release', 'MinSizeRel')
7
     string $Configuration = 'RelWithDebInfo',
8
-    ValidateSet('x86', 'x64')
9
-    string $Target,
10
-    ValidateSet('Visual Studio 17 2022', 'Visual Studio 16 2019')
11
-    string $CMakeGenerator,
12
     switch $SkipAll,
13
     switch $SkipBuild,
14
-    switch $SkipDeps,
15
-    switch $SkipUnpack
16
+    switch $SkipDeps
17
 )
18
 
19
 $ErrorActionPreference = 'Stop'
20
@@ -19,6 +16,10 @@
21
     $InformationPreference = 'Continue'
22
 }
23
 
24
+if ( ! ( System.Environment::Is64BitOperatingSystem ) ) {
25
+    throw "A 64-bit system is required to build the project."
26
+}
27
+
28
 if ( $PSVersionTable.PSVersion -lt '7.0.0' ) {
29
     Write-Warning 'The obs-deps PowerShell build script requires PowerShell Core 7. Install or upgrade your PowerShell version: https://aka.ms/pscore6'
30
     exit 2
31
@@ -28,6 +29,7 @@
32
     trap {
33
         Pop-Location -Stack BuildTemp -ErrorAction 'SilentlyContinue'
34
         Write-Error $_
35
+        Log-Group
36
         exit 2
37
     }
38
 
39
@@ -46,56 +48,58 @@
40
     $ProductName = $BuildSpec.name
41
     $ProductVersion = $BuildSpec.version
42
 
43
-    $script:DepsVersion = ''
44
-    $script:QtVersion = '5'
45
-    $script:VisualStudioVersion = ''
46
-    $script:PlatformSDK = '10.0.18363.657'
47
-
48
-    Setup-Host
49
-
50
-    if ( $CmakeGenerator -eq '' ) {
51
-        $CmakeGenerator = $script:VisualStudioVersion
52
+    if ( ! $SkipDeps ) {
53
+        Install-BuildDependencies -WingetFile "${ScriptHome}/.Wingetfile"
54
     }
55
 
56
-    (Get-Content -Path ${ProjectRoot}/CMakeLists.txt -Raw) `
57
-        -replace "project\((.*) VERSION (.*)\)", "project(${ProductName} VERSION ${ProductVersion})" `
58
-        | Out-File -Path ${ProjectRoot}/CMakeLists.txt -NoNewline
59
-
60
-    Setup-Obs
61
-
62
     Push-Location -Stack BuildTemp
63
     if ( ! ( ( $SkipAll ) -or ( $SkipBuild ) ) ) {
64
         Ensure-Location $ProjectRoot
65
 
66
-        $DepsPath = "plugin-deps-${script:DepsVersion}-qt${script:QtVersion}-${script:Target}"
67
-        $CmakeArgs = @(
68
-            '-G', $CmakeGenerator
69
-            "-DCMAKE_SYSTEM_VERSION=${script:PlatformSDK}"
70
-            "-DCMAKE_GENERATOR_PLATFORM=$(if (${script:Target} -eq "x86") { "Win32" } else { "x64" })"
71
-            "-DCMAKE_BUILD_TYPE=${Configuration}"
72
-            "-DCMAKE_PREFIX_PATH:PATH=$(Resolve-Path -Path "${ProjectRoot}/../obs-build-dependencies/${DepsPath}")"
73
-            "-DQT_VERSION=${script:QtVersion}"
74
+        $CmakeArgs = @()
75
+        $CmakeBuildArgs = @()
76
+        $CmakeInstallArgs = @()
77
+
78
+        if ( $VerbosePreference -eq 'Continue' ) {
79
+            $CmakeBuildArgs += ('--verbose')
80
+            $CmakeInstallArgs += ('--verbose')
81
+        }
82
+
83
+        if ( $DebugPreference -eq 'Continue' ) {
84
+            $CmakeArgs += ('--debug-output')
85
+        }
86
+
87
+        $Preset = "windows-$(if ( $Env:CI -ne $null ) { 'ci-' })${Target}"
88
+
89
+        $CmakeArgs += @(
90
+            '--preset', $Preset
91
         )
92
 
93
-        Log-Debug "Attempting to configure OBS with CMake arguments: $($CmakeArgs | Out-String)"
94
-        Log-Information "Configuring ${ProductName}..."
95
-        Invoke-External cmake -S . -B build_${script:Target} @CmakeArgs
96
+        $CmakeBuildArgs += @(
97
+            '--build'
98
+            '--preset', $Preset
99
+            '--config', $Configuration
100
+            '--parallel'
101
+            '--', '/consoleLoggerParameters:Summary', '/noLogo'
102
+        )
103
 
104
-        $CmakeArgs = @(
105
-            '--config', "${Configuration}"
106
+        $CmakeInstallArgs += @(
107
+            '--install', "build_${Target}"
108
+            '--prefix', "${ProjectRoot}/release/${Configuration}"
109
+            '--config', $Configuration
110
         )
111
 
112
-        if ( $VerbosePreference -eq 'Continue' ) {
113
-            $CmakeArgs+=('--verbose')
114
-        }
115
+        Log-Group "Configuring ${ProductName}..."
116
+        Invoke-External cmake @CmakeArgs
117
 
118
-        Log-Information "Building ${ProductName}..."
119
-        Invoke-External cmake --build "build_${script:Target}" @CmakeArgs
120
+        Log-Group "Building ${ProductName}..."
121
+        Invoke-External cmake @CmakeBuildArgs
122
     }
123
-    Log-Information "Install ${ProductName}..."
124
-    Invoke-External cmake --install "build_${script:Target}" --prefix "${ProjectRoot}/release" @CmakeArgs
125
+    Log-Group "Install ${ProductName}..."
126
+    Invoke-External cmake @CmakeInstallArgs
127
 
128
     Pop-Location -Stack BuildTemp
129
+    Log-Group
130
 }
131
 
132
 Build
133
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/Package-Windows.ps1 -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/Package-Windows.ps1 Changed
99
 
1
@@ -1,10 +1,11 @@
2
 CmdletBinding()
3
 param(
4
+    ValidateSet('x64')
5
+    string $Target = 'x64',
6
     ValidateSet('Debug', 'RelWithDebInfo', 'Release', 'MinSizeRel')
7
     string $Configuration = 'RelWithDebInfo',
8
-    ValidateSet('x86', 'x64', 'x86+x64')
9
-    string $Target,
10
-    switch $BuildInstaller = $false
11
+    switch $BuildInstaller,
12
+    switch $SkipDeps
13
 )
14
 
15
 $ErrorActionPreference = 'Stop'
16
@@ -14,14 +15,21 @@
17
     $InformationPreference = 'Continue'
18
 }
19
 
20
+if ( ! ( System.Environment::Is64BitOperatingSystem ) ) {
21
+    throw "Packaging script requires a 64-bit system to build and run."
22
+}
23
+
24
+
25
 if ( $PSVersionTable.PSVersion -lt '7.0.0' ) {
26
-    Write-Warning 'The obs-deps PowerShell build script requires PowerShell Core 7. Install or upgrade your PowerShell version: https://aka.ms/pscore6'
27
+    Write-Warning 'The packaging script requires PowerShell Core 7. Install or upgrade your PowerShell version: https://aka.ms/pscore6'
28
     exit 2
29
 }
30
 
31
 function Package {
32
     trap {
33
+        Pop-Location -Stack BuildTemp -ErrorAction 'SilentlyContinue'
34
         Write-Error $_
35
+        Log-Group
36
         exit 2
37
     }
38
 
39
@@ -42,9 +50,9 @@
40
 
41
     $OutputName = "${ProductName}-${ProductVersion}-windows-${Target}"
42
 
43
-    Install-BuildDependencies -WingetFile "${ScriptHome}/.Wingetfile"
44
-
45
-    Log-Information "Packaging ${ProductName}..."
46
+    if ( ! $SkipDeps ) {
47
+        Install-BuildDependencies -WingetFile "${ScriptHome}/.Wingetfile"
48
+    }
49
 
50
     $RemoveArgs = @{
51
         ErrorAction = 'SilentlyContinue'
52
@@ -57,17 +65,8 @@
53
     Remove-Item @RemoveArgs
54
 
55
     if ( ( $BuildInstaller ) ) {
56
-        if ( $Target -eq 'x86+x64' ) {
57
-            $IsccCandidates = Get-ChildItem -Recurse -Path '*.iss'
58
-
59
-            if ( $IsccCandidates.length -gt 0 ) {
60
-                $IsccFile = $IsccCandidates0.FullName
61
-            } else {
62
-                $IsccFile = ''
63
-            }
64
-        } else {
65
-            $IsccFile = "${ProjectRoot}/build_${Target}/installer-Windows.generated.iss"
66
-        }
67
+        Log-Group "Packaging ${ProductName}..."
68
+        $IsccFile = "${ProjectRoot}/build_${Target}/installer-Windows.generated.iss"
69
 
70
         if ( ! ( Test-Path -Path $IsccFile ) ) {
71
             throw 'InnoSetup install script not found. Run the build script or the CMake build and install procedures first.'
72
@@ -76,17 +75,23 @@
73
         Log-Information 'Creating InnoSetup installer...'
74
         Push-Location -Stack BuildTemp
75
         Ensure-Location -Path "${ProjectRoot}/release"
76
-        Invoke-External iscc ${IsccFile} /O. /F"${OutputName}-Installer"
77
+        Copy-Item -Path ${Configuration} -Destination Package -Recurse
78
+        Invoke-External iscc ${IsccFile} /O"${ProjectRoot}/release" /F"${OutputName}-Installer"
79
+        Remove-Item -Path Package -Recurse
80
         Pop-Location -Stack BuildTemp
81
     }
82
 
83
+    Log-Group "Archiving ${ProductName}..."
84
     $CompressArgs = @{
85
-        Path = (Get-ChildItem -Path "${ProjectRoot}/release" -Exclude "${OutputName}*.*")
86
+        Path = (Get-ChildItem -Path "${ProjectRoot}/release/${Configuration}" -Exclude "${OutputName}*.*")
87
         CompressionLevel = 'Optimal'
88
-        DestinationPath = "${ProjectRoot}/release/${OutputName}-Portable.zip"
89
+        DestinationPath = "${ProjectRoot}/release/${OutputName}.zip"
90
+        Verbose = ($Env:CI -ne $null)
91
     }
92
 
93
     Compress-Archive -Force @CompressArgs
94
+
95
+    Log-Group
96
 }
97
 
98
 Package
99
obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/build-linux Added
2
 
1
+(symlink to .build.zsh)
2
obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/build-macos Added
2
 
1
+(symlink to .build.zsh)
2
obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/package-linux Added
2
 
1
+(symlink to .package.zsh)
2
obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/package-macos Added
2
 
1
+(symlink to .package.zsh)
2
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.pwsh/Install-BuildDependencies.ps1 -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.pwsh/Install-BuildDependencies.ps1 Changed
55
 
1
@@ -17,8 +17,12 @@
2
     if ( ! ( Test-Path function:Log-Warning ) ) {
3
         . $PSScriptRoot/Logger.ps1
4
     }
5
-    
6
-    $Host64Bit = System.Environment::Is64BitOperatingSystem
7
+
8
+    $Prefixes = @{
9
+        'x64' = ${Env:ProgramFiles}
10
+        'x86' = ${Env:ProgramFiles(x86)}
11
+        'arm64' = ${Env:ProgramFiles(arm)}
12
+    }
13
 
14
     $Paths = $Env:Path -split System.IO.Path::PathSeparator
15
 
16
@@ -28,14 +32,15 @@
17
         $WingetOptions += '--silent'
18
     }
19
 
20
+    Log-Group 'Check Windows build requirements'
21
     Get-Content $WingetFile | ForEach-Object {
22
-        $_, $Package, $_, $Path, $_, $Binary = (regex::Split($_, " (?=(?:^'|'^'*')*$)")) -replace ',', '' -replace "'",''
23
+        $_, $Package, $_, $Path, $_, $Binary, $_, $Version = $_ -replace ',','' -split " +(?=(?:^\'*\'^\'*\')*^\'*$)" -replace "'",''
24
 
25
-        (${Env:ProgramFiles(x86)}, $Env:ProgramFiles) | ForEach-Object {
26
-            $Prefix = $_
27
+        $Prefixes.GetEnumerator() | ForEach-Object {
28
+            $Prefix = $_.value
29
             $FullPath = "${Prefix}\${Path}"
30
             if ( ( Test-Path $FullPath  ) -and ! ( $Paths -contains $FullPath ) ) {
31
-                $Paths += $FullPath
32
+                $Paths = @($FullPath) + $Paths
33
                 $Env:Path = $Paths -join System.IO.Path::PathSeparator
34
             }
35
         }
36
@@ -46,7 +51,11 @@
37
         if ( $Found ) {
38
             Log-Status "Found dependency ${Binary} as $($Found.Source)"
39
         } else {
40
-            Log-Status "Installing package ${Package}"
41
+            Log-Status "Installing package ${Package} $(if ( $Version -ne $null ) { "Version: ${Version}" } )"
42
+
43
+            if ( $Version -ne $null ) {
44
+                $WingetOptions += @('--version', ${Version})
45
+            }
46
 
47
             try {
48
                 $Params = $WingetOptions + $Package
49
@@ -57,4 +66,5 @@
50
             }
51
         }
52
     }
53
+    Log-Group
54
 }
55
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.pwsh/Logger.ps1 -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.pwsh/Logger.ps1 Changed
61
 
1
@@ -8,7 +8,7 @@
2
 
3
     Process {
4
         foreach($m in $Message) {
5
-            Write-Debug $m
6
+            Write-Debug "$(if ( $env:CI -ne $null ) { '::debug::' })$m"
7
         }
8
     }
9
 }
10
@@ -38,7 +38,7 @@
11
 
12
     Process {
13
         foreach($m in $Message) {
14
-            Write-Warning $m
15
+            Write-Warning "$(if ( $env:CI -ne $null ) { '::warning::' })$m"
16
         }
17
     }
18
 }
19
@@ -53,7 +53,7 @@
20
 
21
     Process {
22
         foreach($m in $Message) {
23
-            Write-Error $m
24
+            Write-Error "$(if ( $env:CI -ne $null ) { '::error::' })$m"
25
         }
26
     }
27
 }
28
@@ -79,6 +79,32 @@
29
     }
30
 }
31
 
32
+function Log-Group {
33
+    CmdletBinding()
34
+    param(
35
+        Parameter(ValueFromPipeline)
36
+        string $Message
37
+    )
38
+
39
+    Process {
40
+        if ( $Env:CI -ne $null )  {
41
+            if ( $script:LogGroup ) {
42
+                Write-Output '::endgroup::'
43
+                $script:LogGroup = $false
44
+            }
45
+
46
+            if ( $Message.count -ge 1 ) {
47
+                Write-Output "::group::$($Message -join ' ')"
48
+                $script:LogGroup = $true
49
+            }
50
+        } else {
51
+            if ( $Message.count -ge 1 ) {
52
+                Log-Information $Message
53
+            }
54
+        }
55
+    }
56
+}
57
+
58
 function Log-Status {
59
     CmdletBinding()
60
     param(
61
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.zsh/check_linux -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.zsh/check_linux Changed
62
 
1
@@ -1,4 +1,20 @@
2
-autoload -Uz log_info log_status log_error log_debug log_warning
3
+autoload -Uz log_info log_status log_error log_debug log_warning log_group
4
+
5
+log_group 'Check Linux build requirements'
6
+log_debug 'Checking Linux distribution name and version...'
7
+
8
+# Check for Ubuntu version 22.10 or later, which have srt and librist available via apt-get
9
+typeset -g -i UBUNTU_2210_OR_LATER=0
10
+if  -f /etc/os_release  {
11
+  local dist_name
12
+  local dist_version
13
+  read -r dist_name dist_version <<< "$(source /etc/os_release; print "${NAME} ${VERSION_ID}")"
14
+
15
+  autoload -Uz is-at-least
16
+  if  ${dist_name} == Ubuntu  && is-at-least 22.10 ${dist_version}; then
17
+    typeset -g -i UBUNTU_2210_OR_LATER=1
18
+  fi
19
+}
20
 
21
 log_debug 'Checking for apt-get...'
22
 if (( ! ${+commandsapt-get} )) {
23
@@ -8,12 +24,14 @@
24
   log_debug "Apt-get located at ${commandsapt-get}"
25
 }
26
 
27
-local -a dependencies=("${(f)$(<${SCRIPT_HOME}/.Aptfile)}")
28
+local -a dependencies=("${(fA)$(<${SCRIPT_HOME}/.Aptfile)}")
29
 local -a install_list
30
 local binary
31
 
32
+sudo apt-get update -qq
33
+
34
 for dependency (${dependencies}) {
35
-  local -a tokens=(${(s: :)dependency//(,|:|\')/})
36
+  local -a tokens=(${=dependency//(,|:|\')/})
37
 
38
   if  ! ${tokens1} == 'package'  continue
39
 
40
@@ -26,11 +44,18 @@
41
   if (( ! ${+commands${binary}} )) install_list+=(${tokens2})
42
 }
43
 
44
-local -a _quiet=('' '--quiet')
45
-
46
 log_debug "List of dependencies to install: ${install_list}"
47
 if (( ${#install_list} )) {
48
   if (( ! ${+CI} )) log_warning 'Dependency installation via apt may require elevated privileges'
49
 
50
-  sudo apt-get -y install ${install_list} ${_quiet(( (_loglevel == 0) + 1 ))}
51
+  local -a apt_args=(
52
+    ${CI:+-y}
53
+    --no-install-recommends
54
+  )
55
+  if (( _loglevel == 0 )) apt_args+=(--quiet)
56
+
57
+  sudo apt-get ${apt_args} install ${install_list}
58
 }
59
+
60
+rehash
61
+log_group
62
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.zsh/check_macos -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.zsh/check_macos Changed
22
 
1
@@ -1,9 +1,10 @@
2
-autoload -Uz is-at-least log_info log_error log_status read_codesign
3
+autoload -Uz is-at-least log_group log_info log_error log_status read_codesign
4
 
5
 local macos_version=$(sw_vers -productVersion)
6
 
7
+log_group 'Install macOS build requirements'
8
 log_info 'Checking macOS version...'
9
-if ! is-at-least 11.0 "${macos_version}"; then
10
+if ! is-at-least 11.0 ${macos_version}; then
11
   log_error "Minimum required macOS version is 11.0, but running on macOS ${macos_version}"
12
   return 2
13
 else
14
@@ -16,5 +17,6 @@
15
   return 2
16
 }
17
 
18
-brew bundle --file "${SCRIPT_HOME}/.Brewfile"
19
+brew bundle --file ${SCRIPT_HOME}/.Brewfile
20
 rehash
21
+log_group
22
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.zsh/check_packages -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.zsh/check_packages Changed
85
 
1
@@ -1,5 +1,5 @@
2
 if (( ! ${+commandspackagesbuild} )) {
3
-  autoload -Uz log_info log_status mkcd
4
+  autoload -Uz log_group log_info log_status mkcd
5
 
6
   if (( ! ${+commandscurl} )) {
7
     log_error 'curl not found. Please install curl.'
8
@@ -12,41 +12,51 @@
9
   }
10
 
11
   local -a curl_opts=()
12
-  if (( ! ${+CI} )) {
13
-    curl_opts+=(--progress-bar)
14
-  } else {
15
+  if (( ${+CI} )) {
16
     curl_opts+=(--show-error --silent)
17
+  } else {
18
+    curl_opts+=(--progress-bar)
19
   }
20
-  curl_opts+=(--location -O ${@})
21
+  curl_opts+=(--location -O)
22
 
23
-  log_info 'Installing Packages.app...'
24
+  log_group 'Installing Packages.app...'
25
 
26
-  pushd
27
-  mkcd ${project_root:h}/obs-build-dependencies
28
+  local version
29
+  local base_url
30
+  local hash
31
+  IFS=';' read -r version base_url hash <<< \
32
+    "$(jq -r '.tools.packages | {version, baseUrl, hash} | join(";")' buildspec.json)"
33
 
34
-  local packages_url='http://s.sudre.free.fr/Software/files/Packages.dmg'
35
-  local packages_hash='6afdd25386295974dad8f078b8f1e41cabebd08e72d970bf92f707c7e48b16c9'
36
+  mkdir -p ${project_root}/.deps && pushd ${project_root}/.deps
37
+  curl ${curl_opts} "${base_url}/Packages.dmg"
38
 
39
-  if  ! -f Packages.dmg  {
40
-    log_status 'Download Packages.app'
41
-    curl ${curl_opts} ${packages_url}
42
-  }
43
-
44
-  local image_checksum
45
-  read -r image_checksum _ <<< "$(sha256sum Packages.dmg)"
46
+  local checksum="$(sha256sum Packages.dmg | cut -d " " -f 1)"
47
 
48
-  if  ${packages_hash} != ${image_checksum}  {
49
-    log_error "Checksum mismatch of Packages.app download.
50
-Expected : ${packages_hash}
51
-Actual   : ${image_checksum}"
52
+  if  ${hash} != ${checksum}  {
53
+    log_error "Checksum mismatch of Packages.dmg download.
54
+Expected : ${hash}
55
+Actual   : ${checksum}"
56
     return 2
57
   }
58
 
59
-  hdiutil attach -noverify Packages.dmg &> /dev/null && log_status 'Packages.dmg image mounted.'
60
+  hdiutil attach -readonly -noverify -noautoopen -plist Packages.dmg > .result.plist
61
+  local -i num_entities=$(( $(plutil -extract system-entities raw -- .result.plist) - 1 ))
62
+  local keys
63
+  local mount_point
64
+  for i ({0..${num_entities}}) {
65
+    keys=($(plutil -extract system-entities.${i} raw -- .result.plist))
66
+    if  ${keys} == *mount-point*  {
67
+      mount_point=$(plutil -extract system-entities.${i}.mount-point raw -- .result.plist)
68
+      break
69
+    }
70
+  }
71
+  rm .result.plist
72
+
73
+  log_status 'Installing Packages.app requires elevated privileges!'
74
 
75
-  log_info 'Installing Packages.app...'
76
-  packages_volume=$(hdiutil info -plist | grep '<string>/Volumes/Packages' | sed 's/.*<string>\(\/Volumes\/^<*\)<\/string>/\1/')
77
+  sudo installer -pkg ${mount_point}/packages/Packages.pkg -target / && rehash
78
+  hdiutil detach ${mount_point} &> /dev/null && log_status 'Packages.dmg image unmounted.'
79
+  popd
80
 
81
-  sudo installer -pkg "${packages_volume}/packages/Packages.pkg" -target / && rehash
82
-  hdiutil detach ${packages_volume} &> /dev/null && log_status 'Packages.dmg image unmounted.'
83
+  log_group
84
 }
85
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.zsh/log_debug -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.zsh/log_debug Changed
6
 
1
@@ -1,3 +1,3 @@
2
 if (( ! ${+_loglevel} )) typeset -g _loglevel=1
3
 
4
-if (( _loglevel > 2 )) print -PR -e -- "%F{220}DEBUG: ${@}%f"
5
+if (( _loglevel > 2 )) print -PR -e -- "${CI:+::debug::}%F{220}DEBUG: ${@}%f"
6
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.zsh/log_error -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.zsh/log_error Changed
6
 
1
@@ -1,3 +1,3 @@
2
 local icon='  ✖︎ '
3
 
4
-print -u2 -PR "%F{1} ${icon} %f ${@}"
5
+print -u2 -PR "${CI:+::error::}%F{1} ${icon} %f ${@}"
6
obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.zsh/log_group Added
18
 
1
@@ -0,0 +1,16 @@
2
+autoload -Uz log_info
3
+
4
+if (( ! ${+_log_group} )) typeset -g _log_group=0
5
+
6
+if (( ${+CI} )) {
7
+  if (( _log_group )) {
8
+    print "::endgroup::"
9
+    typeset -g _log_group=0
10
+  }
11
+  if (( # )) {
12
+    print "::group::${@}"
13
+    typeset -g _log_group=1
14
+  }
15
+} else {
16
+  if (( # )) log_info ${@}
17
+}
18
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.zsh/log_warning -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.zsh/log_warning Changed
8
 
1
@@ -1,5 +1,5 @@
2
 if (( _loglevel > 0 )) {
3
   local icon=' =>'
4
 
5
-  print -PR "%F{3}  ${(r:5:)icon} ${@}%f"
6
+  print -PR "${CI:+::warning::}%F{3}  ${(r:5:)icon} ${@}%f"
7
 }
8
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.zsh/read_codesign -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.zsh/read_codesign Changed
11
 
1
@@ -2,6 +2,8 @@
2
 
3
 if (( ! ${+CODESIGN_IDENT} )) {
4
   typeset -g CODESIGN_IDENT
5
-  log_info 'Setting up identity for application codesigning...'
6
+  log_info 'Setting up Apple Developer ID for application codesigning...'
7
   read CODESIGN_IDENT'?Apple Developer Application ID: '
8
 }
9
+
10
+typeset -g CODESIGN_TEAM=$(print "${CODESIGN_IDENT}" | /usr/bin/sed -En 's/.+\((.+)\)/\1/p')
11
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.zsh/read_codesign_installer -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.zsh/read_codesign_installer Changed
9
 
1
@@ -2,6 +2,6 @@
2
 
3
 if (( ! ${+CODESIGN_IDENT_INSTALLER} )) {
4
   typeset -g CODESIGN_IDENT_INSTALLER
5
-  log_info 'Setting up identity for installer package codesigning...'
6
+  log_info 'Setting up Apple Developer Installer ID for installer package codesigning...'
7
   read CODESIGN_IDENT_INSTALLER'?Apple Developer Installer ID: '
8
 }
9
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.zsh/read_codesign_pass -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.zsh/read_codesign_pass Changed
30
 
1
@@ -11,14 +11,12 @@
2
 #     'OBS-Codesign-Password'with access Apple's 'altool' only.
3
 ##############################################################################
4
 
5
-autoload -Uz read_codesign read_codesign_user log_info
6
+autoload -Uz read_codesign read_codesign_user log_info log_warning
7
 
8
 if (( ! ${+CODESIGN_IDENT} )) {
9
   read_codesign
10
 }
11
 
12
-local codesign_ident_short=$(print "${CODESIGN_IDENT}" | /usr/bin/sed -En 's/.+\((.+)\)/\1/p')
13
-
14
 if (( ! ${+CODESIGN_IDENT_USER} )) {
15
   read_codesign_user
16
 }
17
@@ -30,4 +28,11 @@
18
 
19
 print ''
20
 log_info 'Setting up notarization keychain...'
21
-xcrun notarytool store-credentials 'OBS-Codesign-Password' --apple-id "${CODESIGN_IDENT_USER}" --team-id "${codesign_ident_short}" --password "${CODESIGN_IDENT_PASS}"
22
+log_warning "
23
+ + Your Apple ID and an app-specific password is necessary for notarization from CLI
24
+ + This password will be stored in your macOS keychain under the identifier
25
+   'OBS-Codesign-Password' with access Apple's 'altool' only.
26
+
27
+"
28
+xcrun notarytool store-credentials 'OBS-Codesign-Password' --apple-id "${CODESIGN_IDENT_USER}" --team-id "${CODESIGN_TEAM}" --password "${CODESIGN_IDENT_PASS}"
29
+
30
obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.zsh/read_codesign_team Added
9
 
1
@@ -0,0 +1,7 @@
2
+autoload -Uz log_info
3
+
4
+if (( ! ${+CODESIGN_TEAM} )) {
5
+  typeset -g CODESIGN_TEAM
6
+  log_info 'Setting up Apple Developer Team ID for codesigning...'
7
+  read CODESIGN_TEAM'?Apple Developer Team ID (leave empty to use Apple Developer ID instead): '
8
+}
9
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.zsh/read_codesign_user -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.zsh/read_codesign_user Changed
10
 
1
@@ -2,6 +2,6 @@
2
 
3
 if (( ! ${+CODESIGN_IDENT_USER} )) {
4
   typeset -g CODESIGN_IDENT_USER
5
-  log_info 'Setting up developer id for codesigning...'
6
-  read CODESIGN_IDENT_USER'?Apple Developer ID: '
7
+  log_info 'Setting up Apple ID for notarization...'
8
+  read CODESIGN_IDENT_USER'?Apple ID: '
9
 }
10
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.zsh/setup_ccache -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.zsh/setup_ccache Changed
45
 
1
@@ -1,13 +1,40 @@
2
 autoload -Uz log_debug log_warning
3
 
4
-hash -r
5
+if (( ! ${+project_root} )) {
6
+  log_error "'project_root' not set. Please set before running ${0}."
7
+  return 2
8
+}
9
+
10
 if (( ${+commandsccache} )) {
11
   log_debug "Found ccache at ${commandsccache}"
12
 
13
+  typeset -gx CCACHE_CONFIGPATH="${project_root}/.ccache.conf"
14
+
15
+  ccache --set-config=run_second_cpp=true
16
+  ccache --set-config=direct_mode=true
17
+  ccache --set-config=inode_cache=true
18
+  ccache --set-config=compiler_check=content
19
+  ccache --set-config=file_clone=true
20
+
21
+  local -a sloppiness=(
22
+    include_file_mtime
23
+    include_file_ctime
24
+    file_stat_matches
25
+    system_headers
26
+  )
27
+
28
+  if  ${host_os} == macos  {
29
+    sloppiness+=(
30
+      modules
31
+      clang_index_store
32
+    )
33
+
34
+    ccache --set-config=sloppiness=${(j:,:)sloppiness}
35
+  }
36
+
37
   if (( ${+CI} )) {
38
     ccache --set-config=cache_dir="${GITHUB_WORKSPACE:-${HOME}}/.ccache"
39
-    ccache --set-config=max_size="${CCACHE_SIZE:-500M}"
40
-    ccache --set-config=compression=true
41
+    ccache --set-config=max_size="${CCACHE_SIZE:-1G}"
42
     ccache -z > /dev/null
43
   }
44
 } else {
45
obs-backgroundremoval-1.0.3.tar.gz/.github/scripts/utils.zsh/setup_linux -> obs-backgroundremoval-1.1.5.tar.gz/.github/scripts/utils.zsh/setup_linux Changed
88
 
1
@@ -13,50 +13,55 @@
2
 pushd ${project_root}
3
 
4
 typeset -g QT_VERSION
5
-read -r QT_VERSION <<< \
6
-  "$(jq -r --arg target "${target}" \
7
-    '.platformConfig$target | { qtVersion } | join(" ")' \
8
-    ${project_root}/buildspec.json)"
9
+
10
+local -a apt_args=(
11
+  ${CI:+-y}
12
+  --no-install-recommends
13
+)
14
+if (( _loglevel == 0 )) apt_args+=(--quiet)
15
 
16
 if (( ! (${skips(Ie)all} + ${skips(Ie)deps}) )) {
17
-  log_info 'Installing obs build dependencies...'
18
+  log_group 'Installing obs-studio build dependencies...'
19
+
20
+  local suffix
21
+  if  ${CPUTYPE} != "${target##*-}"  {
22
+    local -A arch_mappings=(
23
+      aarch64 arm64
24
+      x86_64 amd64
25
+    )
26
+
27
+    suffix=":${arch_mappings${target##*-}}"
28
+
29
+    sudo apt-get install ${apt_args} gcc-${${target##*-}//_/-}-linux-gnu g++-${${target##*-}//_/-}-linux-gnu
30
+  }
31
 
32
-  sudo apt-get install -y \
33
+  sudo add-apt-repository --yes ppa:obsproject/obs-studio
34
+  sudo apt update
35
+
36
+  sudo apt-get install ${apt_args} \
37
     build-essential \
38
-    libcurl4-openssl-dev \
39
-    libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev \
40
-    libswresample-dev libswscale-dev \
41
-    libjansson-dev \
42
-    libx11-xcb-dev \
43
     libgles2-mesa-dev \
44
-    libwayland-dev \
45
-    libpulse-dev
46
+    obs-studio \
47
+    libssl-dev \
48
+    libcurl4-openssl-dev
49
 
50
   local -a _qt_packages=()
51
 
52
   if (( QT_VERSION == 5 )) {
53
     _qt_packages+=(
54
-      qtbase5-dev
55
-      libqt5svg5-dev
56
-      qtbase5-private-dev
57
-      libqt5x11extras5-dev
58
+      qtbase5-dev${suffix}
59
+      libqt5svg5-dev${suffix}
60
+      qtbase5-private-dev${suffix}
61
+      libqt5x11extras5-dev${suffix}
62
     )
63
-  } elif (( QT_VERSION == 6 )) {
64
+  } else {
65
     _qt_packages+=(
66
-      qt6-base-dev
67
-      libqt6svg6-dev
68
-      qt6-base-private-dev
69
+      qt6-base-dev${suffix}
70
+      libqt6svg6-dev${suffix}
71
+      qt6-base-private-dev${suffix}
72
     )
73
-  } else {
74
-    log_error "Unsupported Qt version '${QT_VERSION}' specified."
75
-    return 2
76
   }
77
 
78
-  sudo apt-get install -y ${_qt_packages}
79
+  sudo apt-get install ${apt_args} ${_qt_packages}
80
+  log_group
81
 }
82
-
83
-local deps_version
84
-read -r deps_version <<< \
85
-  "$(jq -r '.dependencies.prebuilt.version' ${buildspec_file})"
86
-
87
-typeset -g OBS_DEPS_VERSION=${deps_version}
88
obs-backgroundremoval-1.1.5.tar.gz/.github/workflows/build-project.yaml Added
201
 
1
@@ -0,0 +1,262 @@
2
+name: Build Project
3
+on:
4
+  workflow_call:
5
+jobs:
6
+  check-event:
7
+    name: Check GitHub Event Data 📡
8
+    runs-on: ubuntu-22.04
9
+    defaults:
10
+      run:
11
+        shell: bash
12
+    outputs:
13
+      package: ${{ steps.setup.outputs.package }}
14
+      codesign: ${{ steps.setup.outputs.codesign }}
15
+      notarize: ${{ steps.setup.outputs.notarize }}
16
+      config: ${{ steps.setup.outputs.config }}
17
+      commitHash: ${{ steps.setup.outputs.commitHash }}
18
+    steps:
19
+      - uses: actions/checkout@v3
20
+        with:
21
+          fetch-depth: 0
22
+      - name: Check Event Data ☑️
23
+        id: setup
24
+        env:
25
+          GH_TOKEN: ${{ github.token }}
26
+        run: |
27
+          : Check Event Data ☑️
28
+          if  "${RUNNER_DEBUG}" ; then set -x; fi
29
+
30
+          case "${GITHUB_EVENT_NAME}" in
31
+            pull_request)
32
+              config_data=('codesign:false' 'notarize:false' 'package:false' 'config:RelWithDebInfo')
33
+              if  ${{ contains(github.event.pull_request.labels.*.name, 'Seeking Testers') }} = true ; then
34
+                config_data0='codesign:true'
35
+                config_data2='package:true'
36
+              fi
37
+              ;;
38
+            push)
39
+              config_data=('codesign:true' 'notarize:false' 'package:true' 'config:RelWithDebInfo')
40
+              if  ${GITHUB_REF_NAME} =~ 0-9+.0-9+.0-9+(-(rc|beta).+)? ; then
41
+                config_data1='notarize:true'
42
+                config_data3='config:Release'
43
+              fi
44
+              ;;
45
+            workflow_dispatch)
46
+              config_data=('codesign:true' 'notarize:false' 'package:false' 'config:RelWithDebInfo')
47
+              ;;
48
+            schedule)
49
+              config_data=('codesign:true' 'notarize:false' 'package:true' 'config:RelWithDebInfo')
50
+              ;;
51
+            *) ;;
52
+          esac
53
+
54
+          for config in "${config_data@}"; do
55
+            IFS=':' read -r key value <<< "${config}"
56
+            echo "${key}=${value}" >> $GITHUB_OUTPUT
57
+          done
58
+          echo "commitHash=${GITHUB_SHA:0:9}" >> $GITHUB_OUTPUT
59
+
60
+  macos-build:
61
+    name: Build for macOS 🍏
62
+    runs-on: macos-13
63
+    needs: check-event
64
+    defaults:
65
+      run:
66
+        shell: zsh --no-rcs --errexit --pipefail {0}
67
+    steps:
68
+      - uses: actions/checkout@v3
69
+        with:
70
+          submodules: recursive
71
+          fetch-depth: 0
72
+
73
+      - name: Set Up Environment 🔧
74
+        id: setup
75
+        run: |
76
+          : Set Up Environment 🔧
77
+          if (( ${+RUNNER_DEBUG} )) setopt XTRACE
78
+
79
+          print '::group::Clean Homebrew Environment'
80
+          typeset -a to_remove=()
81
+
82
+          if (( #to_remove > 0 )) brew uninstall --ignore-dependencies ${to_remove}
83
+          print '::endgroup::'
84
+
85
+          local product_name
86
+          local product_version
87
+          read -r product_name product_version <<< \
88
+            "$(jq -r '. | {name, version} | join(" ")' buildspec.json)"
89
+
90
+          print "pluginName=${product_name}" >> $GITHUB_OUTPUT
91
+          print "pluginVersion=${product_version}" >> $GITHUB_OUTPUT
92
+
93
+      - uses: actions/cache@v3
94
+        id: ccache-cache
95
+        with:
96
+          path: ${{ github.workspace }}/.ccache
97
+          key: ${{ runner.os }}-ccache-${{ needs.check-event.outputs.config }}
98
+          restore-keys: |
99
+            ${{ runner.os }}-ccache-
100
+
101
+      - name: Set Up Codesigning 🔑
102
+        uses: ./.github/actions/setup-macos-codesigning
103
+        if: ${{ fromJSON(needs.check-event.outputs.codesign) }}
104
+        id: codesign
105
+        with:
106
+          codesignIdentity: ${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}
107
+          installerIdentity: ${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}
108
+          codesignCertificate: ${{ secrets.MACOS_SIGNING_CERT }}
109
+          certificatePassword: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }}
110
+          keychainPassword: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
111
+          provisioningProfile: ${{ secrets.MACOS_SIGNING_PROVISIONING_PROFILE }}
112
+          notarizationUser: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
113
+          notarizationPassword: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}
114
+
115
+      - name: Build Plugin 🧱
116
+        uses: ./.github/actions/build-plugin
117
+        with:
118
+          target: macos-universal
119
+          config: ${{ needs.check-event.outputs.config }}
120
+          codesign: ${{ fromJSON(needs.check-event.outputs.codesign) }}
121
+          codesignIdent: ${{ steps.codesign.outputs.codesignIdent }}
122
+
123
+      - name: Package Plugin 📀
124
+        uses: ./.github/actions/package-plugin
125
+        with:
126
+          target: macos-universal
127
+          config: ${{ needs.check-event.outputs.config }}
128
+          package: ${{ fromJSON(needs.check-event.outputs.package) }}
129
+          codesign: ${{ fromJSON(needs.check-event.outputs.codesign) && fromJSON(steps.codesign.outputs.haveCodesignIdent) }}
130
+          codesignIdent: ${{ steps.codesign.outputs.codesignIdent }}
131
+          installerIdent: ${{ steps.codesign.outputs.installerIdent }}
132
+          codesignTeam: ${{ steps.codesign.outputs.codesignTeam }}
133
+          notarize: ${{ fromJSON(needs.check-event.outputs.notarize) && fromJSON(steps.codesign.outputs.haveNotarizationUser) }}
134
+          codesignUser: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
135
+          codesignPass: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}
136
+
137
+      - name: Upload Artifacts 📡
138
+        uses: actions/upload-artifact@v3
139
+        with:
140
+          name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-macos-universal-${{ needs.check-event.outputs.commitHash }}
141
+          path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-macos-universal.*
142
+
143
+      - name: Upload Debug Symbol Artifacts 🪲
144
+        uses: actions/upload-artifact@v3
145
+        if: ${{ needs.check-event.outputs.config == 'Release' }}
146
+        with:
147
+          name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-macos-universal-${{ needs.check-event.outputs.commitHash }}-dSYMs
148
+          path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-macos-universal-dSYMs.*
149
+
150
+  ubuntu-build:
151
+    name: Build for Ubuntu 🐧
152
+    runs-on: ubuntu-22.04
153
+    needs: check-event
154
+    defaults:
155
+      run:
156
+        shell: bash
157
+    steps:
158
+      - uses: actions/checkout@v3
159
+        with:
160
+          submodules: recursive
161
+          fetch-depth: 0
162
+
163
+      - name: Set Up Environment 🔧
164
+        id: setup
165
+        run: |
166
+          : Set Up Environment 🔧
167
+          if  "${RUNNER_DEBUG}" ; then set -x; fi
168
+
169
+          read -r product_name product_version <<< \
170
+            "$(jq -r '. | {name, version} | join(" ")' buildspec.json)"
171
+
172
+          echo "pluginName=${product_name}" >> $GITHUB_OUTPUT
173
+          echo "pluginVersion=${product_version}" >> $GITHUB_OUTPUT
174
+
175
+      - uses: actions/cache@v3
176
+        id: ccache-cache
177
+        with:
178
+          path: ${{ github.workspace }}/.ccache
179
+          key: ${{ runner.os }}-ccache-x86_64-${{ needs.check-event.outputs.config }}
180
+          restore-keys: |
181
+            ${{ runner.os }}-ccache-x86_64-
182
+
183
+      - name: Set up Homebrew 🍺
184
+        uses: Homebrew/actions/setup-homebrew@master
185
+
186
+      - name: Build Plugin 🧱
187
+        uses: ./.github/actions/build-plugin
188
+        with:
189
+          target: x86_64
190
+          config: ${{ needs.check-event.outputs.config }}
191
+
192
+      - name: Package Plugin 📀
193
+        uses: ./.github/actions/package-plugin
194
+        with:
195
+          package: ${{ fromJSON(needs.check-event.outputs.package) }}
196
+          target: x86_64
197
+          config: ${{ needs.check-event.outputs.config }}
198
+
199
+      - name: Upload Source Tarball 🗜️
200
+        uses: actions/upload-artifact@v3
201
obs-backgroundremoval-1.1.5.tar.gz/.github/workflows/check-format.yaml Added
29
 
1
@@ -0,0 +1,27 @@
2
+name: Check Code Formatting 🛠️
3
+on:
4
+  workflow_call:
5
+jobs:
6
+  clang-format:
7
+    runs-on: ubuntu-22.04
8
+    steps:
9
+      - uses: actions/checkout@v3
10
+        with:
11
+          fetch-depth: 0
12
+      - name: clang-format check 🐉
13
+        id: clang-format
14
+        uses: ./.github/actions/run-clang-format
15
+        with:
16
+          failCondition: error
17
+
18
+  cmake-format:
19
+    runs-on: ubuntu-22.04
20
+    steps:
21
+      - uses: actions/checkout@v3
22
+        with:
23
+          fetch-depth: 0
24
+      - name: cmake-format check 🎛️
25
+        id: cmake-format
26
+        uses: ./.github/actions/run-cmake-format
27
+        with:
28
+          failCondition: error
29
obs-backgroundremoval-1.1.5.tar.gz/.github/workflows/dispatch.yaml Added
20
 
1
@@ -0,0 +1,18 @@
2
+name: Dispatch
3
+run-name: Dispatched Repository Actions - ${{ inputs.job }} ⌛️
4
+on:
5
+  workflow_dispatch:
6
+    inputs:
7
+      job:
8
+        description: Dispatch job to run
9
+        required: true
10
+        type: choice
11
+        options:
12
+          - build
13
+permissions:
14
+  contents: write
15
+jobs:
16
+  check-and-build:
17
+    if: inputs.job == 'build'
18
+    uses: ./.github/workflows/build-project.yaml
19
+    secrets: inherit
20
obs-backgroundremoval-1.1.5.tar.gz/.github/workflows/pr-pull.yaml Added
29
 
1
@@ -0,0 +1,27 @@
2
+name: Pull Request
3
+run-name: ${{ github.event.pull_request.title }} pull request run 🚀
4
+on:
5
+  workflow_dispatch:
6
+  pull_request:
7
+    paths-ignore:
8
+      - '**.md'
9
+    branches: master, main
10
+    types:  opened, synchronize, reopened, labeled, unlabeled 
11
+permissions:
12
+  contents: read
13
+concurrency:
14
+  group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
15
+  cancel-in-progress: true
16
+jobs:
17
+  check-format:
18
+    name: Check Formatting 🔍
19
+    uses: ./.github/workflows/check-format.yaml
20
+    permissions:
21
+      contents: read
22
+
23
+  build-project:
24
+    name: Build Project 🧱
25
+    uses: ./.github/workflows/build-project.yaml
26
+    secrets: inherit
27
+    permissions:
28
+      contents: read
29
obs-backgroundremoval-1.1.5.tar.gz/.github/workflows/push.yaml Added
124
 
1
@@ -0,0 +1,122 @@
2
+name: Push to master
3
+run-name: ${{ github.ref_name }} push run 🚀
4
+on:
5
+  push:
6
+    branches:
7
+      - master
8
+      - main
9
+      - 'release/**'
10
+    tags:
11
+      - '*'
12
+permissions:
13
+  contents: write
14
+concurrency:
15
+  group: '${{ github.workflow }} @ ${{ github.ref }}'
16
+  cancel-in-progress: ${{ github.ref_type == 'tag' }}
17
+jobs:
18
+  check-format:
19
+    name: Check Formatting 🔍
20
+    if: github.ref_name == 'master'
21
+    uses: ./.github/workflows/check-format.yaml
22
+    permissions:
23
+      contents: read
24
+
25
+  build-project:
26
+    name: Build Project 🧱
27
+    uses: ./.github/workflows/build-project.yaml
28
+    secrets: inherit
29
+    permissions:
30
+      contents: read
31
+
32
+  create-release:
33
+    name: Create Release 🛫
34
+    if: github.ref_type == 'tag'
35
+    runs-on: ubuntu-22.04
36
+    needs: build-project
37
+    defaults:
38
+      run:
39
+        shell: bash
40
+    steps:
41
+      - name: Check Release Tag ☑️
42
+        id: check
43
+        run: |
44
+          : Check Release Tag ☑️
45
+          if  "${RUNNER_DEBUG}" ; then set -x; fi
46
+          shopt -s extglob
47
+
48
+          case "${GITHUB_REF_NAME}" in
49
+            +(0-9).+(0-9).+(0-9) )
50
+              echo 'validTag=true' >> $GITHUB_OUTPUT
51
+              echo 'prerelease=false' >> $GITHUB_OUTPUT
52
+              echo "version=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
53
+              ;;
54
+            +(0-9).+(0-9).+(0-9)-@(beta|rc)*(0-9) )
55
+              echo 'validTag=true' >> $GITHUB_OUTPUT
56
+              echo 'prerelease=true' >> $GITHUB_OUTPUT
57
+              echo "version=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
58
+              ;;
59
+            *) echo 'validTag=false' >> $GITHUB_OUTPUT ;;
60
+          esac
61
+
62
+      - name: Download Build Artifacts 📥
63
+        uses: actions/download-artifact@v3
64
+        if: fromJSON(steps.check.outputs.validTag)
65
+        id: download
66
+
67
+      - name: Rename Files 🏷️
68
+        if: fromJSON(steps.check.outputs.validTag)
69
+        run: |
70
+          : Rename Files 🏷️
71
+          if  "${RUNNER_DEBUG}" ; then set -x; fi
72
+          shopt -s extglob
73
+          shopt -s nullglob
74
+
75
+          root_dir="$(pwd)"
76
+          commit_hash="${GITHUB_SHA:0:9}"
77
+
78
+          variants=(
79
+            'windows-x64;zip|exe'
80
+            'macos-universal;tar.xz|pkg'
81
+            'ubuntu-22.04-x86_64;tar.xz|deb|ddeb'
82
+            'sources;tar.xz'
83
+          )
84
+
85
+          for variant_data in "${variants@}"; do
86
+            IFS=';' read -r variant suffix <<< "${variant_data}"
87
+
88
+            candidates=(*-${variant}-${commit_hash}/@(*|*-dbgsym).@(${suffix}))
89
+
90
+            for candidate in "${candidates@}"; do
91
+              mv "${candidate}" "${root_dir}"
92
+            done
93
+          done
94
+
95
+      - name: Generate Checksums 🪪
96
+        if: fromJSON(steps.check.outputs.validTag)
97
+        run: |
98
+          : Generate Checksums 🪪
99
+          if  "${RUNNER_DEBUG}" ; then set -x; fi
100
+          shopt -s extglob
101
+
102
+          echo "### Checksums" > ${{ github.workspace }}/CHECKSUMS.txt
103
+          for file in ${{ github.workspace }}/@(*.exe|*.deb|*.ddeb|*.pkg|*.tar.xz|*.zip); do
104
+            echo "    ${file##*/}: $(sha256sum "${file}" | cut -d " " -f 1)" >> ${{ github.workspace }}/CHECKSUMS.txt
105
+          done
106
+
107
+      - name: Create Release 🛫
108
+        if: fromJSON(steps.check.outputs.validTag)
109
+        id: create_release
110
+        uses: softprops/action-gh-release@d4e8205d7e959a9107da6396278b2f1f07af0f9b
111
+        with:
112
+          draft: true
113
+          prerelease: ${{ fromJSON(steps.check.outputs.prerelease) }}
114
+          tag_name: ${{ steps.check.outputs.version }}
115
+          name: OBS Studio ${{ steps.check.outputs.version }}
116
+          body_path: ${{ github.workspace }}/CHECKSUMS.txt
117
+          files: |
118
+            ${{ github.workspace }}/*.exe
119
+            ${{ github.workspace }}/*.zip
120
+            ${{ github.workspace }}/*.pkg
121
+            ${{ github.workspace }}/*.deb
122
+            ${{ github.workspace }}/*.ddeb
123
+            ${{ github.workspace }}/*.tar.xz
124
obs-backgroundremoval-1.0.3.tar.gz/.gitignore -> obs-backgroundremoval-1.1.5.tar.gz/.gitignore Changed
45
 
1
@@ -1,14 +1,30 @@
2
-*~
3
+# Exclude everything
4
+/*
5
+
6
+# Except for default project files
7
+!/.github
8
+!/build-aux
9
+!/cmake
10
+!/data
11
+!/docs
12
+!/src
13
+!/vendor
14
+!.clang-format
15
+!.cmake-format.json
16
+!.gitignore
17
+!buildspec.json
18
+!CMakeLists.txt
19
+!CMakePresets.json
20
+!LICENSE
21
+!README.md
22
+
23
+# Exclude lock files
24
+*.lock.json
25
+
26
+# Exclude macOS legacy resource forks
27
 .DS_Store
28
-/build/
29
-/build_*/
30
-/release/
31
-/installer/Output/
32
-build_x86_64
33
-
34
-.vscode
35
-.idea
36
-
37
-# ignore generated files
38
-*.generated.*
39
-**/.Brewfile.lock.json
40
+
41
+# Exclude CMake build number cache
42
+/cmake/.CMakeBuildNumber
43
+
44
+src/*.generated.*
45
obs-backgroundremoval-1.0.3.tar.gz/CMakeLists.txt -> obs-backgroundremoval-1.1.5.tar.gz/CMakeLists.txt Changed
163
 
1
@@ -1,42 +1,38 @@
2
-cmake_minimum_required(VERSION 3.16...3.21)
3
+cmake_minimum_required(VERSION 3.16...3.26)
4
 
5
-set(CMAKE_C_STANDARD 99)
6
-set(CMAKE_CXX_STANDARD 11)
7
-list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
8
+include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/common/bootstrap.cmake" NO_POLICY_SCOPE)
9
 
10
-project(
11
-  obs-backgroundremoval
12
-  VERSION 1.0.3
13
-  LANGUAGES C CXX)
14
-add_library(${CMAKE_PROJECT_NAME} MODULE)
15
+project(${_name} VERSION ${_version})
16
 
17
-set(PLUGIN_AUTHOR "Roy Shilkrot")
18
-set(PLUGIN_PRETTY_NAME "OBS Background Removal plugin")
19
-set(MACOS_BUNDLEID "com.royshilkrot.obs-backgroundremoval")
20
-set(LINUX_MAINTAINER_EMAIL "roy.shil@gmail.com")
21
-set(PLUGIN_HOME_URL "https://github.com/royshil/obs-backgroundremoval")
22
+option(ENABLE_FRONTEND_API "Use obs-frontend-api for UI functionality" OFF)
23
+option(ENABLE_QT "Use Qt functionality" OFF)
24
 
25
-target_sources(
26
-  ${CMAKE_PROJECT_NAME}
27
-  PRIVATE src/plugin-main.c
28
-          src/ort-utils/ort-session-utils.cpp
29
-          src/obs-utils/obs-utils.cpp
30
-          src/background-filter-info.c
31
-          src/background-filter.cpp
32
-          src/enhance-filter.cpp
33
-          src/enhance-filter-info.c)
34
+include(compilerconfig)
35
+include(defaults)
36
+include(helpers)
37
 
38
-# Import libobs as main plugin dependency
39
-find_package(libobs REQUIRED)
40
-include(cmake/ObsPluginHelpers.cmake)
41
+add_library(${CMAKE_PROJECT_NAME} MODULE)
42
 
43
-# Uncomment these lines if you want to use the OBS Frontend API in your plugin
44
-find_package(obs-frontend-api REQUIRED)
45
-target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::obs-frontend-api)
46
+find_package(libobs REQUIRED)
47
+target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::libobs)
48
 
49
-configure_file(src/plugin-macros.h.in ${CMAKE_SOURCE_DIR}/src/plugin-macros.generated.h)
50
+if(ENABLE_FRONTEND_API)
51
+  find_package(obs-frontend-api REQUIRED)
52
+  target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::obs-frontend-api)
53
+endif()
54
 
55
-target_sources(${CMAKE_PROJECT_NAME} PRIVATE src/plugin-macros.generated.h)
56
+if(ENABLE_QT)
57
+  find_qt(COMPONENTS Widgets Core)
58
+  target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt::Core Qt::Widgets)
59
+  target_compile_options(
60
+    ${CMAKE_PROJECT_NAME} PRIVATE $<$<C_COMPILER_ID:Clang,AppleClang>:-Wno-quoted-include-in-framework-header
61
+                                  -Wno-comma>)
62
+  set_target_properties(
63
+    ${CMAKE_PROJECT_NAME}
64
+    PROPERTIES AUTOMOC ON
65
+               AUTOUIC ON
66
+               AUTORCC ON)
67
+endif()
68
 
69
 set(USE_SYSTEM_ONNXRUNTIME
70
     OFF
71
@@ -46,8 +42,7 @@
72
     find_package(Onnxruntime 1.14.1 REQUIRED)
73
     set(Onnxruntime_INCLUDE_PATH
74
         ${Onnxruntime_INCLUDE_DIR} ${Onnxruntime_INCLUDE_DIR}/onnxruntime
75
-        ${Onnxruntime_INCLUDE_DIR}/onnxruntime/core/session
76
-        ${Onnxruntime_INCLUDE_DIR}/onnxruntime/core/providers/cpu)
77
+        ${Onnxruntime_INCLUDE_DIR}/onnxruntime/core/session ${Onnxruntime_INCLUDE_DIR}/onnxruntime/core/providers/cpu)
78
     target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE "${Onnxruntime_LIBRARIES}")
79
     target_include_directories(${CMAKE_PROJECT_NAME} SYSTEM PUBLIC "${Onnxruntime_INCLUDE_PATH}")
80
   else()
81
@@ -69,55 +64,35 @@
82
     message(FATAL_ERROR "System OpenCV is only supported on Linux!")
83
   endif()
84
 else()
85
-  include(cmake/BuildMyOpenCV.cmake)
86
+  include(cmake/FetchOpenCV.cmake)
87
   target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OpenCV)
88
 endif()
89
 
90
-if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin|iOS")
91
-  foreach(flags CMAKE_CXX_FLAGS CMAKE_OBJC_FLAGS CMAKE_OBJCXX_FLAGS)
92
-    string(APPEND ${flags} " -fvisibility=hidden -fvisibility-inlines-hidden")
93
-  endforeach()
94
+if(APPLE)
95
+  add_subdirectory(src/update-checker/URLSessionClient)
96
+  target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE URLSessionClient)
97
+elseif(MSVC)
98
+  add_subdirectory(src/update-checker/WinRTHttpClient)
99
+  target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE WinRTHttpClient)
100
+elseif(UNIX)
101
+  add_subdirectory(src/update-checker/CurlClient)
102
+  target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE CurlClient)
103
 endif()
104
 
105
-# /!\ TAKE NOTE: No need to edit things past this point /!\
106
-
107
-# --- Platform-independent build settings ---
108
-
109
-target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)
110
-
111
-target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::libobs)
112
-
113
-# --- End of section ---
114
-
115
-# --- Windows-specific build settings and tasks ---
116
-if(OS_WINDOWS)
117
-  configure_file(cmake/bundle/windows/installer-Windows.iss.in
118
-                 ${CMAKE_BINARY_DIR}/installer-Windows.generated.iss)
119
-
120
-  configure_file(cmake/bundle/windows/resource.rc.in ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.rc)
121
-  target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.rc)
122
-
123
-  if(MSVC)
124
-    target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE /W4)
125
-  endif()
126
-  # --- End of section ---
127
-
128
-  # -- macOS specific build settings and tasks --
129
-elseif(OS_MACOS)
130
-  configure_file(cmake/bundle/macos/installer-macos.pkgproj.in
131
-                 ${CMAKE_BINARY_DIR}/installer-macos.generated.pkgproj)
132
-
133
-  set(MACOSX_PLUGIN_GUI_IDENTIFIER "${MACOS_BUNDLEID}")
134
-  set(MACOSX_PLUGIN_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION}")
135
-  set(MACOSX_PLUGIN_SHORT_VERSION_STRING "1")
136
-
137
-  target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall)
138
-  # --- End of section ---
139
-
140
-  # --- Linux-specific build settings and tasks ---
141
-else()
142
-  target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall)
143
-endif()
144
-# --- End of section ---
145
+target_sources(
146
+  ${CMAKE_PROJECT_NAME}
147
+  PRIVATE src/plugin-main.c
148
+          src/ort-utils/ort-session-utils.cpp
149
+          src/obs-utils/obs-utils.cpp
150
+          src/obs-utils/obs-config-utils.cpp
151
+          src/update-checker/github-utils.cpp
152
+          src/update-checker/update-checker.cpp
153
+          src/update-checker/UpdateDialog.cpp
154
+          src/background-filter-info.c
155
+          src/background-filter.cpp
156
+          src/enhance-filter.cpp
157
+          src/enhance-filter-info.c)
158
+target_compile_options(${CMAKE_PROJECT_NAME}
159
+                       PRIVATE $<$<C_COMPILER_ID:Clang,AppleClang>:-Wno-error=unused-command-line-argument>)
160
 
161
-setup_plugin_target(${CMAKE_PROJECT_NAME})
162
+set_target_properties_plugin(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${_name})
163
obs-backgroundremoval-1.1.5.tar.gz/CMakePresets.json Added
192
 
1
@@ -0,0 +1,190 @@
2
+{
3
+  "version": 3,
4
+  "cmakeMinimumRequired": {
5
+    "major": 3,
6
+    "minor": 22,
7
+    "patch": 0
8
+  },
9
+  "configurePresets": 
10
+    {
11
+      "name": "macos",
12
+      "displayName": "macOS Universal",
13
+      "description": "Build for macOS 11.0+ (Universal binary)",
14
+      "binaryDir": "${sourceDir}/build_macos",
15
+      "condition": {
16
+        "type": "equals",
17
+        "lhs": "${hostSystemName}",
18
+        "rhs": "Darwin"
19
+      },
20
+      "generator": "Xcode",
21
+      "warnings": {"dev": true, "deprecated": true},
22
+      "cacheVariables": {
23
+        "QT_VERSION": "6",
24
+        "CMAKE_OSX_DEPLOYMENT_TARGET": "11.0",
25
+        "CODESIGN_IDENTITY": "$penv{CODESIGN_IDENT}",
26
+        "CODESIGN_TEAM": "$penv{CODESIGN_TEAM}",
27
+        "ENABLE_FRONTEND_API": true,
28
+        "ENABLE_QT": true
29
+      }
30
+    },
31
+    {
32
+      "name": "macos-ci",
33
+      "inherits": "macos",
34
+      "displayName": "macOS Universal CI build",
35
+      "description": "Build for macOS 11.0+ (Universal binary) for CI",
36
+      "generator": "Xcode",
37
+      "cacheVariables": {
38
+        "CMAKE_COMPILE_WARNING_AS_ERROR": true
39
+      }
40
+    },
41
+    {
42
+      "name": "windows-x64",
43
+      "displayName": "Windows x64",
44
+      "description": "Build for Windows x64",
45
+      "binaryDir": "${sourceDir}/build_x64",
46
+      "condition": {
47
+        "type": "equals",
48
+        "lhs": "${hostSystemName}",
49
+        "rhs": "Windows"
50
+      },
51
+      "generator": "Visual Studio 17 2022",
52
+      "architecture": "x64",
53
+      "warnings": {"dev": true, "deprecated": true},
54
+      "cacheVariables": {
55
+        "QT_VERSION": "6",
56
+        "CMAKE_SYSTEM_VERSION": "10.0.18363.657",
57
+        "ENABLE_FRONTEND_API": true,
58
+        "ENABLE_QT": true
59
+      }
60
+    },
61
+    {
62
+      "name": "windows-ci-x64",
63
+      "inherits": "windows-x64",
64
+      "displayName": "Windows x64 CI build",
65
+      "description": "Build for Windows x64 on CI",
66
+      "cacheVariables": {
67
+        "CMAKE_COMPILE_WARNING_AS_ERROR": true
68
+      }
69
+    },
70
+    {
71
+      "name": "linux-x86_64",
72
+      "displayName": "Linux x86_64",
73
+      "description": "Build for Linux x86_64",
74
+      "binaryDir": "${sourceDir}/build_x86_64",
75
+      "condition": {
76
+        "type": "equals",
77
+        "lhs": "${hostSystemName}",
78
+        "rhs": "Linux"
79
+      },
80
+      "generator": "Ninja",
81
+      "warnings": {"dev": true, "deprecated": true},
82
+      "cacheVariables": {
83
+        "QT_VERSION": "6",
84
+        "CMAKE_BUILD_TYPE": "RelWithDebInfo",
85
+        "CMAKE_POSITION_INDEPENDENT_CODE": true,
86
+        "ENABLE_FRONTEND_API": true,
87
+        "ENABLE_QT": true,
88
+        "USE_SYSTEM_CURL": true
89
+      }
90
+    },
91
+    {
92
+      "name": "linux-ci-x86_64",
93
+      "inherits": "linux-x86_64",
94
+      "displayName": "Linux x86_64 CI build",
95
+      "description": "Build for Linux x86_64 on CI",
96
+      "cacheVariables": {
97
+        "CMAKE_BUILD_TYPE": "RelWithDebInfo",
98
+        "CMAKE_COMPILE_WARNING_AS_ERROR": true
99
+      }
100
+    },
101
+    {
102
+      "name": "linux-aarch64",
103
+      "displayName": "Linux aarch64",
104
+      "description": "Build for Linux aarch64",
105
+      "binaryDir": "${sourceDir}/build_aarch64",
106
+      "condition": {
107
+        "type": "equals",
108
+        "lhs": "${hostSystemName}",
109
+        "rhs": "Linux"
110
+      },
111
+      "generator": "Ninja",
112
+      "warnings": {"dev": true, "deprecated": true},
113
+      "cacheVariables": {
114
+        "QT_VERSION": "6",
115
+        "CMAKE_BUILD_TYPE": "RelWithDebInfo",
116
+        "CMAKE_POSITION_INDEPENDENT_CODE": true,
117
+        "ENABLE_FRONTEND_API": true,
118
+        "ENABLE_QT": true,
119
+        "USE_SYSTEM_CURL": true
120
+      }
121
+    },
122
+    {
123
+      "name": "linux-ci-aarch64",
124
+      "inherits": "linux-aarch64",
125
+      "displayName": "Linux aarch64 CI build",
126
+      "description": "Build for Linux aarch64 on CI",
127
+      "cacheVariables": {
128
+        "CMAKE_BUILD_TYPE": "RelWithDebInfo",
129
+        "CMAKE_COMPILE_WARNING_AS_ERROR": true
130
+      }
131
+    }
132
+  ,
133
+  "buildPresets": 
134
+    {
135
+      "name": "macos",
136
+      "configurePreset": "macos",
137
+      "displayName": "macOS Universal",
138
+      "description": "macOS build for Universal architectures",
139
+      "configuration": "Release"
140
+    },
141
+    {
142
+      "name": "macos-ci",
143
+      "configurePreset": "macos-ci",
144
+      "displayName": "macOS Universal CI",
145
+      "description": "macOS CI build for Universal architectures",
146
+      "configuration": "RelWithDebInfo"
147
+    },
148
+    {
149
+      "name": "windows-x64",
150
+      "configurePreset": "windows-x64",
151
+      "displayName": "Windows x64",
152
+      "description": "Windows build for x64",
153
+      "configuration": "RelWithDebInfo"
154
+    },
155
+    {
156
+      "name": "windows-ci-x64",
157
+      "configurePreset": "windows-ci-x64",
158
+      "displayName": "Windows x64 CI",
159
+      "description": "Windows CI build for x64 (RelWithDebInfo configuration)",
160
+      "configuration": "RelWithDebInfo"
161
+    },
162
+    {
163
+      "name": "linux-x86_64",
164
+      "configurePreset": "linux-x86_64",
165
+      "displayName": "Linux x86_64",
166
+      "description": "Linux build for x86_64",
167
+      "configuration": "RelWithDebInfo"
168
+    },
169
+    {
170
+      "name": "linux-ci-x86_64",
171
+      "configurePreset": "linux-ci-x86_64",
172
+      "displayName": "Linux x86_64 CI",
173
+      "description": "Linux CI build for x86_64",
174
+      "configuration": "RelWithDebInfo"
175
+    },
176
+    {
177
+      "name": "linux-aarch64",
178
+      "configurePreset": "linux-aarch64",
179
+      "displayName": "Linux aarch64",
180
+      "description": "Linux build for aarch64",
181
+      "configuration": "RelWithDebInfo"
182
+    },
183
+    {
184
+      "name": "linux-ci-aarch64",
185
+      "configurePreset": "linux-ci-aarch64",
186
+      "displayName": "Linux aarch64 CI",
187
+      "description": "Linux CI build for aarch64",
188
+      "configuration": "RelWithDebInfo"
189
+    }
190
+  
191
+}
192
obs-backgroundremoval-1.0.3.tar.gz/README.md -> obs-backgroundremoval-1.1.5.tar.gz/README.md Changed
122
 
1
@@ -3,8 +3,9 @@
2
 <div align="center">
3
 
4
 !GitHub(https://img.shields.io/github/license/royshil/obs-backgroundremoval)(https://github.com/royshil/obs-backgroundremoval/blob/main/LICENSE)
5
-!GitHub Workflow Status(https://img.shields.io/github/actions/workflow/status/royshil/obs-backgroundremoval/main.yml)(https://github.com/royshil/obs-backgroundremoval/actions/workflows/main.yml)
6
+!GitHub Workflow Status(https://img.shields.io/github/actions/workflow/status/royshil/obs-backgroundremoval/push.yaml)(https://github.com/royshil/obs-backgroundremoval/actions/workflows/push.yaml)
7
 !Total downloads(https://img.shields.io/github/downloads/royshil/obs-backgroundremoval/total)(https://github.com/royshil/obs-backgroundremoval/releases)
8
+!Flathub(https://img.shields.io/flathub/downloads/com.obsproject.Studio.Plugin.BackgroundRemoval?label=Flathub%20Installs)
9
 !GitHub release (latest by date)(https://img.shields.io/github/v/release/royshil/obs-backgroundremoval)(https://github.com/royshil/obs-backgroundremoval/releases)
10
 
11
 </div>
12
@@ -16,8 +17,11 @@
13
   - MacOSX(#mac-osx)
14
   - Linux (Ubuntu, Arch, openSUSE)(#linux)
15
   - Windows(#windows)
16
- 
17
-🚧 Check out our experimental CleanStream(https://github.com/royshil/obs-cleanstream) OBS plugin for real-time filler word (uh,um) and profanity removal from live audio stream 🚧
18
+
19
+Other plugins from us:
20
+- 🚧 Experimental 🚧: CleanStream(https://github.com/royshil/obs-cleanstream) OBS plugin for real-time filler word (uh,um) and profanity removal from live audio stream
21
+- ✨ NEW: URL/API Source(https://github.com/royshil/obs-urlsource) a plugin for live fetching of API data and displaying on screen as a video source
22
+- ✨ NEW: LocalVocal(https://github.com/royshil/obs-localvocal) speech AI assistant plugin for real-time local transcription (captions), translation and other language functions
23
 
24
 ## Download
25
 Check out the latest releases(https://github.com/royshil/obs-backgroundremoval/releases) for downloads and install instructions.
26
@@ -43,10 +47,10 @@
27
   </a>
28
 </div>
29
 
30
-## Requirements
31
-- OBS version 28+ (download(https://obsproject.com/download))
32
-
33
-We do not support older versions of OBS since the plugin is using newer APIs.
34
+## OBS Version Support and Compatibility
35
+- OBS version 29+ (download(https://obsproject.com/download)) for the latest version of this plugin, e.g. 1.1.x and above.
36
+- OBS version 28+ for this plugin's version between 0.5.x and 1.0.x.
37
+- OBS version 27+ for this plugin's version 0.4.x and below.
38
 
39
 ## Introduction
40
 
41
@@ -63,7 +67,7 @@
42
 
43
 Tutorial video on YouTube: https://youtu.be/veqNEsMqEE0
44
 
45
-!(demo.gif)(https://youtu.be/veqNEsMqEE0)
46
+https://github.com/royshil/obs-backgroundremoval/assets/1067855/5ba5aae2-7ea2-4c90-ad45-fba5ccde1a4e
47
 
48
 GPU support:
49
 * Currently on Windows we support DirectML, which should reduce CPU usage by 95% and effectively use the systems accelerators (GPUs if available).
50
@@ -78,6 +82,7 @@
51
 - https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.7/contrib/PP-HumanSeg
52
 - https://github.com/PINTO0309/PINTO_model_zoo/tree/main/082_MediaPipe_Meet_Segmentation
53
 - https://github.com/PeterL1n/RobustVideoMatting
54
+- https://github.com/PINTO0309/PINTO_model_zoo/tree/main/384_TCMonoDepth and https://github.com/yu-li/TCMonoDepth
55
 
56
 Image enhancement (low light) models are taken from:
57
 - https://github.com/PINTO0309/PINTO_model_zoo/tree/main/213_TBEFN
58
@@ -85,32 +90,32 @@
59
 - https://github.com/PINTO0309/PINTO_model_zoo/tree/main/370_Semantic-Guided-Low-Light-Image-Enhancement
60
 - https://github.com/PINTO0309/PINTO_model_zoo/tree/main/243_Zero-DCE-improved
61
 
62
-Some more information about how I built it: https://www.morethantechnical.com/2021/04/15/obs-plugin-for-portrait-background-removal-with-onnx-sinet-model/
63
+Some more information about how I built it: https://www.morethantechnical.com/2021/04/15/obs-plugin-for-portrait-background-removal-with-onnx-sinet-model/ and https://www.morethantechnical.com/2023/05/20/building-an-obs-background-removal-plugin-a-walkthrough/
64
 
65
 ## Building
66
 
67
-The plugin was built and tested on Mac OSX, Windows and Ubuntu Linux. Help is appreciated in building on other OSs and packages.
68
+The plugin was built and tested on Mac OSX  (Intel & Apple silicon), Windows and several Linux disros (e.g. Ubuntu/Debian-ish, Fedora, and more). Help is appreciated in building on other OSs and packages.
69
 
70
-The building pipelines in CI take care of the heavy lifting. Use them in order to build the plugin locally. Note that due to the fact we're building and packaging OpenCV and ONNX Runtime the build times are quite long.
71
+The building pipelines in CI take care of the heavy lifting. Use them in order to build the plugin locally. We attempt to use external OpenCV, libcurl and ONNX Runtime to reduce build times.
72
 
73
 Start by cloning this repo to a directory of your choice.
74
 
75
 ### Mac OSX
76
 
77
-Using the CI pipeline scripts, locally you would just call the zsh script.
78
+Using the CI pipeline scripts, locally you would just call the zsh script. By default this builds a universal binary for both Intel and Apple Silicon. To build for a specific architecture please see `.github/scripts/.build.zsh` for the `-arch` options.
79
 
80
 ```sh
81
-$ ./.github/scripts/build-macos.zsh -c Release -t macos-x86_64
82
+$ ./.github/scripts/build-macos -c Release
83
 ```
84
 
85
 #### Install
86
-The above script should succeed and the plugin files will reside in the `./release` folder off of the root. Copy the files to the OBS directory e.g. `/Applications/OBS.app/Contents/`.
87
+The above script should succeed and the plugin files (e.g. `obs-backgroundremoval.plugin`) will reside in the `./release/Release` folder off of the root. Copy the `.plugin` file to the OBS directory e.g. `~/Library/Application Support/obs-studio/plugins`.
88
 
89
-To get `.pkg` installer file, run
90
+To get `.pkg` installer file, run for example
91
 ```sh
92
-$ ./.github/scripts/package-macos.zsh -c Release -t macos-x86_64
93
+$ ./.github/scripts/package-macos -c Release
94
 ```
95
-(Note that maybe the outputs in the e.g. `build_x86_64` will be in the `Release` folder and not the `install` folder like `pakage-macos.zsh` expects, so you will need to rename the folder from `build_x86_64/Release` to `build_x86_64/install`)
96
+(Note that maybe the outputs will be in the `Release` folder and not the `install` folder like `pakage-macos` expects, so you will need to rename the folder from `build_x86_64/Release` to `build_x86_64/install`)
97
 
98
 ### Linux
99
 
100
@@ -124,6 +129,9 @@
101
 #### Arch Linux
102
 The community maintains AUR packages: https://aur.archlinux.org/packages/obs-backgroundremoval
103
 
104
+#### Fedora
105
+To compile on Fedora, you need to manage the dependencies manually. See docs/BUILDING-FEDORA.md(docs/BUILDING-FEDORA.md) for more information.
106
+
107
 #### FlatHub
108
 The plugin is available on FlatHub: https://github.com/flathub/com.obsproject.Studio.Plugin.BackgroundRemoval
109
 
110
@@ -141,6 +149,8 @@
111
 
112
 The build should exist in the `./release` folder off the root. You can manually install the files in the OBS directory.
113
 
114
-## Star History
115
-
116
-!Star History Chart(https://api.star-history.com/svg?repos=royshil/obs-backgroundremoval&type=Date)(https://star-history.com/#royshil/obs-backgroundremoval&Date)
117
+<picture>
118
+  <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=royshil/obs-backgroundremoval&type=Date&theme=dark" />
119
+  <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=royshil/obs-backgroundremoval&type=Date" />
120
+  <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=royshil/obs-backgroundremoval&type=Date" />
121
+</picture>
122
obs-backgroundremoval-1.1.5.tar.gz/build-aux Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/build-aux/.functions Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/build-aux/.functions/log_debug Added
5
 
1
@@ -0,0 +1,3 @@
2
+if (( ! ${+_loglevel} )) typeset -g _loglevel=1
3
+
4
+if (( _loglevel > 2 )) print -PR -e -- "${CI:+::debug::}%F{220}DEBUG: ${@}%f"
5
obs-backgroundremoval-1.1.5.tar.gz/build-aux/.functions/log_error Added
5
 
1
@@ -0,0 +1,3 @@
2
+local icon='  ✖︎ '
3
+
4
+print -u2 -PR "${CI:+::error::}%F{1} ${icon} %f ${@}"
5
obs-backgroundremoval-1.1.5.tar.gz/build-aux/.functions/log_group Added
18
 
1
@@ -0,0 +1,16 @@
2
+autoload -Uz log_info
3
+
4
+if (( ! ${+_log_group} )) typeset -g _log_group=0
5
+
6
+if (( ${+CI} )) {
7
+  if (( _log_group )) {
8
+    print "::endgroup::"
9
+    typeset -g _log_group=0
10
+  }
11
+  if (( # )) {
12
+    print "::group::${@}"
13
+    typeset -g _log_group=1
14
+  }
15
+} else {
16
+  if (( # )) log_info ${@}
17
+}
18
obs-backgroundremoval-1.1.5.tar.gz/build-aux/.functions/log_info Added
9
 
1
@@ -0,0 +1,7 @@
2
+if (( ! ${+_loglevel} )) typeset -g _loglevel=1
3
+
4
+if (( _loglevel > 0 )) {
5
+  local icon=' =>'
6
+
7
+  print -PR "%F{4}  ${(r:5:)icon}%f %B${@}%b"
8
+}
9
obs-backgroundremoval-1.1.5.tar.gz/build-aux/.functions/log_output Added
9
 
1
@@ -0,0 +1,7 @@
2
+if (( ! ${+_loglevel} )) typeset -g _loglevel=1
3
+
4
+if (( _loglevel > 0 )) {
5
+  local icon=''
6
+
7
+  print -PR "  ${(r:5:)icon} ${@}"
8
+}
9
obs-backgroundremoval-1.1.5.tar.gz/build-aux/.functions/log_status Added
9
 
1
@@ -0,0 +1,7 @@
2
+if (( ! ${+_loglevel} )) typeset -g _loglevel=1
3
+
4
+if (( _loglevel > 0 )) {
5
+  local icon='  >'
6
+
7
+  print -PR "%F{2}  ${(r:5:)icon}%f ${@}"
8
+}
9
obs-backgroundremoval-1.1.5.tar.gz/build-aux/.functions/log_warning Added
9
 
1
@@ -0,0 +1,7 @@
2
+if (( ! ${+_loglevel} )) typeset -g _loglevel=1
3
+
4
+if (( _loglevel > 0 )) {
5
+  local icon=' =>'
6
+
7
+  print -PR "${CI:+::warning::}%F{3}  ${(r:5:)icon} ${@}%f"
8
+}
9
obs-backgroundremoval-1.1.5.tar.gz/build-aux/.functions/set_loglevel Added
19
 
1
@@ -0,0 +1,17 @@
2
+autoload -Uz log_debug log_error
3
+
4
+local -r _usage="Usage: %B${0}%b <loglevel>
5
+
6
+Set log level, following levels are supported: 0 (quiet), 1 (normal), 2 (verbose), 3 (debug)"
7
+
8
+if (( ! # )); then
9
+  log_error 'Called without arguments.'
10
+  log_output ${_usage}
11
+  return 2
12
+elif (( ${1} >= 4 )); then
13
+  log_error 'Called with loglevel > 3.'
14
+  log_output ${_usage}
15
+fi
16
+
17
+typeset -g -i -r _loglevel=${1}
18
+log_debug "Log level set to '${1}'"
19
obs-backgroundremoval-1.1.5.tar.gz/build-aux/.run-format.zsh Added
192
 
1
@@ -0,0 +1,190 @@
2
+#!/usr/bin/env zsh
3
+
4
+builtin emulate -L zsh
5
+setopt EXTENDED_GLOB
6
+setopt PUSHD_SILENT
7
+setopt ERR_EXIT
8
+setopt ERR_RETURN
9
+setopt NO_UNSET
10
+setopt PIPE_FAIL
11
+setopt NO_AUTO_PUSHD
12
+setopt NO_PUSHD_IGNORE_DUPS
13
+setopt FUNCTION_ARGZERO
14
+
15
+## Enable for script debugging
16
+# setopt WARN_CREATE_GLOBAL
17
+# setopt WARN_NESTED_VAR
18
+# setopt XTRACE
19
+
20
+autoload -Uz is-at-least && if ! is-at-least 5.2; then
21
+  print -u2 -PR "%F{1}${funcstack1##*/}:%f Running on Zsh version %B${ZSH_VERSION}%b, but Zsh %B5.2%b is the minimum supported version. Upgrade zsh to fix this issue."
22
+  exit 1
23
+fi
24
+
25
+invoke_formatter() {
26
+  if (( # < 1 )) {
27
+    log_error "Usage invoke_formatter formatter_name"
28
+    exit 2
29
+  }
30
+
31
+  case ${1} {
32
+    clang)
33
+      if (( ${+commandsclang-format-13} )) {
34
+        local formatter=clang-format-13
35
+      } elif (( ${+commandsclang-format} )) {
36
+        local formatter=clang-format
37
+        local -a formatter_version=($(clang-format --version))
38
+
39
+        if ! is-at-least 13.0.1 ${formatter_version-1}; then
40
+          log_error "clang-format is not version 13.0.1 or above (found ${formatter_version-1}."
41
+          exit 2
42
+        fi
43
+
44
+        if ! is-at-least ${formatter_version-1} 13.0.1; then
45
+          log_error "clang-format is more recent than version 13.0.1 (found ${formatter_version-1})."
46
+          exit 2
47
+        fi
48
+      } else {
49
+        log_error "No viable clang-format version found (required 13.0.1)"
50
+        exit 2
51
+      }
52
+
53
+      local -a source_files=(src/**/*.(c|cpp|h|hpp|m|mm)(.N))
54
+      source_files=(${source_files:#vendor/*})
55
+
56
+      local -a format_args=(-style=file -fallback-style=none)
57
+      if (( _loglevel > 2 )) format_args+=(--verbose)
58
+      ;;
59
+    cmake)
60
+      local formatter=cmake-format
61
+      if (( ${+commandscmake-format} )) {
62
+        local cmake_format_version=$(cmake-format --version)
63
+
64
+        if ! is-at-least 0.6.13 ${cmake_format_version}; then
65
+          log_error "cmake-format is not version 0.6.13 or above (found ${cmake_format_version})."
66
+          exit 2
67
+        fi
68
+      } else {
69
+        log_error "No viable cmake-format version found (required 0.6.13)"
70
+        exit 2
71
+      }
72
+
73
+      local -a source_files=(**/(CMakeLists.txt|*.cmake)(.N))
74
+      source_files=(${source_files:#(build_*)/*})
75
+      source_files=(${source_files:#vendor/*})
76
+
77
+      local -a format_args=()
78
+      if (( _loglevel > 2 )) format_args+=(--log-level debug)
79
+      ;;
80
+    swift)
81
+      local formatter=swift-format
82
+      if (( ${+commandsswift-format} )) {
83
+        local swift_format_version=$(swift-format --version)
84
+
85
+        if ! is-at-least 508.0.0 ${swift_format_version}; then
86
+          log_error "swift-format is not version 508.0.0 or above (found ${swift_format_version})."
87
+          exit 2
88
+        fi
89
+      } else {
90
+        log_error "No viable swift-format version found (required 508.0.0)"
91
+        exit 2
92
+      }
93
+
94
+      local -a source_files=(**/*.swift(.N))
95
+
96
+      local -a format_args=()
97
+      ;;
98
+    *) log_error "Invalid formatter specified: ${1}. Valid options are clang-format, cmake-format, and swift-format."; exit 2 ;;
99
+  }
100
+
101
+  local file
102
+  local -i num_failures=0
103
+  if (( check_only )) {
104
+    for file (${source_files}) {
105
+      if (( _loglevel > 1 )) log_info "Checking format of ${file}..."
106
+
107
+      if ! "${formatter}" ${format_args} "${file}" | diff -q "${file}" - &> /dev/null; then
108
+        log_error "${file} requires formatting changes."
109
+
110
+        if (( fail_on_error == 2 )) return 2;
111
+        num_failures=$(( num_failures + 1 ))
112
+      else
113
+        if (( _loglevel > 1 )) log_status "${file} requires no formatting changes."
114
+      fi
115
+    }
116
+    if (( fail_on_error && num_failures )) return 2;
117
+  } elif (( ${#source_files} )) {
118
+    format_args+=(-i)
119
+    "${formatter}" ${format_args} ${source_files}
120
+  }
121
+}
122
+
123
+run_format() {
124
+  if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO:A:h}
125
+  if (( ! ${+FORMATTER_NAME} )) typeset -g FORMATTER_NAME=${${(s:-:)ZSH_ARGZERO:t:r}2}
126
+
127
+  typeset -g host_os=${${(L)$(uname -s)}//darwin/macos}
128
+  local -i fail_on_error=0
129
+  local -i check_only=0
130
+  local -i verbosity=1
131
+  local -r _version='1.0.0'
132
+
133
+  fpath=("${SCRIPT_HOME}/.functions" ${fpath})
134
+  autoload -Uz log_info log_error log_output set_loglevel log_status log_warning
135
+
136
+  local -r _usage="
137
+Usage: %B${functrace1%:*}%b <option>
138
+
139
+%BOptions%b:
140
+
141
+%F{yellow} Formatting options%f
142
+ -----------------------------------------------------------------------------
143
+  %B-c | --check%b                      Check only, no actual formatting takes place
144
+
145
+%F{yellow} Output options%f
146
+ -----------------------------------------------------------------------------
147
+  %B-v | --verbose%b                    Verbose (more detailed output)
148
+  %B--fail-never|error                Fail script never/on formatting change - default: %B%F{green}never%f%b
149
+  %B--debug%b                           Debug (very detailed and added output)
150
+
151
+%F{yellow} General options%f
152
+ -----------------------------------------------------------------------------
153
+  %B-h | --help%b                       Print this usage help
154
+  %B-V | --version%b                    Print script version information"
155
+
156
+  local -a args
157
+  while (( # )) {
158
+    case ${1} {
159
+      --)
160
+        shift
161
+        args+=($@)
162
+        break
163
+        ;;
164
+      -c|--check) check_only=1; shift ;;
165
+      -v|--verbose) (( _verbosity += 1 )); shift ;;
166
+      -h|--help) log_output ${_usage}; exit 0 ;;
167
+      -V|--version) print -Pr "${_version}"; exit 0 ;;
168
+      --debug) verbosity=3; shift ;;
169
+      --fail-never)
170
+        fail_on_error=0
171
+        shift
172
+        ;;
173
+      --fail-error)
174
+        fail_on_error=1
175
+        shift
176
+        ;;
177
+      --fail-fast)
178
+        fail_on_error=2
179
+        shift
180
+        ;;
181
+      *) log_error "Unknown option: %B${1}%b"; log_output ${_usage}; exit 2 ;;
182
+    }
183
+  }
184
+
185
+  set -- ${(@)args}
186
+  set_loglevel ${verbosity}
187
+
188
+  invoke_formatter ${FORMATTER_NAME}
189
+}
190
+
191
+run_format ${@}
192
obs-backgroundremoval-1.1.5.tar.gz/build-aux/run-clang-format Added
2
 
1
+(symlink to .run-format.zsh)
2
obs-backgroundremoval-1.1.5.tar.gz/build-aux/run-cmake-format Added
2
 
1
+(symlink to .run-format.zsh)
2
obs-backgroundremoval-1.1.5.tar.gz/build-aux/run-swift-format Added
2
 
1
+(symlink to .run-format.zsh)
2
obs-backgroundremoval-1.0.3.tar.gz/buildspec.json -> obs-backgroundremoval-1.1.5.tar.gz/buildspec.json Changed
123
 
1
@@ -1,86 +1,57 @@
2
 {
3
     "dependencies": {
4
         "obs-studio": {
5
-            "version": "28.0.1",
6
-            "repository": "https://github.com/obsproject/obs-studio.git",
7
-            "branch": "master",
8
-            "hash": "e8dc70d0eef4503378d6ac300e680215eb5c9379"
9
-        },
10
-        "prebuilt": {
11
-            "version": "2022-08-02",
12
-            "baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
13
-            "label": "Pre-built obs-deps",
14
+            "version": "29.1.2",
15
+            "baseUrl": "https://github.com/obsproject/obs-studio/archive/refs/tags",
16
+            "label": "OBS sources",
17
             "hashes": {
18
-                "macos-x86_64": "7637e52305e6fc53014b5aabd583f1a4490b1d97450420e977cae9a336a29525",
19
-                "macos-arm64": "755e0fa69b17a3ae444e1befa9d91d77e3cafe628fbd1c6333686091826595cd",
20
-                "macos-universal": "de057e73e6fe0825664c258ca2dd6798c41ae580bf4d896e1647676a4941934a",
21
-                "windows-x64": "2192d8ce780c4281b807cd457994963669e5202659ecd92f19b54c3e7d0c1915",
22
-                "windows-x86": "9f8582ab5891b000869d6484ea591add9fbac9f1c91b56c7b85fdfd56a261c1b"
23
+                "macos": "215f1fa5772c5dd9f3d6e35b0cb573912b00320149666a77864f9d305525504b",
24
+                "windows-x64": "46d451f3f42b9d2c59339ec268165849c7b7904cdf1cc2a8d44c015815a9e37d"
25
             }
26
         },
27
-        "qt5": {
28
-            "version": "2022-08-02",
29
+        "prebuilt": {
30
+            "version": "2023-04-12",
31
             "baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
32
-            "label": "Pre-built Qt5",
33
+            "label": "Pre-Built obs-deps",
34
             "hashes": {
35
-                "macos-x86_64": "3d0381a52b0e4d49967936c4357f79ac711f43564329304a6db5c90edadd2697",
36
-                "macos-arm64": "f4b32548c0530f121956bf0a9a70c36ecbbfca81073d39c396a1759baf2a05c3",
37
-                "macos-universal": "9a6cf3b9a6c9efee6ba10df649202e8075e99f3c54ae88dc9a36dbc9d7471c1e",
38
-                "windows-x64": "6488a33a474f750d5a4a268a5e20c78bb40799d99136a1b7ce3365a843cb2fd7",
39
-                "windows-x86": "a916e09b0a874036801deab2c8a7ec14fdf5d268aa5511eac5bf40727e0c4e33"
40
-            },
41
-            "pdb-hashes": {
42
-                "windows-x64": "e0e5070143fcad9311a68ce5685d8ba8f34f581ed6942b7a92d360f94ca1ba11",
43
-                "windows-x86": "36642d1052aa461964f46c17610477b0d9b9defbe2d745ccaacb85f805c1bec2"
44
+                "macos": "9535c6e1ad96f7d49960251e85a245774088d48da1d602bb82f734b10219125a",
45
+                "windows-x64": "c13a14a1acc4224b21304d97b63da4121de1ed6981297e50496fbc474abc0503"
46
             }
47
         },
48
         "qt6": {
49
-            "version": "2022-08-02",
50
+            "version": "2023-04-12",
51
             "baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
52
-            "label": "Pre-built Qt6",
53
+            "label": "Pre-Built Qt6",
54
             "hashes": {
55
-                "macos-x86_64": "a83f72a11023b03b6cb2dc365f0a66ad9df31163bbb4fe2df32d601856a9fad3",
56
-                "macos-arm64": "2f30af90c049670a5660656adbb440668aa1b0567f75a5f29e1def9108928403",
57
-                "macos-universal": "252e6684f43ab9c6f262c73af739e2296ce391b998da2c4ee04c254aaa07db18",
58
-                "windows-x64": "e5509b54196a3f935250cc4b9c54160c8e588fd0f92bc078a2a64f9d9e2e4e93",
59
-                "windows-x86": "24fc03bef153a0e027c1479e42eb08097a4ea1d70a4710825be0783d0626cb0d"
60
+                "macos": "eb7614544ab4f3d2c6052c797635602280ca5b028a6b987523d8484222ce45d1",
61
+                "windows-x64": "4d39364b8a8dee5aa24fcebd8440d5c22bb4551c6b440ffeacce7d61f2ed1add"
62
             },
63
-            "pdb-hashes": {
64
-                "windows-x64": "60e5b1d2bc4d7c431bc05f14e3b1e85e088788c372fa85f58717cd6c49555a46",
65
-                "windows-x86": "f34d1a89fc85d92913bd6c7f75ec5c28471d74db708c98161100bc8b75f8fc63"
66
+            "debugSymbols": {
67
+                "windows-x64": "f34ee5067be19ed370268b15c53684b7b8aaa867dc800b68931df905d679e31f"
68
             }
69
         }
70
     },
71
+    "tools": {
72
+        "packages": {
73
+            "version": "1.2.10",
74
+            "baseUrl": "http://s.sudre.free.fr/Software/files",
75
+            "label": "Packages.app",
76
+            "hash": "6afdd25386295974dad8f078b8f1e41cabebd08e72d970bf92f707c7e48b16c9"
77
+        }
78
+    },
79
     "platformConfig": {
80
-        "macos-x86_64": {
81
-            "qtVersion": 6,
82
-            "deploymentTarget": "10.15"
83
-        },
84
-        "macos-arm64": {
85
-            "qtVersion": 6,
86
-            "deploymentTarget": "11.0"
87
-        },
88
-        "macos-universal": {
89
-            "qtVersion": 6,
90
-            "deploymentTarget": "10.15"
91
-        },
92
-        "windows-x64": {
93
-            "qtVersion": 6,
94
-            "visualStudio": "Visual Studio 17 2022",
95
-            "platformSDK": "10.0.20348.0"
96
-        },
97
-        "windows-x86": {
98
-            "qtVersion": 6,
99
-            "visualStudio": "Visual Studio 17 2022",
100
-            "platformSDK": "10.0.20348.0"
101
-        },
102
-        "linux-x86_64": {
103
-            "qtVersion": 6
104
-        },
105
-        "linux-aarch64": {
106
-            "qtVersion": 6
107
+        "macos": {
108
+            "bundleId": "com.royshilkrot.obs-backgroundremoval"
109
         }
110
     },
111
     "name": "obs-backgroundremoval",
112
-    "version": "1.0.3"
113
+    "version": "1.1.5",
114
+    "author": "Roy Shilkrot",
115
+    "website": "https://github.com/royshil/obs-backgroundremoval",
116
+    "email": "roy.shil@gmail.com",
117
+    "uuids": {
118
+        "macosPackage": "c6b4a038-f7da-490a-b8ba-a31e29e337c9",
119
+        "macosInstaller": "368f7535-4e71-4587-952b-33ad935bf9f3",
120
+        "windowsApp": "1527c9ec-2638-4e3b-94d7-cc25d27cd725"
121
+    }
122
 }
123
obs-backgroundremoval-1.1.5.tar.gz/cmake/BuildMyCurl.cmake Added
23
 
1
@@ -0,0 +1,21 @@
2
+if(OS_MACOS)
3
+  set(CURL_USE_OPENSSL OFF)
4
+  set(CURL_USE_SECTRANSP ON)
5
+elseif(OS_WINDOWS)
6
+  set(CURL_USE_OPENSSL OFF)
7
+  set(CURL_USE_SCHANNEL ON)
8
+elseif(OS_LINUX)
9
+  add_compile_options(-fPIC)
10
+  set(CURL_USE_OPENSSL ON)
11
+endif()
12
+set(BUILD_CURL_EXE OFF)
13
+set(BUILD_SHARED_LIBS OFF)
14
+set(HTTP_ONLY OFF)
15
+set(CURL_USE_LIBSSH2 OFF)
16
+add_subdirectory(vendor/curl EXCLUDE_FROM_ALL)
17
+if(OS_MACOS)
18
+  target_compile_options(
19
+    libcurl PRIVATE -Wno-error=ambiguous-macro -Wno-error=deprecated-declarations -Wno-error=unreachable-code
20
+                    -Wno-error=unused-parameter -Wno-error=unused-variable)
21
+endif()
22
+include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/vendor/curl/include)
23
obs-backgroundremoval-1.0.3.tar.gz/cmake/FetchOnnxruntime.cmake -> obs-backgroundremoval-1.1.5.tar.gz/cmake/FetchOnnxruntime.cmake Changed
113
 
1
@@ -12,8 +12,7 @@
2
   set(USE_PREDEFINED_ONNXRUNTIME ON)
3
 else()
4
   if(CUSTOM_ONNXRUNTIME_MD5 STREQUAL "")
5
-    message(
6
-      FATAL_ERROR "Both of CUSTOM_ONNXRUNTIME_URL and CUSTOM_ONNXRUNTIME_MD5 must be present!")
7
+    message(FATAL_ERROR "Both of CUSTOM_ONNXRUNTIME_URL and CUSTOM_ONNXRUNTIME_MD5 must be present!")
8
   else()
9
     set(USE_PREDEFINED_ONNXRUNTIME OFF)
10
   endif()
11
@@ -36,16 +35,16 @@
12
   FetchContent_MakeAvailable(Onnxruntime)
13
   set(Onnxruntime_LIB "${onnxruntime_SOURCE_DIR}/lib/libonnxruntime.${Onnxruntime_VERSION}.dylib")
14
   target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE "${Onnxruntime_LIB}")
15
-  target_include_directories(${CMAKE_PROJECT_NAME} SYSTEM
16
-                             PUBLIC "${onnxruntime_SOURCE_DIR}/include")
17
-  install(FILES "${Onnxruntime_LIB}" DESTINATION "${CMAKE_PROJECT_NAME}.plugin/Contents/Frameworks")
18
+  target_include_directories(${CMAKE_PROJECT_NAME} SYSTEM PUBLIC "${onnxruntime_SOURCE_DIR}/include")
19
+  target_sources(${CMAKE_PROJECT_NAME} PRIVATE "${Onnxruntime_LIB}")
20
+  set_property(SOURCE "${Onnxruntime_LIB}" PROPERTY MACOSX_PACKAGE_LOCATION Frameworks)
21
+  source_group("Frameworks" FILES "${Onnxruntime_LIB}")
22
   add_custom_command(
23
     TARGET "${CMAKE_PROJECT_NAME}"
24
     POST_BUILD
25
     COMMAND
26
       ${CMAKE_INSTALL_NAME_TOOL} -change "@rpath/libonnxruntime.${Onnxruntime_VERSION}.dylib"
27
-      "@loader_path/../Frameworks/libonnxruntime.${Onnxruntime_VERSION}.dylib"
28
-      $<TARGET_FILE:${CMAKE_PROJECT_NAME}>)
29
+      "@loader_path/../Frameworks/libonnxruntime.${Onnxruntime_VERSION}.dylib" $<TARGET_FILE:${CMAKE_PROJECT_NAME}>)
30
 elseif(OS_WINDOWS)
31
   if(USE_PREDEFINED_ONNXRUNTIME)
32
     FetchContent_Declare(
33
@@ -62,15 +61,12 @@
34
 
35
   add_library(Ort INTERFACE)
36
   set(Onnxruntime_LIB_NAMES
37
-      session;providers_shared;providers_dml;optimizer;providers;framework;graph;util;mlas;common;flatbuffers
38
-  )
39
+      session;providers_shared;providers_dml;optimizer;providers;framework;graph;util;mlas;common;flatbuffers)
40
   foreach(lib_name IN LISTS Onnxruntime_LIB_NAMES)
41
     add_library(Ort::${lib_name} STATIC IMPORTED)
42
-    set_target_properties(
43
-      Ort::${lib_name} PROPERTIES IMPORTED_LOCATION
44
-                                  ${onnxruntime_SOURCE_DIR}/lib/onnxruntime_${lib_name}.lib)
45
-    set_target_properties(Ort::${lib_name} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
46
-                                                      ${onnxruntime_SOURCE_DIR}/include)
47
+    set_target_properties(Ort::${lib_name} PROPERTIES IMPORTED_LOCATION
48
+                                                      ${onnxruntime_SOURCE_DIR}/lib/onnxruntime_${lib_name}.lib)
49
+    set_target_properties(Ort::${lib_name} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${onnxruntime_SOURCE_DIR}/include)
50
     target_link_libraries(Ort INTERFACE Ort::${lib_name})
51
   endforeach()
52
 
53
@@ -79,22 +75,19 @@
54
   )
55
   foreach(lib_name IN LISTS Onnxruntime_EXTERNAL_LIB_NAMES)
56
     add_library(Ort::${lib_name} STATIC IMPORTED)
57
-    set_target_properties(Ort::${lib_name} PROPERTIES IMPORTED_LOCATION
58
-                                                      ${onnxruntime_SOURCE_DIR}/lib/${lib_name}.lib)
59
+    set_target_properties(Ort::${lib_name} PROPERTIES IMPORTED_LOCATION ${onnxruntime_SOURCE_DIR}/lib/${lib_name}.lib)
60
     target_link_libraries(Ort INTERFACE Ort::${lib_name})
61
   endforeach()
62
 
63
   add_library(Ort::DirectML SHARED IMPORTED)
64
-  set_target_properties(Ort::DirectML PROPERTIES IMPORTED_LOCATION
65
-                                                 ${onnxruntime_SOURCE_DIR}/bin/DirectML.dll)
66
-  set_target_properties(Ort::DirectML PROPERTIES IMPORTED_IMPLIB
67
-                                                 ${onnxruntime_SOURCE_DIR}/bin/DirectML.lib)
68
+  set_target_properties(Ort::DirectML PROPERTIES IMPORTED_LOCATION ${onnxruntime_SOURCE_DIR}/bin/DirectML.dll)
69
+  set_target_properties(Ort::DirectML PROPERTIES IMPORTED_IMPLIB ${onnxruntime_SOURCE_DIR}/bin/DirectML.lib)
70
 
71
   target_link_libraries(Ort INTERFACE Ort::DirectML d3d12.lib dxgi.lib dxguid.lib)
72
 
73
   target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Ort)
74
 
75
-  install(IMPORTED_RUNTIME_ARTIFACTS Ort::DirectML DESTINATION "${OBS_PLUGIN_DESTINATION}")
76
+  install(IMPORTED_RUNTIME_ARTIFACTS Ort::DirectML DESTINATION "obs-plugins/64bit")
77
 elseif(OS_LINUX)
78
   if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
79
     if(USE_PREDEFINED_ONNXRUNTIME)
80
@@ -109,8 +102,7 @@
81
         URL_HASH MD5=${CUSTOM_ONNXRUNTIME_MD5})
82
     endif()
83
     FetchContent_MakeAvailable(Onnxruntime)
84
-    set(Onnxruntime_LINK_LIBS
85
-        "${onnxruntime_SOURCE_DIR}/lib/libonnxruntime.so.${Onnxruntime_VERSION}")
86
+    set(Onnxruntime_LINK_LIBS "${onnxruntime_SOURCE_DIR}/lib/libonnxruntime.so.${Onnxruntime_VERSION}")
87
     set(Onnxruntime_INSTALL_LIBS ${Onnxruntime_LINK_LIBS})
88
   else()
89
     if(USE_PREDEFINED_ONNXRUNTIME)
90
@@ -125,18 +117,14 @@
91
         URL_HASH MD5=${CUSTOM_ONNXRUNTIME_MD5})
92
     endif()
93
     FetchContent_MakeAvailable(Onnxruntime)
94
-    set(Onnxruntime_LINK_LIBS
95
-        "${onnxruntime_SOURCE_DIR}/lib/libonnxruntime.so.${Onnxruntime_VERSION}")
96
+    set(Onnxruntime_LINK_LIBS "${onnxruntime_SOURCE_DIR}/lib/libonnxruntime.so.${Onnxruntime_VERSION}")
97
     set(Onnxruntime_INSTALL_LIBS
98
         ${Onnxruntime_LINK_LIBS} "${onnxruntime_SOURCE_DIR}/lib/libonnxruntime_providers_shared.so"
99
         "${onnxruntime_SOURCE_DIR}/lib/libonnxruntime_providers_cuda.so"
100
         "${onnxruntime_SOURCE_DIR}/lib/libonnxruntime_providers_tensorrt.so")
101
   endif()
102
   target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ${Onnxruntime_LINK_LIBS})
103
-  target_include_directories(${CMAKE_PROJECT_NAME} SYSTEM
104
-                             PUBLIC "${onnxruntime_SOURCE_DIR}/include")
105
-  install(FILES ${Onnxruntime_INSTALL_LIBS}
106
-          DESTINATION "${OBS_PLUGIN_DESTINATION}/${CMAKE_PROJECT_NAME}")
107
-  set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES INSTALL_RPATH
108
-                                                         "$ORIGIN/${CMAKE_PROJECT_NAME}")
109
+  target_include_directories(${CMAKE_PROJECT_NAME} SYSTEM PUBLIC "${onnxruntime_SOURCE_DIR}/include")
110
+  install(FILES ${Onnxruntime_INSTALL_LIBS} DESTINATION "${CMAKE_INSTALL_LIBDIR}/obs-plugins/${CMAKE_PROJECT_NAME}")
111
+  set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/${CMAKE_PROJECT_NAME}")
112
 endif()
113
obs-backgroundremoval-1.1.5.tar.gz/cmake/FetchOpenCV.cmake Added
82
 
1
@@ -0,0 +1,80 @@
2
+include(FetchContent)
3
+
4
+set(CUSTOM_OPENCV_URL
5
+    ""
6
+    CACHE STRING "URL of a downloaded OpenCV static library tarball")
7
+
8
+set(CUSTOM_OPENCV_HASH
9
+    ""
10
+    CACHE STRING "Hash of a downloaded OpenCV staitc library tarball")
11
+
12
+if(CUSTOM_OPENCV_URL STREQUAL "")
13
+  set(USE_PREDEFINED_OPENCV ON)
14
+else()
15
+  if(CUSTOM_OPENCV_HASH STREQUAL "")
16
+    message(FATAL_ERROR "Both of CUSTOM_OPENCV_URL and CUSTOM_OPENCV_HASH must be present!")
17
+  else()
18
+    set(USE_PREDEFINED_OPENCV OFF)
19
+  endif()
20
+endif()
21
+
22
+if(USE_PREDEFINED_OPENCV)
23
+  set(OpenCV_VERSION "4.8.0-1")
24
+  set(OpenCV_BASEURL "https://github.com/umireon/obs-backgroundremoval-dep-opencv/releases/download/${OpenCV_VERSION}")
25
+
26
+  if(${CMAKE_BUILD_TYPE} STREQUAL Release OR ${CMAKE_BUILD_TYPE} STREQUAL RelWithDebInfo)
27
+    set(OpenCV_BUILD_TYPE Release)
28
+  else()
29
+    set(OpenCV_BUILD_TYPE Debug)
30
+  endif()
31
+
32
+  if(APPLE)
33
+    if(OpenCV_BUILD_TYPE STREQUAL Release)
34
+      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-macos-Release.tar.gz")
35
+      set(OpenCV_HASH MD5=0875366a03aa44def76ab5a12d3e7b8f)
36
+    else()
37
+      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-macos-Debug.tar.gz")
38
+      set(OpenCV_HASH MD5=9ae59653c7f9a4c991fbf59018e45d2c)
39
+    endif()
40
+  elseif(MSVC)
41
+    if(OpenCV_BUILD_TYPE STREQUAL Release)
42
+      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-windows-Release.zip")
43
+      set(OpenCV_HASH MD5=e653d590cfbcc3a9bf15ef20e64a6e32)
44
+    else()
45
+      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-windows-Debug.zip")
46
+      set(OpenCV_HASH MD5=abad340ccb73da2924544ec9066afcb3)
47
+    endif()
48
+  else()
49
+    if(OpenCV_BUILD_TYPE STREQUAL Release)
50
+      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-linux-Release.tar.gz")
51
+      set(OpenCV_HASH MD5=7a668fbc3ac536812643c6b8c8f96be9)
52
+    else()
53
+      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-linux-Debug.tar.gz")
54
+      set(OpenCV_HASH MD5=259699c71055ff748c200e62af059104)
55
+    endif()
56
+  endif()
57
+else()
58
+  set(OpenCV_URL "${CUSTOM_OPENCV_URL}")
59
+  set(OpenCV_HASH "${CUSTOM_OPENCV_HASH}")
60
+endif()
61
+
62
+FetchContent_Declare(
63
+  opencv
64
+  URL ${OpenCV_URL}
65
+  URL_HASH ${OpenCV_HASH})
66
+FetchContent_MakeAvailable(opencv)
67
+
68
+add_library(OpenCV INTERFACE)
69
+if(MSVC)
70
+  target_link_libraries(
71
+    OpenCV
72
+    INTERFACE ${opencv_SOURCE_DIR}/x64/vc17/staticlib/opencv_imgproc480.lib
73
+              ${opencv_SOURCE_DIR}/x64/vc17/staticlib/opencv_core480.lib
74
+              ${opencv_SOURCE_DIR}/x64/vc17/staticlib/zlib.lib)
75
+  target_include_directories(OpenCV SYSTEM INTERFACE ${opencv_SOURCE_DIR}/include)
76
+else()
77
+  target_link_libraries(
78
+    OpenCV INTERFACE ${opencv_SOURCE_DIR}/lib/libopencv_imgproc.a ${opencv_SOURCE_DIR}/lib/libopencv_core.a
79
+                     ${opencv_SOURCE_DIR}/lib/opencv4/3rdparty/libzlib.a)
80
+  target_include_directories(OpenCV SYSTEM INTERFACE ${opencv_SOURCE_DIR}/include/opencv4)
81
+endif()
82
obs-backgroundremoval-1.0.3.tar.gz/cmake/FindOnnxruntime.cmake -> obs-backgroundremoval-1.1.5.tar.gz/cmake/FindOnnxruntime.cmake Changed
33
 
1
@@ -1,7 +1,6 @@
2
-# Try to find onnxruntime library Once done this will define Onnxruntime_FOUND - if system found
3
-# onnruntime library Onnxruntime_INCLUDE_DIRS - The onnruntime include directories
4
-# Onnxruntime_LIBRARIES - The libraries needed to use onnxruntime Onnxruntime_LIBRARY_DIR - The
5
-# directory of onnxruntime libraries
6
+# Try to find onnxruntime library Once done this will define Onnxruntime_FOUND - if system found onnruntime library
7
+# Onnxruntime_INCLUDE_DIRS - The onnruntime include directories Onnxruntime_LIBRARIES - The libraries needed to use
8
+# onnxruntime Onnxruntime_LIBRARY_DIR - The directory of onnxruntime libraries
9
 
10
 if(APPLE)
11
   set(Onnxruntime_DIR_BUILD ${CMAKE_SOURCE_DIR}/build/onnxruntime)
12
@@ -39,10 +38,8 @@
13
 endif()
14
 
15
 include(FindPackageHandleStandardArgs)
16
-# handle the QUIETLY and REQUIRED arguments and set LOGGING_FOUND to TRUE if all listed variables
17
-# are TRUE
18
-find_package_handle_standard_args(Onnxruntime DEFAULT_MSG Onnxruntime_INCLUDE_DIR
19
-                                  Onnxruntime_LIBRARIES)
20
+# handle the QUIETLY and REQUIRED arguments and set LOGGING_FOUND to TRUE if all listed variables are TRUE
21
+find_package_handle_standard_args(Onnxruntime DEFAULT_MSG Onnxruntime_INCLUDE_DIR Onnxruntime_LIBRARIES)
22
 
23
 if(Onnxruntime_FOUND)
24
   set(Onnxruntime_INCLUDE_DIRS
25
@@ -60,5 +57,5 @@
26
 endif()
27
 
28
 # Tell cmake GUIs to ignore the "local" variables.
29
-mark_as_advanced(Onnxruntime_INCLUDE_DIR Onnxruntime_LIBRARY Onnxruntime_INCLUDE_DIRS
30
-                 Onnxruntime_LIBRARY_DIR Onnxruntime_LIBRARIES)
31
+mark_as_advanced(Onnxruntime_INCLUDE_DIR Onnxruntime_LIBRARY Onnxruntime_INCLUDE_DIRS Onnxruntime_LIBRARY_DIR
32
+                 Onnxruntime_LIBRARIES)
33
obs-backgroundremoval-1.1.5.tar.gz/cmake/common Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/cmake/common/bootstrap.cmake Added
79
 
1
@@ -0,0 +1,77 @@
2
+cmake_minimum_required(VERSION 3.16...3.26)
3
+
4
+include_guard(GLOBAL)
5
+
6
+# Enable automatic PUSH and POP of policies to parent scope
7
+if(POLICY CMP0011)
8
+  cmake_policy(SET CMP0011 NEW)
9
+endif()
10
+
11
+# Enable distinction between Clang and AppleClang
12
+if(POLICY CMP0025)
13
+  cmake_policy(SET CMP0025 NEW)
14
+endif()
15
+
16
+# Enable strict checking of "break()" usage
17
+if(POLICY CMP0055)
18
+  cmake_policy(SET CMP0055 NEW)
19
+endif()
20
+
21
+# Honor visibility presets for all target types (executable, shared, module, static)
22
+if(POLICY CMP0063)
23
+  cmake_policy(SET CMP0063 NEW)
24
+endif()
25
+
26
+# Disable export function calls to populate package registry by default
27
+if(POLICY CMP0090)
28
+  cmake_policy(SET CMP0090 NEW)
29
+endif()
30
+
31
+# Prohibit in-source builds
32
+if("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
33
+  message(FATAL_ERROR "In-source builds are not supported. "
34
+                      "Specify a build directory via 'cmake -S <SOURCE DIRECTORY> -B <BUILD_DIRECTORY>' instead.")
35
+  file(REMOVE_RECURSE "${CMAKE_CURRENT_SOURCE_DIR}/CMakeCache.txt" "${CMAKE_CURRENT_SOURCE_DIR}/CMakeFiles")
36
+endif()
37
+
38
+# Use folders for source file organization with IDE generators (Visual Studio/Xcode)
39
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
40
+
41
+# Add common module directories to default search path
42
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/common")
43
+
44
+file(READ "${CMAKE_CURRENT_SOURCE_DIR}/buildspec.json" buildspec)
45
+
46
+# cmake-format: off
47
+string(JSON _name GET ${buildspec} name)
48
+string(JSON _website GET ${buildspec} website)
49
+string(JSON _author GET ${buildspec} author)
50
+string(JSON _email GET ${buildspec} email)
51
+string(JSON _version GET ${buildspec} version)
52
+string(JSON _bundleId GET ${buildspec} platformConfig macos bundleId)
53
+string(JSON _macosPackageUUID GET ${buildspec} uuids macosPackage)
54
+string(JSON _macosInstallerUUID GET ${buildspec} uuids macosInstaller)
55
+string(JSON _windowsAppUUID GET ${buildspec} uuids windowsApp)
56
+# cmake-format: on
57
+
58
+set(PLUGIN_AUTHOR ${_author})
59
+set(PLUGIN_WEBSITE ${_website})
60
+set(PLUGIN_EMAIL ${_email})
61
+set(PLUGIN_VERSION ${_version})
62
+set(MACOS_BUNDLEID ${_bundleId})
63
+
64
+include(buildnumber)
65
+include(osconfig)
66
+
67
+# Allow selection of common build types via UI
68
+if(NOT CMAKE_BUILD_TYPE)
69
+  set(CMAKE_BUILD_TYPE
70
+      "RelWithDebInfo"
71
+      CACHE STRING "OBS build type Release, RelWithDebInfo, Debug, MinSizeRel" FORCE)
72
+  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Release RelWithDebInfo Debug MinSizeRel)
73
+endif()
74
+
75
+# Disable exports automatically going into the CMake package registry
76
+set(CMAKE_EXPORT_PACKAGE_REGISTRY FALSE)
77
+# Enable default inclusion of targets' source and binary directory
78
+set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
79
obs-backgroundremoval-1.1.5.tar.gz/cmake/common/buildnumber.cmake Added
23
 
1
@@ -0,0 +1,21 @@
2
+# CMake build number module
3
+
4
+include_guard(GLOBAL)
5
+
6
+# Define build number cache file
7
+set(_BUILD_NUMBER_CACHE
8
+    "${CMAKE_CURRENT_SOURCE_DIR}/cmake/.CMakeBuildNumber"
9
+    CACHE INTERNAL "OBS build number cache file")
10
+
11
+# Read build number from cache file or manual override
12
+if(NOT DEFINED PLUGIN_BUILD_NUMBER AND EXISTS "${_BUILD_NUMBER_CACHE}")
13
+  file(READ "${_BUILD_NUMBER_CACHE}" PLUGIN_BUILD_NUMBER)
14
+  math(EXPR PLUGIN_BUILD_NUMBER "${PLUGIN_BUILD_NUMBER}+1")
15
+elseif(NOT DEFINED PLUGIN_BUILD_NUMBER)
16
+  if($ENV{CI} AND $ENV{GITHUB_RUN_ID})
17
+    set(PLUGIN_BUILD_NUMBER "$ENV{GITHUB_RUN_ID}")
18
+  else()
19
+    set(PLUGIN_BUILD_NUMBER "1")
20
+  endif()
21
+endif()
22
+file(WRITE "${_BUILD_NUMBER_CACHE}" "${PLUGIN_BUILD_NUMBER}")
23
obs-backgroundremoval-1.1.5.tar.gz/cmake/common/buildspec_common.cmake Added
201
 
1
@@ -0,0 +1,215 @@
2
+# Common build dependencies module
3
+
4
+# cmake-format: off
5
+# cmake-lint: disable=C0103
6
+# cmake-lint: disable=E1126
7
+# cmake-lint: disable=R0912
8
+# cmake-lint: disable=R0915
9
+# cmake-format: on
10
+
11
+include_guard(GLOBAL)
12
+
13
+# _check_deps_version: Checks for obs-deps VERSION file in prefix paths
14
+function(_check_deps_version version)
15
+  # cmake-format: off
16
+  set(found FALSE PARENT_SCOPE)
17
+  # cmake-format: on
18
+
19
+  foreach(path IN LISTS CMAKE_PREFIX_PATH)
20
+    if(EXISTS "${path}/share/obs-deps/VERSION")
21
+      if(dependency STREQUAL qt6 AND NOT EXISTS "${path}/lib/cmake/Qt6/Qt6Config.cmake")
22
+        # cmake-format: off
23
+        set(found FALSE PARENT_SCOPE)
24
+        # cmake-format: on
25
+        continue()
26
+      endif()
27
+
28
+      file(READ "${path}/share/obs-deps/VERSION" _check_version)
29
+      string(REPLACE "\n" "" _check_version "${_check_version}")
30
+      string(REPLACE "-" "." _check_version "${_check_version}")
31
+      string(REPLACE "-" "." version "${version}")
32
+
33
+      if(_check_version VERSION_EQUAL version)
34
+        # cmake-format: off
35
+        set(found TRUE PARENT_SCOPE)
36
+        # cmake-format: on
37
+        break()
38
+      elseif(_check_version VERSION_LESS version)
39
+        message(AUTHOR_WARNING "Older ${label} version detected in ${path}: \n"
40
+                               "Found ${_check_version}, require ${version}")
41
+        list(REMOVE_ITEM CMAKE_PREFIX_PATH "${path}")
42
+        list(APPEND CMAKE_PREFIX_PATH "${path}")
43
+        # cmake-format: off
44
+        set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE)
45
+        # cmake-format: on
46
+        continue()
47
+      else()
48
+        message(AUTHOR_WARNING "Newer ${label} version detected in ${path}: \n"
49
+                               "Found ${_check_version}, require ${version}")
50
+        # cmake-format: off
51
+        set(found TRUE PARENT_SCOPE)
52
+        # cmake-format: on
53
+        break()
54
+      endif()
55
+    endif()
56
+  endforeach()
57
+endfunction()
58
+
59
+# _setup_obs_studio: Create obs-studio build project, then build libobs and obs-frontend-api
60
+function(_setup_obs_studio)
61
+  if(NOT libobs_DIR)
62
+    set(_is_fresh --fresh)
63
+  endif()
64
+
65
+  if(OS_WINDOWS)
66
+    set(_cmake_generator "${CMAKE_GENERATOR}")
67
+    set(_cmake_arch "-A ${arch}")
68
+    set(_cmake_extra "-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION} -DCMAKE_ENABLE_SCRIPTING=OFF")
69
+    set(_cmake_version "2.0.0")
70
+  elseif(OS_MACOS)
71
+    set(_cmake_generator "Xcode")
72
+    set(_cmake_arch "-DCMAKE_OSX_ARCHITECTURES:STRING='arm64;x86_64'")
73
+    set(_cmake_extra "-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
74
+    set(_cmake_version "3.0.0")
75
+  endif()
76
+
77
+  message(STATUS "Configure ${label} (${arch})")
78
+  execute_process(
79
+    COMMAND
80
+      "${CMAKE_COMMAND}" -S "${dependencies_dir}/${_obs_destination}" -B
81
+      "${dependencies_dir}/${_obs_destination}/build_${arch}" -G ${_cmake_generator} "${_cmake_arch}"
82
+      -DOBS_CMAKE_VERSION:STRING=${_cmake_version} -DENABLE_PLUGINS:BOOL=OFF -DENABLE_UI:BOOL=OFF
83
+      -DOBS_VERSION_OVERRIDE:STRING=${_obs_version} "-DCMAKE_PREFIX_PATH='${CMAKE_PREFIX_PATH}'" ${_is_fresh}
84
+      ${_cmake_extra}
85
+    RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
86
+    OUTPUT_QUIET)
87
+  message(STATUS "Configure ${label} (${arch}) - done")
88
+
89
+  message(STATUS "Build ${label} (${arch})")
90
+  execute_process(
91
+    COMMAND "${CMAKE_COMMAND}" --build build_${arch} --target obs-frontend-api --config Debug --parallel
92
+    WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
93
+    RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
94
+    OUTPUT_QUIET)
95
+  message(STATUS "Build ${label} (${arch}) - done")
96
+
97
+  message(STATUS "Install ${label} (${arch})")
98
+  if(OS_WINDOWS)
99
+    set(_cmake_extra "--component obs_libraries")
100
+  else()
101
+    set(_cmake_extra "")
102
+  endif()
103
+  execute_process(
104
+    COMMAND "${CMAKE_COMMAND}" --install build_${arch} --component Development --config Debug --prefix
105
+            "${dependencies_dir}" ${_cmake_extra}
106
+    WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
107
+    RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
108
+    OUTPUT_QUIET)
109
+  message(STATUS "Install ${label} (${arch}) - done")
110
+endfunction()
111
+
112
+# _check_dependencies: Fetch and extract pre-built OBS build dependencies
113
+function(_check_dependencies)
114
+  if(NOT buildspec)
115
+    file(READ "${CMAKE_CURRENT_SOURCE_DIR}/buildspec.json" buildspec)
116
+  endif()
117
+
118
+  # cmake-format: off
119
+  string(JSON dependency_data GET ${buildspec} dependencies)
120
+  # cmake-format: on
121
+
122
+  foreach(dependency IN LISTS dependencies_list)
123
+    # cmake-format: off
124
+    string(JSON data GET ${dependency_data} ${dependency})
125
+    string(JSON version GET ${data} version)
126
+    string(JSON hash GET ${data} hashes ${platform})
127
+    string(JSON url GET ${data} baseUrl)
128
+    string(JSON label GET ${data} label)
129
+    string(JSON revision ERROR_VARIABLE error GET ${data} revision ${platform})
130
+    # cmake-format: on
131
+
132
+    message(STATUS "Setting up ${label} (${arch})")
133
+
134
+    set(file "${${dependency}_filename}")
135
+    set(destination "${${dependency}_destination}")
136
+    string(REPLACE "VERSION" "${version}" file "${file}")
137
+    string(REPLACE "VERSION" "${version}" destination "${destination}")
138
+    string(REPLACE "ARCH" "${arch}" file "${file}")
139
+    string(REPLACE "ARCH" "${arch}" destination "${destination}")
140
+    if(revision)
141
+      string(REPLACE "_REVISION" "_v${revision}" file "${file}")
142
+      string(REPLACE "-REVISION" "-v${revision}" file "${file}")
143
+    else()
144
+      string(REPLACE "_REVISION" "" file "${file}")
145
+      string(REPLACE "-REVISION" "" file "${file}")
146
+    endif()
147
+
148
+    set(skip FALSE)
149
+    if(dependency STREQUAL prebuilt OR dependency STREQUAL qt6)
150
+      _check_deps_version(${version})
151
+
152
+      if(found)
153
+        set(skip TRUE)
154
+      endif()
155
+    endif()
156
+
157
+    if(skip)
158
+      message(STATUS "Setting up ${label} (${arch}) - skipped")
159
+      continue()
160
+    endif()
161
+
162
+    if(dependency STREQUAL obs-studio)
163
+      set(url ${url}/${file})
164
+    else()
165
+      set(url ${url}/${version}/${file})
166
+    endif()
167
+
168
+    if(NOT EXISTS "${dependencies_dir}/${file}")
169
+      message(STATUS "Downloading ${url}")
170
+      file(
171
+        DOWNLOAD "${url}" "${dependencies_dir}/${file}"
172
+        STATUS download_status
173
+        EXPECTED_HASH SHA256=${hash})
174
+
175
+      list(GET download_status 0 error_code)
176
+      list(GET download_status 1 error_message)
177
+      if(error_code GREATER 0)
178
+        message(STATUS "Downloading ${url} - Failure")
179
+        message(FATAL_ERROR "Unable to download ${url}, failed with error: ${error_message}")
180
+        file(REMOVE "${dependencies_dir}/${file}")
181
+      else()
182
+        message(STATUS "Downloading ${url} - done")
183
+      endif()
184
+    endif()
185
+
186
+    if(NOT EXISTS "${dependencies_dir}/${destination}")
187
+      file(MAKE_DIRECTORY "${dependencies_dir}/${destination}")
188
+      if(dependency STREQUAL obs-studio)
189
+        file(ARCHIVE_EXTRACT INPUT "${dependencies_dir}/${file}" DESTINATION "${dependencies_dir}")
190
+      else()
191
+        file(ARCHIVE_EXTRACT INPUT "${dependencies_dir}/${file}" DESTINATION "${dependencies_dir}/${destination}")
192
+      endif()
193
+    endif()
194
+
195
+    if(dependency STREQUAL prebuilt)
196
+      list(APPEND CMAKE_PREFIX_PATH "${dependencies_dir}/${destination}")
197
+    elseif(dependency STREQUAL qt6)
198
+      list(APPEND CMAKE_PREFIX_PATH "${dependencies_dir}/${destination}")
199
+    elseif(dependency STREQUAL obs-studio)
200
+      set(_obs_version ${version})
201
obs-backgroundremoval-1.1.5.tar.gz/cmake/common/ccache.cmake Added
24
 
1
@@ -0,0 +1,22 @@
2
+# CMake ccache module
3
+
4
+include_guard(GLOBAL)
5
+
6
+if(NOT DEFINED CCACHE_PROGRAM)
7
+  message(DEBUG "Trying to find ccache on build host...")
8
+  find_program(CCACHE_PROGRAM "ccache")
9
+  mark_as_advanced(CCACHE_PROGRAM)
10
+endif()
11
+
12
+if(CCACHE_PROGRAM)
13
+  message(DEBUG "Ccache found as ${CCACHE_PROGRAM}...")
14
+  option(ENABLE_CCACHE "Enable compiler acceleration with ccache" ON)
15
+
16
+  if(ENABLE_CCACHE)
17
+    set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
18
+    set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
19
+    set(CMAKE_OBJC_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
20
+    set(CMAKE_OBJCXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
21
+    set(CMAKE_CUDA_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
22
+  endif()
23
+endif()
24
obs-backgroundremoval-1.1.5.tar.gz/cmake/common/compiler_common.cmake Added
89
 
1
@@ -0,0 +1,87 @@
2
+# CMake common compiler options module
3
+
4
+include_guard(GLOBAL)
5
+
6
+# Set C and C++ language standards to C17 and C++17
7
+if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
8
+  set(CMAKE_C_STANDARD 17)
9
+else()
10
+  set(CMAKE_C_STANDARD 11)
11
+endif()
12
+set(CMAKE_C_STANDARD_REQUIRED TRUE)
13
+set(CMAKE_CXX_STANDARD 17)
14
+set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
15
+
16
+# Set symbols to be hidden by default for C and C++
17
+set(CMAKE_C_VISIBILITY_PRESET hidden)
18
+set(CMAKE_CXX_VISIBILITY_PRESET hidden)
19
+set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
20
+
21
+# clang options for C
22
+set(_obs_clang_c_options
23
+    # cmake-format: sortable
24
+    -fno-strict-aliasing
25
+    -Wbool-conversion
26
+    -Wcomma
27
+    -Wconstant-conversion
28
+    -Wdeprecated-declarations
29
+    -Wempty-body
30
+    -Wenum-conversion
31
+    -Werror=return-type
32
+    -Wextra
33
+    -Wformat
34
+    -Wformat-security
35
+    -Wfour-char-constants
36
+    -Winfinite-recursion
37
+    -Wint-conversion
38
+    -Wnewline-eof
39
+    -Wno-conversion
40
+    -Wno-float-conversion
41
+    -Wno-implicit-fallthrough
42
+    -Wno-missing-braces
43
+    -Wno-missing-field-initializers
44
+    -Wno-missing-prototypes
45
+    -Wno-semicolon-before-method-body
46
+    -Wno-shadow
47
+    -Wno-sign-conversion
48
+    -Wno-strict-prototypes
49
+    -Wno-trigraphs
50
+    -Wno-unknown-pragmas
51
+    -Wno-unused-function
52
+    -Wno-unused-label
53
+    -Wnon-literal-null-conversion
54
+    -Wobjc-literal-conversion
55
+    -Wparentheses
56
+    -Wpointer-sign
57
+    -Wquoted-include-in-framework-header
58
+    -Wshadow
59
+    -Wshorten-64-to-32
60
+    -Wuninitialized
61
+    -Wunreachable-code
62
+    -Wunused-parameter
63
+    -Wunused-value
64
+    -Wunused-variable
65
+    -Wvla)
66
+
67
+# clang options for C++
68
+set(_obs_clang_cxx_options
69
+    # cmake-format: sortable
70
+    ${_obs_clang_c_options}
71
+    -Wconversion
72
+    -Wdeprecated-implementations
73
+    -Wduplicate-method-match
74
+    -Wfloat-conversion
75
+    -Wfour-char-constants
76
+    -Wimplicit-retain-self
77
+    -Winvalid-offsetof
78
+    -Wmove
79
+    -Wno-c++11-extensions
80
+    -Wno-exit-time-destructors
81
+    -Wno-implicit-atomic-properties
82
+    -Wno-objc-interface-ivars
83
+    -Wno-overloaded-virtual
84
+    -Wrange-loop-analysis)
85
+
86
+if(NOT DEFINED CMAKE_COMPILE_WARNING_AS_ERROR)
87
+  set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
88
+endif()
89
obs-backgroundremoval-1.1.5.tar.gz/cmake/common/helpers_common.cmake Added
139
 
1
@@ -0,0 +1,137 @@
2
+# CMake common helper functions module
3
+
4
+# cmake-format: off
5
+# cmake-lint: disable=C0103
6
+# cmake-format: on
7
+
8
+include_guard(GLOBAL)
9
+
10
+# * Use QT_VERSION value as a hint for desired Qt version
11
+# * If "AUTO" was specified, prefer Qt6 over Qt5
12
+# * Creates versionless targets of desired component if none had been created by Qt itself (Qt versions < 5.15)
13
+if(NOT QT_VERSION)
14
+  set(QT_VERSION
15
+      AUTO
16
+      CACHE STRING "OBS Qt version AUTO, 5, 6" FORCE)
17
+  set_property(CACHE QT_VERSION PROPERTY STRINGS AUTO 5 6)
18
+endif()
19
+
20
+# find_qt: Macro to find best possible Qt version for use with the project:
21
+macro(find_qt)
22
+  set(multiValueArgs COMPONENTS COMPONENTS_WIN COMPONENTS_MAC COMPONENTS_LINUX)
23
+  cmake_parse_arguments(find_qt "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
24
+
25
+  # Do not use versionless targets in the first step to avoid Qt::Core being clobbered by later opportunistic
26
+  # find_package runs
27
+  set(QT_NO_CREATE_VERSIONLESS_TARGETS TRUE)
28
+
29
+  message(DEBUG "Start Qt version discovery...")
30
+  # Loop until _QT_VERSION is set or FATAL_ERROR aborts script execution early
31
+  while(NOT _QT_VERSION)
32
+    message(DEBUG "QT_VERSION set to ${QT_VERSION}")
33
+    if(QT_VERSION STREQUAL AUTO AND NOT qt_test_version)
34
+      set(qt_test_version 6)
35
+    elseif(NOT QT_VERSION STREQUAL AUTO)
36
+      set(qt_test_version ${QT_VERSION})
37
+    endif()
38
+    message(DEBUG "Attempting to find Qt${qt_test_version}")
39
+
40
+    find_package(
41
+      Qt${qt_test_version}
42
+      COMPONENTS Core
43
+      QUIET)
44
+
45
+    if(TARGET Qt${qt_test_version}::Core)
46
+      set(_QT_VERSION
47
+          ${qt_test_version}
48
+          CACHE INTERNAL "")
49
+      message(STATUS "Qt version found: ${_QT_VERSION}")
50
+      unset(qt_test_version)
51
+      break()
52
+    elseif(QT_VERSION STREQUAL AUTO)
53
+      if(qt_test_version EQUAL 6)
54
+        message(WARNING "Qt6 was not found, falling back to Qt5")
55
+        set(qt_test_version 5)
56
+        continue()
57
+      endif()
58
+    endif()
59
+    message(FATAL_ERROR "Neither Qt6 nor Qt5 found.")
60
+  endwhile()
61
+
62
+  # Enable versionless targets for the remaining Qt components
63
+  set(QT_NO_CREATE_VERSIONLESS_TARGETS FALSE)
64
+
65
+  set(qt_components ${find_qt_COMPONENTS})
66
+  if(OS_WINDOWS)
67
+    list(APPEND qt_components ${find_qt_COMPONENTS_WIN})
68
+  elseif(OS_MACOS)
69
+    list(APPEND qt_components ${find_qt_COMPONENTS_MAC})
70
+  else()
71
+    list(APPEND qt_components ${find_qt_COMPONENTS_LINUX})
72
+  endif()
73
+  message(DEBUG "Trying to find Qt components ${qt_components}...")
74
+
75
+  find_package(Qt${_QT_VERSION} REQUIRED ${qt_components})
76
+
77
+  list(APPEND qt_components Core)
78
+
79
+  if("Gui" IN_LIST find_qt_COMPONENTS_LINUX)
80
+    list(APPEND qt_components "GuiPrivate")
81
+  endif()
82
+
83
+  # Check for versionless targets of each requested component and create if necessary
84
+  foreach(component IN LISTS qt_components)
85
+    message(DEBUG "Checking for target Qt::${component}")
86
+    if(NOT TARGET Qt::${component} AND TARGET Qt${_QT_VERSION}::${component})
87
+      add_library(Qt::${component} INTERFACE IMPORTED)
88
+      set_target_properties(Qt::${component} PROPERTIES INTERFACE_LINK_LIBRARIES Qt${_QT_VERSION}::${component})
89
+    endif()
90
+    set_property(TARGET Qt::${component} PROPERTY INTERFACE_COMPILE_FEATURES "")
91
+  endforeach()
92
+
93
+endmacro()
94
+
95
+# check_uuid: Helper function to check for valid UUID
96
+function(check_uuid uuid_string return_value)
97
+  set(valid_uuid TRUE)
98
+  set(uuid_token_lengths 8 4 4 4 12)
99
+  set(token_num 0)
100
+
101
+  string(REPLACE "-" ";" uuid_tokens ${uuid_string})
102
+  list(LENGTH uuid_tokens uuid_num_tokens)
103
+
104
+  if(uuid_num_tokens EQUAL 5)
105
+    message(DEBUG "UUID ${uuid_string} is valid with 5 tokens.")
106
+    foreach(uuid_token IN LISTS uuid_tokens)
107
+      list(GET uuid_token_lengths ${token_num} uuid_target_length)
108
+      string(LENGTH "${uuid_token}" uuid_actual_length)
109
+      if(uuid_actual_length EQUAL uuid_target_length)
110
+        string(REGEX MATCH "0-9a-fA-F+" uuid_hex_match ${uuid_token})
111
+        if(NOT uuid_hex_match STREQUAL uuid_token)
112
+          set(valid_uuid FALSE)
113
+          break()
114
+        endif()
115
+      else()
116
+        set(valid_uuid FALSE)
117
+        break()
118
+      endif()
119
+      math(EXPR token_num "${token_num}+1")
120
+    endforeach()
121
+  else()
122
+    set(valid_uuid FALSE)
123
+  endif()
124
+  message(DEBUG "UUID ${uuid_string} valid: ${valid_uuid}")
125
+  set(${return_value}
126
+      ${valid_uuid}
127
+      PARENT_SCOPE)
128
+endfunction()
129
+
130
+if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/plugin-support.c.in")
131
+  configure_file(src/plugin-support.c.in plugin-support.c @ONLY)
132
+  add_library(plugin-support STATIC)
133
+  target_sources(
134
+    plugin-support
135
+    PRIVATE plugin-support.c
136
+    PUBLIC src/plugin-support.h)
137
+  target_include_directories(plugin-support PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")
138
+endif()
139
obs-backgroundremoval-1.1.5.tar.gz/cmake/common/osconfig.cmake Added
24
 
1
@@ -0,0 +1,22 @@
2
+# CMake operating system bootstrap module
3
+
4
+include_guard(GLOBAL)
5
+
6
+# Set minimum CMake version specific to host operating system, add OS-specific module directory to default search paths,
7
+# and set helper variables for OS detection in other CMake list files.
8
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
9
+  set(CMAKE_C_EXTENSIONS FALSE)
10
+  set(CMAKE_CXX_EXTENSIONS FALSE)
11
+  list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/windows")
12
+  set(OS_WINDOWS TRUE)
13
+elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
14
+  set(CMAKE_C_EXTENSIONS FALSE)
15
+  set(CMAKE_CXX_EXTENSIONS FALSE)
16
+  list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos")
17
+  set(OS_MACOS TRUE)
18
+elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD")
19
+  set(CMAKE_CXX_EXTENSIONS FALSE)
20
+  list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/linux")
21
+  string(TOUPPER "${CMAKE_HOST_SYSTEM_NAME}" _SYSTEM_NAME_U)
22
+  set(OS_${_SYSTEM_NAME_U} TRUE)
23
+endif()
24
obs-backgroundremoval-1.1.5.tar.gz/cmake/linux Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/cmake/linux/compilerconfig.cmake Added
87
 
1
@@ -0,0 +1,85 @@
2
+# CMake Linux compiler configuration module
3
+
4
+include_guard(GLOBAL)
5
+
6
+include(ccache)
7
+include(compiler_common)
8
+
9
+option(ENABLE_COMPILER_TRACE "Enable Clang time-trace (required Clang and Ninja)" OFF)
10
+mark_as_advanced(ENABLE_COMPILER_TRACE)
11
+
12
+# gcc options for C
13
+set(_obs_gcc_c_options
14
+    # cmake-format: sortable
15
+    -fno-strict-aliasing
16
+    -fopenmp-simd
17
+    -Wdeprecated-declarations
18
+    -Wempty-body
19
+    -Wenum-conversion
20
+    -Werror=return-type
21
+    -Wextra
22
+    -Wformat
23
+    -Wformat-security
24
+    -Wno-conversion
25
+    -Wno-float-conversion
26
+    -Wno-implicit-fallthrough
27
+    -Wno-missing-braces
28
+    -Wno-missing-field-initializers
29
+    -Wno-shadow
30
+    -Wno-sign-conversion
31
+    -Wno-trigraphs
32
+    -Wno-unknown-pragmas
33
+    -Wno-unused-function
34
+    -Wno-unused-label
35
+    -Wparentheses
36
+    -Wshadow
37
+    -Wuninitialized
38
+    -Wunreachable-code
39
+    -Wunused-parameter
40
+    -Wunused-value
41
+    -Wunused-variable
42
+    -Wvla)
43
+
44
+# gcc options for C++
45
+set(_obs_gcc_cxx_options
46
+    # cmake-format: sortable
47
+    ${_obs_gcc_c_options} -Wconversion -Wfloat-conversion -Winvalid-offsetof -Wno-overloaded-virtual)
48
+
49
+add_compile_options(
50
+  -fopenmp-simd
51
+  "$<$<COMPILE_LANG_AND_ID:C,GNU>:${_obs_gcc_c_options}>"
52
+  "$<$<COMPILE_LANG_AND_ID:C,GNU>:-Wint-conversion;-Wno-missing-prototypes;-Wno-strict-prototypes;-Wpointer-sign>"
53
+  "$<$<COMPILE_LANG_AND_ID:CXX,GNU>:${_obs_gcc_cxx_options}>"
54
+  "$<$<COMPILE_LANG_AND_ID:C,Clang>:${_obs_clang_c_options}>"
55
+  "$<$<COMPILE_LANG_AND_ID:CXX,Clang>:${_obs_clang_cxx_options}>")
56
+
57
+# Add support for color diagnostics and CMake switch for warnings as errors to CMake < 3.24
58
+if(CMAKE_VERSION VERSION_LESS 3.24.0)
59
+  add_compile_options($<$<C_COMPILER_ID:Clang>:-fcolor-diagnostics> $<$<CXX_COMPILER_ID:Clang>:-fcolor-diagnostics>)
60
+  if(CMAKE_COMPILE_WARNING_AS_ERROR)
61
+    add_compile_options(-Werror)
62
+  endif()
63
+else()
64
+  set(CMAKE_COLOR_DIAGNOSTICS ON)
65
+endif()
66
+
67
+if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
68
+  # Disable false-positive warning in GCC 12.1.0 and later
69
+  add_compile_options(-Wno-error=maybe-uninitialized)
70
+
71
+  # Add warning for infinite recursion (added in GCC 12)
72
+  if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0.0)
73
+    add_compile_options(-Winfinite-recursion)
74
+  endif()
75
+endif()
76
+
77
+# Enable compiler and build tracing (requires Ninja generator)
78
+if(ENABLE_COMPILER_TRACE AND CMAKE_GENERATOR STREQUAL "Ninja")
79
+  add_compile_options($<$<COMPILE_LANG_AND_ID:C,Clang>:-ftime-trace> $<$<COMPILE_LANG_AND_ID:CXX,Clang>:-ftime-trace>)
80
+else()
81
+  set(ENABLE_COMPILER_TRACE
82
+      OFF
83
+      CACHE STRING "Enable Clang time-trace (required Clang and Ninja)" FORCE)
84
+endif()
85
+
86
+add_compile_definitions($<$<CONFIG:DEBUG>:DEBUG> $<$<CONFIG:DEBUG>:_DEBUG> SIMDE_ENABLE_OPENMP)
87
obs-backgroundremoval-1.1.5.tar.gz/cmake/linux/defaults.cmake Added
87
 
1
@@ -0,0 +1,85 @@
2
+# CMake Linux defaults module
3
+
4
+# cmake-format: off
5
+# cmake-lint: disable=C0103
6
+# cmake-lint: disable=C0111
7
+# cmake-format: on
8
+
9
+include_guard(GLOBAL)
10
+
11
+include(GNUInstallDirs)
12
+
13
+# Enable find_package targets to become globally available targets
14
+set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL TRUE)
15
+
16
+set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
17
+set(CPACK_PACKAGE_VERSION "${CMAKE_PROJECT_VERSION}")
18
+set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_C_LIBRARY_ARCHITECTURE}")
19
+
20
+set(CPACK_GENERATOR "DEB")
21
+set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
22
+set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${PLUGIN_EMAIL}")
23
+
24
+if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.25.0 OR NOT CMAKE_CROSSCOMPILING)
25
+  set(CPACK_DEBIAN_DEBUGINFO_PACKAGE ON)
26
+endif()
27
+
28
+set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/release")
29
+
30
+set(CPACK_SOURCE_GENERATOR "TXZ")
31
+set(CPACK_SOURCE_IGNORE_FILES
32
+    # cmake-format: sortable
33
+    ".*~$"
34
+    \\.git/
35
+    \\.github/
36
+    \\.gitignore
37
+    build_.*
38
+    cmake/\\.CMakeBuildNumber
39
+    release/)
40
+
41
+set(CPACK_VERBATIM_VARIABLES YES)
42
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-source")
43
+set(CPACK_ARCHIVE_THREADS 0)
44
+
45
+include(CPack)
46
+
47
+find_package(libobs QUIET)
48
+
49
+if(NOT TARGET OBS::libobs)
50
+  find_package(LibObs REQUIRED)
51
+  add_library(OBS::libobs ALIAS libobs)
52
+
53
+  if(ENABLE_FRONTEND_API)
54
+    find_path(
55
+      obs-frontend-api_INCLUDE_DIR
56
+      NAMES obs-frontend-api.h
57
+      PATHS /usr/include /usr/local/include
58
+      PATH_SUFFIXES obs)
59
+
60
+    find_library(
61
+      obs-frontend-api_LIBRARY
62
+      NAMES obs-frontend-api
63
+      PATHS /usr/lib /usr/local/lib)
64
+
65
+    if(obs-frontend-api_LIBRARY)
66
+      if(NOT TARGET OBS::obs-frontend-api)
67
+        if(IS_ABSOLUTE "${obs-frontend-api_LIBRARY}")
68
+          add_library(OBS::obs-frontend-api UNKNOWN IMPORTED)
69
+          set_property(TARGET OBS::obs-frontend-api PROPERTY IMPORTED_LOCATION "${obs-frontend-api_LIBRARY}")
70
+        else()
71
+          add_library(OBS::obs-frontend-api INTERFACE IMPORTED)
72
+          set_property(TARGET OBS::obs-frontend-api PROPERTY IMPORTED_LIBNAME "${obs-frontend-api_LIBRARY}")
73
+        endif()
74
+
75
+        set_target_properties(OBS::obs-frontend-api PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
76
+                                                               "${obs-frontend-api_INCLUDE_DIR}")
77
+      endif()
78
+    endif()
79
+  endif()
80
+
81
+  macro(find_package)
82
+    if(NOT "${ARGV0}" STREQUAL libobs AND NOT "${ARGV0}" STREQUAL obs-frontend-api)
83
+      _find_package(${ARGV})
84
+    endif()
85
+  endmacro()
86
+endif()
87
obs-backgroundremoval-1.1.5.tar.gz/cmake/linux/helpers.cmake Added
76
 
1
@@ -0,0 +1,74 @@
2
+# CMake Linux helper functions module
3
+
4
+include_guard(GLOBAL)
5
+
6
+include(helpers_common)
7
+
8
+# set_target_properties_plugin: Set target properties for use in obs-studio
9
+function(set_target_properties_plugin target)
10
+  set(options "")
11
+  set(oneValueArgs "")
12
+  set(multiValueArgs PROPERTIES)
13
+  cmake_parse_arguments(PARSE_ARGV 0 _STPO "${options}" "${oneValueArgs}" "${multiValueArgs}")
14
+
15
+  message(DEBUG "Setting additional properties for target ${target}...")
16
+
17
+  while(_STPO_PROPERTIES)
18
+    list(POP_FRONT _STPO_PROPERTIES key value)
19
+    set_property(TARGET ${target} PROPERTY ${key} "${value}")
20
+  endwhile()
21
+
22
+  set_target_properties(
23
+    ${target}
24
+    PROPERTIES VERSION 0
25
+               SOVERSION ${PLUGIN_VERSION}
26
+               PREFIX "")
27
+
28
+  install(
29
+    TARGETS ${target}
30
+    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
31
+    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/obs-plugins)
32
+
33
+  if(TARGET plugin-support)
34
+    target_link_libraries(${target} PRIVATE plugin-support)
35
+  endif()
36
+
37
+  target_install_resources(${target})
38
+
39
+  get_target_property(target_sources ${target} SOURCES)
40
+  set(target_ui_files ${target_sources})
41
+  list(FILTER target_ui_files INCLUDE REGEX ".+\\.(ui|qrc)")
42
+  source_group(
43
+    TREE "${CMAKE_CURRENT_SOURCE_DIR}"
44
+    PREFIX "UI Files"
45
+    FILES ${target_ui_files})
46
+endfunction()
47
+
48
+# Helper function to add resources into bundle
49
+function(target_install_resources target)
50
+  message(DEBUG "Installing resources for target ${target}...")
51
+  if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/data")
52
+    file(GLOB_RECURSE data_files "${CMAKE_CURRENT_SOURCE_DIR}/data/*")
53
+    foreach(data_file IN LISTS data_files)
54
+      cmake_path(RELATIVE_PATH data_file BASE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/" OUTPUT_VARIABLE
55
+                 relative_path)
56
+      cmake_path(GET relative_path PARENT_PATH relative_path)
57
+      target_sources(${target} PRIVATE "${data_file}")
58
+      source_group("Resources/${relative_path}" FILES "${data_file}")
59
+    endforeach()
60
+
61
+    install(
62
+      DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/"
63
+      DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target}
64
+      USE_SOURCE_PERMISSIONS)
65
+  endif()
66
+endfunction()
67
+
68
+# Helper function to add a specific resource to a bundle
69
+function(target_add_resource target resource)
70
+  message(DEBUG "Add resource '${resource}' to target ${target} at destination '${target_destination}'...")
71
+
72
+  install(FILES "${resource}" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target})
73
+
74
+  source_group("Resources" FILES "${resource}")
75
+endfunction()
76
obs-backgroundremoval-1.1.5.tar.gz/cmake/linux/toolchains Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/cmake/linux/toolchains/aarch64-linux-clang.cmake Added
58
 
1
@@ -0,0 +1,56 @@
2
+set(CMAKE_SYSTEM_NAME Linux)
3
+set(CMAKE_SYSTEM_PROCESSOR aarch64)
4
+set(CMAKE_CROSSCOMPILING TRUE)
5
+
6
+set(CMAKE_C_COMPILER /usr/bin/clang)
7
+set(CMAKE_CXX_COMPILER /usr/bin/clang++)
8
+
9
+set(CMAKE_C_COMPILER_TARGET aarch64-linux-gnu)
10
+set(CMAKE_CXX_COMPILER_TARGET aarch64-linux-gnu)
11
+
12
+set(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu)
13
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
14
+set(PKG_CONFIG_EXECUTABLE
15
+    /usr/bin/aarch64-linux-gnu-pkg-config
16
+    CACHE FILEPATH "pkg-config executable")
17
+
18
+execute_process(
19
+  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-ranlib
20
+  OUTPUT_VARIABLE CMAKE_RANLIB
21
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
22
+
23
+execute_process(
24
+  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-ar
25
+  OUTPUT_VARIABLE CMAKE_LLVM_AR
26
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
27
+
28
+execute_process(
29
+  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-readelf
30
+  OUTPUT_VARIABLE READELF
31
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
32
+
33
+execute_process(
34
+  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-objcopy
35
+  OUTPUT_VARIABLE CMAKE_LLVM_OBJCOPY
36
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
37
+
38
+execute_process(
39
+  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-objdump
40
+  OUTPUT_VARIABLE CMAKE_LLVM_OBJDUMP
41
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
42
+
43
+set(CMAKE_AR
44
+    "${CMAKE_LLVM_AR}"
45
+    CACHE INTERNAL "${CMAKE_SYSTEM_NAME} ar" FORCE)
46
+set(CMAKE_OBJCOPY
47
+    "${CMAKE_LLVM_OBJCOPY}"
48
+    CACHE INTERNAL "${CMAKE_SYSTEM_NAME} objcopy" FORCE)
49
+set(CMAKE_OBJDUMP
50
+    "${CMAKE_LLVM_OBJDUMP}"
51
+    CACHE INTERNAL "${CMAKE_SYSTEM_NAME} objdump" FORCE)
52
+
53
+set(CPACK_READELF_EXECUTABLE "${READELF}")
54
+set(CPACK_OBJCOPY_EXECUTABLE "${CMAKE_LLVM_OBJCOPY}")
55
+set(CPACK_OBJDUMP_EXECUTABLE "${CMAKE_LLVM_OBJDUMP}")
56
+set(CPACK_PACKAGE_ARCHITECTURE arm64)
57
+set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE arm64)
58
obs-backgroundremoval-1.1.5.tar.gz/cmake/linux/toolchains/aarch64-linux-gcc.cmake Added
22
 
1
@@ -0,0 +1,20 @@
2
+set(CMAKE_SYSTEM_NAME Linux)
3
+set(CMAKE_SYSTEM_PROCESSOR aarch64)
4
+set(CMAKE_CROSSCOMPILING TRUE)
5
+
6
+set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc)
7
+set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++)
8
+
9
+set(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu)
10
+
11
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
12
+
13
+set(PKG_CONFIG_EXECUTABLE
14
+    /usr/bin/aarch64-linux-gnu-pkg-config
15
+    CACHE FILEPATH "pkg-config executable")
16
+
17
+set(CPACK_READELF_EXECUTABLE /usr/bin/aarch64-linux-gnu-readelf)
18
+set(CPACK_OBJCOPY_EXECUTABLE /usr/bin/aarch64-linux-gnu-objcopy)
19
+set(CPACK_OBJDUMP_EXECUTABLE /usr/bin/aarch64-linux-gnu-objdump)
20
+set(CPACK_PACKAGE_ARCHITECTURE arm64)
21
+set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE arm64)
22
obs-backgroundremoval-1.1.5.tar.gz/cmake/linux/toolchains/x86_64-linux-clang.cmake Added
58
 
1
@@ -0,0 +1,56 @@
2
+set(CMAKE_SYSTEM_NAME Linux)
3
+set(CMAKE_SYSTEM_PROCESSOR x86_64)
4
+set(CMAKE_CROSSCOMPILING TRUE)
5
+
6
+set(CMAKE_C_COMPILER /usr/bin/clang)
7
+set(CMAKE_CXX_COMPILER /usr/bin/clang++)
8
+
9
+set(CMAKE_C_COMPILER_TARGET x86_64-linux-gnu)
10
+set(CMAKE_CXX_COMPILER_TARGET x86_64-linux-gnu)
11
+
12
+set(CMAKE_FIND_ROOT_PATH /usr/x86_64-linux-gnu)
13
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
14
+set(PKG_CONFIG_EXECUTABLE
15
+    /usr/bin/x86_64-linux-gnu-pkg-config
16
+    CACHE FILEPATH "pkg-config executable")
17
+
18
+execute_process(
19
+  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-ranlib
20
+  OUTPUT_VARIABLE CMAKE_RANLIB
21
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
22
+
23
+execute_process(
24
+  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-ar
25
+  OUTPUT_VARIABLE CMAKE_LLVM_AR
26
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
27
+
28
+execute_process(
29
+  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-readelf
30
+  OUTPUT_VARIABLE READELF
31
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
32
+
33
+execute_process(
34
+  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-objcopy
35
+  OUTPUT_VARIABLE CMAKE_LLVM_OBJCOPY
36
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
37
+
38
+execute_process(
39
+  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-objdump
40
+  OUTPUT_VARIABLE CMAKE_LLVM_OBJDUMP
41
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
42
+
43
+set(CMAKE_AR
44
+    "${CMAKE_LLVM_AR}"
45
+    CACHE INTERNAL "${CMAKE_SYSTEM_NAME} ar" FORCE)
46
+set(CMAKE_OBJCOPY
47
+    "${CMAKE_LLVM_OBJCOPY}"
48
+    CACHE INTERNAL "${CMAKE_SYSTEM_NAME} objcopy" FORCE)
49
+set(CMAKE_OBJDUMP
50
+    "${CMAKE_LLVM_OBJDUMP}"
51
+    CACHE INTERNAL "${CMAKE_SYSTEM_NAME} objdump" FORCE)
52
+
53
+set(CPACK_READELF_EXECUTABLE "${READELF}")
54
+set(CPACK_OBJCOPY_EXECUTABLE "${CMAKE_LLVM_OBJCOPY}")
55
+set(CPACK_OBJDUMP_EXECUTABLE "${CMAKE_LLVM_OBJDUMP}")
56
+set(CPACK_PACKAGE_ARCHITECTURE x86_64)
57
+set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE x86_64)
58
obs-backgroundremoval-1.1.5.tar.gz/cmake/linux/toolchains/x86_64-linux-gcc.cmake Added
22
 
1
@@ -0,0 +1,20 @@
2
+set(CMAKE_SYSTEM_NAME Linux)
3
+set(CMAKE_SYSTEM_PROCESSOR x86_64)
4
+set(CMAKE_CROSSCOMPILING TRUE)
5
+
6
+set(CMAKE_C_COMPILER /usr/bin/x86_64-linux-gnu-gcc)
7
+set(CMAKE_CXX_COMPILER /usr/bin/x86_64-linux-gnu-g++)
8
+
9
+set(CMAKE_FIND_ROOT_PATH /usr/x86_64-linux-gnu)
10
+
11
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
12
+
13
+set(PKG_CONFIG_EXECUTABLE
14
+    /usr/bin/x86_64-linux-gnu-pkg-config
15
+    CACHE FILEPATH "pkg-config executable")
16
+
17
+set(CPACK_READELF_EXECUTABLE /usr/bin/x86_64-linux-gnu-readelf)
18
+set(CPACK_OBJCOPY_EXECUTABLE /usr/bin/x86_64-linux-gnu-objcopy)
19
+set(CPACK_OBJDUMP_EXECUTABLE /usr/bin/x86_64-linux-gnu-objdump)
20
+set(CPACK_PACKAGE_ARCHITECTURE x86_64)
21
+set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE x86_64)
22
obs-backgroundremoval-1.1.5.tar.gz/cmake/macos Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/cmake/macos/buildspec.cmake Added
36
 
1
@@ -0,0 +1,34 @@
2
+# CMake macOS build dependencies module
3
+
4
+include_guard(GLOBAL)
5
+
6
+include(buildspec_common)
7
+
8
+# _check_dependencies_macos: Set up macOS slice for _check_dependencies
9
+function(_check_dependencies_macos)
10
+  set(arch universal)
11
+  set(platform macos)
12
+
13
+  file(READ "${CMAKE_CURRENT_SOURCE_DIR}/buildspec.json" buildspec)
14
+
15
+  set(dependencies_dir "${CMAKE_CURRENT_SOURCE_DIR}/.deps")
16
+  set(prebuilt_filename "macos-deps-VERSION-ARCH_REVISION.tar.xz")
17
+  set(prebuilt_destination "obs-deps-VERSION-ARCH")
18
+  set(qt6_filename "macos-deps-qt6-VERSION-ARCH-REVISION.tar.xz")
19
+  set(qt6_destination "obs-deps-qt6-VERSION-ARCH")
20
+  set(obs-studio_filename "VERSION.tar.gz")
21
+  set(obs-studio_destination "obs-studio-VERSION")
22
+  set(dependencies_list prebuilt qt6 obs-studio)
23
+
24
+  _check_dependencies()
25
+
26
+  execute_process(COMMAND "xattr" -r -d com.apple.quarantine "${dependencies_dir}"
27
+                  RESULT_VARIABLE result COMMAND_ERROR_IS_FATAL ANY)
28
+
29
+  list(APPEND CMAKE_FRAMEWORK_PATH "${dependencies_dir}/Frameworks")
30
+  set(CMAKE_FRAMEWORK_PATH
31
+      ${CMAKE_FRAMEWORK_PATH}
32
+      PARENT_SCOPE)
33
+endfunction()
34
+
35
+_check_dependencies_macos()
36
obs-backgroundremoval-1.1.5.tar.gz/cmake/macos/compilerconfig.cmake Added
59
 
1
@@ -0,0 +1,57 @@
2
+# CMake macOS compiler configuration module
3
+
4
+include_guard(GLOBAL)
5
+
6
+include(ccache)
7
+include(compiler_common)
8
+
9
+add_compile_options(-fopenmp-simd)
10
+
11
+if(XCODE)
12
+  # Use Xcode's standard architecture selection
13
+  set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)")
14
+  # Enable dSYM generation for Release builds
15
+  string(APPEND CMAKE_C_FLAGS_RELEASE " -g")
16
+  string(APPEND CMAKE_CXX_FLAGS_RELEASE " -g")
17
+else()
18
+  option(ENABLE_COMPILER_TRACE "Enable clang time-trace (requires Ninja)" OFF)
19
+  mark_as_advanced(ENABLE_COMPILER_TRACE)
20
+
21
+  # clang options for ObjC
22
+  set(_obs_clang_objc_options
23
+      # cmake-format: sortable
24
+      -Werror=block-capture-autoreleasing -Wno-selector -Wno-strict-selector-match -Wnon-virtual-dtor -Wprotocol
25
+      -Wundeclared-selector)
26
+
27
+  # clang options for ObjC++
28
+  set(_obs_clang_objcxx_options
29
+      # cmake-format: sortable
30
+      ${_obs_clang_objc_options} -Warc-repeated-use-of-weak -Wno-arc-maybe-repeated-use-of-weak)
31
+
32
+  add_compile_options(
33
+    "$<$<COMPILE_LANGUAGE:C>:${_obs_clang_c_options}>" "$<$<COMPILE_LANGUAGE:CXX>:${_obs_clang_cxx_options}>"
34
+    "$<$<COMPILE_LANGUAGE:OBJC>:${_obs_clang_objc_options}>"
35
+    "$<$<COMPILE_LANGUAGE:OBJCXX>:${_obs_clang_objcxx_options}>")
36
+
37
+  # Enable stripping of dead symbols when not building for Debug configuration
38
+  set(_release_configs RelWithDebInfo Release MinSizeRel)
39
+  if(CMAKE_BUILD_TYPE IN_LIST _release_configs)
40
+    add_link_options(LINKER:-dead_strip)
41
+  endif()
42
+
43
+  # Enable color diagnostics for AppleClang
44
+  set(CMAKE_COLOR_DIAGNOSTICS ON)
45
+  # Set universal architectures via CMake flag for non-Xcode generators
46
+  set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
47
+
48
+  # Enable compiler and build tracing (requires Ninja generator)
49
+  if(ENABLE_COMPILER_TRACE AND CMAKE_GENERATOR STREQUAL "Ninja")
50
+    add_compile_options($<$<COMPILE_LANGUAGE:C>:-ftime-trace> $<$<COMPILE_LANGUAGE:CXX>:-ftime-trace>)
51
+  else()
52
+    set(ENABLE_COMPILER_TRACE
53
+        OFF
54
+        CACHE STRING "Enable clang time-trace (requires Ninja)" FORCE)
55
+  endif()
56
+endif()
57
+
58
+add_compile_definitions($<$<CONFIG:DEBUG>:DEBUG> $<$<CONFIG:DEBUG>:_DEBUG> SIMDE_ENABLE_OPENMP)
59
obs-backgroundremoval-1.1.5.tar.gz/cmake/macos/defaults.cmake Added
51
 
1
@@ -0,0 +1,49 @@
2
+# CMake macOS defaults module
3
+
4
+include_guard(GLOBAL)
5
+
6
+# Set empty codesigning team if not specified as cache variable
7
+if(NOT CODESIGN_TEAM)
8
+  set(CODESIGN_TEAM
9
+      ""
10
+      CACHE STRING "OBS code signing team for macOS" FORCE)
11
+
12
+  # Set ad-hoc codesigning identity if not specified as cache variable
13
+  if(NOT CODESIGN_IDENTITY)
14
+    set(CODESIGN_IDENTITY
15
+        "-"
16
+        CACHE STRING "OBS code signing identity for macOS" FORCE)
17
+  endif()
18
+endif()
19
+
20
+if(XCODE)
21
+  include(xcode)
22
+endif()
23
+
24
+include(buildspec)
25
+
26
+# Set default deployment target to 11.0 if not set and enable selection in GUI up to 13.0
27
+if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
28
+  set(CMAKE_OSX_DEPLOYMENT_TARGET
29
+      11.0
30
+      CACHE STRING "Minimum macOS version to target for deployment (at runtime). Newer APIs will be weak-linked." FORCE)
31
+endif()
32
+set_property(CACHE CMAKE_OSX_DEPLOYMENT_TARGET PROPERTY STRINGS 13.0 12.0 11.0)
33
+
34
+# Use Applications directory as default install destination
35
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
36
+  set(CMAKE_INSTALL_PREFIX
37
+      "$ENV{HOME}/Library/Application Support/obs-studio/plugins"
38
+      CACHE STRING "Directory to install OBS after building" FORCE)
39
+endif()
40
+
41
+# Enable find_package targets to become globally available targets
42
+set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL TRUE)
43
+# Enable RPATH support for generated binaries
44
+set(CMAKE_MACOSX_RPATH TRUE)
45
+# Use RPATHs from build tree _in_ the build tree
46
+set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
47
+# Do not add default linker search paths to RPATH
48
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
49
+# Use common bundle-relative RPATH for installed targets
50
+set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks")
51
obs-backgroundremoval-1.1.5.tar.gz/cmake/macos/helpers.cmake Added
110
 
1
@@ -0,0 +1,108 @@
2
+# CMake macOS helper functions module
3
+
4
+# cmake-format: off
5
+# cmake-lint: disable=C0103
6
+# cmake-lint: disable=C0307
7
+# cmake-format: on
8
+
9
+include_guard(GLOBAL)
10
+
11
+include(helpers_common)
12
+
13
+# set_target_properties_obs: Set target properties for use in obs-studio
14
+function(set_target_properties_plugin target)
15
+  set(options "")
16
+  set(oneValueArgs "")
17
+  set(multiValueArgs PROPERTIES)
18
+  cmake_parse_arguments(PARSE_ARGV 0 _STPO "${options}" "${oneValueArgs}" "${multiValueArgs}")
19
+
20
+  message(DEBUG "Setting additional properties for target ${target}...")
21
+
22
+  while(_STPO_PROPERTIES)
23
+    list(POP_FRONT _STPO_PROPERTIES key value)
24
+    set_property(TARGET ${target} PROPERTY ${key} "${value}")
25
+  endwhile()
26
+
27
+  string(TIMESTAMP CURRENT_YEAR "%Y")
28
+  set_target_properties(
29
+    ${target}
30
+    PROPERTIES BUNDLE TRUE
31
+               BUNDLE_EXTENSION plugin
32
+               XCODE_ATTRIBUTE_PRODUCT_NAME ${target}
33
+               XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER ${MACOS_BUNDLEID}
34
+               XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION ${PLUGIN_BUILD_NUMBER}
35
+               XCODE_ATTRIBUTE_MARKETING_VERSION ${PLUGIN_VERSION}
36
+               XCODE_ATTRIBUTE_GENERATE_INFOPLIST_FILE YES
37
+               XCODE_ATTRIBUTE_INFOPLIST_FILE ""
38
+               XCODE_ATTRIBUTE_INFOPLIST_KEY_CFBundleDisplayName ${target}
39
+               XCODE_ATTRIBUTE_INFOPLIST_KEY_NSHumanReadableCopyright "(c) ${CURRENT_YEAR} ${PLUGIN_AUTHOR}"
40
+               XCODE_ATTRIBUTE_INSTALL_PATH "$(USER_LIBRARY_DIR)/Application Support/obs-studio/plugins")
41
+
42
+  if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/entitlements.plist")
43
+    set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS
44
+                                               "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/entitlements.plist")
45
+  endif()
46
+
47
+  if(TARGET plugin-support)
48
+    target_link_libraries(${target} PRIVATE plugin-support)
49
+  endif()
50
+
51
+  target_install_resources(${target})
52
+
53
+  get_target_property(target_sources ${target} SOURCES)
54
+  set(target_ui_files ${target_sources})
55
+  list(FILTER target_ui_files INCLUDE REGEX ".+\\.(ui|qrc)")
56
+  source_group(
57
+    TREE "${CMAKE_CURRENT_SOURCE_DIR}"
58
+    PREFIX "UI Files"
59
+    FILES ${target_ui_files})
60
+
61
+  set(valid_uuid FALSE)
62
+  check_uuid(${_macosPackageUUID} valid_uuid)
63
+  if(NOT valid_uuid)
64
+    message(FATAL_ERROR "Specified macOS package UUID is not a valid UUID value: ${_macosPackageUUID}")
65
+  else()
66
+    set(UUID_PACKAGE ${_macosPackageUUID})
67
+  endif()
68
+
69
+  set(valid_uuid FALSE)
70
+  check_uuid(${_macosInstallerUUID} valid_uuid)
71
+  if(NOT valid_uuid)
72
+    message(FATAL_ERROR "Specified macOS package UUID is not a valid UUID value: ${_macosInstallerUUID}")
73
+  else()
74
+    set(UUID_INSTALLER ${_macosInstallerUUID})
75
+  endif()
76
+
77
+  install(TARGETS ${target} LIBRARY DESTINATION .)
78
+  install(
79
+    FILES "$<TARGET_BUNDLE_DIR:${target}>.dsym"
80
+    CONFIGURATIONS Release
81
+    DESTINATION .
82
+    OPTIONAL)
83
+  configure_file(cmake/macos/resources/create-package.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/create-package.cmake")
84
+  install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/create-package.cmake")
85
+endfunction()
86
+
87
+# target_install_resources: Helper function to add resources into bundle
88
+function(target_install_resources target)
89
+  message(DEBUG "Installing resources for target ${target}...")
90
+  if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/data")
91
+    file(GLOB_RECURSE data_files "${CMAKE_CURRENT_SOURCE_DIR}/data/*")
92
+    foreach(data_file IN LISTS data_files)
93
+      cmake_path(RELATIVE_PATH data_file BASE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/" OUTPUT_VARIABLE
94
+                 relative_path)
95
+      cmake_path(GET relative_path PARENT_PATH relative_path)
96
+      target_sources(${target} PRIVATE "${data_file}")
97
+      set_property(SOURCE "${data_file}" PROPERTY MACOSX_PACKAGE_LOCATION "Resources/${relative_path}")
98
+      source_group("Resources/${relative_path}" FILES "${data_file}")
99
+    endforeach()
100
+  endif()
101
+endfunction()
102
+
103
+# target_add_resource: Helper function to add a specific resource to a bundle
104
+function(target_add_resource target resource)
105
+  message(DEBUG "Add resource ${resource} to target ${target} at destination ${destination}...")
106
+  target_sources(${target} PRIVATE "${resource}")
107
+  set_property(SOURCE "${resource}" PROPERTY MACOSX_PACKAGE_LOCATION Resources)
108
+  source_group("Resources" FILES "${resource}")
109
+endfunction()
110
obs-backgroundremoval-1.1.5.tar.gz/cmake/macos/resources Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/cmake/macos/resources/Distribution.xml Changed
2
 
1
(renamed from cmake/bundle/macos/Distribution.xml)
2
obs-backgroundremoval-1.1.5.tar.gz/cmake/macos/resources/ccache-launcher-c.in Added
19
 
1
@@ -0,0 +1,17 @@
2
+#!/bin/sh
3
+
4
+if  "$1" == "${CMAKE_C_COMPILER}"  ; then
5
+    shift
6
+fi
7
+
8
+export CCACHE_CPP2=true
9
+export CCACHE_DEPEND=true
10
+export CCACHE_DIRECT=true
11
+export CCACHE_FILECLONE=true
12
+export CCACHE_INODECACHE=true
13
+export CCACHE_NOCOMPILERCHECK='content'
14
+export CCACHE_SLOPPINESS='include_file_mtime,include_file_ctime,clang_index_store,system_headers'
15
+if  "${CI}" ; then
16
+    export CCACHE_NOHASHDIR=true
17
+fi
18
+exec "${CMAKE_C_COMPILER_LAUNCHER}" "${CMAKE_C_COMPILER}" "$@"
19
obs-backgroundremoval-1.1.5.tar.gz/cmake/macos/resources/ccache-launcher-cxx.in Added
19
 
1
@@ -0,0 +1,17 @@
2
+#!/bin/sh
3
+
4
+if  "$1" == "${CMAKE_CXX_COMPILER}"  ; then
5
+    shift
6
+fi
7
+
8
+export CCACHE_CPP2=true
9
+export CCACHE_NODEPEND=true
10
+export CCACHE_DIRECT=true
11
+export CCACHE_FILECLONE=true
12
+export CCACHE_INODECACHE=true
13
+export CCACHE_NOCOMPILERCHECK='content'
14
+export CCACHE_SLOPPINESS='include_file_mtime,include_file_ctime,clang_index_store,system_headers'
15
+if  "${CI}" ; then
16
+    export CCACHE_NOHASHDIR=true
17
+fi
18
+exec "${CMAKE_CXX_COMPILER_LAUNCHER}" "${CMAKE_CXX_COMPILER}" "$@"
19
obs-backgroundremoval-1.1.5.tar.gz/cmake/macos/resources/create-package.cmake.in Added
9
 
1
@@ -0,0 +1,7 @@
2
+set(CMAKE_PROJECT_NAME ${CMAKE_PROJECT_NAME})
3
+set(CMAKE_PROJECT_VERSION ${CMAKE_PROJECT_VERSION})
4
+set(MACOS_BUNDLEID ${MACOS_BUNDLEID})
5
+set(UUID_PACKAGE ${UUID_PACKAGE})
6
+set(UUID_INSTALLER ${UUID_INSTALLER})
7
+configure_file(cmake/macos/resources/installer-macos.pkgproj.in
8
+  "${CMAKE_CURRENT_BINARY_DIR}/installer-macos.generated.pkgproj")
9
obs-backgroundremoval-1.1.5.tar.gz/cmake/macos/resources/installer-macos.pkgproj.in Added
201
 
1
@@ -0,0 +1,920 @@
2
+<?xml version="1.0" encoding="UTF-8"?>
3
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
4
+<plist version="1.0">
5
+<dict>
6
+   <key>PACKAGES</key>
7
+   <array>
8
+       <dict>
9
+           <key>MUST-CLOSE-APPLICATION-ITEMS</key>
10
+           <array/>
11
+           <key>MUST-CLOSE-APPLICATIONS</key>
12
+           <false/>
13
+           <key>PACKAGE_FILES</key>
14
+           <dict>
15
+               <key>DEFAULT_INSTALL_LOCATION</key>
16
+               <string>/</string>
17
+               <key>HIERARCHY</key>
18
+               <dict>
19
+                   <key>CHILDREN</key>
20
+                   <array>
21
+                       <dict>
22
+                           <key>CHILDREN</key>
23
+                           <array/>
24
+                           <key>GID</key>
25
+                           <integer>80</integer>
26
+                           <key>PATH</key>
27
+                           <string>Applications</string>
28
+                           <key>PATH_TYPE</key>
29
+                           <integer>0</integer>
30
+                           <key>PERMISSIONS</key>
31
+                           <integer>509</integer>
32
+                           <key>TYPE</key>
33
+                           <integer>1</integer>
34
+                           <key>UID</key>
35
+                           <integer>0</integer>
36
+                       </dict>
37
+                       <dict>
38
+                           <key>CHILDREN</key>
39
+                           <array>
40
+                               <dict>
41
+                                   <key>CHILDREN</key>
42
+                                   <array>
43
+                                       <dict>
44
+                                           <key>CHILDREN</key>
45
+                                           <array>
46
+                                               <dict>
47
+                                                   <key>CHILDREN</key>
48
+                                                   <array>
49
+                                                       <dict>
50
+                                                           <key>BUNDLE_CAN_DOWNGRADE</key>
51
+                                                           <false/>
52
+                                                           <key>BUNDLE_POSTINSTALL_PATH</key>
53
+                                                           <dict>
54
+                                                               <key>PATH_TYPE</key>
55
+                                                               <integer>0</integer>
56
+                                                           </dict>
57
+                                                           <key>BUNDLE_PREINSTALL_PATH</key>
58
+                                                           <dict>
59
+                                                               <key>PATH_TYPE</key>
60
+                                                               <integer>0</integer>
61
+                                                           </dict>
62
+                                                           <key>CHILDREN</key>
63
+                                                           <array/>
64
+                                                           <key>GID</key>
65
+                                                           <integer>80</integer>
66
+                                                           <key>PATH</key>
67
+                                                           <string>../release/@CMAKE_INSTALL_CONFIG_NAME@/@CMAKE_PROJECT_NAME@.plugin</string>
68
+                                                           <key>PATH_TYPE</key>
69
+                                                           <integer>1</integer>
70
+                                                           <key>PERMISSIONS</key>
71
+                                                           <integer>493</integer>
72
+                                                           <key>TYPE</key>
73
+                                                           <integer>3</integer>
74
+                                                           <key>UID</key>
75
+                                                           <integer>0</integer>
76
+                                                       </dict>
77
+                                                   </array>
78
+                                                   <key>GID</key>
79
+                                                   <integer>80</integer>
80
+                                                   <key>PATH</key>
81
+                                                   <string>plugins</string>
82
+                                                   <key>PATH_TYPE</key>
83
+                                                   <integer>2</integer>
84
+                                                   <key>PERMISSIONS</key>
85
+                                                   <integer>509</integer>
86
+                                                   <key>TYPE</key>
87
+                                                   <integer>2</integer>
88
+                                                   <key>UID</key>
89
+                                                   <integer>0</integer>
90
+                                               </dict>
91
+                                           </array>
92
+                                           <key>GID</key>
93
+                                           <integer>80</integer>
94
+                                           <key>PATH</key>
95
+                                           <string>obs-studio</string>
96
+                                           <key>PATH_TYPE</key>
97
+                                           <integer>2</integer>
98
+                                           <key>PERMISSIONS</key>
99
+                                           <integer>509</integer>
100
+                                           <key>TYPE</key>
101
+                                           <integer>2</integer>
102
+                                           <key>UID</key>
103
+                                           <integer>0</integer>
104
+                                       </dict>
105
+                                   </array>
106
+                                   <key>GID</key>
107
+                                   <integer>80</integer>
108
+                                   <key>PATH</key>
109
+                                   <string>Application Support</string>
110
+                                   <key>PATH_TYPE</key>
111
+                                   <integer>0</integer>
112
+                                   <key>PERMISSIONS</key>
113
+                                   <integer>493</integer>
114
+                                   <key>TYPE</key>
115
+                                   <integer>1</integer>
116
+                                   <key>UID</key>
117
+                                   <integer>0</integer>
118
+                               </dict>
119
+                               <dict>
120
+                                   <key>CHILDREN</key>
121
+                                   <array/>
122
+                                   <key>GID</key>
123
+                                   <integer>0</integer>
124
+                                   <key>PATH</key>
125
+                                   <string>Automator</string>
126
+                                   <key>PATH_TYPE</key>
127
+                                   <integer>0</integer>
128
+                                   <key>PERMISSIONS</key>
129
+                                   <integer>493</integer>
130
+                                   <key>TYPE</key>
131
+                                   <integer>1</integer>
132
+                                   <key>UID</key>
133
+                                   <integer>0</integer>
134
+                               </dict>
135
+                               <dict>
136
+                                   <key>CHILDREN</key>
137
+                                   <array/>
138
+                                   <key>GID</key>
139
+                                   <integer>0</integer>
140
+                                   <key>PATH</key>
141
+                                   <string>Documentation</string>
142
+                                   <key>PATH_TYPE</key>
143
+                                   <integer>0</integer>
144
+                                   <key>PERMISSIONS</key>
145
+                                   <integer>493</integer>
146
+                                   <key>TYPE</key>
147
+                                   <integer>1</integer>
148
+                                   <key>UID</key>
149
+                                   <integer>0</integer>
150
+                               </dict>
151
+                               <dict>
152
+                                   <key>CHILDREN</key>
153
+                                   <array/>
154
+                                   <key>GID</key>
155
+                                   <integer>0</integer>
156
+                                   <key>PATH</key>
157
+                                   <string>Extensions</string>
158
+                                   <key>PATH_TYPE</key>
159
+                                   <integer>0</integer>
160
+                                   <key>PERMISSIONS</key>
161
+                                   <integer>493</integer>
162
+                                   <key>TYPE</key>
163
+                                   <integer>1</integer>
164
+                                   <key>UID</key>
165
+                                   <integer>0</integer>
166
+                               </dict>
167
+                               <dict>
168
+                                   <key>CHILDREN</key>
169
+                                   <array/>
170
+                                   <key>GID</key>
171
+                                   <integer>0</integer>
172
+                                   <key>PATH</key>
173
+                                   <string>Filesystems</string>
174
+                                   <key>PATH_TYPE</key>
175
+                                   <integer>0</integer>
176
+                                   <key>PERMISSIONS</key>
177
+                                   <integer>493</integer>
178
+                                   <key>TYPE</key>
179
+                                   <integer>1</integer>
180
+                                   <key>UID</key>
181
+                                   <integer>0</integer>
182
+                               </dict>
183
+                               <dict>
184
+                                   <key>CHILDREN</key>
185
+                                   <array/>
186
+                                   <key>GID</key>
187
+                                   <integer>0</integer>
188
+                                   <key>PATH</key>
189
+                                   <string>Frameworks</string>
190
+                                   <key>PATH_TYPE</key>
191
+                                   <integer>0</integer>
192
+                                   <key>PERMISSIONS</key>
193
+                                   <integer>493</integer>
194
+                                   <key>TYPE</key>
195
+                                   <integer>1</integer>
196
+                                   <key>UID</key>
197
+                                   <integer>0</integer>
198
+                               </dict>
199
+                               <dict>
200
+                                   <key>CHILDREN</key>
201
obs-backgroundremoval-1.1.5.tar.gz/cmake/macos/resources/scripts Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/cmake/macos/resources/scripts/postinstall Changed
2
 
1
(renamed from cmake/bundle/macos/scripts/postinstall)
2
obs-backgroundremoval-1.1.5.tar.gz/cmake/macos/xcode.cmake Added
176
 
1
@@ -0,0 +1,174 @@
2
+# CMake macOS Xcode module
3
+
4
+include_guard(GLOBAL)
5
+
6
+# Use a compiler wrapper to enable ccache in Xcode projects
7
+if(ENABLE_CCACHE AND CCACHE_PROGRAM)
8
+  configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/resources/ccache-launcher-c.in" ccache-launcher-c)
9
+  configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/resources/ccache-launcher-cxx.in" ccache-launcher-cxx)
10
+
11
+  execute_process(COMMAND chmod a+rx "${CMAKE_CURRENT_BINARY_DIR}/ccache-launcher-c"
12
+                          "${CMAKE_CURRENT_BINARY_DIR}/ccache-launcher-cxx")
13
+  set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_CURRENT_BINARY_DIR}/ccache-launcher-c")
14
+  set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_CURRENT_BINARY_DIR}/ccache-launcher-cxx")
15
+  set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_C_COMPILER}")
16
+  set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_CXX_COMPILER}")
17
+endif()
18
+
19
+# Set project variables
20
+set(CMAKE_XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION ${PLUGIN_BUILD_NUMBER})
21
+set(CMAKE_XCODE_ATTRIBUTE_DYLIB_COMPATIBILITY_VERSION 1.0.0)
22
+set(CMAKE_XCODE_ATTRIBUTE_MARKETING_VERSION ${PLUGIN_VERSION})
23
+
24
+# Set deployment target
25
+set(CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET})
26
+
27
+if(NOT CODESIGN_TEAM)
28
+  # Switch to manual codesigning if no codesigning team is provided
29
+  set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE Manual)
30
+  set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${CODESIGN_IDENTITY}")
31
+else()
32
+  if(CODESIGN_IDENTITY AND NOT CODESIGN_IDENTITY STREQUAL "-")
33
+    # Switch to manual codesigning if a non-adhoc codesigning identity is provided
34
+    set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE Manual)
35
+    set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${CODESIGN_IDENTITY}")
36
+  else()
37
+    # Switch to automatic codesigning via valid team ID
38
+    set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE Automatic)
39
+    set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Development")
40
+  endif()
41
+  set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "${CODESIGN_TEAM}")
42
+endif()
43
+
44
+# Only create a single Xcode project file
45
+set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE)
46
+# Add all libraries to project link phase (lets Xcode handle linking)
47
+set(CMAKE_XCODE_LINK_BUILD_PHASE_MODE KNOWN_LOCATION)
48
+
49
+# Enable codesigning with secure timestamp when not in Debug configuration (required for Notarization)
50
+set(CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGSvariant=Release "--deep --timestamp")
51
+set(CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGSvariant=RelWithDebInfo "--deep --timestamp")
52
+set(CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGSvariant=MinSizeRel "--deep --timestamp")
53
+
54
+# Enable codesigning with hardened runtime option when not in Debug configuration (required for Notarization)
55
+set(CMAKE_XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIMEvariant=Release YES)
56
+set(CMAKE_XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIMEvariant=RelWithDebInfo YES)
57
+set(CMAKE_XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIMEvariant=MinSizeRel YES)
58
+
59
+# Disable injection of Xcode's base entitlements used for debugging when not in Debug configuration (required for
60
+# Notarization)
61
+set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_INJECT_BASE_ENTITLEMENTSvariant=Release NO)
62
+set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_INJECT_BASE_ENTITLEMENTSvariant=RelWithDebInfo NO)
63
+set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_INJECT_BASE_ENTITLEMENTSvariant=MinSizeRel NO)
64
+
65
+# Use Swift version 5.0 by default
66
+set(CMAKE_XCODE_ATTRIBUTE_SWIFT_VERSION 5.0)
67
+
68
+# Use DWARF with separate dSYM files when in Release or MinSizeRel configuration.
69
+#
70
+# * Currently overruled by CMake's Xcode generator, requires adding '-g' flag to raw compiler command line for desired
71
+#   output configuration. Report to KitWare.
72
+#
73
+set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMATvariant=Debug dwarf)
74
+set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMATvariant=RelWithDebInfo dwarf)
75
+set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMATvariant=Release dwarf-with-dsym)
76
+set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMATvariant=MinSizeRel dwarf-with-dsym)
77
+
78
+# Make all symbols hidden by default (currently overriden by CMake's compiler flags)
79
+set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN YES)
80
+set(CMAKE_XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN YES)
81
+
82
+# Strip unused code
83
+set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING YES)
84
+
85
+# Display mangled names in Debug configuration
86
+set(CMAKE_XCODE_ATTRIBUTE_LINKER_DISPLAYS_MANGLED_NAMESvariant=Debug YES)
87
+
88
+# Build active architecture only in Debug configuration
89
+set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCHvariant=Debug YES)
90
+
91
+# Enable testability in Debug configuration
92
+set(CMAKE_XCODE_ATTRIBUTE_ENABLE_TESTABILITYvariant=Debug YES)
93
+
94
+# Enable using ARC in ObjC by default
95
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
96
+# Enable weak references in manual retain release
97
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_WEAK YES)
98
+# Disable strict aliasing
99
+set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO)
100
+
101
+# Set C++ language default to c17
102
+#
103
+# * CMake explicitly sets the version via compiler flag when transitive dependencies require specific compiler feature
104
+#   set, resulting in the flag being added twice. Report to KitWare as a feature request for Xcode generator
105
+# * See also: https://gitlab.kitware.com/cmake/cmake/-/issues/17183
106
+#
107
+# set(CMAKE_XCODE_ATTRIBUTE_GCC_C_LANGUAGE_STANDARD c17)
108
+#
109
+# Set C++ language default to c++17
110
+#
111
+# * See above. Report to KitWare as a feature request for Xcode generator
112
+#
113
+# set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD c++17)
114
+
115
+# Enable support for module imports in ObjC
116
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_MODULES YES)
117
+# Enable automatic linking of imported modules in ObjC
118
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_MODULES_AUTOLINK YES)
119
+# Enable strict msg_send rules for ObjC
120
+set(CMAKE_XCODE_ATTRIBUTE_ENABLE_STRICT_OBJC_MSGSEND YES)
121
+
122
+# Set default warnings for ObjC and C++
123
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING YES_ERROR)
124
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_BOOL_CONVERSION YES)
125
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS YES)
126
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_COMMA YES)
127
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_CONSTANT_CONVERSION YES)
128
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_EMPTY_BODY YES)
129
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_ENUM_CONVERSION YES)
130
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_INFINITE_RECURSION YES)
131
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_INT_CONVERSION YES)
132
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_NON_LITERAL_NULL_CONVERSION YES)
133
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF YES)
134
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_OBJC_LITERAL_CONVERSION YES)
135
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK YES)
136
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER YES)
137
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_RANGE_LOOP_ANALYSIS YES)
138
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_STRICT_PROTOTYPES NO)
139
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION NO)
140
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_SUSPICIOUS_MOVE YES)
141
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_UNREACHABLE_CODE YES)
142
+set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN__DUPLICATE_METHOD_MATCH YES)
143
+
144
+# Set default warnings for C and C++
145
+set(CMAKE_XCODE_ATTRIBUTE_GCC_NO_COMMON_BLOCKS YES)
146
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_64_TO_32_BIT_CONVERSION YES)
147
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS NO)
148
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_NEWLINE YES)
149
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_RETURN_TYPE YES_ERROR)
150
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_CHECK_SWITCH_STATEMENTS YES)
151
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_FOUR_CHARACTER_CONSTANTS YES)
152
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_SHADOW NO)
153
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_SIGN_COMPARE YES)
154
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_TYPECHECK_CALLS_TO_PRINTF YES)
155
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNDECLARED_SELECTOR YES)
156
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNINITIALIZED_AUTOS YES)
157
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_FUNCTION NO)
158
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_PARAMETER YES)
159
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VALUE YES)
160
+set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VARIABLE YES)
161
+
162
+# Add additional warning compiler flags
163
+set(CMAKE_XCODE_ATTRIBUTE_WARNING_CFLAGS "-Wvla -Wformat-security")
164
+
165
+if(CMAKE_COMPILE_WARNING_AS_ERROR)
166
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_TREAT_WARNINGS_AS_ERRORS YES)
167
+endif()
168
+
169
+# Enable color diagnostics
170
+set(CMAKE_COLOR_DIAGNOSTICS TRUE)
171
+
172
+# Disable usage of RPATH in build or install configurations
173
+set(CMAKE_SKIP_RPATH TRUE)
174
+# Have Xcode set default RPATH entries
175
+set(CMAKE_XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks")
176
obs-backgroundremoval-1.1.5.tar.gz/cmake/windows Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/cmake/windows/buildspec.cmake Added
26
 
1
@@ -0,0 +1,24 @@
2
+# CMake Windows build dependencies module
3
+
4
+include_guard(GLOBAL)
5
+
6
+include(buildspec_common)
7
+
8
+# _check_dependencies_windows: Set up Windows slice for _check_dependencies
9
+function(_check_dependencies_windows)
10
+  set(arch ${CMAKE_GENERATOR_PLATFORM})
11
+  set(platform windows-${arch})
12
+
13
+  set(dependencies_dir "${CMAKE_CURRENT_SOURCE_DIR}/.deps")
14
+  set(prebuilt_filename "windows-deps-VERSION-ARCH-REVISION.zip")
15
+  set(prebuilt_destination "obs-deps-VERSION-ARCH")
16
+  set(qt6_filename "windows-deps-qt6-VERSION-ARCH-REVISION.zip")
17
+  set(qt6_destination "obs-deps-qt6-VERSION-ARCH")
18
+  set(obs-studio_filename "VERSION.zip")
19
+  set(obs-studio_destination "obs-studio-VERSION")
20
+  set(dependencies_list prebuilt qt6 obs-studio)
21
+
22
+  _check_dependencies()
23
+endfunction()
24
+
25
+_check_dependencies_windows()
26
obs-backgroundremoval-1.1.5.tar.gz/cmake/windows/compilerconfig.cmake Added
37
 
1
@@ -0,0 +1,35 @@
2
+# CMake Windows compiler configuration module
3
+
4
+include_guard(GLOBAL)
5
+
6
+include(compiler_common)
7
+
8
+# CMake 3.24 introduces a bug mistakenly interpreting MSVC as supporting the '-pthread' compiler flag
9
+if(CMAKE_VERSION VERSION_EQUAL 3.24.0)
10
+  set(THREADS_HAVE_PTHREAD_ARG FALSE)
11
+endif()
12
+
13
+message(DEBUG "Current Windows API version: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
14
+if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM)
15
+  message(DEBUG "Maximum Windows API version: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM}")
16
+endif()
17
+
18
+if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS 10.0.20348)
19
+  message(FATAL_ERROR "OBS requires Windows 10 SDK version 10.0.20348.0 or more recent.\n"
20
+                      "Please download and install the most recent Windows platform SDK.")
21
+endif()
22
+
23
+add_compile_options(
24
+  /W3 /utf-8 "$<$<COMPILE_LANG_AND_ID:C,MSVC>:/MP>" "$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/MP>"
25
+  "$<$<COMPILE_LANG_AND_ID:C,Clang>:${_obs_clang_c_options}>"
26
+  "$<$<COMPILE_LANG_AND_ID:CXX,Clang>:${_obs_clang_cxx_options}>")
27
+
28
+add_compile_definitions(UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS $<$<CONFIG:DEBUG>:DEBUG>
29
+                        $<$<CONFIG:DEBUG>:_DEBUG>)
30
+
31
+add_link_options("$<$<NOT:$<CONFIG:Debug>>:/OPT:REF>" "$<$<CONFIG:Debug>:/INCREMENTAL:NO>"
32
+                 "$<$<CONFIG:RelWithDebInfo>:/INCREMENTAL:NO>" "$<$<CONFIG:RelWithDebInfo>:/OPT:ICF>")
33
+
34
+if(CMAKE_COMPILE_WARNING_AS_ERROR)
35
+  add_link_options(/WX)
36
+endif()
37
obs-backgroundremoval-1.1.5.tar.gz/cmake/windows/defaults.cmake Added
10
 
1
@@ -0,0 +1,8 @@
2
+# CMake Windows defaults module
3
+
4
+include_guard(GLOBAL)
5
+
6
+# Enable find_package targets to become globally available targets
7
+set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL TRUE)
8
+
9
+include(buildspec)
10
obs-backgroundremoval-1.1.5.tar.gz/cmake/windows/helpers.cmake Added
132
 
1
@@ -0,0 +1,130 @@
2
+# CMake Windows helper functions module
3
+
4
+# cmake-format: off
5
+# cmake-lint: disable=C0103
6
+# cmake-format: on
7
+
8
+include_guard(GLOBAL)
9
+
10
+include(helpers_common)
11
+
12
+# set_target_properties_plugin: Set target properties for use in obs-studio
13
+function(set_target_properties_plugin target)
14
+  set(options "")
15
+  set(oneValueArgs "")
16
+  set(multiValueArgs PROPERTIES)
17
+  cmake_parse_arguments(PARSE_ARGV 0 _STPO "${options}" "${oneValueArgs}" "${multiValueArgs}")
18
+
19
+  message(DEBUG "Setting additional properties for target ${target}...")
20
+
21
+  while(_STPO_PROPERTIES)
22
+    list(POP_FRONT _STPO_PROPERTIES key value)
23
+    set_property(TARGET ${target} PROPERTY ${key} "${value}")
24
+  endwhile()
25
+
26
+  string(TIMESTAMP CURRENT_YEAR "%Y")
27
+
28
+  set_target_properties(${target} PROPERTIES VERSION 0 SOVERSION ${PLUGIN_VERSION})
29
+
30
+  install(
31
+    TARGETS ${target}
32
+    RUNTIME DESTINATION bin/64bit
33
+    LIBRARY DESTINATION obs-plugins/64bit)
34
+
35
+  install(
36
+    FILES "$<TARGET_PDB_FILE:${target}>"
37
+    CONFIGURATIONS RelWithDebInfo Debug
38
+    DESTINATION obs-plugins/64bit
39
+    OPTIONAL)
40
+
41
+  if(OBS_BUILD_DIR)
42
+    add_custom_command(
43
+      TARGET ${target}
44
+      POST_BUILD
45
+      COMMAND "${CMAKE_COMMAND}" -E make_directory "${OBS_BUILD_DIR}/obs-plugins/64bit"
46
+      COMMAND "${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:${target}>"
47
+              "$<$<CONFIG:Debug,RelWithDebInfo>:$<TARGET_PDB_FILE:${target}>>" "${OBS_BUILD_DIR}/obs-plugin/64bit"
48
+      COMMENT "Copy ${target} to obs-studio directory ${OBS_BUILD_DIR}"
49
+      VERBATIM)
50
+  endif()
51
+
52
+  if(TARGET plugin-support)
53
+    target_link_libraries(${target} PRIVATE plugin-support)
54
+  endif()
55
+
56
+  target_install_resources(${target})
57
+
58
+  get_target_property(target_sources ${target} SOURCES)
59
+  set(target_ui_files ${target_sources})
60
+  list(FILTER target_ui_files INCLUDE REGEX ".+\\.(ui|qrc)")
61
+  source_group(
62
+    TREE "${CMAKE_CURRENT_SOURCE_DIR}"
63
+    PREFIX "UI Files"
64
+    FILES ${target_ui_files})
65
+
66
+  set(valid_uuid FALSE)
67
+  check_uuid(${_windowsAppUUID} valid_uuid)
68
+  if(NOT valid_uuid)
69
+    message(FATAL_ERROR "Specified Windows package UUID is not a valid UUID value: ${_windowsAppUUID}")
70
+  else()
71
+    set(UUID_APP ${_windowsAppUUID})
72
+  endif()
73
+
74
+  configure_file(cmake/windows/resources/installer-Windows.iss.in
75
+                 "${CMAKE_CURRENT_BINARY_DIR}/installer-Windows.generated.iss")
76
+
77
+  configure_file(cmake/windows/resources/resource.rc.in "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.rc")
78
+  target_sources(${CMAKE_PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.rc")
79
+endfunction()
80
+
81
+# Helper function to add resources into bundle
82
+function(target_install_resources target)
83
+  message(DEBUG "Installing resources for target ${target}...")
84
+  if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/data")
85
+    file(GLOB_RECURSE data_files "${CMAKE_CURRENT_SOURCE_DIR}/data/*")
86
+    foreach(data_file IN LISTS data_files)
87
+      cmake_path(RELATIVE_PATH data_file BASE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/" OUTPUT_VARIABLE
88
+                 relative_path)
89
+      cmake_path(GET relative_path PARENT_PATH relative_path)
90
+      target_sources(${target} PRIVATE "${data_file}")
91
+      source_group("Resources/${relative_path}" FILES "${data_file}")
92
+    endforeach()
93
+
94
+    install(
95
+      DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/"
96
+      DESTINATION data/obs-plugins/${target}
97
+      USE_SOURCE_PERMISSIONS)
98
+
99
+    if(OBS_BUILD_DIR)
100
+      add_custom_command(
101
+        TARGET ${target}
102
+        POST_BUILD
103
+        COMMAND "${CMAKE_COMMAND}" -E make_directory "${OBS_BUILD_DIR}/data/obs-plugins/${target}"
104
+        COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/data"
105
+                "${OBS_BUILD_DIR}/data/obs-plugins/${target}"
106
+        COMMENT "Copy ${target} resources to data directory"
107
+        VERBATIM)
108
+    endif()
109
+  endif()
110
+endfunction()
111
+
112
+# Helper function to add a specific resource to a bundle
113
+function(target_add_resource target resource)
114
+  message(DEBUG "Add resource '${resource}' to target ${target} at destination '${target_destination}'...")
115
+
116
+  install(
117
+    FILES "${resource}"
118
+    DESTINATION data/obs-plugins/${target}
119
+    COMPONENT Runtime)
120
+
121
+  if(OBS_BUILD_DIR)
122
+    add_custom_command(
123
+      TARGET ${target}
124
+      POST_BUILD
125
+      COMMAND "${CMAKE_COMMAND}" -E make_directory "${OBS_BUILD_DIR}/data/obs-plugins/${target}"
126
+      COMMAND "${CMAKE_COMMAND}" -E copy "${resource}" "${OBS_BUILD_DIR}/data/obs-plugins/${target}"
127
+      COMMENT "Copy ${target} resource ${resource} to library directory"
128
+      VERBATIM)
129
+  endif()
130
+  source_group("Resources" FILES "${resource}")
131
+endfunction()
132
obs-backgroundremoval-1.1.5.tar.gz/cmake/windows/resources Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/cmake/windows/resources/installer-Windows.iss.in Added
66
 
1
@@ -0,0 +1,64 @@
2
+#define MyAppName "@CMAKE_PROJECT_NAME@"
3
+#define MyAppVersion "@CMAKE_PROJECT_VERSION@"
4
+#define MyAppPublisher "@PLUGIN_AUTHOR@"
5
+#define MyAppURL "@PLUGIN_WEBSITE@"
6
+
7
+Setup
8
+; NOTE: The value of AppId uniquely identifies this application.
9
+; Do not use the same AppId value in installers for other applications.
10
+; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
11
+AppId={{@UUID_APP@}
12
+AppName={#MyAppName}
13
+AppVersion={#MyAppVersion}
14
+AppPublisher={#MyAppPublisher}
15
+AppPublisherURL={#MyAppURL}
16
+AppSupportURL={#MyAppURL}
17
+AppUpdatesURL={#MyAppURL}
18
+DefaultDirName={code:GetDirName}
19
+DefaultGroupName={#MyAppName}
20
+OutputBaseFilename={#MyAppName}-{#MyAppVersion}-Windows-Installer
21
+Compression=lzma
22
+SolidCompression=yes
23
+DirExistsWarning=no
24
+
25
+Languages
26
+Name: "english"; MessagesFile: "compiler:Default.isl"
27
+
28
+Files
29
+Source: "..\release\Package\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
30
+Source: "..\LICENSE"; Flags: dontcopy
31
+; NOTE: Don't use "Flags: ignoreversion" on any shared system files
32
+
33
+Icons
34
+Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
35
+Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
36
+
37
+Code
38
+procedure InitializeWizard();
39
+var
40
+  GPLText: AnsiString;
41
+  Page: TOutputMsgMemoWizardPage;
42
+begin
43
+  ExtractTemporaryFile('LICENSE');
44
+  LoadStringFromFile(ExpandConstant('{tmp}\LICENSE'), GPLText);
45
+  Page := CreateOutputMsgMemoPage(wpWelcome,
46
+    'License Information', 'Please review the license terms before installing {#MyAppName}',
47
+    'Press Page Down to see the rest of the agreement. Once you are aware of your rights, click Next to continue.',
48
+    String(GPLText)
49
+  );
50
+end;
51
+
52
+// credit where it's due :
53
+// following function come from https://github.com/Xaymar/obs-studio_amf-encoder-plugin/blob/master/%23Resources/Installer.in.iss#L45
54
+function GetDirName(Value: string): string;
55
+var
56
+  InstallPath: string;
57
+begin
58
+  // initialize default path, which will be returned when the following registry
59
+  // key queries fail due to missing keys or for some different reason
60
+  Result := '{autopf}\obs-studio';
61
+  // query the first registry value; if this succeeds, return the obtained value
62
+  if RegQueryStringValue(HKLM32, 'SOFTWARE\OBS Studio', '', InstallPath) then
63
+    Result := InstallPath
64
+end;
65
+
66
obs-backgroundremoval-1.1.5.tar.gz/cmake/windows/resources/resource.rc.in Added
34
 
1
@@ -0,0 +1,32 @@
2
+1 VERSIONINFO
3
+ FILEVERSION ${PROJECT_VERSION_MAJOR},${PROJECT_VERSION_MINOR},${PROJECT_VERSION_PATCH},0
4
+ PRODUCTVERSION ${PROJECT_VERSION_MAJOR},${PROJECT_VERSION_MINOR},${PROJECT_VERSION_PATCH},0
5
+ FILEFLAGSMASK 0x0L
6
+#ifdef _DEBUG
7
+ FILEFLAGS 0x1L
8
+#else
9
+ FILEFLAGS 0x0L
10
+#endif
11
+ FILEOS 0x0L
12
+ FILETYPE 0x2L
13
+ FILESUBTYPE 0x0L
14
+BEGIN
15
+    BLOCK "StringFileInfo"
16
+    BEGIN
17
+        BLOCK "040904b0"
18
+        BEGIN
19
+            VALUE "CompanyName", "${PLUGIN_AUTHOR}"
20
+            VALUE "FileDescription", "${PROJECT_NAME}"
21
+            VALUE "FileVersion", "${PROJECT_VERSION}"
22
+            VALUE "InternalName", "${PROJECT_NAME}"
23
+            VALUE "LegalCopyright", "(C) ${CURRENT_YEAR} ${PLUGIN_AUTHOR}"
24
+            VALUE "OriginalFilename", "${PROJECT_NAME}"
25
+            VALUE "ProductName", "${PROJECT_NAME}"
26
+            VALUE "ProductVersion", "${PROJECT_VERSION}"
27
+        END
28
+    END
29
+    BLOCK "VarFileInfo"
30
+    BEGIN
31
+        VALUE "Translation", 0x409, 1200
32
+    END
33
+END
34
obs-backgroundremoval-1.1.5.tar.gz/data/config.json Added
5
 
1
@@ -0,0 +1,3 @@
2
+{
3
+  "check_for_updates": true
4
+}
5
obs-backgroundremoval-1.0.3.tar.gz/data/effects/kawase_blur.effect -> obs-backgroundremoval-1.1.5.tar.gz/data/effects/kawase_blur.effect Changed
125
 
1
@@ -1,9 +1,15 @@
2
 uniform float4x4 ViewProj;
3
 uniform texture2d image;
4
+uniform texture2d focalmask; // focal (depth) mask
5
 
6
 uniform float xOffset;
7
 uniform float yOffset;
8
 
9
+uniform int   blurIter; // Current blur iteration
10
+uniform int   blurTotal; // Total number of blur iterations
11
+uniform float blurFocusPoint; // Focus point for the blur. 0 = back, 1 = front
12
+uniform float blurFocusDepth; // Depth of the focal blur. 0 = narrow, 1 = deep
13
+
14
 sampler_state textureSampler {
15
    Filter    = Linear;
16
    AddressU  = Clamp;
17
@@ -28,8 +34,50 @@
18
    return vert_out;
19
 }
20
 
21
+/**
22
+ * Kawase focal blur
23
+ * The blur amount will be based on the depth of the pixel, and the focus point.
24
+ * The focus point is a value between 0 and 1, where 0 is the back of the image, and 1 is the front.
25
+ * The blur amount is the difference between the focus point and the estimated depth of the pixel.
26
+ */
27
+float4 PSKawaseFocalBlur(VertDataOut v_in) : TARGET
28
+{
29
+   float blurIterF = float(blurIter) / float(blurTotal);
30
+
31
+   // Blur the focal map to get a smoother value else aliasing occurs
32
+   float blurValue = focalmask.Sample(textureSampler, v_in.uv).r;
33
+   blurValue += focalmask.Sample(textureSampler, v_in.uv + float2( 0.01,  0.01)).r;
34
+   blurValue += focalmask.Sample(textureSampler, v_in.uv + float2(-0.01,  0.01)).r;
35
+   blurValue += focalmask.Sample(textureSampler, v_in.uv + float2( 0.01, -0.01)).r;
36
+   blurValue += focalmask.Sample(textureSampler, v_in.uv + float2(-0.01, -0.01)).r;
37
+   blurValue *= 0.25;
38
+
39
+   // Calculate the distance from the focus point for this pixel
40
+   float blurFocusDistance = clamp(abs(blurValue - blurFocusPoint), 0.0, 1.0);
41
+   float blurFocusFactor = clamp(blurFocusDistance - blurFocusDepth, 0.0, 1.0);
42
+
43
+   if (blurIterF > blurFocusFactor) {
44
+       // If we're past the focus point, just return the image pixel, don't blur further
45
+       return image.Sample(textureSampler, v_in.uv);
46
+   }
47
+
48
+   // Calculate the blur value from neighboring pixels
49
+   float4 sum = float4(0.0, 0.0, 0.0, 0.0);
50
+   sum += image.Sample(textureSampler, v_in.uv + float2( xOffset,  yOffset));
51
+   sum += image.Sample(textureSampler, v_in.uv + float2(-xOffset,  yOffset));
52
+   sum += image.Sample(textureSampler, v_in.uv + float2( xOffset, -yOffset));
53
+   sum += image.Sample(textureSampler, v_in.uv + float2(-xOffset, -yOffset));
54
+   sum *= 0.25;
55
+   return sum;
56
+}
57
+
58
+/**
59
+ * Standard Kawase blur
60
+ * While it's not being used, we keep it here for reference.
61
+ */
62
 float4 PSKawaseBlur(VertDataOut v_in) : TARGET
63
 {
64
+   // Calculate the blur value from neighboring pixels
65
    float4 sum = float4(0.0, 0.0, 0.0, 0.0);
66
    sum += image.Sample(textureSampler, v_in.uv + float2( xOffset,  yOffset));
67
    sum += image.Sample(textureSampler, v_in.uv + float2(-xOffset,  yOffset));
68
@@ -39,11 +87,55 @@
69
    return sum;
70
 }
71
 
72
+/**
73
+ * Mask aware Kawase blur
74
+ * Only uses pixels which are in the masked area for blur. This prevents the "Halo Effect" on
75
+ * the border pixels of the mask.
76
+ */
77
+float4 PSKawaseBlurMaskAware(VertDataOut v_in) : TARGET
78
+{
79
+   if (focalmask.Sample(textureSampler, v_in.uv).r == 0) {
80
+       // No mask - return the original image value without any blur
81
+       return image.Sample(textureSampler, v_in.uv);
82
+   }
83
+
84
+   // Calculate the blur value from neighboring pixels
85
+
86
+   float alphaValue1 = focalmask.Sample(textureSampler, v_in.uv + float2( xOffset,  yOffset)).r;
87
+   float4 sum = image.Sample(textureSampler, v_in.uv + float2( xOffset,  yOffset)) * alphaValue1;
88
+   float pixelCounter = alphaValue1;
89
+
90
+   float alphaValue2 = focalmask.Sample(textureSampler, v_in.uv + float2(-xOffset,  yOffset)).r;
91
+   sum += image.Sample(textureSampler, v_in.uv + float2(-xOffset,  yOffset)) * alphaValue2;
92
+   pixelCounter += alphaValue2;
93
+
94
+   float alphaValue3 = focalmask.Sample(textureSampler, v_in.uv + float2( xOffset, -yOffset)).r;
95
+   sum += image.Sample(textureSampler, v_in.uv + float2( xOffset, -yOffset)) * alphaValue3;
96
+   pixelCounter += alphaValue3;
97
+
98
+   float alphaValue4 = focalmask.Sample(textureSampler, v_in.uv + float2(-xOffset, -yOffset)).r;
99
+   sum += image.Sample(textureSampler, v_in.uv + float2(-xOffset, -yOffset)) * alphaValue4;
100
+   pixelCounter += alphaValue4;
101
+
102
+   // Complement the blur pixels with a relative fraction of the center pixel
103
+   return (sum + image.Sample(textureSampler, v_in.uv) * (4.0 - pixelCounter)) * 0.25;
104
+}
105
+
106
+
107
+technique DrawFocalBlur
108
+{
109
+   pass
110
+   {
111
+       vertex_shader = VSDefault(v_in);
112
+       pixel_shader  = PSKawaseFocalBlur(v_in);
113
+   }
114
+}
115
+
116
 technique Draw
117
 {
118
    pass
119
    {
120
        vertex_shader = VSDefault(v_in);
121
-       pixel_shader  = PSKawaseBlur(v_in);
122
+       pixel_shader  = PSKawaseBlurMaskAware(v_in);
123
    }
124
 }
125
obs-backgroundremoval-1.0.3.tar.gz/data/effects/mask_alpha_filter.effect -> obs-backgroundremoval-1.1.5.tar.gz/data/effects/mask_alpha_filter.effect Changed
42
 
1
@@ -2,9 +2,6 @@
2
 
3
 uniform texture2d image;     // input RGBA
4
 uniform texture2d alphamask; // alpha mask
5
-uniform int blurSize;        // Size of the image blur kernel. 0 = no blur
6
-uniform float xTexelSize;    // Size of texel in X coord
7
-uniform float yTexelSize;    // Size of texel in Y coord
8
 uniform texture2d blurredBackground; // input RGBA
9
 
10
 sampler_state textureSampler {
11
@@ -43,6 +40,12 @@
12
    return outputRGBA;
13
 }
14
 
15
+float4 PSTakeBlur(VertDataOut v_in) : TARGET
16
+{
17
+   // Return the blurred image, assume any masking is already applied to the blurred image
18
+   return float4(blurredBackground.Sample(textureSampler, v_in.uv).rgb, 1.0);
19
+}
20
+
21
 float4 PSAlphaMaskRGBAWithoutBlur(VertDataOut v_in) : TARGET
22
 {
23
    float4 inputRGBA = image.Sample(textureSampler, v_in.uv);
24
@@ -60,7 +63,16 @@
25
    pass
26
    {
27
        vertex_shader = VSDefault(v_in);
28
-       pixel_shader  = PSAlphaMaskRGBAWithBlur(v_in);
29
+       pixel_shader  = PSTakeBlur(v_in);
30
+   }
31
+}
32
+
33
+technique DrawWithFocalBlur
34
+{
35
+   pass
36
+   {
37
+       vertex_shader = VSDefault(v_in);
38
+       pixel_shader  = PSTakeBlur(v_in);
39
    }
40
 }
41
 
42
obs-backgroundremoval-1.0.3.tar.gz/data/locale/en-US.ini -> obs-backgroundremoval-1.1.5.tar.gz/data/locale/en-US.ini Changed
9
 
1
@@ -28,3 +28,7 @@
2
 SGLLIE="Semantic Guided Enhancement"
3
 ZERODCE="Zero-DCE"
4
 EnableThreshold="Enable threshold"
5
+BlurFocusPoint="Blur focus point"
6
+TCMonoDepth="TCMonoDepth (Depth)"
7
+EnableFocalBlur="Enable focal blur"
8
+BlurFocusDepth="Blur focus depth"
9
obs-backgroundremoval-1.1.5.tar.gz/data/models/tcmonodepth_tcsmallnet_192x320.onnx Added
obs-backgroundremoval-1.1.5.tar.gz/docs/BUILDING-FEDORA.md Added
31
 
1
@@ -0,0 +1,29 @@
2
+## Instructions for building the plugin on Fedora
3
+
4
+First, you have to install the development tools:
5
+```
6
+sudo dnf groupinstall "Development Tools"
7
+```
8
+
9
+Then, make sure you have the dependencies of this plugin installed:
10
+
11
+```
12
+sudo dnf install cmake gcc-c++ ninja-build obs-studio-devel opencv-devel qt6-qtbase-devel zsh
13
+```
14
+
15
+Clone the repository and set up the submodules:
16
+```
17
+git clone https://github.com/royshil/obs-backgroundremoval.git
18
+cd obs-backgroundremoval
19
+git submodule update --init
20
+```
21
+
22
+Run the following command to compile the plugin:  
23
+```
24
+.github/scripts/build-linux --skip-deps
25
+```
26
+
27
+Finally, install the necessary files into the system directories, by issuing this command:
28
+```
29
+sudo cmake --install build_x86_64 --prefix /usr
30
+```
31
obs-backgroundremoval-1.1.5.tar.gz/docs/UNINSTALL.md Added
27
 
1
@@ -0,0 +1,25 @@
2
+## Uninstalling the plugin
3
+
4
+### Mac
5
+
6
+```
7
+rm -rf "$HOME/Library/Application Support/obs-studio/plugins/obs-backgroundremoval.plugin"
8
+```
9
+
10
+### Ubuntu
11
+
12
+```
13
+dpkg -r obs-backgroundremoval
14
+```
15
+
16
+### Windows
17
+
18
+Uninstall obs-backgroundremoval on Apps and Programs.
19
+
20
+### Windows (Portable)
21
+
22
+Remove the following files and directory under the OBS directory.
23
+
24
+- `data\obs-plugins\obs-backgroundremoval`
25
+- `obs-plugins\64bit\DirectML.dll`
26
+- `obs-plugins\64bit\obs-backgroundremoval.dll`
27
obs-backgroundremoval-1.0.3.tar.gz/src/FilterData.h -> obs-backgroundremoval-1.1.5.tar.gz/src/FilterData.h Changed
41
 
1
@@ -13,26 +13,26 @@
2
   *
3
 */
4
 struct filter_data : public ORTModelData {
5
-  std::string useGPU;
6
-  uint32_t numThreads;
7
-  std::string modelSelection;
8
-  std::unique_ptr<Model> model;
9
+   std::string useGPU;
10
+   uint32_t numThreads;
11
+   std::string modelSelection;
12
+   std::unique_ptr<Model> model;
13
 
14
-  obs_source_t *source;
15
-  gs_texrender_t *texrender;
16
-  gs_stagesurf_t *stagesurface;
17
+   obs_source_t *source;
18
+   gs_texrender_t *texrender;
19
+   gs_stagesurf_t *stagesurface;
20
 
21
-  cv::Mat inputBGRA;
22
+   cv::Mat inputBGRA;
23
 
24
-  bool isDisabled;
25
+   bool isDisabled;
26
 
27
-  std::mutex inputBGRALock;
28
-  std::mutex outputLock;
29
+   std::mutex inputBGRALock;
30
+   std::mutex outputLock;
31
 
32
 #if _WIN32
33
-  const wchar_t *modelFilepath = nullptr;
34
+   const wchar_t *modelFilepath = nullptr;
35
 #else
36
-  const char *modelFilepath = nullptr;
37
+   const char *modelFilepath = nullptr;
38
 #endif
39
 };
40
 
41
obs-backgroundremoval-1.0.3.tar.gz/src/background-filter-info.c -> obs-backgroundremoval-1.1.5.tar.gz/src/background-filter-info.c Changed
32
 
1
@@ -1,17 +1,17 @@
2
 #include "background-filter.h"
3
 
4
 struct obs_source_info background_removal_filter_info = {
5
-  .id = "background_removal",
6
-  .type = OBS_SOURCE_TYPE_FILTER,
7
-  .output_flags = OBS_SOURCE_VIDEO,
8
-  .get_name = background_filter_getname,
9
-  .create = background_filter_create,
10
-  .destroy = background_filter_destroy,
11
-  .get_defaults = background_filter_defaults,
12
-  .get_properties = background_filter_properties,
13
-  .update = background_filter_update,
14
-  .activate = background_filter_activate,
15
-  .deactivate = background_filter_deactivate,
16
-  .video_tick = background_filter_video_tick,
17
-  .video_render = background_filter_video_render,
18
+   .id = "background_removal",
19
+   .type = OBS_SOURCE_TYPE_FILTER,
20
+   .output_flags = OBS_SOURCE_VIDEO,
21
+   .get_name = background_filter_getname,
22
+   .create = background_filter_create,
23
+   .destroy = background_filter_destroy,
24
+   .get_defaults = background_filter_defaults,
25
+   .get_properties = background_filter_properties,
26
+   .update = background_filter_update,
27
+   .activate = background_filter_activate,
28
+   .deactivate = background_filter_deactivate,
29
+   .video_tick = background_filter_video_tick,
30
+   .video_render = background_filter_video_render,
31
 };
32
obs-backgroundremoval-1.0.3.tar.gz/src/background-filter.cpp -> obs-backgroundremoval-1.1.5.tar.gz/src/background-filter.cpp Changed
201
 
1
@@ -15,467 +15,611 @@
2
 #include <new>
3
 #include <mutex>
4
 
5
-#include "plugin-macros.generated.h"
6
+#include <plugin-support.h>
7
 #include "models/ModelSINET.h"
8
 #include "models/ModelMediapipe.h"
9
 #include "models/ModelSelfie.h"
10
 #include "models/ModelRVM.h"
11
 #include "models/ModelPPHumanSeg.h"
12
+#include "models/ModelTCMonoDepth.h"
13
 #include "FilterData.h"
14
 #include "ort-utils/ort-session-utils.h"
15
 #include "obs-utils/obs-utils.h"
16
 #include "consts.h"
17
 
18
 struct background_removal_filter : public filter_data {
19
-  bool enableThreshold = true;
20
-  float threshold = 0.5f;
21
-  cv::Scalar backgroundColor{0, 0, 0, 0};
22
-  float contourFilter = 0.05f;
23
-  float smoothContour = 0.5f;
24
-  float feather = 0.0f;
25
-
26
-  cv::Mat backgroundMask;
27
-  int maskEveryXFrames = 1;
28
-  int maskEveryXFramesCount = 0;
29
-  int64_t blurBackground = 0;
30
-
31
-  gs_effect_t *effect;
32
-  gs_effect_t *kawaseBlurEffect;
33
+   bool enableThreshold = true;
34
+   float threshold = 0.5f;
35
+   cv::Scalar backgroundColor{0, 0, 0, 0};
36
+   float contourFilter = 0.05f;
37
+   float smoothContour = 0.5f;
38
+   float feather = 0.0f;
39
+
40
+   cv::Mat backgroundMask;
41
+   int maskEveryXFrames = 1;
42
+   int maskEveryXFramesCount = 0;
43
+   int64_t blurBackground = 0;
44
+   bool enableFocalBlur = true;
45
+   float blurFocusPoint = 0.1f;
46
+   float blurFocusDepth = 0.1f;
47
+
48
+   gs_effect_t *effect;
49
+   gs_effect_t *kawaseBlurEffect;
50
 };
51
 
52
 const char *background_filter_getname(void *unused)
53
 {
54
-  UNUSED_PARAMETER(unused);
55
-  return obs_module_text("BackgroundRemoval");
56
+   UNUSED_PARAMETER(unused);
57
+   return obs_module_text("BackgroundRemoval");
58
 }
59
 
60
 /**                   PROPERTIES                     */
61
 
62
 static bool enable_threshold_modified(obs_properties_t *ppts, obs_property_t *p,
63
-                                      obs_data_t *settings)
64
+                     obs_data_t *settings)
65
 {
66
-  const bool enabled = obs_data_get_bool(settings, "enable_threshold");
67
-  p = obs_properties_get(ppts, "threshold");
68
-  obs_property_set_visible(p, enabled);
69
-  p = obs_properties_get(ppts, "contour_filter");
70
-  obs_property_set_visible(p, enabled);
71
-  p = obs_properties_get(ppts, "smooth_contour");
72
-  obs_property_set_visible(p, enabled);
73
-  p = obs_properties_get(ppts, "feather");
74
-  obs_property_set_visible(p, enabled);
75
-
76
-  return true;
77
+   const bool enabled = obs_data_get_bool(settings, "enable_threshold");
78
+   p = obs_properties_get(ppts, "threshold");
79
+   obs_property_set_visible(p, enabled);
80
+   p = obs_properties_get(ppts, "contour_filter");
81
+   obs_property_set_visible(p, enabled);
82
+   p = obs_properties_get(ppts, "smooth_contour");
83
+   obs_property_set_visible(p, enabled);
84
+   p = obs_properties_get(ppts, "feather");
85
+   obs_property_set_visible(p, enabled);
86
+
87
+   return true;
88
 }
89
 
90
 obs_properties_t *background_filter_properties(void *data)
91
 {
92
-  obs_properties_t *props = obs_properties_create();
93
-
94
-  obs_property_t *p =
95
-    obs_properties_add_bool(props, "enable_threshold", obs_module_text("EnableThreshold"));
96
-  obs_property_set_modified_callback(p, enable_threshold_modified);
97
-
98
-  obs_properties_add_float_slider(props, "threshold", obs_module_text("Threshold"), 0.0, 1.0,
99
-                                  0.025);
100
-
101
-  obs_properties_add_float_slider(props, "contour_filter",
102
-                                  obs_module_text("ContourFilterPercentOfImage"), 0.0, 1.0, 0.025);
103
-
104
-  obs_properties_add_float_slider(props, "smooth_contour", obs_module_text("SmoothSilhouette"), 0.0,
105
-                                  1.0, 0.05);
106
-
107
-  obs_properties_add_float_slider(props, "feather", obs_module_text("FeatherBlendSilhouette"), 0.0,
108
-                                  1.0, 0.05);
109
-
110
-  obs_property_t *p_use_gpu = obs_properties_add_list(props, "useGPU",
111
-                                                      obs_module_text("InferenceDevice"),
112
-                                                      OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
113
-
114
-  obs_property_list_add_string(p_use_gpu, obs_module_text("CPU"), USEGPU_CPU);
115
+   obs_properties_t *props = obs_properties_create();
116
+
117
+   /* Threshold props */
118
+   obs_property_t *p_enable_threshold = obs_properties_add_bool(
119
+       props, "enable_threshold", obs_module_text("EnableThreshold"));
120
+   obs_property_set_modified_callback(p_enable_threshold,
121
+                      enable_threshold_modified);
122
+
123
+   obs_properties_add_float_slider(props, "threshold",
124
+                   obs_module_text("Threshold"), 0.0, 1.0,
125
+                   0.025);
126
+
127
+   obs_properties_add_float_slider(
128
+       props, "contour_filter",
129
+       obs_module_text("ContourFilterPercentOfImage"), 0.0, 1.0,
130
+       0.025);
131
+
132
+   obs_properties_add_float_slider(props, "smooth_contour",
133
+                   obs_module_text("SmoothSilhouette"),
134
+                   0.0, 1.0, 0.05);
135
+
136
+   obs_properties_add_float_slider(
137
+       props, "feather", obs_module_text("FeatherBlendSilhouette"),
138
+       0.0, 1.0, 0.05);
139
+
140
+   /* GPU, CPU and performance Props */
141
+   obs_property_t *p_use_gpu = obs_properties_add_list(
142
+       props, "useGPU", obs_module_text("InferenceDevice"),
143
+       OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
144
+
145
+   obs_property_list_add_string(p_use_gpu, obs_module_text("CPU"),
146
+                    USEGPU_CPU);
147
 #if defined(__linux__) && defined(__x86_64__)
148
-  obs_property_list_add_string(p_use_gpu, obs_module_text("GPUTensorRT"), USEGPU_TENSORRT);
149
+   obs_property_list_add_string(p_use_gpu, obs_module_text("GPUTensorRT"),
150
+                    USEGPU_TENSORRT);
151
 #endif
152
 #if _WIN32
153
-  obs_property_list_add_string(p_use_gpu, obs_module_text("GPUDirectML"), USEGPU_DML);
154
+   obs_property_list_add_string(p_use_gpu, obs_module_text("GPUDirectML"),
155
+                    USEGPU_DML);
156
 #endif
157
 #if defined(__APPLE__)
158
-  obs_property_list_add_string(p_use_gpu, obs_module_text("CoreML"), USEGPU_COREML);
159
+   obs_property_list_add_string(p_use_gpu, obs_module_text("CoreML"),
160
+                    USEGPU_COREML);
161
 #endif
162
 
163
-  obs_property_t *p_model_select =
164
-    obs_properties_add_list(props, "model_select", obs_module_text("SegmentationModel"),
165
-                            OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
166
-
167
-  obs_property_list_add_string(p_model_select, obs_module_text("SINet"), MODEL_SINET);
168
-  obs_property_list_add_string(p_model_select, obs_module_text("MediaPipe"), MODEL_MEDIAPIPE);
169
-  obs_property_list_add_string(p_model_select, obs_module_text("Selfie Segmentation"),
170
-                               MODEL_SELFIE);
171
-  obs_property_list_add_string(p_model_select, obs_module_text("PPHumanSeg"), MODEL_PPHUMANSEG);
172
-  obs_property_list_add_string(p_model_select, obs_module_text("Robust Video Matting"), MODEL_RVM);
173
-
174
-  obs_properties_add_int(props, "mask_every_x_frames", obs_module_text("CalculateMaskEveryXFrame"),
175
-                         1, 300, 1);
176
-
177
-  obs_properties_add_int_slider(props, "blur_background",
178
-                                obs_module_text("BlurBackgroundFactor0NoBlurUseColor"), 0, 20, 1);
179
-  obs_properties_add_int_slider(props, "numThreads", obs_module_text("NumThreads"), 0, 8, 1);
180
-
181
-  UNUSED_PARAMETER(data);
182
-  return props;
183
+   obs_properties_add_int(props, "mask_every_x_frames",
184
+                  obs_module_text("CalculateMaskEveryXFrame"), 1,
185
+                  300, 1);
186
+   obs_properties_add_int_slider(props, "numThreads",
187
+                     obs_module_text("NumThreads"), 0, 8, 1);
188
+
189
+   /* Model selection Props */
190
+   obs_property_t *p_model_select = obs_properties_add_list(
191
+       props, "model_select", obs_module_text("SegmentationModel"),
192
+       OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
193
+
194
+   obs_property_list_add_string(p_model_select, obs_module_text("SINet"),
195
+                    MODEL_SINET);
196
+   obs_property_list_add_string(
197
+       p_model_select, obs_module_text("MediaPipe"), MODEL_MEDIAPIPE);
198
+   obs_property_list_add_string(p_model_select,
199
+                    obs_module_text("Selfie Segmentation"),
200
+                    MODEL_SELFIE);
201
obs-backgroundremoval-1.0.3.tar.gz/src/consts.h -> obs-backgroundremoval-1.1.5.tar.gz/src/consts.h Changed
14
 
1
@@ -8,8 +8,11 @@
2
 const char *const MODEL_PPHUMANSEG = "models/pphumanseg_fp32.onnx";
3
 const char *const MODEL_ENHANCE_TBEFN = "models/tbefn_fp32.onnx";
4
 const char *const MODEL_ENHANCE_URETINEX = "models/uretinex_net_180x320.onnx";
5
-const char *const MODEL_ENHANCE_SGLLIE = "models/semantic_guided_llie_180x324.onnx";
6
+const char *const MODEL_ENHANCE_SGLLIE =
7
+   "models/semantic_guided_llie_180x324.onnx";
8
 const char *const MODEL_ENHANCE_ZERODCE = "models/zero_dce_180x320.onnx";
9
+const char *const MODEL_DEPTH_TCMONODEPTH =
10
+   "models/tcmonodepth_tcsmallnet_192x320.onnx";
11
 
12
 const char *const USEGPU_CPU = "cpu";
13
 const char *const USEGPU_DML = "dml";
14
obs-backgroundremoval-1.0.3.tar.gz/src/enhance-filter-info.c -> obs-backgroundremoval-1.1.5.tar.gz/src/enhance-filter-info.c Changed
32
 
1
@@ -1,17 +1,17 @@
2
 #include "enhance-filter.h"
3
 
4
 struct obs_source_info enhance_filter_info = {
5
-  .id = "enhanceportrait",
6
-  .type = OBS_SOURCE_TYPE_FILTER,
7
-  .output_flags = OBS_SOURCE_VIDEO,
8
-  .get_name = enhance_filter_getname,
9
-  .create = enhance_filter_create,
10
-  .destroy = enhance_filter_destroy,
11
-  .get_defaults = enhance_filter_defaults,
12
-  .get_properties = enhance_filter_properties,
13
-  .update = enhance_filter_update,
14
-  .activate = enhance_filter_activate,
15
-  .deactivate = enhance_filter_deactivate,
16
-  .video_tick = enhance_filter_video_tick,
17
-  .video_render = enhance_filter_video_render,
18
+   .id = "enhanceportrait",
19
+   .type = OBS_SOURCE_TYPE_FILTER,
20
+   .output_flags = OBS_SOURCE_VIDEO,
21
+   .get_name = enhance_filter_getname,
22
+   .create = enhance_filter_create,
23
+   .destroy = enhance_filter_destroy,
24
+   .get_defaults = enhance_filter_defaults,
25
+   .get_properties = enhance_filter_properties,
26
+   .update = enhance_filter_update,
27
+   .activate = enhance_filter_activate,
28
+   .deactivate = enhance_filter_deactivate,
29
+   .video_tick = enhance_filter_video_tick,
30
+   .video_render = enhance_filter_video_render,
31
 };
32
obs-backgroundremoval-1.0.3.tar.gz/src/enhance-filter.cpp -> obs-backgroundremoval-1.1.5.tar.gz/src/enhance-filter.cpp Changed
201
 
1
@@ -15,7 +15,7 @@
2
 #include <new>
3
 #include <mutex>
4
 
5
-#include "plugin-macros.generated.h"
6
+#include <plugin-support.h>
7
 #include "consts.h"
8
 #include "obs-utils/obs-utils.h"
9
 #include "ort-utils/ort-session-utils.h"
10
@@ -24,242 +24,267 @@
11
 #include "models/ModelURetinex.h"
12
 
13
 struct enhance_filter : public filter_data {
14
-  cv::Mat outputBGRA;
15
-  gs_effect_t *blendEffect;
16
-  float blendFactor;
17
+   cv::Mat outputBGRA;
18
+   gs_effect_t *blendEffect;
19
+   float blendFactor;
20
 };
21
 
22
 const char *enhance_filter_getname(void *unused)
23
 {
24
-  UNUSED_PARAMETER(unused);
25
-  return obs_module_text("EnhancePortrait");
26
+   UNUSED_PARAMETER(unused);
27
+   return obs_module_text("EnhancePortrait");
28
 }
29
 
30
 obs_properties_t *enhance_filter_properties(void *data)
31
 {
32
-  UNUSED_PARAMETER(data);
33
-  obs_properties_t *props = obs_properties_create();
34
-  obs_properties_add_float_slider(props, "blend", obs_module_text("EffectStrengh"), 0.0, 1.0, 0.05);
35
-  obs_properties_add_int_slider(props, "numThreads", obs_module_text("NumThreads"), 0, 8, 1);
36
-  obs_property_t *p_model_select =
37
-    obs_properties_add_list(props, "model_select", obs_module_text("EnhancementModel"),
38
-                            OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
39
-  obs_property_list_add_string(p_model_select, obs_module_text("TBEFN"), MODEL_ENHANCE_TBEFN);
40
-  obs_property_list_add_string(p_model_select, obs_module_text("URETINEX"), MODEL_ENHANCE_URETINEX);
41
-  obs_property_list_add_string(p_model_select, obs_module_text("SGLLIE"), MODEL_ENHANCE_SGLLIE);
42
-  obs_property_list_add_string(p_model_select, obs_module_text("ZERODCE"), MODEL_ENHANCE_ZERODCE);
43
-  obs_property_t *p_use_gpu = obs_properties_add_list(props, "useGPU",
44
-                                                      obs_module_text("InferenceDevice"),
45
-                                                      OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
46
-  obs_property_list_add_string(p_use_gpu, obs_module_text("CPU"), USEGPU_CPU);
47
+   UNUSED_PARAMETER(data);
48
+   obs_properties_t *props = obs_properties_create();
49
+   obs_properties_add_float_slider(props, "blend",
50
+                   obs_module_text("EffectStrengh"), 0.0,
51
+                   1.0, 0.05);
52
+   obs_properties_add_int_slider(props, "numThreads",
53
+                     obs_module_text("NumThreads"), 0, 8, 1);
54
+   obs_property_t *p_model_select = obs_properties_add_list(
55
+       props, "model_select", obs_module_text("EnhancementModel"),
56
+       OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
57
+   obs_property_list_add_string(p_model_select, obs_module_text("TBEFN"),
58
+                    MODEL_ENHANCE_TBEFN);
59
+   obs_property_list_add_string(p_model_select,
60
+                    obs_module_text("URETINEX"),
61
+                    MODEL_ENHANCE_URETINEX);
62
+   obs_property_list_add_string(p_model_select, obs_module_text("SGLLIE"),
63
+                    MODEL_ENHANCE_SGLLIE);
64
+   obs_property_list_add_string(p_model_select, obs_module_text("ZERODCE"),
65
+                    MODEL_ENHANCE_ZERODCE);
66
+   obs_property_t *p_use_gpu = obs_properties_add_list(
67
+       props, "useGPU", obs_module_text("InferenceDevice"),
68
+       OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
69
+   obs_property_list_add_string(p_use_gpu, obs_module_text("CPU"),
70
+                    USEGPU_CPU);
71
 #ifdef __linux__
72
-  obs_property_list_add_string(p_use_gpu, obs_module_text("GPUTensorRT"), USEGPU_TENSORRT);
73
+   obs_property_list_add_string(p_use_gpu, obs_module_text("GPUTensorRT"),
74
+                    USEGPU_TENSORRT);
75
 #endif
76
 #if _WIN32
77
-  obs_property_list_add_string(p_use_gpu, obs_module_text("GPUDirectML"), USEGPU_DML);
78
+   obs_property_list_add_string(p_use_gpu, obs_module_text("GPUDirectML"),
79
+                    USEGPU_DML);
80
 #endif
81
 #if defined(__APPLE__)
82
-  obs_property_list_add_string(p_use_gpu, obs_module_text("CoreML"), USEGPU_COREML);
83
+   obs_property_list_add_string(p_use_gpu, obs_module_text("CoreML"),
84
+                    USEGPU_COREML);
85
 #endif
86
-  return props;
87
+   return props;
88
 }
89
 
90
 void enhance_filter_defaults(obs_data_t *settings)
91
 {
92
-  obs_data_set_default_double(settings, "blend", 1.0);
93
-  obs_data_set_default_int(settings, "numThreads", 1);
94
-  obs_data_set_default_string(settings, "model_select", MODEL_ENHANCE_TBEFN);
95
+   obs_data_set_default_double(settings, "blend", 1.0);
96
+   obs_data_set_default_int(settings, "numThreads", 1);
97
+   obs_data_set_default_string(settings, "model_select",
98
+                   MODEL_ENHANCE_TBEFN);
99
 #if _WIN32
100
-  obs_data_set_default_string(settings, "useGPU", USEGPU_DML);
101
+   obs_data_set_default_string(settings, "useGPU", USEGPU_DML);
102
 #elif defined(__APPLE__)
103
-  obs_data_set_default_string(settings, "useGPU", USEGPU_CPU);
104
+   obs_data_set_default_string(settings, "useGPU", USEGPU_CPU);
105
 #else
106
-  // Linux
107
-  obs_data_set_default_string(settings, "useGPU", USEGPU_CPU);
108
+   // Linux
109
+   obs_data_set_default_string(settings, "useGPU", USEGPU_CPU);
110
 #endif
111
 }
112
 
113
 void enhance_filter_activate(void *data)
114
 {
115
-  struct enhance_filter *tf = reinterpret_cast<enhance_filter *>(data);
116
-  tf->isDisabled = false;
117
+   struct enhance_filter *tf = reinterpret_cast<enhance_filter *>(data);
118
+   tf->isDisabled = false;
119
 }
120
 
121
 void enhance_filter_deactivate(void *data)
122
 {
123
-  struct enhance_filter *tf = reinterpret_cast<enhance_filter *>(data);
124
-  tf->isDisabled = true;
125
+   struct enhance_filter *tf = reinterpret_cast<enhance_filter *>(data);
126
+   tf->isDisabled = true;
127
 }
128
 
129
 void enhance_filter_update(void *data, obs_data_t *settings)
130
 {
131
-  UNUSED_PARAMETER(settings);
132
-  struct enhance_filter *tf = reinterpret_cast<enhance_filter *>(data);
133
-
134
-  tf->blendFactor = (float)obs_data_get_double(settings, "blend");
135
-  const uint32_t newNumThreads = (uint32_t)obs_data_get_int(settings, "numThreads");
136
-  const std::string newModel = obs_data_get_string(settings, "model_select");
137
-  const std::string newUseGpu = obs_data_get_string(settings, "useGPU");
138
-
139
-  if (tf->modelSelection.empty() || tf->modelSelection != newModel || tf->useGPU != newUseGpu ||
140
-      tf->numThreads != newNumThreads) {
141
-    tf->numThreads = newNumThreads;
142
-    tf->modelSelection = newModel;
143
-    if (tf->modelSelection == MODEL_ENHANCE_TBEFN) {
144
-      tf->model.reset(new ModelTBEFN);
145
-    } else if (tf->modelSelection == MODEL_ENHANCE_ZERODCE) {
146
-      tf->model.reset(new ModelZeroDCE);
147
-    } else if (tf->modelSelection == MODEL_ENHANCE_URETINEX) {
148
-      tf->model.reset(new ModelURetinex);
149
-    } else {
150
-      tf->model.reset(new ModelBCHW);
151
-    }
152
-    tf->useGPU = newUseGpu;
153
-    createOrtSession(tf);
154
-  }
155
-
156
-  if (tf->blendEffect == nullptr) {
157
-    obs_enter_graphics();
158
-
159
-    char *effect_path = obs_module_file(BLEND_EFFECT_PATH);
160
-    gs_effect_destroy(tf->blendEffect);
161
-    tf->blendEffect = gs_effect_create_from_file(effect_path, NULL);
162
-    bfree(effect_path);
163
-
164
-    obs_leave_graphics();
165
-  }
166
+   UNUSED_PARAMETER(settings);
167
+   struct enhance_filter *tf = reinterpret_cast<enhance_filter *>(data);
168
+
169
+   tf->blendFactor = (float)obs_data_get_double(settings, "blend");
170
+   const uint32_t newNumThreads =
171
+       (uint32_t)obs_data_get_int(settings, "numThreads");
172
+   const std::string newModel =
173
+       obs_data_get_string(settings, "model_select");
174
+   const std::string newUseGpu = obs_data_get_string(settings, "useGPU");
175
+
176
+   if (tf->modelSelection.empty() || tf->modelSelection != newModel ||
177
+       tf->useGPU != newUseGpu || tf->numThreads != newNumThreads) {
178
+       tf->numThreads = newNumThreads;
179
+       tf->modelSelection = newModel;
180
+       if (tf->modelSelection == MODEL_ENHANCE_TBEFN) {
181
+           tf->model.reset(new ModelTBEFN);
182
+       } else if (tf->modelSelection == MODEL_ENHANCE_ZERODCE) {
183
+           tf->model.reset(new ModelZeroDCE);
184
+       } else if (tf->modelSelection == MODEL_ENHANCE_URETINEX) {
185
+           tf->model.reset(new ModelURetinex);
186
+       } else {
187
+           tf->model.reset(new ModelBCHW);
188
+       }
189
+       tf->useGPU = newUseGpu;
190
+       createOrtSession(tf);
191
+   }
192
+
193
+   if (tf->blendEffect == nullptr) {
194
+       obs_enter_graphics();
195
+
196
+       char *effect_path = obs_module_file(BLEND_EFFECT_PATH);
197
+       gs_effect_destroy(tf->blendEffect);
198
+       tf->blendEffect = gs_effect_create_from_file(effect_path, NULL);
199
+       bfree(effect_path);
200
+
201
obs-backgroundremoval-1.0.3.tar.gz/src/models/Model.h -> obs-backgroundremoval-1.1.5.tar.gz/src/models/Model.h Changed
201
 
1
@@ -12,28 +12,28 @@
2
 
3
 template<typename T> T vectorProduct(const std::vector<T> &v)
4
 {
5
-  T product = 1;
6
-  for (auto &i : v) {
7
-    // turn 0 or -1, which are usually used as "None" (meaning any size), to 1s
8
-    if (i > 0) {
9
-      product *= i;
10
-    }
11
-  }
12
-  return product;
13
+   T product = 1;
14
+   for (auto &i : v) {
15
+       // turn 0 or -1, which are usually used as "None" (meaning any size), to 1s
16
+       if (i > 0) {
17
+           product *= i;
18
+       }
19
+   }
20
+   return product;
21
 }
22
 
23
 static void hwc_to_chw(cv::InputArray src, cv::OutputArray dst)
24
 {
25
-  std::vector<cv::Mat> channels;
26
-  cv::split(src, channels);
27
+   std::vector<cv::Mat> channels;
28
+   cv::split(src, channels);
29
 
30
-  // Stretch one-channel images to vector
31
-  for (auto &img : channels) {
32
-    img = img.reshape(1, 1);
33
-  }
34
+   // Stretch one-channel images to vector
35
+   for (auto &img : channels) {
36
+       img = img.reshape(1, 1);
37
+   }
38
 
39
-  // Concatenate three vectors to one
40
-  cv::hconcat(channels, dst);
41
+   // Concatenate three vectors to one
42
+   cv::hconcat(channels, dst);
43
 }
44
 
45
 /**
46
@@ -46,25 +46,26 @@
47
 */
48
 static void chw_to_hwc_32f(cv::InputArray src, cv::OutputArray dst)
49
 {
50
-  const cv::Mat srcMat = src.getMat();
51
-  const int channels = srcMat.channels();
52
-  const int height = srcMat.rows;
53
-  const int width = srcMat.cols;
54
-  const int dtype = srcMat.type();
55
-  assert(dtype == CV_32F);
56
-  const int channelStride = height * width;
57
-
58
-  // Flatten to a vector of channels
59
-  cv::Mat flatMat = srcMat.reshape(1, 1);
60
-
61
-  std::vector<cv::Mat> channelsVec(channels);
62
-  // Split the vector into channels
63
-  for (int i = 0; i < channels; i++) {
64
-    channelsVeci =
65
-      cv::Mat(height, width, CV_MAKE_TYPE(dtype, 1), flatMat.ptr<float>(0) + i * channelStride);
66
-  }
67
-
68
-  cv::merge(channelsVec, dst);
69
+   const cv::Mat srcMat = src.getMat();
70
+   const int channels = srcMat.channels();
71
+   const int height = srcMat.rows;
72
+   const int width = srcMat.cols;
73
+   const int dtype = srcMat.type();
74
+   assert(dtype == CV_32F);
75
+   const int channelStride = height * width;
76
+
77
+   // Flatten to a vector of channels
78
+   cv::Mat flatMat = srcMat.reshape(1, 1);
79
+
80
+   std::vector<cv::Mat> channelsVec(channels);
81
+   // Split the vector into channels
82
+   for (int i = 0; i < channels; i++) {
83
+       channelsVeci =
84
+           cv::Mat(height, width, CV_MAKE_TYPE(dtype, 1),
85
+               flatMat.ptr<float>(0) + i * channelStride);
86
+   }
87
+
88
+   cv::merge(channelsVec, dst);
89
 }
90
 
91
 /**
92
@@ -81,250 +82,292 @@
93
   * with different pre-post processing behavior (like BCHW instead of BHWC or different ranges).
94
 */
95
 class Model {
96
-  private:
97
-  /* data */
98
-  public:
99
-  Model(/* args */){};
100
-  virtual ~Model(){};
101
+private:
102
+   /* data */
103
+public:
104
+   Model(/* args */){};
105
+   virtual ~Model(){};
106
 
107
-  const char *name;
108
+   const char *name;
109
 
110
 #if _WIN32
111
-  const std::wstring
112
+   const std::wstring
113
 #else
114
-  const std::string
115
+   const std::string
116
 #endif
117
-  getModelFilepath(const std::string &modelSelection)
118
-  {
119
-    char *modelFilepath_rawPtr = obs_module_file(modelSelection.c_str());
120
+   getModelFilepath(const std::string &modelSelection)
121
+   {
122
+       char *modelFilepath_rawPtr =
123
+           obs_module_file(modelSelection.c_str());
124
 
125
-    if (modelFilepath_rawPtr == nullptr) {
126
-      blog(LOG_ERROR, "Unable to get model filename %s from plugin.", modelSelection.c_str());
127
-      return nullptr;
128
-    }
129
+       if (modelFilepath_rawPtr == nullptr) {
130
+           blog(LOG_ERROR,
131
+                "Unable to get model filename %s from plugin.",
132
+                modelSelection.c_str());
133
+           return nullptr;
134
+       }
135
 
136
-    std::string modelFilepath_s(modelFilepath_rawPtr);
137
-    bfree(modelFilepath_rawPtr);
138
+       std::string modelFilepath_s(modelFilepath_rawPtr);
139
+       bfree(modelFilepath_rawPtr);
140
 
141
 #if _WIN32
142
-    std::wstring modelFilepath_ws(modelFilepath_s.size(), L' ');
143
-    std::copy(modelFilepath_s.begin(), modelFilepath_s.end(), modelFilepath_ws.begin());
144
-    return modelFilepath_ws;
145
+       std::wstring modelFilepath_ws(modelFilepath_s.size(), L' ');
146
+       std::copy(modelFilepath_s.begin(), modelFilepath_s.end(),
147
+             modelFilepath_ws.begin());
148
+       return modelFilepath_ws;
149
 #else
150
-    return modelFilepath_s;
151
+       return modelFilepath_s;
152
 #endif
153
-  }
154
-
155
-  virtual void populateInputOutputNames(const std::unique_ptr<Ort::Session> &session,
156
-                                        std::vector<Ort::AllocatedStringPtr> &inputNames,
157
-                                        std::vector<Ort::AllocatedStringPtr> &outputNames)
158
-  {
159
-    Ort::AllocatorWithDefaultOptions allocator;
160
-
161
-    inputNames.clear();
162
-    outputNames.clear();
163
-    inputNames.push_back(session->GetInputNameAllocated(0, allocator));
164
-    outputNames.push_back(session->GetOutputNameAllocated(0, allocator));
165
-  }
166
-
167
-  virtual bool populateInputOutputShapes(const std::unique_ptr<Ort::Session> &session,
168
-                                         std::vector<std::vector<int64_t>> &inputDims,
169
-                                         std::vector<std::vector<int64_t>> &outputDims)
170
-  {
171
-    // Assuming model only has one input and one output image
172
-
173
-    inputDims.clear();
174
-    outputDims.clear();
175
-
176
-    inputDims.push_back(std::vector<int64_t>());
177
-    outputDims.push_back(std::vector<int64_t>());
178
-
179
-    // Get output shape
180
-    const Ort::TypeInfo outputTypeInfo = session->GetOutputTypeInfo(0);
181
-    const auto outputTensorInfo = outputTypeInfo.GetTensorTypeAndShapeInfo();
182
-    outputDims0 = outputTensorInfo.GetShape();
183
-
184
-    // fix any -1 values in outputDims to 1
185
-    for (auto &i : outputDims0) {
186
-      if (i == -1) {
187
-        i = 1;
188
-      }
189
-    }
190
-
191
-    // Get input shape
192
-    const Ort::TypeInfo inputTypeInfo = session->GetInputTypeInfo(0);
193
-    const auto inputTensorInfo = inputTypeInfo.GetTensorTypeAndShapeInfo();
194
-    inputDims0 = inputTensorInfo.GetShape();
195
-
196
-    // fix any -1 values in inputDims to 1
197
-    for (auto &i : inputDims0) {
198
-      if (i == -1) {
199
-        i = 1;
200
-      }
201
obs-backgroundremoval-1.0.3.tar.gz/src/models/ModelMediapipe.h -> obs-backgroundremoval-1.1.5.tar.gz/src/models/ModelMediapipe.h Changed
54
 
1
@@ -4,30 +4,32 @@
2
 #include "Model.h"
3
 
4
 class ModelMediaPipe : public Model {
5
-  private:
6
-  /* data */
7
-  public:
8
-  ModelMediaPipe(/* args */) {}
9
-  ~ModelMediaPipe() {}
10
+private:
11
+   /* data */
12
+public:
13
+   ModelMediaPipe(/* args */) {}
14
+   ~ModelMediaPipe() {}
15
 
16
-  virtual cv::Mat getNetworkOutput(const std::vector<std::vector<int64_t>> &outputDims,
17
-                                   std::vector<std::vector<float>> &outputTensorValues)
18
-  {
19
-    uint32_t outputWidth = (int)outputDims0.at(2);
20
-    uint32_t outputHeight = (int)outputDims0.at(1);
21
-    int32_t outputChannels = CV_32FC2;
22
+   virtual cv::Mat
23
+   getNetworkOutput(const std::vector<std::vector<int64_t>> &outputDims,
24
+            std::vector<std::vector<float>> &outputTensorValues)
25
+   {
26
+       uint32_t outputWidth = (int)outputDims0.at(2);
27
+       uint32_t outputHeight = (int)outputDims0.at(1);
28
+       int32_t outputChannels = CV_32FC2;
29
 
30
-    return cv::Mat(outputHeight, outputWidth, outputChannels, outputTensorValues0.data());
31
-  }
32
+       return cv::Mat(outputHeight, outputWidth, outputChannels,
33
+                  outputTensorValues0.data());
34
+   }
35
 
36
-  virtual void postprocessOutput(cv::Mat &outputImage)
37
-  {
38
-    // take 2nd channel
39
-    std::vector<cv::Mat> outputImageSplit;
40
-    cv::split(outputImage, outputImageSplit);
41
+   virtual void postprocessOutput(cv::Mat &outputImage)
42
+   {
43
+       // take 2nd channel
44
+       std::vector<cv::Mat> outputImageSplit;
45
+       cv::split(outputImage, outputImageSplit);
46
 
47
-    outputImage = outputImageSplit1;
48
-  }
49
+       outputImage = outputImageSplit1;
50
+   }
51
 };
52
 
53
 #endif // MODELMEDIAPIPE_H
54
obs-backgroundremoval-1.0.3.tar.gz/src/models/ModelPPHumanSeg.h -> obs-backgroundremoval-1.1.5.tar.gz/src/models/ModelPPHumanSeg.h Changed
72
 
1
@@ -4,35 +4,41 @@
2
 #include "Model.h"
3
 
4
 class ModelPPHumanSeg : public ModelBCHW {
5
-  public:
6
-  ModelPPHumanSeg(/* args */) {}
7
-  ~ModelPPHumanSeg() {}
8
-
9
-  virtual void prepareInputToNetwork(cv::Mat &resizedImage, cv::Mat &preprocessedImage)
10
-  {
11
-    resizedImage = (resizedImage / 256.0 - cv::Scalar(0.5, 0.5, 0.5)) / cv::Scalar(0.5, 0.5, 0.5);
12
-
13
-    hwc_to_chw(resizedImage, preprocessedImage);
14
-  }
15
-
16
-  virtual cv::Mat getNetworkOutput(const std::vector<std::vector<int64_t>> &outputDims,
17
-                                   std::vector<std::vector<float>> &outputTensorValues)
18
-  {
19
-    uint32_t outputWidth = (int)outputDims0.at(2);
20
-    uint32_t outputHeight = (int)outputDims0.at(1);
21
-    int32_t outputChannels = CV_32FC2;
22
-
23
-    return cv::Mat(outputHeight, outputWidth, outputChannels, outputTensorValues0.data());
24
-  }
25
-
26
-  virtual void postprocessOutput(cv::Mat &outputImage)
27
-  {
28
-    // take 1st channel
29
-    std::vector<cv::Mat> outputImageSplit;
30
-    cv::split(outputImage, outputImageSplit);
31
-
32
-    cv::normalize(outputImageSplit1, outputImage, 1.0, 0.0, cv::NORM_MINMAX);
33
-  }
34
+public:
35
+   ModelPPHumanSeg(/* args */) {}
36
+   ~ModelPPHumanSeg() {}
37
+
38
+   virtual void prepareInputToNetwork(cv::Mat &resizedImage,
39
+                      cv::Mat &preprocessedImage)
40
+   {
41
+       resizedImage =
42
+           (resizedImage / 256.0 - cv::Scalar(0.5, 0.5, 0.5)) /
43
+           cv::Scalar(0.5, 0.5, 0.5);
44
+
45
+       hwc_to_chw(resizedImage, preprocessedImage);
46
+   }
47
+
48
+   virtual cv::Mat
49
+   getNetworkOutput(const std::vector<std::vector<int64_t>> &outputDims,
50
+            std::vector<std::vector<float>> &outputTensorValues)
51
+   {
52
+       uint32_t outputWidth = (int)outputDims0.at(2);
53
+       uint32_t outputHeight = (int)outputDims0.at(1);
54
+       int32_t outputChannels = CV_32FC2;
55
+
56
+       return cv::Mat(outputHeight, outputWidth, outputChannels,
57
+                  outputTensorValues0.data());
58
+   }
59
+
60
+   virtual void postprocessOutput(cv::Mat &outputImage)
61
+   {
62
+       // take 1st channel
63
+       std::vector<cv::Mat> outputImageSplit;
64
+       cv::split(outputImage, outputImageSplit);
65
+
66
+       cv::normalize(outputImageSplit1, outputImage, 1.0, 0.0,
67
+                 cv::NORM_MINMAX);
68
+   }
69
 };
70
 
71
 #endif // MODELPPHUMANSEG_H
72
obs-backgroundremoval-1.0.3.tar.gz/src/models/ModelRVM.h -> obs-backgroundremoval-1.1.5.tar.gz/src/models/ModelRVM.h Changed
175
 
1
@@ -4,87 +4,103 @@
2
 #include "Model.h"
3
 
4
 class ModelRVM : public ModelBCHW {
5
-  private:
6
-  /* data */
7
-  public:
8
-  ModelRVM(/* args */) {}
9
-  ~ModelRVM() {}
10
+private:
11
+   /* data */
12
+public:
13
+   ModelRVM(/* args */) {}
14
+   ~ModelRVM() {}
15
 
16
-  virtual void populateInputOutputNames(const std::unique_ptr<Ort::Session> &session,
17
-                                        std::vector<Ort::AllocatedStringPtr> &inputNames,
18
-                                        std::vector<Ort::AllocatedStringPtr> &outputNames)
19
-  {
20
-    Ort::AllocatorWithDefaultOptions allocator;
21
+   virtual void populateInputOutputNames(
22
+       const std::unique_ptr<Ort::Session> &session,
23
+       std::vector<Ort::AllocatedStringPtr> &inputNames,
24
+       std::vector<Ort::AllocatedStringPtr> &outputNames)
25
+   {
26
+       Ort::AllocatorWithDefaultOptions allocator;
27
 
28
-    inputNames.clear();
29
-    outputNames.clear();
30
+       inputNames.clear();
31
+       outputNames.clear();
32
 
33
-    for (size_t i = 0; i < session->GetInputCount(); i++) {
34
-      inputNames.push_back(session->GetInputNameAllocated(i, allocator));
35
-    }
36
-    for (size_t i = 1; i < session->GetOutputCount(); i++) {
37
-      outputNames.push_back(session->GetOutputNameAllocated(i, allocator));
38
-    }
39
-  }
40
+       for (size_t i = 0; i < session->GetInputCount(); i++) {
41
+           inputNames.push_back(
42
+               session->GetInputNameAllocated(i, allocator));
43
+       }
44
+       for (size_t i = 1; i < session->GetOutputCount(); i++) {
45
+           outputNames.push_back(
46
+               session->GetOutputNameAllocated(i, allocator));
47
+       }
48
+   }
49
 
50
-  virtual bool populateInputOutputShapes(const std::unique_ptr<Ort::Session> &session,
51
-                                         std::vector<std::vector<int64_t>> &inputDims,
52
-                                         std::vector<std::vector<int64_t>> &outputDims)
53
-  {
54
-    // Assuming model only has one input and one output image
55
+   virtual bool
56
+   populateInputOutputShapes(const std::unique_ptr<Ort::Session> &session,
57
+                 std::vector<std::vector<int64_t>> &inputDims,
58
+                 std::vector<std::vector<int64_t>> &outputDims)
59
+   {
60
+       // Assuming model only has one input and one output image
61
 
62
-    inputDims.clear();
63
-    outputDims.clear();
64
+       inputDims.clear();
65
+       outputDims.clear();
66
 
67
-    for (size_t i = 0; i < session->GetInputCount(); i++) {
68
-      // Get input shape
69
-      const Ort::TypeInfo inputTypeInfo = session->GetInputTypeInfo(i);
70
-      const auto inputTensorInfo = inputTypeInfo.GetTensorTypeAndShapeInfo();
71
-      inputDims.push_back(inputTensorInfo.GetShape());
72
-    }
73
+       for (size_t i = 0; i < session->GetInputCount(); i++) {
74
+           // Get input shape
75
+           const Ort::TypeInfo inputTypeInfo =
76
+               session->GetInputTypeInfo(i);
77
+           const auto inputTensorInfo =
78
+               inputTypeInfo.GetTensorTypeAndShapeInfo();
79
+           inputDims.push_back(inputTensorInfo.GetShape());
80
+       }
81
 
82
-    for (size_t i = 1; i < session->GetOutputCount(); i++) {
83
-      // Get output shape
84
-      const Ort::TypeInfo outputTypeInfo = session->GetOutputTypeInfo(i);
85
-      const auto outputTensorInfo = outputTypeInfo.GetTensorTypeAndShapeInfo();
86
-      outputDims.push_back(outputTensorInfo.GetShape());
87
-    }
88
+       for (size_t i = 1; i < session->GetOutputCount(); i++) {
89
+           // Get output shape
90
+           const Ort::TypeInfo outputTypeInfo =
91
+               session->GetOutputTypeInfo(i);
92
+           const auto outputTensorInfo =
93
+               outputTypeInfo.GetTensorTypeAndShapeInfo();
94
+           outputDims.push_back(outputTensorInfo.GetShape());
95
+       }
96
 
97
-    inputDims00 = 1;
98
-    inputDims02 = 192;
99
-    inputDims03 = 192;
100
-    for (size_t i = 1; i < 5; i++) {
101
-      inputDimsi0 = 1;
102
-      inputDimsi1 = (i == 1) ? 16 : (i == 2) ? 20 : (i == 3) ? 40 : 64;
103
-      inputDimsi2 = 192 / (2 << (i - 1));
104
-      inputDimsi3 = 192 / (2 << (i - 1));
105
-    }
106
+       inputDims00 = 1;
107
+       inputDims02 = 192;
108
+       inputDims03 = 192;
109
+       for (size_t i = 1; i < 5; i++) {
110
+           inputDimsi0 = 1;
111
+           inputDimsi1 = (i == 1)   ? 16
112
+                     : (i == 2) ? 20
113
+                     : (i == 3) ? 40
114
+                            : 64;
115
+           inputDimsi2 = 192 / (2 << (i - 1));
116
+           inputDimsi3 = 192 / (2 << (i - 1));
117
+       }
118
 
119
-    outputDims00 = 1;
120
-    outputDims02 = 192;
121
-    outputDims03 = 192;
122
-    for (size_t i = 1; i < 5; i++) {
123
-      outputDimsi0 = 1;
124
-      outputDimsi2 = 192 / (2 << (i - 1));
125
-      outputDimsi3 = 192 / (2 << (i - 1));
126
-    }
127
-    return true;
128
-  }
129
+       outputDims00 = 1;
130
+       outputDims02 = 192;
131
+       outputDims03 = 192;
132
+       for (size_t i = 1; i < 5; i++) {
133
+           outputDimsi0 = 1;
134
+           outputDimsi2 = 192 / (2 << (i - 1));
135
+           outputDimsi3 = 192 / (2 << (i - 1));
136
+       }
137
+       return true;
138
+   }
139
 
140
-  virtual void loadInputToTensor(const cv::Mat &preprocessedImage, uint32_t, uint32_t,
141
-                                 std::vector<std::vector<float>> &inputTensorValues)
142
-  {
143
-    inputTensorValues0.assign(preprocessedImage.begin<float>(), preprocessedImage.end<float>());
144
-    inputTensorValues50 = 1.0f;
145
-  }
146
+   virtual void
147
+   loadInputToTensor(const cv::Mat &preprocessedImage, uint32_t, uint32_t,
148
+             std::vector<std::vector<float>> &inputTensorValues)
149
+   {
150
+       inputTensorValues0.assign(preprocessedImage.begin<float>(),
151
+                       preprocessedImage.end<float>());
152
+       inputTensorValues50 = 1.0f;
153
+   }
154
 
155
-  virtual void assignOutputToInput(std::vector<std::vector<float>> &outputTensorValues,
156
-                                   std::vector<std::vector<float>> &inputTensorValues)
157
-  {
158
-    for (size_t i = 1; i < 5; i++) {
159
-      inputTensorValuesi.assign(outputTensorValuesi.begin(), outputTensorValuesi.end());
160
-    }
161
-  }
162
+   virtual void
163
+   assignOutputToInput(std::vector<std::vector<float>> &outputTensorValues,
164
+               std::vector<std::vector<float>> &inputTensorValues)
165
+   {
166
+       for (size_t i = 1; i < 5; i++) {
167
+           inputTensorValuesi.assign(
168
+               outputTensorValuesi.begin(),
169
+               outputTensorValuesi.end());
170
+       }
171
+   }
172
 };
173
 
174
 #endif /* MODELRVM_H */
175
obs-backgroundremoval-1.0.3.tar.gz/src/models/ModelSINET.h -> obs-backgroundremoval-1.1.5.tar.gz/src/models/ModelSINET.h Changed
64
 
1
@@ -4,33 +4,38 @@
2
 #include "Model.h"
3
 
4
 class ModelSINET : public ModelBCHW {
5
-  public:
6
-  ModelSINET(/* args */) {}
7
-  ~ModelSINET() {}
8
+public:
9
+   ModelSINET(/* args */) {}
10
+   ~ModelSINET() {}
11
 
12
-  virtual void prepareInputToNetwork(cv::Mat &resizedImage, cv::Mat &preprocessedImage)
13
-  {
14
-    resizedImage = (resizedImage - cv::Scalar(102.890434, 111.25247, 126.91212)) /
15
-                   cv::Scalar(62.93292 * 255.0, 62.82138 * 255.0, 66.355705 * 255.0);
16
-    hwc_to_chw(resizedImage, preprocessedImage);
17
-  }
18
+   virtual void prepareInputToNetwork(cv::Mat &resizedImage,
19
+                      cv::Mat &preprocessedImage)
20
+   {
21
+       resizedImage = (resizedImage -
22
+               cv::Scalar(102.890434, 111.25247, 126.91212)) /
23
+                  cv::Scalar(62.93292 * 255.0, 62.82138 * 255.0,
24
+                     66.355705 * 255.0);
25
+       hwc_to_chw(resizedImage, preprocessedImage);
26
+   }
27
 
28
-  virtual cv::Mat getNetworkOutput(const std::vector<std::vector<int64_t>> &outputDims,
29
-                                   std::vector<std::vector<float>> &outputTensorValues)
30
-  {
31
-    UNUSED_PARAMETER(outputDims);
32
-    return cv::Mat(320, 320, CV_32FC2, outputTensorValues0.data());
33
-  }
34
+   virtual cv::Mat
35
+   getNetworkOutput(const std::vector<std::vector<int64_t>> &outputDims,
36
+            std::vector<std::vector<float>> &outputTensorValues)
37
+   {
38
+       UNUSED_PARAMETER(outputDims);
39
+       return cv::Mat(320, 320, CV_32FC2,
40
+                  outputTensorValues0.data());
41
+   }
42
 
43
-  virtual void postprocessOutput(cv::Mat &outputImage)
44
-  {
45
-    cv::Mat outputTransposed;
46
-    chw_to_hwc_32f(outputImage, outputTransposed);
47
-    // take 2nd channel
48
-    std::vector<cv::Mat> outputImageSplit;
49
-    cv::split(outputTransposed, outputImageSplit);
50
-    outputImage = outputImageSplit1;
51
-  }
52
+   virtual void postprocessOutput(cv::Mat &outputImage)
53
+   {
54
+       cv::Mat outputTransposed;
55
+       chw_to_hwc_32f(outputImage, outputTransposed);
56
+       // take 2nd channel
57
+       std::vector<cv::Mat> outputImageSplit;
58
+       cv::split(outputTransposed, outputImageSplit);
59
+       outputImage = outputImageSplit1;
60
+   }
61
 };
62
 
63
 #endif // MODELSINET_H
64
obs-backgroundremoval-1.0.3.tar.gz/src/models/ModelSelfie.h -> obs-backgroundremoval-1.1.5.tar.gz/src/models/ModelSelfie.h Changed
28
 
1
@@ -4,16 +4,17 @@
2
 #include "Model.h"
3
 
4
 class ModelSelfie : public Model {
5
-  private:
6
-  /* data */
7
-  public:
8
-  ModelSelfie(/* args */) {}
9
-  ~ModelSelfie() {}
10
+private:
11
+   /* data */
12
+public:
13
+   ModelSelfie(/* args */) {}
14
+   ~ModelSelfie() {}
15
 
16
-  virtual void postprocessOutput(cv::Mat &outputImage)
17
-  {
18
-    cv::normalize(outputImage, outputImage, 1.0, 0.0, cv::NORM_MINMAX);
19
-  }
20
+   virtual void postprocessOutput(cv::Mat &outputImage)
21
+   {
22
+       cv::normalize(outputImage, outputImage, 1.0, 0.0,
23
+                 cv::NORM_MINMAX);
24
+   }
25
 };
26
 
27
 #endif // MODELSELFIE_H
28
obs-backgroundremoval-1.0.3.tar.gz/src/models/ModelTBEFN.h -> obs-backgroundremoval-1.1.5.tar.gz/src/models/ModelTBEFN.h Changed
43
 
1
@@ -4,23 +4,26 @@
2
 #include "Model.h"
3
 
4
 class ModelTBEFN : public ModelBCHW {
5
-  public:
6
-  virtual void postprocessOutput(cv::Mat &output)
7
-  {
8
-    // output is already BHWC ...
9
-    output = output * 255.0; // Convert to 0-255 range
10
-  }
11
+public:
12
+   virtual void postprocessOutput(cv::Mat &output)
13
+   {
14
+       // output is already BHWC ...
15
+       output = output * 255.0; // Convert to 0-255 range
16
+   }
17
 
18
-  virtual cv::Mat getNetworkOutput(const std::vector<std::vector<int64_t>> &outputDims,
19
-                                   std::vector<std::vector<float>> &outputTensorValues)
20
-  {
21
-    // BHWC
22
-    uint32_t outputWidth = (int)outputDims0.at(2);
23
-    uint32_t outputHeight = (int)outputDims0.at(1);
24
-    int32_t outputChannels = CV_MAKE_TYPE(CV_32F, (int)outputDims0.at(3));
25
+   virtual cv::Mat
26
+   getNetworkOutput(const std::vector<std::vector<int64_t>> &outputDims,
27
+            std::vector<std::vector<float>> &outputTensorValues)
28
+   {
29
+       // BHWC
30
+       uint32_t outputWidth = (int)outputDims0.at(2);
31
+       uint32_t outputHeight = (int)outputDims0.at(1);
32
+       int32_t outputChannels =
33
+           CV_MAKE_TYPE(CV_32F, (int)outputDims0.at(3));
34
 
35
-    return cv::Mat(outputHeight, outputWidth, outputChannels, outputTensorValues0.data());
36
-  }
37
+       return cv::Mat(outputHeight, outputWidth, outputChannels,
38
+                  outputTensorValues0.data());
39
+   }
40
 };
41
 
42
 #endif /* MODELTBEFN_H */
43
obs-backgroundremoval-1.1.5.tar.gz/src/models/ModelTCMonoDepth.h Added
30
 
1
@@ -0,0 +1,28 @@
2
+#ifndef MODELTCMONODEPTH_H
3
+#define MODELTCMONODEPTH_H
4
+
5
+#include "Model.h"
6
+
7
+class ModelTCMonoDepth : public ModelBCHW {
8
+private:
9
+   /* data */
10
+public:
11
+   ModelTCMonoDepth(/* args */) {}
12
+   ~ModelTCMonoDepth() {}
13
+
14
+   virtual void prepareInputToNetwork(cv::Mat &resizedImage,
15
+                      cv::Mat &preprocessedImage)
16
+   {
17
+       // Do not normalize from 0, 255 to 0, 1.
18
+
19
+       hwc_to_chw(resizedImage, preprocessedImage);
20
+   }
21
+
22
+   virtual void postprocessOutput(cv::Mat &outputImage)
23
+   {
24
+       cv::normalize(outputImage, outputImage, 1.0, 0.0,
25
+                 cv::NORM_MINMAX);
26
+   }
27
+};
28
+
29
+#endif // MODELTCMONODEPTH_H
30
obs-backgroundremoval-1.0.3.tar.gz/src/models/ModelURetinex.h -> obs-backgroundremoval-1.1.5.tar.gz/src/models/ModelURetinex.h Changed
118
 
1
@@ -4,56 +4,66 @@
2
 #include "Model.h"
3
 
4
 class ModelURetinex : public ModelBCHW {
5
-  public:
6
-  virtual void populateInputOutputNames(const std::unique_ptr<Ort::Session> &session,
7
-                                        std::vector<Ort::AllocatedStringPtr> &inputNames,
8
-                                        std::vector<Ort::AllocatedStringPtr> &outputNames)
9
-  {
10
-    Ort::AllocatorWithDefaultOptions allocator;
11
-
12
-    inputNames.clear();
13
-    outputNames.clear();
14
-
15
-    for (size_t i = 0; i < session->GetInputCount(); i++) {
16
-      inputNames.push_back(session->GetInputNameAllocated(i, allocator));
17
-    }
18
-    for (size_t i = 0; i < session->GetOutputCount(); i++) {
19
-      outputNames.push_back(session->GetOutputNameAllocated(i, allocator));
20
-    }
21
-  }
22
-
23
-  virtual bool populateInputOutputShapes(const std::unique_ptr<Ort::Session> &session,
24
-                                         std::vector<std::vector<int64_t>> &inputDims,
25
-                                         std::vector<std::vector<int64_t>> &outputDims)
26
-  {
27
-    // Assuming model only has one input and one output image
28
-
29
-    inputDims.clear();
30
-    outputDims.clear();
31
-
32
-    for (size_t i = 0; i < session->GetInputCount(); i++) {
33
-      // Get input shape
34
-      const Ort::TypeInfo inputTypeInfo = session->GetInputTypeInfo(i);
35
-      const auto inputTensorInfo = inputTypeInfo.GetTensorTypeAndShapeInfo();
36
-      inputDims.push_back(inputTensorInfo.GetShape());
37
-    }
38
-
39
-    for (size_t i = 0; i < session->GetOutputCount(); i++) {
40
-      // Get output shape
41
-      const Ort::TypeInfo outputTypeInfo = session->GetOutputTypeInfo(i);
42
-      const auto outputTensorInfo = outputTypeInfo.GetTensorTypeAndShapeInfo();
43
-      outputDims.push_back(outputTensorInfo.GetShape());
44
-    }
45
-
46
-    return true;
47
-  }
48
-
49
-  virtual void loadInputToTensor(const cv::Mat &preprocessedImage, uint32_t, uint32_t,
50
-                                 std::vector<std::vector<float>> &inputTensorValues)
51
-  {
52
-    inputTensorValues0.assign(preprocessedImage.begin<float>(), preprocessedImage.end<float>());
53
-    inputTensorValues10 = 5.0f;
54
-  }
55
+public:
56
+   virtual void populateInputOutputNames(
57
+       const std::unique_ptr<Ort::Session> &session,
58
+       std::vector<Ort::AllocatedStringPtr> &inputNames,
59
+       std::vector<Ort::AllocatedStringPtr> &outputNames)
60
+   {
61
+       Ort::AllocatorWithDefaultOptions allocator;
62
+
63
+       inputNames.clear();
64
+       outputNames.clear();
65
+
66
+       for (size_t i = 0; i < session->GetInputCount(); i++) {
67
+           inputNames.push_back(
68
+               session->GetInputNameAllocated(i, allocator));
69
+       }
70
+       for (size_t i = 0; i < session->GetOutputCount(); i++) {
71
+           outputNames.push_back(
72
+               session->GetOutputNameAllocated(i, allocator));
73
+       }
74
+   }
75
+
76
+   virtual bool
77
+   populateInputOutputShapes(const std::unique_ptr<Ort::Session> &session,
78
+                 std::vector<std::vector<int64_t>> &inputDims,
79
+                 std::vector<std::vector<int64_t>> &outputDims)
80
+   {
81
+       // Assuming model only has one input and one output image
82
+
83
+       inputDims.clear();
84
+       outputDims.clear();
85
+
86
+       for (size_t i = 0; i < session->GetInputCount(); i++) {
87
+           // Get input shape
88
+           const Ort::TypeInfo inputTypeInfo =
89
+               session->GetInputTypeInfo(i);
90
+           const auto inputTensorInfo =
91
+               inputTypeInfo.GetTensorTypeAndShapeInfo();
92
+           inputDims.push_back(inputTensorInfo.GetShape());
93
+       }
94
+
95
+       for (size_t i = 0; i < session->GetOutputCount(); i++) {
96
+           // Get output shape
97
+           const Ort::TypeInfo outputTypeInfo =
98
+               session->GetOutputTypeInfo(i);
99
+           const auto outputTensorInfo =
100
+               outputTypeInfo.GetTensorTypeAndShapeInfo();
101
+           outputDims.push_back(outputTensorInfo.GetShape());
102
+       }
103
+
104
+       return true;
105
+   }
106
+
107
+   virtual void
108
+   loadInputToTensor(const cv::Mat &preprocessedImage, uint32_t, uint32_t,
109
+             std::vector<std::vector<float>> &inputTensorValues)
110
+   {
111
+       inputTensorValues0.assign(preprocessedImage.begin<float>(),
112
+                       preprocessedImage.end<float>());
113
+       inputTensorValues10 = 5.0f;
114
+   }
115
 };
116
 
117
 #endif /* MODELURETINEX_H */
118
obs-backgroundremoval-1.0.3.tar.gz/src/models/ModelZeroDCE.h -> obs-backgroundremoval-1.1.5.tar.gz/src/models/ModelZeroDCE.h Changed
43
 
1
@@ -4,23 +4,26 @@
2
 #include "Model.h"
3
 
4
 class ModelZeroDCE : public ModelBCHW {
5
-  public:
6
-  virtual void postprocessOutput(cv::Mat &output)
7
-  {
8
-    UNUSED_PARAMETER(output);
9
-    // output is already BHWC and 0-255... nothing to do
10
-  }
11
+public:
12
+   virtual void postprocessOutput(cv::Mat &output)
13
+   {
14
+       UNUSED_PARAMETER(output);
15
+       // output is already BHWC and 0-255... nothing to do
16
+   }
17
 
18
-  virtual cv::Mat getNetworkOutput(const std::vector<std::vector<int64_t>> &outputDims,
19
-                                   std::vector<std::vector<float>> &outputTensorValues)
20
-  {
21
-    // BHWC
22
-    uint32_t outputWidth = (int)outputDims0.at(1);
23
-    uint32_t outputHeight = (int)outputDims0.at(0);
24
-    int32_t outputChannels = CV_MAKE_TYPE(CV_32F, (int)outputDims0.at(2));
25
+   virtual cv::Mat
26
+   getNetworkOutput(const std::vector<std::vector<int64_t>> &outputDims,
27
+            std::vector<std::vector<float>> &outputTensorValues)
28
+   {
29
+       // BHWC
30
+       uint32_t outputWidth = (int)outputDims0.at(1);
31
+       uint32_t outputHeight = (int)outputDims0.at(0);
32
+       int32_t outputChannels =
33
+           CV_MAKE_TYPE(CV_32F, (int)outputDims0.at(2));
34
 
35
-    return cv::Mat(outputHeight, outputWidth, outputChannels, outputTensorValues0.data());
36
-  }
37
+       return cv::Mat(outputHeight, outputWidth, outputChannels,
38
+                  outputTensorValues0.data());
39
+   }
40
 };
41
 
42
 #endif /* MODELZERODCE_H */
43
obs-backgroundremoval-1.1.5.tar.gz/src/obs-utils/obs-config-utils.cpp Added
51
 
1
@@ -0,0 +1,49 @@
2
+#include "obs-config-utils.h"
3
+
4
+#include <obs-module.h>
5
+
6
+int getFlagFromConfig(const char *name, bool *returnValue)
7
+{
8
+   // Check configuration to see if update checks are disabled
9
+   char *config_file = obs_module_file("config.json");
10
+   if (!config_file) {
11
+       blog(LOG_INFO, "Unable to find config file");
12
+       return OBS_BGREMOVAL_CONFIG_FAIL;
13
+   }
14
+
15
+   obs_data_t *data = obs_data_create_from_json_file(config_file);
16
+   if (!data) {
17
+       blog(LOG_INFO, "Failed to parse config file");
18
+       return OBS_BGREMOVAL_CONFIG_FAIL;
19
+   }
20
+
21
+   *returnValue = obs_data_get_bool(data, name);
22
+   obs_data_release(data);
23
+
24
+   return OBS_BGREMOVAL_CONFIG_SUCCESS;
25
+}
26
+
27
+int setFlagFromConfig(const char *name, const bool value)
28
+{
29
+   // Get the config file
30
+   char *config_file = obs_module_file("config.json");
31
+   if (!config_file) {
32
+       blog(LOG_INFO, "Unable to find config file");
33
+       return OBS_BGREMOVAL_CONFIG_FAIL;
34
+   }
35
+
36
+   // Parse the config file
37
+   obs_data_t *json_data = obs_data_create_from_json_file(config_file);
38
+   if (!json_data) {
39
+       blog(LOG_INFO, "Failed to parse config file");
40
+       return OBS_BGREMOVAL_CONFIG_FAIL;
41
+   }
42
+
43
+   // Update the config
44
+   obs_data_set_bool(json_data, name, value);
45
+   obs_data_save_json(json_data, config_file);
46
+
47
+   obs_data_release(json_data);
48
+
49
+   return OBS_BGREMOVAL_CONFIG_SUCCESS;
50
+}
51
obs-backgroundremoval-1.1.5.tar.gz/src/obs-utils/obs-config-utils.h Added
31
 
1
@@ -0,0 +1,29 @@
2
+#ifndef OBS_CONFIG_UTILS_H
3
+#define OBS_CONFIG_UTILS_H
4
+
5
+enum {
6
+   OBS_BGREMOVAL_CONFIG_SUCCESS = 0,
7
+   OBS_BGREMOVAL_CONFIG_FAIL = 1,
8
+};
9
+
10
+/**
11
+ * Get a boolean flasg from the module configuration file.
12
+ *
13
+ * @param name The name of the config item.
14
+ * @param returnValue The value of the config item.
15
+ * @return OBS_BGREMOVAL_CONFIG_SUCCESS if the config item was found,
16
+ * OBS_BGREMOVAL_CONFIG_FAIL otherwise.
17
+ */
18
+int getFlagFromConfig(const char *name, bool *returnValue);
19
+
20
+/**
21
+ * Set a boolean flag in the module configuration file.
22
+ *
23
+ * @param name The name of the config item.
24
+ * @param value The value of the config item.
25
+ * @return OBS_BGREMOVAL_CONFIG_SUCCESS if the config item was found,
26
+ * OBS_BGREMOVAL_CONFIG_FAIL otherwise.
27
+ */
28
+int setFlagFromConfig(const char *name, const bool value);
29
+
30
+#endif /* OBS_CONFIG_UTILS_H */
31
obs-backgroundremoval-1.0.3.tar.gz/src/obs-utils/obs-utils.cpp -> obs-backgroundremoval-1.1.5.tar.gz/src/obs-utils/obs-utils.cpp Changed
110
 
1
@@ -14,54 +14,60 @@
2
 bool getRGBAFromStageSurface(filter_data *tf, uint32_t &width, uint32_t &height)
3
 {
4
 
5
-  if (!obs_source_enabled(tf->source)) {
6
-    return false;
7
-  }
8
+   if (!obs_source_enabled(tf->source)) {
9
+       return false;
10
+   }
11
 
12
-  obs_source_t *target = obs_filter_get_target(tf->source);
13
-  if (!target) {
14
-    return false;
15
-  }
16
-  width = obs_source_get_base_width(target);
17
-  height = obs_source_get_base_height(target);
18
-  if (width == 0 || height == 0) {
19
-    return false;
20
-  }
21
-  gs_texrender_reset(tf->texrender);
22
-  if (!gs_texrender_begin(tf->texrender, width, height)) {
23
-    return false;
24
-  }
25
-  struct vec4 background;
26
-  vec4_zero(&background);
27
-  gs_clear(GS_CLEAR_COLOR, &background, 0.0f, 0);
28
-  gs_ortho(0.0f, static_cast<float>(width), 0.0f, static_cast<float>(height), -100.0f, 100.0f);
29
-  gs_blend_state_push();
30
-  gs_blend_function(GS_BLEND_ONE, GS_BLEND_ZERO);
31
-  obs_source_video_render(target);
32
-  gs_blend_state_pop();
33
-  gs_texrender_end(tf->texrender);
34
+   obs_source_t *target = obs_filter_get_target(tf->source);
35
+   if (!target) {
36
+       return false;
37
+   }
38
+   width = obs_source_get_base_width(target);
39
+   height = obs_source_get_base_height(target);
40
+   if (width == 0 || height == 0) {
41
+       return false;
42
+   }
43
+   gs_texrender_reset(tf->texrender);
44
+   if (!gs_texrender_begin(tf->texrender, width, height)) {
45
+       return false;
46
+   }
47
+   struct vec4 background;
48
+   vec4_zero(&background);
49
+   gs_clear(GS_CLEAR_COLOR, &background, 0.0f, 0);
50
+   gs_ortho(0.0f, static_cast<float>(width), 0.0f,
51
+        static_cast<float>(height), -100.0f, 100.0f);
52
+   gs_blend_state_push();
53
+   gs_blend_function(GS_BLEND_ONE, GS_BLEND_ZERO);
54
+   obs_source_video_render(target);
55
+   gs_blend_state_pop();
56
+   gs_texrender_end(tf->texrender);
57
 
58
-  if (tf->stagesurface) {
59
-    uint32_t stagesurf_width = gs_stagesurface_get_width(tf->stagesurface);
60
-    uint32_t stagesurf_height = gs_stagesurface_get_height(tf->stagesurface);
61
-    if (stagesurf_width != width || stagesurf_height != height) {
62
-      gs_stagesurface_destroy(tf->stagesurface);
63
-      tf->stagesurface = nullptr;
64
-    }
65
-  }
66
-  if (!tf->stagesurface) {
67
-    tf->stagesurface = gs_stagesurface_create(width, height, GS_BGRA);
68
-  }
69
-  gs_stage_texture(tf->stagesurface, gs_texrender_get_texture(tf->texrender));
70
-  uint8_t *video_data;
71
-  uint32_t linesize;
72
-  if (!gs_stagesurface_map(tf->stagesurface, &video_data, &linesize)) {
73
-    return false;
74
-  }
75
-  {
76
-    std::lock_guard<std::mutex> lock(tf->inputBGRALock);
77
-    tf->inputBGRA = cv::Mat(height, width, CV_8UC4, video_data, linesize);
78
-  }
79
-  gs_stagesurface_unmap(tf->stagesurface);
80
-  return true;
81
+   if (tf->stagesurface) {
82
+       uint32_t stagesurf_width =
83
+           gs_stagesurface_get_width(tf->stagesurface);
84
+       uint32_t stagesurf_height =
85
+           gs_stagesurface_get_height(tf->stagesurface);
86
+       if (stagesurf_width != width || stagesurf_height != height) {
87
+           gs_stagesurface_destroy(tf->stagesurface);
88
+           tf->stagesurface = nullptr;
89
+       }
90
+   }
91
+   if (!tf->stagesurface) {
92
+       tf->stagesurface =
93
+           gs_stagesurface_create(width, height, GS_BGRA);
94
+   }
95
+   gs_stage_texture(tf->stagesurface,
96
+            gs_texrender_get_texture(tf->texrender));
97
+   uint8_t *video_data;
98
+   uint32_t linesize;
99
+   if (!gs_stagesurface_map(tf->stagesurface, &video_data, &linesize)) {
100
+       return false;
101
+   }
102
+   {
103
+       std::lock_guard<std::mutex> lock(tf->inputBGRALock);
104
+       tf->inputBGRA =
105
+           cv::Mat(height, width, CV_8UC4, video_data, linesize);
106
+   }
107
+   gs_stagesurface_unmap(tf->stagesurface);
108
+   return true;
109
 }
110
obs-backgroundremoval-1.0.3.tar.gz/src/obs-utils/obs-utils.h -> obs-backgroundremoval-1.1.5.tar.gz/src/obs-utils/obs-utils.h Changed
10
 
1
@@ -3,6 +3,7 @@
2
 
3
 #include "FilterData.h"
4
 
5
-bool getRGBAFromStageSurface(filter_data *tf, uint32_t &width, uint32_t &height);
6
+bool getRGBAFromStageSurface(filter_data *tf, uint32_t &width,
7
+                uint32_t &height);
8
 
9
 #endif /* OBS_UTILS_H */
10
obs-backgroundremoval-1.0.3.tar.gz/src/ort-utils/ORTModelData.h -> obs-backgroundremoval-1.1.5.tar.gz/src/ort-utils/ORTModelData.h Changed
28
 
1
@@ -4,16 +4,16 @@
2
 #include <onnxruntime_cxx_api.h>
3
 
4
 struct ORTModelData {
5
-  std::unique_ptr<Ort::Session> session;
6
-  std::unique_ptr<Ort::Env> env;
7
-  std::vector<Ort::AllocatedStringPtr> inputNames;
8
-  std::vector<Ort::AllocatedStringPtr> outputNames;
9
-  std::vector<Ort::Value> inputTensor;
10
-  std::vector<Ort::Value> outputTensor;
11
-  std::vector<std::vector<int64_t>> inputDims;
12
-  std::vector<std::vector<int64_t>> outputDims;
13
-  std::vector<std::vector<float>> outputTensorValues;
14
-  std::vector<std::vector<float>> inputTensorValues;
15
+   std::unique_ptr<Ort::Session> session;
16
+   std::unique_ptr<Ort::Env> env;
17
+   std::vector<Ort::AllocatedStringPtr> inputNames;
18
+   std::vector<Ort::AllocatedStringPtr> outputNames;
19
+   std::vector<Ort::Value> inputTensor;
20
+   std::vector<Ort::Value> outputTensor;
21
+   std::vector<std::vector<int64_t>> inputDims;
22
+   std::vector<std::vector<int64_t>> outputDims;
23
+   std::vector<std::vector<float>> outputTensorValues;
24
+   std::vector<std::vector<float>> inputTensorValues;
25
 };
26
 
27
 #endif /* ORTMODELDATA_H */
28
obs-backgroundremoval-1.0.3.tar.gz/src/ort-utils/ort-session-utils.cpp -> obs-backgroundremoval-1.1.5.tar.gz/src/ort-utils/ort-session-utils.cpp Changed
201
 
1
@@ -21,146 +21,183 @@
2
 
3
 void createOrtSession(filter_data *tf)
4
 {
5
-  if (tf->model.get() == nullptr) {
6
-    blog(LOG_ERROR, "Model object is not initialized");
7
-    return;
8
-  }
9
-
10
-  Ort::SessionOptions sessionOptions;
11
-
12
-  sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_ALL);
13
-  if (tf->useGPU != USEGPU_CPU) {
14
-    sessionOptions.DisableMemPattern();
15
-    sessionOptions.SetExecutionMode(ExecutionMode::ORT_SEQUENTIAL);
16
-  } else {
17
-    sessionOptions.SetInterOpNumThreads(tf->numThreads);
18
-    sessionOptions.SetIntraOpNumThreads(tf->numThreads);
19
-  }
20
-
21
-  char *modelFilepath_rawPtr = obs_module_file(tf->modelSelection.c_str());
22
-
23
-  if (modelFilepath_rawPtr == nullptr) {
24
-    blog(LOG_ERROR, "Unable to get model filename %s from plugin.", tf->modelSelection.c_str());
25
-    return;
26
-  }
27
-
28
-  std::string modelFilepath_s(modelFilepath_rawPtr);
29
-  bfree(modelFilepath_rawPtr);
30
+   if (tf->model.get() == nullptr) {
31
+       blog(LOG_ERROR, "Model object is not initialized");
32
+       return;
33
+   }
34
+
35
+   Ort::SessionOptions sessionOptions;
36
+
37
+   sessionOptions.SetGraphOptimizationLevel(
38
+       GraphOptimizationLevel::ORT_ENABLE_ALL);
39
+   if (tf->useGPU != USEGPU_CPU) {
40
+       sessionOptions.DisableMemPattern();
41
+       sessionOptions.SetExecutionMode(ExecutionMode::ORT_SEQUENTIAL);
42
+   } else {
43
+       sessionOptions.SetInterOpNumThreads(tf->numThreads);
44
+       sessionOptions.SetIntraOpNumThreads(tf->numThreads);
45
+   }
46
+
47
+   char *modelFilepath_rawPtr =
48
+       obs_module_file(tf->modelSelection.c_str());
49
+
50
+   if (modelFilepath_rawPtr == nullptr) {
51
+       blog(LOG_ERROR, "Unable to get model filename %s from plugin.",
52
+            tf->modelSelection.c_str());
53
+       return;
54
+   }
55
+
56
+   std::string modelFilepath_s(modelFilepath_rawPtr);
57
+   bfree(modelFilepath_rawPtr);
58
 
59
 #if _WIN32
60
-  std::wstring modelFilepath_ws(modelFilepath_s.size(), L' ');
61
-  std::copy(modelFilepath_s.begin(), modelFilepath_s.end(), modelFilepath_ws.begin());
62
-  tf->modelFilepath = modelFilepath_ws.c_str();
63
+   std::wstring modelFilepath_ws(modelFilepath_s.size(), L' ');
64
+   std::copy(modelFilepath_s.begin(), modelFilepath_s.end(),
65
+         modelFilepath_ws.begin());
66
+   tf->modelFilepath = modelFilepath_ws.c_str();
67
 #else
68
-  tf->modelFilepath = modelFilepath_s.c_str();
69
+   tf->modelFilepath = modelFilepath_s.c_str();
70
 #endif
71
 
72
-  try {
73
+   try {
74
 #if defined(__linux__) && defined(__x86_64__)
75
-    if (tf->useGPU == USEGPU_TENSORRT) {
76
-      Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_Tensorrt(sessionOptions, 0));
77
-    }
78
+       if (tf->useGPU == USEGPU_TENSORRT) {
79
+           Ort::ThrowOnError(
80
+               OrtSessionOptionsAppendExecutionProvider_Tensorrt(
81
+                   sessionOptions, 0));
82
+       }
83
 #endif
84
 #ifdef _WIN32
85
-    if (tf->useGPU == USEGPU_DML) {
86
-      auto &api = Ort::GetApi();
87
-      OrtDmlApi *dmlApi = nullptr;
88
-      Ort::ThrowOnError(
89
-        api.GetExecutionProviderApi("DML", ORT_API_VERSION, (const void **)&dmlApi));
90
-      Ort::ThrowOnError(dmlApi->SessionOptionsAppendExecutionProvider_DML(sessionOptions, 0));
91
-    }
92
+       if (tf->useGPU == USEGPU_DML) {
93
+           auto &api = Ort::GetApi();
94
+           OrtDmlApi *dmlApi = nullptr;
95
+           Ort::ThrowOnError(api.GetExecutionProviderApi(
96
+               "DML", ORT_API_VERSION,
97
+               (const void **)&dmlApi));
98
+           Ort::ThrowOnError(
99
+               dmlApi->SessionOptionsAppendExecutionProvider_DML(
100
+                   sessionOptions, 0));
101
+       }
102
 #endif
103
 #if defined(__APPLE__)
104
-    if (tf->useGPU == USEGPU_COREML) {
105
-      uint32_t coreml_flags = 0;
106
-      coreml_flags |= COREML_FLAG_ENABLE_ON_SUBGRAPH;
107
-      Ort::ThrowOnError(
108
-        OrtSessionOptionsAppendExecutionProvider_CoreML(sessionOptions, coreml_flags));
109
-    }
110
+       if (tf->useGPU == USEGPU_COREML) {
111
+           uint32_t coreml_flags = 0;
112
+           coreml_flags |= COREML_FLAG_ENABLE_ON_SUBGRAPH;
113
+           Ort::ThrowOnError(
114
+               OrtSessionOptionsAppendExecutionProvider_CoreML(
115
+                   sessionOptions, coreml_flags));
116
+       }
117
 #endif
118
-    tf->session.reset(new Ort::Session(*tf->env, tf->modelFilepath, sessionOptions));
119
-  } catch (const std::exception &e) {
120
-    blog(LOG_ERROR, "%s", e.what());
121
-    return;
122
-  }
123
-
124
-  Ort::AllocatorWithDefaultOptions allocator;
125
-
126
-  tf->model->populateInputOutputNames(tf->session, tf->inputNames, tf->outputNames);
127
-
128
-  if (!tf->model->populateInputOutputShapes(tf->session, tf->inputDims, tf->outputDims)) {
129
-    blog(LOG_ERROR, "Unable to get model input and output shapes");
130
-    return;
131
-  }
132
-
133
-  for (size_t i = 0; i < tf->inputNames.size(); i++) {
134
-    blog(LOG_INFO, "Model %s input %d: name %s shape (%d dim) %d x %d x %d x %d",
135
-         tf->modelSelection.c_str(), (int)i, tf->inputNamesi.get(), (int)tf->inputDimsi.size(),
136
-         (int)tf->inputDimsi0,
137
-         ((int)tf->inputDimsi.size() > 1) ? (int)tf->inputDimsi1 : 0,
138
-         ((int)tf->inputDimsi.size() > 2) ? (int)tf->inputDimsi2 : 0,
139
-         ((int)tf->inputDimsi.size() > 3) ? (int)tf->inputDimsi3 : 0);
140
-  }
141
-  for (size_t i = 0; i < tf->outputNames.size(); i++) {
142
-    blog(LOG_INFO, "Model %s output %d: name %s shape (%d dim) %d x %d x %d x %d",
143
-         tf->modelSelection.c_str(), (int)i, tf->outputNamesi.get(),
144
-         (int)tf->outputDimsi.size(), (int)tf->outputDimsi0,
145
-         ((int)tf->outputDimsi.size() > 1) ? (int)tf->outputDimsi1 : 0,
146
-         ((int)tf->outputDimsi.size() > 2) ? (int)tf->outputDimsi2 : 0,
147
-         ((int)tf->outputDimsi.size() > 3) ? (int)tf->outputDimsi3 : 0);
148
-  }
149
-
150
-  // Allocate buffers
151
-  tf->model->allocateTensorBuffers(tf->inputDims, tf->outputDims, tf->outputTensorValues,
152
-                                   tf->inputTensorValues, tf->inputTensor, tf->outputTensor);
153
+       tf->session.reset(new Ort::Session(*tf->env, tf->modelFilepath,
154
+                          sessionOptions));
155
+   } catch (const std::exception &e) {
156
+       blog(LOG_ERROR, "%s", e.what());
157
+       return;
158
+   }
159
+
160
+   Ort::AllocatorWithDefaultOptions allocator;
161
+
162
+   tf->model->populateInputOutputNames(tf->session, tf->inputNames,
163
+                       tf->outputNames);
164
+
165
+   if (!tf->model->populateInputOutputShapes(tf->session, tf->inputDims,
166
+                         tf->outputDims)) {
167
+       blog(LOG_ERROR, "Unable to get model input and output shapes");
168
+       return;
169
+   }
170
+
171
+   for (size_t i = 0; i < tf->inputNames.size(); i++) {
172
+       blog(LOG_INFO,
173
+            "Model %s input %d: name %s shape (%d dim) %d x %d x %d x %d",
174
+            tf->modelSelection.c_str(), (int)i,
175
+            tf->inputNamesi.get(), (int)tf->inputDimsi.size(),
176
+            (int)tf->inputDimsi0,
177
+            ((int)tf->inputDimsi.size() > 1)
178
+                ? (int)tf->inputDimsi1
179
+                : 0,
180
+            ((int)tf->inputDimsi.size() > 2)
181
+                ? (int)tf->inputDimsi2
182
+                : 0,
183
+            ((int)tf->inputDimsi.size() > 3)
184
+                ? (int)tf->inputDimsi3
185
+                : 0);
186
+   }
187
+   for (size_t i = 0; i < tf->outputNames.size(); i++) {
188
+       blog(LOG_INFO,
189
+            "Model %s output %d: name %s shape (%d dim) %d x %d x %d x %d",
190
+            tf->modelSelection.c_str(), (int)i,
191
+            tf->outputNamesi.get(), (int)tf->outputDimsi.size(),
192
+            (int)tf->outputDimsi0,
193
+            ((int)tf->outputDimsi.size() > 1)
194
+                ? (int)tf->outputDimsi1
195
+                : 0,
196
+            ((int)tf->outputDimsi.size() > 2)
197
+                ? (int)tf->outputDimsi2
198
+                : 0,
199
+            ((int)tf->outputDimsi.size() > 3)
200
+                ? (int)tf->outputDimsi3
201
obs-backgroundremoval-1.0.3.tar.gz/src/ort-utils/ort-session-utils.h -> obs-backgroundremoval-1.1.5.tar.gz/src/ort-utils/ort-session-utils.h Changed
10
 
1
@@ -7,6 +7,7 @@
2
 
3
 void createOrtSession(filter_data *tf);
4
 
5
-bool runFilterModelInference(filter_data *tf, const cv::Mat &imageBGRA, cv::Mat &output);
6
+bool runFilterModelInference(filter_data *tf, const cv::Mat &imageBGRA,
7
+                cv::Mat &output);
8
 
9
 #endif /* ORT_SESSION_UTILS_H */
10
obs-backgroundremoval-1.0.3.tar.gz/src/plugin-main.c -> obs-backgroundremoval-1.1.5.tar.gz/src/plugin-main.c Changed
43
 
1
@@ -18,14 +18,16 @@
2
 
3
 #include <obs-module.h>
4
 
5
-#include "plugin-macros.generated.h"
6
+#include "plugin-support.h"
7
+
8
+#include "update-checker/update-checker.h"
9
 
10
 OBS_DECLARE_MODULE()
11
 OBS_MODULE_USE_DEFAULT_LOCALE(PLUGIN_NAME, "en-US")
12
 
13
 MODULE_EXPORT const char *obs_module_description(void)
14
 {
15
-  return obs_module_text("PortraitBackgroundFilterPlugin");
16
+   return obs_module_text("PortraitBackgroundFilterPlugin");
17
 }
18
 
19
 extern struct obs_source_info background_removal_filter_info;
20
@@ -33,13 +35,17 @@
21
 
22
 bool obs_module_load(void)
23
 {
24
-  obs_register_source(&background_removal_filter_info);
25
-  obs_register_source(&enhance_filter_info);
26
-  blog(LOG_INFO, "plugin loaded successfully (version %s)", PLUGIN_VERSION);
27
-  return true;
28
+   obs_register_source(&background_removal_filter_info);
29
+   obs_register_source(&enhance_filter_info);
30
+   obs_log(LOG_INFO, "Plugin loaded successfully (version %s)",
31
+       PLUGIN_VERSION);
32
+
33
+   check_update();
34
+
35
+   return true;
36
 }
37
 
38
 void obs_module_unload()
39
 {
40
-  blog(LOG_INFO, "plugin unloaded");
41
+   obs_log(LOG_INFO, "plugin unloaded");
42
 }
43
obs-backgroundremoval-1.1.5.tar.gz/src/plugin-support.c.in Added
41
 
1
@@ -0,0 +1,39 @@
2
+/*
3
+@PLUGIN_PRETTY_NAME@
4
+Copyright (C) 2021 @PLUGIN_AUTHOR@ @LINUX_MAINTAINER_EMAIL@
5
+
6
+This program is free software; you can redistribute it and/or modify
7
+it under the terms of the GNU General Public License as published by
8
+the Free Software Foundation; either version 2 of the License, or
9
+(at your option) any later version.
10
+
11
+This program is distributed in the hope that it will be useful,
12
+but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+GNU General Public License for more details.
15
+
16
+You should have received a copy of the GNU General Public License along
17
+with this program. If not, see <https://www.gnu.org/licenses/>
18
+*/
19
+
20
+#include <plugin-support.h>
21
+
22
+const char *PLUGIN_NAME = "@CMAKE_PROJECT_NAME@";
23
+const char *PLUGIN_VERSION = "@CMAKE_PROJECT_VERSION@";
24
+
25
+void obs_log(int log_level, const char *format, ...)
26
+{
27
+    size_t length = 4 + strlen(PLUGIN_NAME) + strlen(format);
28
+
29
+    char *template = malloc(length + 1);
30
+
31
+    snprintf(template, length, "%s %s", PLUGIN_NAME, format);
32
+
33
+    va_list(args);
34
+
35
+    va_start(args, format);
36
+    blogva(log_level, template, args);
37
+    va_end(args);
38
+
39
+    free(template);
40
+}
41
obs-backgroundremoval-1.1.5.tar.gz/src/plugin-support.h Added
40
 
1
@@ -0,0 +1,38 @@
2
+/*
3
+OBS Background Removal Filter Plugin
4
+Copyright (C) 2021 Roy Shilkrot roy.shil@gmail.com
5
+
6
+This program is free software; you can redistribute it and/or modify
7
+it under the terms of the GNU General Public License as published by
8
+the Free Software Foundation; either version 2 of the License, or
9
+(at your option) any later version.
10
+
11
+This program is distributed in the hope that it will be useful,
12
+but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+GNU General Public License for more details.
15
+
16
+You should have received a copy of the GNU General Public License along
17
+with this program. If not, see <https://www.gnu.org/licenses/>
18
+*/
19
+
20
+#pragma once
21
+
22
+#ifdef __cplusplus
23
+extern "C" {
24
+#endif
25
+
26
+#include <stdio.h>
27
+#include <stdlib.h>
28
+#include <stdarg.h>
29
+#include <string.h>
30
+
31
+extern const char *PLUGIN_NAME;
32
+extern const char *PLUGIN_VERSION;
33
+
34
+void obs_log(int log_level, const char *format, ...);
35
+extern void blogva(int log_level, const char *format, va_list args);
36
+
37
+#ifdef __cplusplus
38
+}
39
+#endif
40
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/Client.hpp Added
7
 
1
@@ -0,0 +1,5 @@
2
+#include <string>
3
+#include <functional>
4
+
5
+void fetchStringFromUrl(const char *urlString,
6
+           std::function<void(std::string, int)> callback);
7
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/CurlClient Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/CurlClient/CMakeLists.txt Added
9
 
1
@@ -0,0 +1,7 @@
2
+add_library(CurlClient CurlClient.cpp)
3
+target_link_libraries(CurlClient PRIVATE OBS::libobs plugin-support)
4
+target_include_directories(CurlClient PRIVATE "${CMAKE_SOURCE_DIR}/src")
5
+
6
+find_package(CURL REQUIRED)
7
+target_link_libraries(CurlClient PRIVATE "${CURL_LIBRARIES}")
8
+target_include_directories(CurlClient SYSTEM PRIVATE "${CURL_INCLUDE_DIRS}")
9
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/CurlClient/CurlClient.cpp Added
45
 
1
@@ -0,0 +1,43 @@
2
+#include <string>
3
+#include <functional>
4
+
5
+#include <curl/curl.h>
6
+
7
+#include <obs.h>
8
+#include <plugin-support.h>
9
+
10
+const std::string userAgent = std::string(PLUGIN_NAME) + "/" + PLUGIN_VERSION;
11
+
12
+static std::size_t writeFunc(void *ptr, std::size_t size, size_t nmemb,
13
+                std::string *data)
14
+{
15
+   data->append(static_cast<char *>(ptr), size * nmemb);
16
+   return size * nmemb;
17
+}
18
+
19
+void fetchStringFromUrl(const char *urlString,
20
+           std::function<void(std::string, int)> callback)
21
+{
22
+   CURL *curl = curl_easy_init();
23
+   if (!curl) {
24
+       obs_log(LOG_INFO, "Failed to initialize curl");
25
+       callback("", CURL_LAST);
26
+       return;
27
+   }
28
+
29
+   std::string responseBody;
30
+   curl_easy_setopt(curl, CURLOPT_URL, urlString);
31
+   curl_easy_setopt(curl, CURLOPT_USERAGENT, userAgent.c_str());
32
+   curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeFunc);
33
+   curl_easy_setopt(curl, CURLOPT_WRITEDATA, &responseBody);
34
+
35
+   CURLcode code = curl_easy_perform(curl);
36
+   curl_easy_cleanup(curl);
37
+
38
+   if (code == CURLE_OK) {
39
+       callback(responseBody, 0);
40
+   } else {
41
+       obs_log(LOG_INFO, "Failed to get latest release info");
42
+       callback("", code);
43
+   }
44
+}
45
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/URLSessionClient Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/URLSessionClient/CMakeLists.txt Added
5
 
1
@@ -0,0 +1,3 @@
2
+add_library(URLSessionClient URLSessionClient.mm)
3
+target_link_libraries(URLSessionClient PRIVATE OBS::libobs plugin-support)
4
+target_include_directories(URLSessionClient PRIVATE "${CMAKE_SOURCE_DIR}/src")
5
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/URLSessionClient/URLSessionClient.mm Added
51
 
1
@@ -0,0 +1,49 @@
2
+#include <string>
3
+#include <functional>
4
+
5
+#include <Foundation/Foundation.h>
6
+
7
+#include <obs.h>
8
+#include <plugin-support.h>
9
+
10
+void dispatch(const std::function<void(std::string, int)> &callback,
11
+         std::string responseBody, int errorCode)
12
+{
13
+   dispatch_async(dispatch_get_main_queue(), ^{
14
+       callback(responseBody, errorCode);
15
+   });
16
+}
17
+
18
+void fetchStringFromUrl(const char *urlString,
19
+           std::function<void(std::string, int)> callback)
20
+{
21
+   NSString *urlNsString = NSString alloc initWithUTF8String:urlString;
22
+   NSURLSession *session = NSURLSession sharedSession;
23
+   NSURL *url = NSURL URLWithString:urlNsString;
24
+   NSURLSessionDataTask *task = session
25
+         dataTaskWithURL:url
26
+       completionHandler:^(NSData *_Nullable data,
27
+                   NSURLResponse *_Nullable response,
28
+                   NSError *_Nullable error) {
29
+           if (error != NULL) {
30
+               obs_log(LOG_INFO, "error");
31
+               dispatch(callback, "", 1);
32
+           } else if (response == NULL) {
33
+               dispatch(callback, "", 2);
34
+           } else if (data == NULL || data.length == 0) {
35
+               dispatch(callback, "", 3);
36
+           } else if (!response isKindOfClass:NSHTTPURLResponse
37
+                                   .class) {
38
+               dispatch(callback, "", 4);
39
+           } else {
40
+               std::string responseBody(
41
+                   (const char *)data.bytes, data.length);
42
+               NSHTTPURLResponse *httpResponse =
43
+                   (NSHTTPURLResponse *)response;
44
+               NSInteger code = httpResponse.statusCode;
45
+               dispatch(callback, responseBody,
46
+                    code < 200 || code > 299 ? 5 : 0);
47
+           }
48
+       };
49
+   task resume;
50
+}
51
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/UpdateDialog.cpp Added
64
 
1
@@ -0,0 +1,62 @@
2
+#include "UpdateDialog.hpp"
3
+#include "obs-utils/obs-config-utils.h"
4
+
5
+#include <obs.h>
6
+#include <obs-module.h>
7
+
8
+#include <QLabel>
9
+#include <QVBoxLayout>
10
+#include <QString>
11
+
12
+static QString dialogContent =
13
+   "<h1>Background Removal - Update available! 🚀</h1>"
14
+   "<p>A new version of the Background Removal plugin (<a "
15
+   "href=\"https://github.com/royshil/obs-backgroundremoval/releases\">v{version}</a>) is "
16
+   "now available for download. We've made some exciting updates and improvements that we think "
17
+   "you'll love. To get the latest features and enhancements, please follow the link below:</p>"
18
+   "<p>Download the latest version from GitHub: <a "
19
+   "href=\"https://github.com/royshil/obs-backgroundremoval/releases\">v{version}</a></p>"
20
+   "<p>Once you've downloaded the new version, install the update as usual, there's no need to "
21
+   "uninstall the previous version.</p>"
22
+   "<p>If you have any questions or need assistance during the update process, feel free to reach out"
23
+   " to our <a href=\"https://github.com/royshil/obs-backgroundremoval/issues\">support team</a>.</p>"
24
+   "<p>Thank you for using our plugin and we hope you enjoy the latest release! 🙏</p>"
25
+   "<h2>Changelog</h2>";
26
+
27
+UpdateDialog::UpdateDialog(
28
+   struct github_utils_release_information latestVersion, QWidget *parent)
29
+   : QDialog(parent), layout(new QVBoxLayout)
30
+{
31
+   setWindowTitle("Background Removal - Update available! 🚀");
32
+   setLayout(layout);
33
+   QLabel *label = new QLabel(dialogContent.replace(
34
+       QString("{version}"), QString(latestVersion.version)));
35
+   label->setOpenExternalLinks(true);
36
+   label->setTextInteractionFlags(Qt::TextBrowserInteraction);
37
+   label->setTextFormat(Qt::RichText);
38
+   label->setWordWrap(true);
39
+   layout->addWidget(label);
40
+
41
+   QScrollArea *scrollArea = new QScrollArea;
42
+   QLabel *scrollAreaLabel =
43
+       new QLabel(QString(latestVersion.responseBody));
44
+   scrollAreaLabel->setOpenExternalLinks(true);
45
+   scrollAreaLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
46
+   scrollAreaLabel->setTextFormat(Qt::MarkdownText);
47
+   scrollAreaLabel->setWordWrap(true);
48
+   scrollArea->setWidget(scrollAreaLabel);
49
+   scrollArea->setWidgetResizable(true);
50
+   layout->addWidget(scrollArea);
51
+
52
+   // Add a checkbox to disable update checks
53
+   QCheckBox *disableCheckbox = new QCheckBox("Disable update checks");
54
+   layout->addWidget(disableCheckbox);
55
+   connect(disableCheckbox, &QCheckBox::stateChanged, this, (int state) {
56
+       setFlagFromConfig("check_for_updates", state == Qt::Unchecked);
57
+   });
58
+
59
+   // Add a button to close the dialog
60
+   QPushButton *closeButton = new QPushButton("Close");
61
+   layout->addWidget(closeButton);
62
+   connect(closeButton, &QPushButton::clicked, this, &QDialog::close);
63
+}
64
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/UpdateDialog.hpp Added
15
 
1
@@ -0,0 +1,13 @@
2
+#include <QtWidgets>
3
+
4
+#include "github-utils.h"
5
+
6
+class UpdateDialog : public QDialog {
7
+   Q_OBJECT
8
+public:
9
+   UpdateDialog(struct github_utils_release_information latestVersion,
10
+            QWidget *parent = nullptr);
11
+
12
+private:
13
+   QVBoxLayout *layout;
14
+};
15
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/WinRTHttpClient Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/WinRTHttpClient/CMakeLists.txt Added
12
 
1
@@ -0,0 +1,10 @@
2
+add_library(WinRTHttpClient WinRTHttpClient.cpp)
3
+set_target_properties(
4
+  WinRTHttpClient
5
+  PROPERTIES CXX_STANDARD 17
6
+             CXX_STANDARD_REQUIRED ON
7
+             CXX_EXTENSIONS OFF
8
+             VS_GLOBAL_CppWinRTOptimized true
9
+             VS_GLOBAL_CppWinRTRootNamespaceAutoMerge true)
10
+target_link_libraries(WinRTHttpClient PRIVATE OBS::libobs plugin-support)
11
+target_include_directories(WinRTHttpClient PRIVATE "${CMAKE_SOURCE_DIR}/src")
12
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/WinRTHttpClient/WinRTHttpClient.cpp Added
42
 
1
@@ -0,0 +1,40 @@
2
+#include <functional>
3
+
4
+#include <winrt/Windows.Foundation.h>
5
+#include <winrt/Windows.Web.Http.Headers.h>
6
+#include <winrt/windows.storage.streams.h>
7
+#include <plugin-support.h>
8
+
9
+using winrt::Windows::Foundation::Uri;
10
+using winrt::Windows::Storage::Streams::IBuffer;
11
+using winrt::Windows::Web::Http::HttpClient;
12
+using winrt::Windows::Web::Http::HttpResponseMessage;
13
+using winrt::Windows::Web::Http::IHttpContent;
14
+
15
+winrt::hstring userAgent = winrt::to_hstring(PLUGIN_NAME) + L"/" +
16
+              winrt::to_hstring(PLUGIN_VERSION);
17
+
18
+void fetchStringFromUrl(const char *urlString,
19
+           std::function<void(std::string, int)> callback)
20
+{
21
+   HttpClient httpClient;
22
+   auto headers(httpClient.DefaultRequestHeaders());
23
+   headers.UserAgent().TryParseAdd(userAgent);
24
+   Uri requestUri(winrt::to_hstring(urlString));
25
+   HttpResponseMessage httpResponseMessage;
26
+   IBuffer httpResponseBuffer;
27
+   try {
28
+       httpResponseMessage = httpClient.GetAsync(requestUri).get();
29
+       httpResponseMessage.EnsureSuccessStatusCode();
30
+       IHttpContent httpContent = httpResponseMessage.Content();
31
+       httpResponseBuffer = httpContent.ReadAsBufferAsync().get();
32
+
33
+       uint8_t *data = httpResponseBuffer.data();
34
+       std::string str((const char *)data,
35
+               httpResponseBuffer.Length());
36
+       callback(str, 0);
37
+   } catch (winrt::hresult_error const &ex) {
38
+       std::string str(winrt::to_string(ex.message()));
39
+       callback(str, 1);
40
+   }
41
+}
42
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/github-utils.cpp Added
58
 
1
@@ -0,0 +1,56 @@
2
+#include <cstddef>
3
+#include <string>
4
+
5
+#include <obs.h>
6
+
7
+#include "Client.hpp"
8
+#include "github-utils.h"
9
+
10
+static const std::string GITHUB_LATEST_RELEASE_URL =
11
+   "https://api.github.com/repos/royshil/obs-backgroundremoval/releases/latest";
12
+
13
+void github_utils_get_release_information(
14
+   std::function<void(github_utils_release_information)> callback)
15
+{
16
+   fetchStringFromUrl(GITHUB_LATEST_RELEASE_URL.c_str(), callback(
17
+                                     std::string
18
+                                         responseBody,
19
+                                     int code) {
20
+       if (code != 0)
21
+           return;
22
+       // Parse the JSON response
23
+       obs_data_t *data =
24
+           obs_data_create_from_json(responseBody.c_str());
25
+       if (!data) {
26
+           blog(LOG_INFO, "Failed to parse latest release info");
27
+           callback(
28
+               {OBS_BGREMOVAL_GITHUB_UTILS_ERROR, NULL, NULL});
29
+           return;
30
+       }
31
+
32
+       // The version is in the "tag_name" property
33
+       char *version = strdup(obs_data_get_string(data, "tag_name"));
34
+       char *body = strdup(obs_data_get_string(data, "body"));
35
+       obs_data_release(data);
36
+
37
+       // remove the "v" prefix in version, if it exists
38
+       if (version0 == 'v') {
39
+           char *newVersion = (char *)malloc(strlen(version) - 1);
40
+           strcpy(newVersion, version + 1);
41
+           free(version);
42
+           version = newVersion;
43
+       }
44
+
45
+       callback({OBS_BGREMOVAL_GITHUB_UTILS_SUCCESS, body, version});
46
+   });
47
+}
48
+
49
+void github_utils_release_information_free(
50
+   struct github_utils_release_information info)
51
+{
52
+   if (info.responseBody != NULL)
53
+       free(info.responseBody);
54
+   if (info.version != NULL)
55
+       free(info.version);
56
+   info.responseCode = OBS_BGREMOVAL_GITHUB_UTILS_ERROR;
57
+}
58
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/github-utils.h Added
22
 
1
@@ -0,0 +1,20 @@
2
+#pragma once
3
+
4
+#include <functional>
5
+
6
+enum {
7
+   OBS_BGREMOVAL_GITHUB_UTILS_SUCCESS = 0,
8
+   OBS_BGREMOVAL_GITHUB_UTILS_ERROR = -1,
9
+};
10
+
11
+struct github_utils_release_information {
12
+   int responseCode;
13
+   char *responseBody;
14
+   char *version;
15
+};
16
+
17
+void github_utils_get_release_information(
18
+   std::function<void(github_utils_release_information)> callback);
19
+
20
+void github_utils_release_information_free(
21
+   struct github_utils_release_information info);
22
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/update-checker.cpp Added
54
 
1
@@ -0,0 +1,52 @@
2
+#include "update-checker.h"
3
+#include "UpdateDialog.hpp"
4
+#include "github-utils.h"
5
+#include "obs-utils/obs-config-utils.h"
6
+
7
+#include <obs-frontend-api.h>
8
+#include <obs-module.h>
9
+
10
+#include <plugin-support.h>
11
+
12
+#include <QTimer>
13
+
14
+UpdateDialog *update_dialog;
15
+
16
+extern "C" const char *PLUGIN_VERSION;
17
+
18
+void check_update(void)
19
+{
20
+   github_utils_get_release_information((github_utils_release_information
21
+                           info) {
22
+       if (info.responseCode == OBS_BGREMOVAL_GITHUB_UTILS_SUCCESS) {
23
+           obs_log(LOG_INFO, "Latest release is %s", info.version);
24
+           bool shouldCheckForUpdates = false;
25
+           if (getFlagFromConfig("check_for_updates",
26
+                         &shouldCheckForUpdates) !=
27
+               OBS_BGREMOVAL_CONFIG_SUCCESS) {
28
+               // Failed to get the config value, assume it's enabled
29
+               shouldCheckForUpdates = true;
30
+           }
31
+
32
+           if (!shouldCheckForUpdates) {
33
+               // Update checks are disabled
34
+               return;
35
+           }
36
+
37
+           if (strcmp(info.version, PLUGIN_VERSION) == 0) {
38
+               // No update available, latest version is the same as the current version
39
+               return;
40
+           }
41
+
42
+           update_dialog = new UpdateDialog(
43
+               info,
44
+               (QWidget *)obs_frontend_get_main_window());
45
+           QTimer::singleShot(2000, update_dialog,
46
+                      &UpdateDialog::exec);
47
+       } else {
48
+           obs_log(LOG_INFO,
49
+               "failed to get latest release information");
50
+       }
51
+       github_utils_release_information_free(info);
52
+   });
53
+}
54
obs-backgroundremoval-1.1.5.tar.gz/src/update-checker/update-checker.h Added
13
 
1
@@ -0,0 +1,11 @@
2
+#pragma once
3
+
4
+#ifdef __cplusplus
5
+extern "C" {
6
+#endif
7
+
8
+void check_update(void);
9
+
10
+#ifdef __cplusplus
11
+}
12
+#endif
13
opencv-4.7.0.tar.gz Deleted