diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index f2eb897a4d..1f09762623 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -77,7 +77,6 @@ body:
- Shortcut Guide
- System tray interaction
- TextExtractor
- - Video Conference Mute
- Workspaces
- Welcome / PowerToys Tour window
validations:
diff --git a/.github/ISSUE_TEMPLATE/translation_issue.yml b/.github/ISSUE_TEMPLATE/translation_issue.yml
index 69787a3ed6..63efb7c928 100644
--- a/.github/ISSUE_TEMPLATE/translation_issue.yml
+++ b/.github/ISSUE_TEMPLATE/translation_issue.yml
@@ -51,7 +51,6 @@ body:
- Shortcut Guide
- System tray interaction
- TextExtractor
- - Video Conference Mute
- Workspaces
- Welcome / PowerToys Tour window
validations:
diff --git a/.github/actions/spell-check/allow/names.txt b/.github/actions/spell-check/allow/names.txt
index fb7ff648b2..d82eb28c11 100644
--- a/.github/actions/spell-check/allow/names.txt
+++ b/.github/actions/spell-check/allow/names.txt
@@ -23,7 +23,6 @@ registrypreview
rooler
scoobe
shortcutguide
-videoconference
# USERS
diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt
index ba07b47d3a..f0d15e6ba2 100644
--- a/.github/actions/spell-check/expect.txt
+++ b/.github/actions/spell-check/expect.txt
@@ -1185,7 +1185,7 @@ psrm
psrree
pstatstg
pstm
-pstr
+PStr
pstream
pstrm
PSYSTEM
@@ -1648,7 +1648,6 @@ vcamp
vcdl
vcgtq
VCINSTALLDIR
-vcm
Vcpkg
VCRT
vcruntime
@@ -1667,7 +1666,6 @@ vget
vgetq
vid
VIDCAP
-videoconferencevirtualdriver
VIDEOINFOHEADER
viewmodel
vih
diff --git a/.pipelines/ESRPSigning_core.json b/.pipelines/ESRPSigning_core.json
index 1f84b4d415..76b55d0597 100644
--- a/.pipelines/ESRPSigning_core.json
+++ b/.pipelines/ESRPSigning_core.json
@@ -17,7 +17,6 @@
"PowerToys.FilePreviewCommon.dll",
"PowerToys.Interop.dll",
"Tools\\PowerToys.BugReportTool.exe",
- "WebcamReportTool\\PowerToys.WebcamReportTool.exe",
"StylesReportTool\\PowerToys.StylesReportTool.exe",
"Telemetry.dll",
"PowerToys.ManagedTelemetry.dll",
@@ -212,11 +211,6 @@
"PowerToys.ShortcutGuide.exe",
"PowerToys.ShortcutGuideModuleInterface.dll",
- "PowerToys.VideoConferenceModule.dll",
- "PowerToys.VideoConferenceProxyFilter_x86.dll",
- "PowerToys.VideoConferenceProxyFilter_x64.dll",
- "PowerToys.VideoConferenceProxyFilter_arm64.dll",
-
"WinUI3Apps\\PowerToys.Settings.dll",
"WinUI3Apps\\PowerToys.Settings.exe"
],
diff --git a/.pipelines/ESRPSigning_vcm.json b/.pipelines/ESRPSigning_vcm.json
deleted file mode 100644
index e9f2309cc4..0000000000
--- a/.pipelines/ESRPSigning_vcm.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "Version": "1.0.0",
- "UseMinimatch": false,
- "SignBatches": [
- {
- "MatchedPath": [
- "PowerToys.VideoConferenceProxyFilter_x86.dll"
- ],
- "SigningInfo": {
- "Operations": [
- {
- "KeyCode": "CP-230012",
- "OperationSetCode": "SigntoolSign",
- "Parameters": [
- {
- "parameterName": "OpusName",
- "parameterValue": "Microsoft"
- },
- {
- "parameterName": "OpusInfo",
- "parameterValue": "http://www.microsoft.com"
- },
- {
- "parameterName": "FileDigest",
- "parameterValue": "/fd \"SHA256\""
- },
- {
- "parameterName": "PageHash",
- "parameterValue": "/NPH"
- },
- {
- "parameterName": "TimeStamp",
- "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
- }
- ],
- "ToolName": "sign",
- "ToolVersion": "1.0"
- },
- {
- "KeyCode": "CP-230012",
- "OperationSetCode": "SigntoolVerify",
- "Parameters": [],
- "ToolName": "sign",
- "ToolVersion": "1.0"
- }
- ]
- }
- }
- ]
-}
diff --git a/.pipelines/v2/templates/job-build-project.yml b/.pipelines/v2/templates/job-build-project.yml
index 653e8cc9fd..5a3b787ede 100644
--- a/.pipelines/v2/templates/job-build-project.yml
+++ b/.pipelines/v2/templates/job-build-project.yml
@@ -172,7 +172,6 @@ jobs:
- pwsh: |-
& '.pipelines/verifyArm64Configuration.ps1' -solution '$(build.sourcesdirectory)\PowerToys.sln'
& '.pipelines/verifyArm64Configuration.ps1' -solution '$(build.sourcesdirectory)\tools\BugReportTool\BugReportTool.sln'
- & '.pipelines/verifyArm64Configuration.ps1' -solution '$(build.sourcesdirectory)\tools\WebcamReportTool\WebcamReportTool.sln'
& '.pipelines/verifyArm64Configuration.ps1' -solution '$(build.sourcesdirectory)\tools\StylesReportTool\StylesReportTool.sln'
& '.pipelines/verifyArm64Configuration.ps1' -solution '$(build.sourcesdirectory)\installer\PowerToysSetup.sln'
displayName: Verify ARM64 configurations
@@ -361,27 +360,6 @@ jobs:
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- - task: VSBuild@1
- displayName: Build WebcamReportTool
- inputs:
- solution: '**/tools/WebcamReportTool/WebcamReportTool.sln'
- vsVersion: 17.0
- msbuildArgs: >-
- -restore -graph
- /p:RestorePackagesConfig=true
- /p:CIBuild=true
- /bl:$(LogOutputDirectory)\build-webcam-report.binlog
- ${{ parameters.additionalBuildOptions }}
- $(MSBuildCacheParameters)
- $(RestoreAdditionalProjectSourcesArg)
- platform: $(BuildPlatform)
- configuration: $(BuildConfiguration)
- msbuildArchitecture: x64
- maximumCpuCount: true
- ${{ if eq(parameters.enableMsBuildCaching, true) }}:
- env:
- SYSTEM_ACCESSTOKEN: $(System.AccessToken)
-
- task: VSBuild@1
displayName: Build StylesReportTool
inputs:
@@ -484,7 +462,7 @@ jobs:
displayName: Sign Core PowerToys
signingIdentity: ${{ parameters.signingIdentity }}
inputs:
- FolderPath: '$(BuildPlatform)/$(BuildConfiguration)' # Video conf uses x86 and x64.
+ FolderPath: '$(BuildPlatform)/$(BuildConfiguration)'
signType: batchSigning
batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_core.json'
ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml'
@@ -499,16 +477,6 @@ jobs:
batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_DSC.json'
ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml'
- - template: steps-esrp-signing.yml
- parameters:
- displayName: Sign x86 DirectShow VCM
- signingIdentity: ${{ parameters.signingIdentity }}
- inputs:
- FolderPath: 'x86/$(BuildConfiguration)' # Video conf uses x86 and x64.
- signType: batchSigning
- batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_vcm.json'
- ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml'
-
- template: steps-build-installer.yml
parameters:
codeSign: ${{ parameters.codeSign }}
diff --git a/DATA_AND_PRIVACY.md b/DATA_AND_PRIVACY.md
index 5570729c20..a8714fa903 100644
--- a/DATA_AND_PRIVACY.md
+++ b/DATA_AND_PRIVACY.md
@@ -941,26 +941,6 @@ _If you want to find diagnostic data events in the source code, these two links
-### Video Conference Mute
-
-
- Event Name |
- Description |
-
-
- Microsoft.PowerToys.VideoConference_CameraMuted |
- Triggered when the camera is turned off by Video Conference Mute. |
-
-
- Microsoft.PowerToys.VideoConference_EnableVideoConference |
- Occurs when Video Conference Mute is enabled. |
-
-
- Microsoft.PowerToys.VideoConference_MicrophoneMuted |
- Occurs when the microphone is muted by Video Conference Mute. |
-
-
-
### Workspaces
diff --git a/PowerToys.sln b/PowerToys.sln
index ca7fa06db7..f28a7c8013 100644
--- a/PowerToys.sln
+++ b/PowerToys.sln
@@ -349,17 +349,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerToys.Update", "src\Upd
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerToys.Run.Plugin.WindowsSettings", "src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.WindowsSettings\Microsoft.PowerToys.Run.Plugin.WindowsSettings.csproj", "{5043CECE-E6A7-4867-9CBE-02D27D83747A}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VideoConferenceShared", "src\modules\videoconference\VideoConferenceShared\VideoConferenceShared.vcxproj", "{459E0768-7EBD-4C41-BBA1-6DB3B3815E0A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VideoConferenceModule", "src\modules\videoconference\VideoConferenceModule\VideoConference.vcxproj", "{5ABA70DE-3A3F-41F6-A1F5-D1F74F54F9BB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VideoConferenceProxyFilter", "src\modules\videoconference\VideoConferenceProxyFilter\VideoConferenceProxyFilter.vcxproj", "{AC2857B4-103D-4D6D-9740-926EBF785042}"
- ProjectSection(ProjectDependencies) = postProject
- {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A} = {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A}
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VideoConference", "VideoConference", "{470FBAF9-E1F8-4F3E-8786-198A1C81C8A8}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PdfThumbnailProvider", "src\modules\previewpane\PdfThumbnailProvider\PdfThumbnailProvider.csproj", "{11491FD8-F921-48BF-880C-7FEA185B80A1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests-PdfThumbnailProvider", "src\modules\previewpane\UnitTests-PdfThumbnailProvider\UnitTests-PdfThumbnailProvider.csproj", "{F40C3397-1834-4530-B2D9-8F8B8456BCDF}"
@@ -1509,40 +1498,6 @@ Global
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x64.ActiveCfg = Release|x64
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x64.Build.0 = Release|x64
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x86.ActiveCfg = Release|x64
- {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A}.Debug|ARM64.Build.0 = Debug|ARM64
- {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A}.Debug|x64.ActiveCfg = Debug|x64
- {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A}.Debug|x64.Build.0 = Debug|x64
- {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A}.Debug|x86.ActiveCfg = Debug|Win32
- {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A}.Debug|x86.Build.0 = Debug|Win32
- {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A}.Release|ARM64.ActiveCfg = Release|ARM64
- {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A}.Release|ARM64.Build.0 = Release|ARM64
- {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A}.Release|x64.ActiveCfg = Release|x64
- {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A}.Release|x64.Build.0 = Release|x64
- {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A}.Release|x86.ActiveCfg = Release|Win32
- {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A}.Release|x86.Build.0 = Release|Win32
- {5ABA70DE-3A3F-41F6-A1F5-D1F74F54F9BB}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {5ABA70DE-3A3F-41F6-A1F5-D1F74F54F9BB}.Debug|ARM64.Build.0 = Debug|ARM64
- {5ABA70DE-3A3F-41F6-A1F5-D1F74F54F9BB}.Debug|x64.ActiveCfg = Debug|x64
- {5ABA70DE-3A3F-41F6-A1F5-D1F74F54F9BB}.Debug|x64.Build.0 = Debug|x64
- {5ABA70DE-3A3F-41F6-A1F5-D1F74F54F9BB}.Debug|x86.ActiveCfg = Debug|x64
- {5ABA70DE-3A3F-41F6-A1F5-D1F74F54F9BB}.Release|ARM64.ActiveCfg = Release|ARM64
- {5ABA70DE-3A3F-41F6-A1F5-D1F74F54F9BB}.Release|ARM64.Build.0 = Release|ARM64
- {5ABA70DE-3A3F-41F6-A1F5-D1F74F54F9BB}.Release|x64.ActiveCfg = Release|x64
- {5ABA70DE-3A3F-41F6-A1F5-D1F74F54F9BB}.Release|x64.Build.0 = Release|x64
- {5ABA70DE-3A3F-41F6-A1F5-D1F74F54F9BB}.Release|x86.ActiveCfg = Release|x64
- {AC2857B4-103D-4D6D-9740-926EBF785042}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {AC2857B4-103D-4D6D-9740-926EBF785042}.Debug|ARM64.Build.0 = Debug|ARM64
- {AC2857B4-103D-4D6D-9740-926EBF785042}.Debug|x64.ActiveCfg = Debug|x64
- {AC2857B4-103D-4D6D-9740-926EBF785042}.Debug|x64.Build.0 = Debug|x64
- {AC2857B4-103D-4D6D-9740-926EBF785042}.Debug|x86.ActiveCfg = Debug|Win32
- {AC2857B4-103D-4D6D-9740-926EBF785042}.Debug|x86.Build.0 = Debug|Win32
- {AC2857B4-103D-4D6D-9740-926EBF785042}.Release|ARM64.ActiveCfg = Release|ARM64
- {AC2857B4-103D-4D6D-9740-926EBF785042}.Release|ARM64.Build.0 = Release|ARM64
- {AC2857B4-103D-4D6D-9740-926EBF785042}.Release|x64.ActiveCfg = Release|x64
- {AC2857B4-103D-4D6D-9740-926EBF785042}.Release|x64.Build.0 = Release|x64
- {AC2857B4-103D-4D6D-9740-926EBF785042}.Release|x86.ActiveCfg = Release|Win32
- {AC2857B4-103D-4D6D-9740-926EBF785042}.Release|x86.Build.0 = Release|Win32
{11491FD8-F921-48BF-880C-7FEA185B80A1}.Debug|ARM64.ActiveCfg = Debug|ARM64
{11491FD8-F921-48BF-880C-7FEA185B80A1}.Debug|ARM64.Build.0 = Debug|ARM64
{11491FD8-F921-48BF-880C-7FEA185B80A1}.Debug|x64.ActiveCfg = Debug|x64
@@ -2938,10 +2893,6 @@ Global
{48804216-2A0E-4168-A6D8-9CD068D14227} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD}
{FF1D7936-842A-4BBB-8BEA-E9FE796DE700} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD}
{5043CECE-E6A7-4867-9CBE-02D27D83747A} = {4AFC9975-2456-4C70-94A4-84073C1CED93}
- {459E0768-7EBD-4C41-BBA1-6DB3B3815E0A} = {470FBAF9-E1F8-4F3E-8786-198A1C81C8A8}
- {5ABA70DE-3A3F-41F6-A1F5-D1F74F54F9BB} = {470FBAF9-E1F8-4F3E-8786-198A1C81C8A8}
- {AC2857B4-103D-4D6D-9740-926EBF785042} = {470FBAF9-E1F8-4F3E-8786-198A1C81C8A8}
- {470FBAF9-E1F8-4F3E-8786-198A1C81C8A8} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
{11491FD8-F921-48BF-880C-7FEA185B80A1} = {2F305555-C296-497E-AC20-5FA1B237996A}
{F40C3397-1834-4530-B2D9-8F8B8456BCDF} = {2F305555-C296-497E-AC20-5FA1B237996A}
{A2D583F0-B70C-4462-B1F0-8E81AFB7BA85} = {4AFC9975-2456-4C70-94A4-84073C1CED93}
diff --git a/README.md b/README.md
index 6e68190911..6b2cc35f66 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ Microsoft PowerToys is a set of utilities for power users to tune and streamline
| [New+](https://aka.ms/PowerToysOverview_NewPlus) | [Peek](https://aka.ms/PowerToysOverview_Peek) | [Paste as Plain Text](https://aka.ms/PowerToysOverview_PastePlain) |
| [PowerRename](https://aka.ms/PowerToysOverview_PowerRename) | [PowerToys Run](https://aka.ms/PowerToysOverview_PowerToysRun) | [Quick Accent](https://aka.ms/PowerToysOverview_QuickAccent) |
| [Registry Preview](https://aka.ms/PowerToysOverview_RegistryPreview) | [Screen Ruler](https://aka.ms/PowerToysOverview_ScreenRuler) | [Shortcut Guide](https://aka.ms/PowerToysOverview_ShortcutGuide) |
-| [Text Extractor](https://aka.ms/PowerToysOverview_TextExtractor) | [Video Conference Mute](https://aka.ms/PowerToysOverview_VideoConference) | [Workspaces](https://aka.ms/PowerToysOverview_Workspaces) |
+| [Text Extractor](https://aka.ms/PowerToysOverview_TextExtractor) | [Workspaces](https://aka.ms/PowerToysOverview_Workspaces) |
## Installing and running Microsoft PowerToys
@@ -226,6 +226,5 @@ The application logs basic diagnostic data (telemetry). For more information on
[winget-link]: https://github.com/microsoft/winget-cli#installing-the-client
[roadmap]: https://github.com/microsoft/PowerToys/wiki/Roadmap
[privacy-link]: http://go.microsoft.com/fwlink/?LinkId=521839
-[vidConfOverview]: https://aka.ms/PowerToysOverview_VideoConference
[loc-bug]: https://github.com/microsoft/PowerToys/issues/new?assignees=&labels=&template=translation_issue.md&title=
[usingPowerToys-docs-link]: https://aka.ms/powertoys-docs
diff --git a/doc/devdocs/akaLinks.md b/doc/devdocs/akaLinks.md
index 6b0dcac1d8..eae60c1161 100644
--- a/doc/devdocs/akaLinks.md
+++ b/doc/devdocs/akaLinks.md
@@ -29,7 +29,6 @@
| PowerToysOverview_PowerRename | https://learn.microsoft.com/windows/powertoys/powerrename |
| PowerToysOverview_PowerToysRun | https://learn.microsoft.com/windows/powertoys/run |
| PowerToysOverview_ShortcutGuide | https://learn.microsoft.com/windows/powertoys/shortcut-guide |
-| PowerToysOverview_VideoConference | https://learn.microsoft.com/windows/powertoys/video-conference-mute |
| powerToysPowerLauncherImageSmall | https://github.com/microsoft/PowerToys/wiki/images/overview/PowerLauncher_small.png |
| powerToysPowerLauncherSettingImage | https://raw.githubusercontent.com/microsoft/PowerToys/main/doc/images/overview/PowerLauncher_large.png |
| powerToysPowerPreviewImageSmall | https://github.com/microsoft/PowerToys/wiki/images/overview/PowerPreview_small.png |
@@ -42,6 +41,4 @@
| powerToysRequestFeature | https://github.com/microsoft/PowerToys/issues/new?assignees=&labels=&template=feature_request.md&title= |
| powerToysShortcutGuideImageSmall | https://github.com/microsoft/PowerToys/wiki/images/overview/ShortcutGuide_small.png |
| powerToysShortcutGuideSettingImage | https://raw.githubusercontent.com/microsoft/PowerToys/main/doc/images/overview/ShortcutGuide_large.png |
-| powerToysVideoConferenceImageSmall | https://github.com/microsoft/PowerToys/wiki/images/overview/VideoConference_small.png |
-| powerToysVideoConferenceSettingImage | https://github.com/microsoft/PowerToys/wiki/images/overview/VideoConference_large.png |
| powertoyswiki | https://github.com/microsoft/PowerToys/wiki |
diff --git a/doc/devdocs/readme.md b/doc/devdocs/readme.md
index 558cb5aa49..50912c5b3f 100644
--- a/doc/devdocs/readme.md
+++ b/doc/devdocs/readme.md
@@ -73,7 +73,6 @@ The installer can only be compiled in `Release` mode; steps 1 and 2 must be perf
1. Compile `PowerToys.sln`. Instructions are listed above.
1. Compile `BugReportTool.sln` tool. Path from root: `tools\BugReportTool\BugReportTool.sln` (details listed below)
-1. Compile `WebcamReportTool.sln` tool. Path from root: `tools\WebcamReportTool\WebcamReportTool.sln` (details listed below)
1. Compile `StylesReportTool.sln` tool. Path from root: `tools\StylesReportTool\StylesReportTool.sln` (details listed below)
1. Compile `PowerToysSetup.sln` Path from root: `installer\PowerToysSetup.sln` (details listed below)
@@ -95,9 +94,6 @@ The installer can only be compiled in `Release` mode; steps 1 and 2 must be perf
nuget restore .\tools\BugReportTool\BugReportTool.sln
msbuild -p:Platform=x64 -p:Configuration=Release .\tools\BugReportTool\BugReportTool.sln
-nuget restore .\tools\WebcamReportTool\WebcamReportTool.sln
-msbuild -p:Platform=x64 -p:Configuration=Release .\tools\WebcamReportTool\WebcamReportTool.sln
-
nuget restore .\tools\StylesReportTool\StylesReportTool.sln
msbuild -p:Platform=x64 -p:Configuration=Release .\tools\StylesReportTool\StylesReportTool.sln
```
@@ -109,9 +105,6 @@ If you prefer, you can alternatively build prerequisite projects for the install
1. Open `tools\BugReportTool\BugReportTool.sln`
1. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
1. From the `Build` menu, choose `Build Solution`.
-1. Open `tools\WebcamReportTool\WebcamReportTool.sln`
-1. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
-1. From the `Build` menu, choose `Build Solution`.
1. Open `tools\StylesReportTool\StylesReportTool.sln`
1. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
1. From the `Build` menu, choose `Build Solution`.
diff --git a/doc/devdocs/tools/build-tools.md b/doc/devdocs/tools/build-tools.md
index dfa4e251b2..b8acaa3273 100644
--- a/doc/devdocs/tools/build-tools.md
+++ b/doc/devdocs/tools/build-tools.md
@@ -25,7 +25,3 @@ This script is used by the pipeline to move the .resw files to the correct locat
## [versionSetting.ps1](/tools/build/versionSetting.ps1)
Sets `version.props` file with the version number.
-
-## [video_conference_make_cab.ps1](/tools/build/video_conference_make_cab.ps1)
-
-This script creates a cab file for the Video Conference Mute driver.
diff --git a/doc/devdocs/tools/readme.md b/doc/devdocs/tools/readme.md
index 1bf19d610b..a2640bda7a 100644
--- a/doc/devdocs/tools/readme.md
+++ b/doc/devdocs/tools/readme.md
@@ -18,4 +18,3 @@ Following tools are currently available:
* [project template](/tools/project_template/README.md) - A Visual Studio project template for a new PowerToys project.
* [StylesReportTool](styles-report-tool.md) - A tool to collect information about an open window.
* [Verification scripts](verification-scripts.md) - A set of scripts that help verifying the PowerToys installation.
-* [WebcamReportTool](webcam-report-tool.md) - A tool to collect information about the connected webcams.
diff --git a/doc/devdocs/tools/webcam-report-tool.md b/doc/devdocs/tools/webcam-report-tool.md
deleted file mode 100644
index efa6d47da3..0000000000
--- a/doc/devdocs/tools/webcam-report-tool.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# [WebcamReportTool](/tools/WebcamReportTool/)
-
-This command line application generates a report about the connected webcams on the desktop called "WebcamReport.txt". The report contains the following information about every webcam:
-
-* Name
-* Supported formats
diff --git a/doc/images/overview/Original/VideoConference.png b/doc/images/overview/Original/VideoConference.png
deleted file mode 100644
index 3a71531361..0000000000
Binary files a/doc/images/overview/Original/VideoConference.png and /dev/null differ
diff --git a/doc/images/overview/VideoConference_large.png b/doc/images/overview/VideoConference_large.png
deleted file mode 100644
index 028d98889c..0000000000
Binary files a/doc/images/overview/VideoConference_large.png and /dev/null differ
diff --git a/doc/images/overview/VideoConference_small.png b/doc/images/overview/VideoConference_small.png
deleted file mode 100644
index 8e2030e92d..0000000000
Binary files a/doc/images/overview/VideoConference_small.png and /dev/null differ
diff --git a/installer/PowerToysSetup/Common.wxi b/installer/PowerToysSetup/Common.wxi
index f036b3797b..21855a7936 100644
--- a/installer/PowerToysSetup/Common.wxi
+++ b/installer/PowerToysSetup/Common.wxi
@@ -8,7 +8,6 @@
-
diff --git a/installer/PowerToysSetup/PowerToysInstaller.wixproj b/installer/PowerToysSetup/PowerToysInstaller.wixproj
index 8771920c3c..7ce39b82cf 100644
--- a/installer/PowerToysSetup/PowerToysInstaller.wixproj
+++ b/installer/PowerToysSetup/PowerToysInstaller.wixproj
@@ -51,7 +51,6 @@ call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuil
call move /Y ..\..\..\Settings.wxs.bk ..\..\..\Settings.wxs
call move /Y ..\..\..\ShortcutGuide.wxs.bk ..\..\..\ShortcutGuide.wxs
call move /Y ..\..\..\Tools.wxs.bk ..\..\..\Tools.wxs
- call move /Y ..\..\..\VideoConference.wxs.bk ..\..\..\VideoConference.wxs
call move /Y ..\..\..\WinAppSDK.wxs.bk ..\..\..\WinAppSDK.wxs
call move /Y ..\..\..\WinUI3Applications.wxs.bk ..\..\..\WinUI3Applications.wxs
call move /Y ..\..\..\Workspaces.wxs.bk ..\..\..\Workspaces.wxs
@@ -119,7 +118,6 @@ call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuil
-
diff --git a/installer/PowerToysSetup/Product.wxs b/installer/PowerToysSetup/Product.wxs
index 7a3a6ee697..33dc8d0e55 100644
--- a/installer/PowerToysSetup/Product.wxs
+++ b/installer/PowerToysSetup/Product.wxs
@@ -69,7 +69,6 @@
-
@@ -196,6 +195,9 @@
NOT Installed
+
+ NOT Installed
+
+
+
-
-
-
-
-
-
@@ -34,7 +28,6 @@
-
diff --git a/installer/PowerToysSetup/VideoConference.wxs b/installer/PowerToysSetup/VideoConference.wxs
deleted file mode 100644
index 04bdb1e506..0000000000
--- a/installer/PowerToysSetup/VideoConference.wxs
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
-
- WINDOWSBUILDNUMBER >= 19041
-
-
-
-
-
-
-
-
-
-
-
-
- WINDOWSBUILDNUMBER >= 19041
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/installer/PowerToysSetupCustomActions/CustomAction.cpp b/installer/PowerToysSetupCustomActions/CustomAction.cpp
index 8995d2f9b6..d757221acd 100644
--- a/installer/PowerToysSetupCustomActions/CustomAction.cpp
+++ b/installer/PowerToysSetupCustomActions/CustomAction.cpp
@@ -11,6 +11,7 @@
#include "../../src/common/updating/installer.h"
#include "../../src/common/version/version.h"
#include "../../src/common/Telemetry/EtwTrace/EtwTrace.h"
+#include "../../src/common/utils/clean_video_conference.h"
#include
#include
@@ -328,6 +329,19 @@ LExit:
return WcaFinalize(er);
}
+// We've deprecated Video Conference Mute. This Custom Action cleans up any stray registry entry for the driver dll.
+UINT __stdcall CleanVideoConferenceRegistryCA(MSIHANDLE hInstall)
+{
+ HRESULT hr = S_OK;
+ UINT er = ERROR_SUCCESS;
+ hr = WcaInitialize(hInstall, "CleanVideoConferenceRegistry");
+ ExitOnFailure(hr, "Failed to initialize");
+ clean_video_conference();
+LExit:
+ er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
+ return WcaFinalize(er);
+}
+
UINT __stdcall ApplyModulesRegistryChangeSetsCA(MSIHANDLE hInstall)
{
HRESULT hr = S_OK;
@@ -1026,164 +1040,6 @@ UINT __stdcall DetectPrevInstallPathCA(MSIHANDLE hInstall)
return WcaFinalize(er);
}
-UINT __stdcall CertifyVirtualCameraDriverCA(MSIHANDLE hInstall)
-{
-#ifdef CIBuild // On pipeline we are using microsoft certification
- WcaInitialize(hInstall, "CertifyVirtualCameraDriverCA");
- return WcaFinalize(ERROR_SUCCESS);
-#else
- HRESULT hr = S_OK;
- UINT er = ERROR_SUCCESS;
- LPWSTR certificatePath = nullptr;
- HCERTSTORE hCertStore = nullptr;
- HANDLE hfile = nullptr;
- DWORD size = INVALID_FILE_SIZE;
- char* pFileContent = nullptr;
-
- hr = WcaInitialize(hInstall, "CertifyVirtualCameraDriverCA");
- ExitOnFailure(hr, "Failed to initialize", hr);
-
- hr = WcaGetProperty(L"CustomActionData", &certificatePath);
- ExitOnFailure(hr, "Failed to get install property", hr);
-
- hCertStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE, L"AuthRoot");
- if (!hCertStore)
- {
- hr = GetLastError();
- ExitOnFailure(hr, "Cannot put principal run level: %x", hr);
- }
-
- hfile = CreateFile(certificatePath, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
- if (hfile == INVALID_HANDLE_VALUE)
- {
- hr = GetLastError();
- ExitOnFailure(hr, "Certificate file open failed", hr);
- }
-
- size = GetFileSize(hfile, nullptr);
- if (size == INVALID_FILE_SIZE)
- {
- hr = GetLastError();
- ExitOnFailure(hr, "Certificate file size not valid", hr);
- }
-
- pFileContent = static_cast(malloc(size));
-
- DWORD sizeread;
- if (!ReadFile(hfile, pFileContent, size, &sizeread, nullptr))
- {
- hr = GetLastError();
- ExitOnFailure(hr, "Certificate file read failed", hr);
- }
-
- if (!CertAddEncodedCertificateToStore(hCertStore,
- X509_ASN_ENCODING,
- reinterpret_cast(pFileContent),
- size,
- CERT_STORE_ADD_ALWAYS,
- nullptr))
- {
- hr = GetLastError();
- ExitOnFailure(hr, "Adding certificate failed", hr);
- }
-
- free(pFileContent);
-
-LExit:
- ReleaseStr(certificatePath);
- if (hCertStore)
- {
- CertCloseStore(hCertStore, 0);
- }
- if (hfile)
- {
- CloseHandle(hfile);
- }
-
- if (!SUCCEEDED(hr))
- {
- PMSIHANDLE hRecord = MsiCreateRecord(0);
- MsiRecordSetString(hRecord, 0, TEXT("Failed to add certificate to store"));
- MsiProcessMessage(hInstall, static_cast(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
- }
-
- er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
- return WcaFinalize(er);
-#endif
-}
-
-UINT __stdcall InstallVirtualCameraDriverCA(MSIHANDLE hInstall)
-{
- HRESULT hr = S_OK;
- UINT er = ERROR_SUCCESS;
- LPWSTR driverPath = nullptr;
-
- hr = WcaInitialize(hInstall, "InstallVirtualCameraDriverCA");
- ExitOnFailure(hr, "Failed to initialize");
-
- hr = WcaGetProperty(L"CustomActionData", &driverPath);
- ExitOnFailure(hr, "Failed to get install property");
-
- BOOL requiresReboot;
- DiInstallDriverW(GetConsoleWindow(), driverPath, DIIRFLAG_FORCE_INF, &requiresReboot);
-
- hr = GetLastError();
- ExitOnFailure(hr, "Failed to install driver");
-
-LExit:
-
- if (!SUCCEEDED(hr))
- {
- PMSIHANDLE hRecord = MsiCreateRecord(0);
- MsiRecordSetString(hRecord, 0, TEXT("Failed to install virtual camera driver"));
- MsiProcessMessage(hInstall, static_cast(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
- }
-
- er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
- return WcaFinalize(er);
-}
-
-UINT __stdcall UninstallVirtualCameraDriverCA(MSIHANDLE hInstall)
-{
- HRESULT hr = S_OK;
- UINT er = ERROR_SUCCESS;
- LPWSTR driverPath = nullptr;
-
- hr = WcaInitialize(hInstall, "UninstallVirtualCameraDriverCA");
- ExitOnFailure(hr, "Failed to initialize");
-
- hr = WcaGetProperty(L"CustomActionData", &driverPath);
- ExitOnFailure(hr, "Failed to get uninstall property");
-
- BOOL requiresReboot;
- DiUninstallDriverW(GetConsoleWindow(), driverPath, 0, &requiresReboot);
-
- switch (GetLastError())
- {
- case ERROR_ACCESS_DENIED:
- case ERROR_FILE_NOT_FOUND:
- case ERROR_INVALID_FLAGS:
- case ERROR_IN_WOW64:
- {
- hr = GetLastError();
- ExitOnFailure(hr, "Failed to uninstall driver");
- break;
- }
- }
-
-LExit:
-
- if (!SUCCEEDED(hr))
- {
- PMSIHANDLE hRecord = MsiCreateRecord(0);
- MsiRecordSetString(hRecord, 0, TEXT("Failed to uninstall virtual camera driver"));
- MsiProcessMessage(hInstall, static_cast(INSTALLMESSAGE_WARNING + MB_OK), hRecord);
- }
-
- er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
- return WcaFinalize(er);
-}
-
UINT __stdcall UnRegisterContextMenuPackagesCA(MSIHANDLE hInstall)
{
using namespace winrt::Windows::Foundation;
diff --git a/installer/PowerToysSetupCustomActions/CustomAction.def b/installer/PowerToysSetupCustomActions/CustomAction.def
index f685a0be1d..d9ed0d0f04 100644
--- a/installer/PowerToysSetupCustomActions/CustomAction.def
+++ b/installer/PowerToysSetupCustomActions/CustomAction.def
@@ -3,6 +3,7 @@ LIBRARY "PowerToysSetupCustomActions"
EXPORTS
LaunchPowerToysCA
CheckGPOCA
+ CleanVideoConferenceRegistryCA
ApplyModulesRegistryChangeSetsCA
DetectPrevInstallPathCA
RemoveScheduledTasksCA
@@ -15,12 +16,9 @@ EXPORTS
TelemetryLogRepairCancelCA
TelemetryLogRepairFailCA
TerminateProcessesCA
- CertifyVirtualCameraDriverCA
- InstallVirtualCameraDriverCA
InstallEmbeddedMSIXCA
InstallDSCModuleCA
UnApplyModulesRegistryChangeSetsCA
- UninstallVirtualCameraDriverCA
UnRegisterContextMenuPackagesCA
UninstallEmbeddedMSIXCA
UninstallDSCModuleCA
diff --git a/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj b/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj
index dee9f63e2b..e2de4a4065 100644
--- a/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj
+++ b/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj
@@ -73,7 +73,6 @@
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Settings.wxs"" ""$(ProjectDir)..\PowerToysSetup\Settings.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\ShortcutGuide.wxs"" ""$(ProjectDir)..\PowerToysSetup\ShortcutGuide.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Tools.wxs"" ""$(ProjectDir)..\PowerToysSetup\Tools.wxs.bk""""
- call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\VideoConference.wxs"" ""$(ProjectDir)..\PowerToysSetup\VideoConference.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\WinAppSDK.wxs"" ""$(ProjectDir)..\PowerToysSetup\WinAppSDK.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\WinUI3Applications.wxs"" ""$(ProjectDir)..\PowerToysSetup\WinUI3Applications.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Workspaces.wxs"" ""$(ProjectDir)..\PowerToysSetup\Workspaces.wxs.bk""""
diff --git a/src/common/Common.UI/SettingsDeepLink.cs b/src/common/Common.UI/SettingsDeepLink.cs
index 41bd2c012e..9a9d4c1070 100644
--- a/src/common/Common.UI/SettingsDeepLink.cs
+++ b/src/common/Common.UI/SettingsDeepLink.cs
@@ -22,7 +22,6 @@ namespace Common.UI
PowerRename,
FileExplorer,
ShortcutGuide,
- VideoConference,
Hosts,
MeasureTool,
PowerOCR,
@@ -60,8 +59,6 @@ namespace Common.UI
return "FileExplorer";
case SettingsWindow.ShortcutGuide:
return "ShortcutGuide";
- case SettingsWindow.VideoConference:
- return "VideoConference";
case SettingsWindow.Hosts:
return "Hosts";
case SettingsWindow.MeasureTool:
diff --git a/src/common/GPOWrapper/GPOWrapper.cpp b/src/common/GPOWrapper/GPOWrapper.cpp
index a9ecb43818..ae051648ab 100644
--- a/src/common/GPOWrapper/GPOWrapper.cpp
+++ b/src/common/GPOWrapper/GPOWrapper.cpp
@@ -128,10 +128,6 @@ namespace winrt::PowerToys::GPOWrapper::implementation
{
return static_cast(powertoys_gpo::getConfiguredAdvancedPasteEnabledValue());
}
- GpoRuleConfigured GPOWrapper::GetConfiguredVideoConferenceMuteEnabledValue()
- {
- return static_cast(powertoys_gpo::getConfiguredVideoConferenceMuteEnabledValue());
- }
GpoRuleConfigured GPOWrapper::GetConfiguredMouseWithoutBordersEnabledValue()
{
return static_cast(powertoys_gpo::getConfiguredMouseWithoutBordersEnabledValue());
diff --git a/src/common/GPOWrapper/GPOWrapper.h b/src/common/GPOWrapper/GPOWrapper.h
index 34c1e3646b..0b9a15942d 100644
--- a/src/common/GPOWrapper/GPOWrapper.h
+++ b/src/common/GPOWrapper/GPOWrapper.h
@@ -39,7 +39,6 @@ namespace winrt::PowerToys::GPOWrapper::implementation
static GpoRuleConfigured GetConfiguredShortcutGuideEnabledValue();
static GpoRuleConfigured GetConfiguredTextExtractorEnabledValue();
static GpoRuleConfigured GetConfiguredAdvancedPasteEnabledValue();
- static GpoRuleConfigured GetConfiguredVideoConferenceMuteEnabledValue();
static GpoRuleConfigured GetConfiguredPeekEnabledValue();
static GpoRuleConfigured GetDisableNewUpdateToastValue();
static GpoRuleConfigured GetDisableAutomaticUpdateDownloadValue();
diff --git a/src/common/GPOWrapper/GPOWrapper.idl b/src/common/GPOWrapper/GPOWrapper.idl
index af58834a0c..c404741e5d 100644
--- a/src/common/GPOWrapper/GPOWrapper.idl
+++ b/src/common/GPOWrapper/GPOWrapper.idl
@@ -43,7 +43,6 @@ namespace PowerToys
static GpoRuleConfigured GetConfiguredShortcutGuideEnabledValue();
static GpoRuleConfigured GetConfiguredTextExtractorEnabledValue();
static GpoRuleConfigured GetConfiguredAdvancedPasteEnabledValue();
- static GpoRuleConfigured GetConfiguredVideoConferenceMuteEnabledValue();
static GpoRuleConfigured GetConfiguredPeekEnabledValue();
static GpoRuleConfigured GetDisableNewUpdateToastValue();
static GpoRuleConfigured GetDisableAutomaticUpdateDownloadValue();
diff --git a/src/common/interop/CommonManaged.cpp b/src/common/interop/CommonManaged.cpp
index 39ae2967b4..d59741fef6 100644
--- a/src/common/interop/CommonManaged.cpp
+++ b/src/common/interop/CommonManaged.cpp
@@ -2,8 +2,6 @@
#include "CommonManaged.h"
#include "CommonManaged.g.cpp"
#include
-#include "../../modules/videoconference/VideoConferenceShared/MicrophoneDevice.h"
-#include "../../modules/videoconference/VideoConferenceShared/VideoCaptureDeviceList.h"
namespace winrt::PowerToys::Interop::implementation
{
@@ -11,29 +9,4 @@ namespace winrt::PowerToys::Interop::implementation
{
return hstring{ get_product_version() };
}
- winrt::Windows::Foundation::Collections::IVector CommonManaged::GetAllActiveMicrophoneDeviceNames()
- {
- auto names = std::vector();
- for (const auto& device : MicrophoneDevice::getAllActive())
- {
- names.push_back(device->name().data());
- }
- return winrt::multi_threaded_vector(std::move(names));
- }
- winrt::Windows::Foundation::Collections::IVector CommonManaged::GetAllVideoCaptureDeviceNames()
- {
- auto names = std::vector();
- VideoCaptureDeviceList vcdl;
- vcdl.EnumerateDevices();
-
- for (UINT32 i = 0; i < vcdl.Count(); ++i)
- {
- auto name = vcdl.GetDeviceName(i).data();
- if (name != L"PowerToys VideoConference Mute")
- {
- names.push_back(name);
- }
- }
- return winrt::multi_threaded_vector(std::move(names));
- }
}
diff --git a/src/common/interop/CommonManaged.h b/src/common/interop/CommonManaged.h
index 96d6f5d8a5..7196699ae9 100644
--- a/src/common/interop/CommonManaged.h
+++ b/src/common/interop/CommonManaged.h
@@ -8,8 +8,6 @@ namespace winrt::PowerToys::Interop::implementation
CommonManaged() = default;
static hstring GetProductVersion();
- static winrt::Windows::Foundation::Collections::IVector GetAllActiveMicrophoneDeviceNames();
- static winrt::Windows::Foundation::Collections::IVector GetAllVideoCaptureDeviceNames();
};
}
namespace winrt::PowerToys::Interop::factory_implementation
diff --git a/src/common/interop/CommonManaged.idl b/src/common/interop/CommonManaged.idl
index 0a523e790a..38e9225bb5 100644
--- a/src/common/interop/CommonManaged.idl
+++ b/src/common/interop/CommonManaged.idl
@@ -4,8 +4,6 @@ namespace PowerToys
{
[default_interface] static runtimeclass CommonManaged {
static String GetProductVersion();
- static Windows.Foundation.Collections.IVector GetAllActiveMicrophoneDeviceNames();
- static Windows.Foundation.Collections.IVector GetAllVideoCaptureDeviceNames();
}
}
}
\ No newline at end of file
diff --git a/src/common/interop/PowerToys.Interop.vcxproj b/src/common/interop/PowerToys.Interop.vcxproj
index 88115f9eab..aadd8b2ebb 100644
--- a/src/common/interop/PowerToys.Interop.vcxproj
+++ b/src/common/interop/PowerToys.Interop.vcxproj
@@ -93,8 +93,6 @@
-
-
CommonManaged.idl
@@ -123,8 +121,6 @@
-
-
CommonManaged.idl
diff --git a/src/common/interop/PowerToys.Interop.vcxproj.filters b/src/common/interop/PowerToys.Interop.vcxproj.filters
index 5df4afc368..6fa51a3275 100644
--- a/src/common/interop/PowerToys.Interop.vcxproj.filters
+++ b/src/common/interop/PowerToys.Interop.vcxproj.filters
@@ -21,12 +21,6 @@
Header Files
-
- Header Files
-
-
- Header Files
-
Header Files
@@ -65,12 +59,6 @@
Source Files
-
- Source Files
-
-
- Source Files
-
Source Files
diff --git a/src/common/utils/clean_video_conference.h b/src/common/utils/clean_video_conference.h
new file mode 100644
index 0000000000..f90a3ad1ee
--- /dev/null
+++ b/src/common/utils/clean_video_conference.h
@@ -0,0 +1,18 @@
+#pragma once
+
+// Video Conference Mute was a utility we deprecated. However, this required a manual user disable of the module to remove the camera registration, so we include the disable code here to be able to clean up.
+void clean_video_conference()
+{
+ // 31AD75E9-8C3A-49C8-B9ED-5880D6B4A764 is the CLSID GUID for the 64 video conference mute driver.
+ // 31AD75E9-8C3A-49C8-B9ED-5880D6B4A732 is the CLSID GUID for the 32 video conference mute driver.
+ // 860BB310-5D01-11D0-BD3B-00A0C911CE86 is the CLSID GUID for CLSID_VideoInputDeviceCategory.
+
+ // Unregister the 64 bit driver CLSID:
+ RegDeleteTreeW(HKEY_CLASSES_ROOT, L"CLSID\\{31AD75E9-8C3A-49C8-B9ED-5880D6B4A764}");
+ // Unregister the 64 bit driver CLSID from Video Input Devices:
+ RegDeleteTreeW(HKEY_CLASSES_ROOT, L"CLSID\\{860BB310-5D01-11D0-BD3B-00A0C911CE86}\\Instance\\{31AD75E9-8C3A-49C8-B9ED-5880D6B4A764}");
+ // Unregister the 32 bit driver CLSID:
+ RegDeleteTreeW(HKEY_LOCAL_MACHINE, L"Software\\WOW6432Node\\Classes\\CLSID\\{31AD75E9-8C3A-49C8-B9ED-5880D6B4A732}");
+ // Unregister the 32 bit driver CLSID from Video Input Devices:
+ RegDeleteTreeW(HKEY_LOCAL_MACHINE, L"Software\\WOW6432Node\\Classes\\CLSID\\{860BB310-5D01-11D0-BD3B-00A0C911CE86}\\Instance\\{31AD75E9-8C3A-49C8-B9ED-5880D6B4A732}");
+}
diff --git a/src/common/utils/gpo.h b/src/common/utils/gpo.h
index 04e03b4767..2e3c681c91 100644
--- a/src/common/utils/gpo.h
+++ b/src/common/utils/gpo.h
@@ -53,7 +53,6 @@ namespace powertoys_gpo {
const std::wstring POLICY_CONFIGURE_ENABLED_SHORTCUT_GUIDE = L"ConfigureEnabledUtilityShortcutGuide";
const std::wstring POLICY_CONFIGURE_ENABLED_TEXT_EXTRACTOR = L"ConfigureEnabledUtilityTextExtractor";
const std::wstring POLICY_CONFIGURE_ENABLED_ADVANCED_PASTE = L"ConfigureEnabledUtilityAdvancedPaste";
- const std::wstring POLICY_CONFIGURE_ENABLED_VIDEO_CONFERENCE_MUTE = L"ConfigureEnabledUtilityVideoConferenceMute";
const std::wstring POLICY_CONFIGURE_ENABLED_REGISTRY_PREVIEW = L"ConfigureEnabledUtilityRegistryPreview";
const std::wstring POLICY_CONFIGURE_ENABLED_MOUSE_WITHOUT_BORDERS = L"ConfigureEnabledUtilityMouseWithoutBorders";
const std::wstring POLICY_CONFIGURE_ENABLED_PEEK = L"ConfigureEnabledUtilityPeek";
@@ -414,11 +413,6 @@ namespace powertoys_gpo {
return getUtilityEnabledValue(POLICY_CONFIGURE_ENABLED_WORKSPACES);
}
- inline gpo_rule_configured_t getConfiguredVideoConferenceMuteEnabledValue()
- {
- return getUtilityEnabledValue(POLICY_CONFIGURE_ENABLED_VIDEO_CONFERENCE_MUTE);
- }
-
inline gpo_rule_configured_t getConfiguredMouseWithoutBordersEnabledValue()
{
return getUtilityEnabledValue(POLICY_CONFIGURE_ENABLED_MOUSE_WITHOUT_BORDERS);
diff --git a/src/common/version/version.vcxproj b/src/common/version/version.vcxproj
index f6ad515137..b045d8f5a5 100644
--- a/src/common/version/version.vcxproj
+++ b/src/common/version/version.vcxproj
@@ -10,7 +10,7 @@
-
+
Debug
diff --git a/src/dsc/Microsoft.PowerToys.Configure/examples/disableAllModules.dsc.yaml b/src/dsc/Microsoft.PowerToys.Configure/examples/disableAllModules.dsc.yaml
index 5324df75ea..92986e8107 100644
--- a/src/dsc/Microsoft.PowerToys.Configure/examples/disableAllModules.dsc.yaml
+++ b/src/dsc/Microsoft.PowerToys.Configure/examples/disableAllModules.dsc.yaml
@@ -63,8 +63,6 @@ properties:
Enabled: false
ShortcutGuide:
Enabled: false
- VideoConference:
- Enabled: false
MeasureTool:
Enabled: false
Hosts:
diff --git a/src/dsc/Microsoft.PowerToys.Configure/examples/enableAllModules.dsc.yaml b/src/dsc/Microsoft.PowerToys.Configure/examples/enableAllModules.dsc.yaml
index 5fa895ddfd..5ff4dcfe71 100644
--- a/src/dsc/Microsoft.PowerToys.Configure/examples/enableAllModules.dsc.yaml
+++ b/src/dsc/Microsoft.PowerToys.Configure/examples/enableAllModules.dsc.yaml
@@ -63,8 +63,6 @@ properties:
Enabled: true
ShortcutGuide:
Enabled: true
- VideoConference:
- Enabled: true
MeasureTool:
Enabled: true
Hosts:
diff --git a/src/gpo/assets/PowerToys.admx b/src/gpo/assets/PowerToys.admx
index 799b1f20f3..c17e6712bf 100644
--- a/src/gpo/assets/PowerToys.admx
+++ b/src/gpo/assets/PowerToys.admx
@@ -1,11 +1,11 @@
-
+
-
+
@@ -23,6 +23,7 @@
+
@@ -45,6 +46,9 @@
+
+
+
@@ -441,8 +445,8 @@
-
-
+
+
diff --git a/src/gpo/assets/en-US/PowerToys.adml b/src/gpo/assets/en-US/PowerToys.adml
index 7a8f037eee..adcc902811 100644
--- a/src/gpo/assets/en-US/PowerToys.adml
+++ b/src/gpo/assets/en-US/PowerToys.adml
@@ -1,7 +1,7 @@
-
+
PowerToys
PowerToys
@@ -13,6 +13,7 @@
Mouse Without Borders
General settings
New+
+ Deprecated policies
PowerToys version 0.64.0 or later
PowerToys version 0.68.0 or later
@@ -29,6 +30,7 @@
PowerToys version 0.84.0 or later
PowerToys version 0.85.0 or later
PowerToys version 0.86.0 or later
+ From PowerToys version 0.64.0 until PowerToys version 0.87.1
This policy configures the enabled state for all PowerToys utilities.
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-NotInUse Dark.png b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-NotInUse Dark.png
deleted file mode 100644
index 08446a2078..0000000000
Binary files a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-NotInUse Dark.png and /dev/null differ
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-NotInUse Dark.svg b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-NotInUse Dark.svg
deleted file mode 100644
index 4860bbfd3a..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-NotInUse Dark.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-NotInUse Light.png b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-NotInUse Light.png
deleted file mode 100644
index 285ea495b8..0000000000
Binary files a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-NotInUse Light.png and /dev/null differ
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-NotInUse Light.svg b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-NotInUse Light.svg
deleted file mode 100644
index a30e909ff1..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-NotInUse Light.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-Off Dark.png b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-Off Dark.png
deleted file mode 100644
index 32d7559e73..0000000000
Binary files a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-Off Dark.png and /dev/null differ
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-Off Dark.svg b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-Off Dark.svg
deleted file mode 100644
index c147f2278e..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-Off Dark.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-Off Light.png b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-Off Light.png
deleted file mode 100644
index 7f0477ff89..0000000000
Binary files a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-Off Light.png and /dev/null differ
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-Off Light.svg b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-Off Light.svg
deleted file mode 100644
index 25eecdd72f..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-Off Light.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-On Dark.png b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-On Dark.png
deleted file mode 100644
index ac33d985c8..0000000000
Binary files a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-On Dark.png and /dev/null differ
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-On Dark.svg b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-On Dark.svg
deleted file mode 100644
index ea31e3d78d..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-On Dark.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-On Light.png b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-On Light.png
deleted file mode 100644
index a43b3cf364..0000000000
Binary files a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-On Light.png and /dev/null differ
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-On Light.svg b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-On Light.svg
deleted file mode 100644
index e3c0352bcc..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/Off-On Light.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-NotInUse Dark.png b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-NotInUse Dark.png
deleted file mode 100644
index ff34ff3eb5..0000000000
Binary files a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-NotInUse Dark.png and /dev/null differ
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-NotInUse Dark.svg b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-NotInUse Dark.svg
deleted file mode 100644
index 268decd93b..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-NotInUse Dark.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-NotInUse Light.png b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-NotInUse Light.png
deleted file mode 100644
index b4e5edaea5..0000000000
Binary files a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-NotInUse Light.png and /dev/null differ
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-NotInUse Light.svg b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-NotInUse Light.svg
deleted file mode 100644
index d9d340c034..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-NotInUse Light.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-Off Dark.png b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-Off Dark.png
deleted file mode 100644
index 8492439759..0000000000
Binary files a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-Off Dark.png and /dev/null differ
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-Off Dark.svg b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-Off Dark.svg
deleted file mode 100644
index 67080eabdd..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-Off Dark.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-Off Light.png b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-Off Light.png
deleted file mode 100644
index b011e944bb..0000000000
Binary files a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-Off Light.png and /dev/null differ
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-Off Light.svg b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-Off Light.svg
deleted file mode 100644
index f5661655bc..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-Off Light.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-On Dark.png b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-On Dark.png
deleted file mode 100644
index 6f1955d2d2..0000000000
Binary files a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-On Dark.png and /dev/null differ
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-On Dark.svg b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-On Dark.svg
deleted file mode 100644
index e539e785a6..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-On Dark.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-On Light.png b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-On Light.png
deleted file mode 100644
index b9fb04c6a6..0000000000
Binary files a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-On Light.png and /dev/null differ
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-On Light.svg b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-On Light.svg
deleted file mode 100644
index ff4a5c2e31..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/On-On Light.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/black.bmp b/src/modules/videoconference/VideoConferenceModule/Assets/VCM/black.bmp
deleted file mode 100644
index 18d40779ce..0000000000
Binary files a/src/modules/videoconference/VideoConferenceModule/Assets/VCM/black.bmp and /dev/null differ
diff --git a/src/modules/videoconference/VideoConferenceModule/AudioDeviceNotificationClient.cpp b/src/modules/videoconference/VideoConferenceModule/AudioDeviceNotificationClient.cpp
deleted file mode 100644
index 1252907184..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/AudioDeviceNotificationClient.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "pch.h"
-
-#include "AudioDeviceNotificationClient.h"
-
-AudioDeviceNotificationClient::AudioDeviceNotificationClient()
-{
- (void)CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&_deviceEnumerator));
- if (!_deviceEnumerator)
- {
- return;
- }
-
- if (FAILED(_deviceEnumerator->RegisterEndpointNotificationCallback(this)))
- {
- _deviceEnumerator->Release();
- _deviceEnumerator = nullptr;
- }
-}
-
-AudioDeviceNotificationClient::~AudioDeviceNotificationClient()
-{
- if (!_deviceEnumerator)
- {
- return;
- }
-
- _deviceEnumerator->UnregisterEndpointNotificationCallback(this);
- _deviceEnumerator->Release();
-}
-
-ULONG AudioDeviceNotificationClient::AddRef()
-{
- return 1;
-}
-
-ULONG AudioDeviceNotificationClient::Release()
-{
- return 1;
-}
-
-HRESULT AudioDeviceNotificationClient::QueryInterface(REFIID, void**)
-{
- return S_OK;
-}
-
-HRESULT AudioDeviceNotificationClient::OnPropertyValueChanged(LPCWSTR, const PROPERTYKEY)
-{
- _deviceConfigurationChanged = true;
- return S_OK;
-}
-
-HRESULT AudioDeviceNotificationClient::OnDeviceAdded(LPCWSTR)
-{
- _deviceConfigurationChanged = true;
- return S_OK;
-}
-
-HRESULT AudioDeviceNotificationClient::OnDeviceRemoved(LPCWSTR)
-{
- _deviceConfigurationChanged = true;
- return S_OK;
-}
-
-HRESULT AudioDeviceNotificationClient::OnDeviceStateChanged(LPCWSTR, DWORD)
-{
- _deviceConfigurationChanged = true;
- return S_OK;
-}
-
-HRESULT AudioDeviceNotificationClient::OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR)
-{
- if (role == eConsole && (flow == eCapture || flow == eAll))
- {
- _deviceConfigurationChanged = true;
- }
-
- return S_OK;
-}
diff --git a/src/modules/videoconference/VideoConferenceModule/AudioDeviceNotificationClient.h b/src/modules/videoconference/VideoConferenceModule/AudioDeviceNotificationClient.h
deleted file mode 100644
index 3fe3f5fd1d..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/AudioDeviceNotificationClient.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#pragma once
-
-#include
-
-struct AudioDeviceNotificationClient : IMMNotificationClient
-{
- AudioDeviceNotificationClient();
- ~AudioDeviceNotificationClient();
-
- bool PullPendingNotifications()
- {
- const bool result = _deviceConfigurationChanged;
- _deviceConfigurationChanged = false;
- return result;
- }
-
-private:
- ULONG AddRef() override;
- ULONG Release() override;
- HRESULT QueryInterface(REFIID, void**) override;
- HRESULT OnPropertyValueChanged(LPCWSTR, const PROPERTYKEY) override;
- HRESULT OnDeviceAdded(LPCWSTR) override;
- HRESULT OnDeviceRemoved(LPCWSTR) override;
- HRESULT OnDeviceStateChanged(LPCWSTR, DWORD) override;
- HRESULT OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR) override;
-
- IMMDeviceEnumerator* _deviceEnumerator = nullptr;
-
- bool _deviceConfigurationChanged = false;
-};
diff --git a/src/modules/videoconference/VideoConferenceModule/README.md b/src/modules/videoconference/VideoConferenceModule/README.md
deleted file mode 100644
index d53920685a..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# Video Conference Mute
-
-# Introduction
-The Video Conference Mute module allows muting microphone and/or web camera video stream during video calls or other activity.
-
-# Usage
-If you'd like to mute your web camera, please select "PowerToys VideoConference Mute" device in your web camera-using app, then restart it.
-
-During a video call, you can use default shortcuts to mute microphone, web camera or both. You'll see a toolbar indicating corresponding mute statuses.
-
-# Options
-You can tweak the toolbar position on the screen as well as set web camera overlay image during muting.
-
-# Backlog
diff --git a/src/modules/videoconference/VideoConferenceModule/Toolbar.cpp b/src/modules/videoconference/VideoConferenceModule/Toolbar.cpp
deleted file mode 100644
index 0dabd58d9c..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/Toolbar.cpp
+++ /dev/null
@@ -1,390 +0,0 @@
-#include "pch.h"
-#include "Toolbar.h"
-
-#include
-
-#include
-#include
-
-#include "Logging.h"
-#include "VideoConferenceModule.h"
-
-Toolbar* toolbar = nullptr;
-
-const int REFRESH_RATE = 100;
-const int OVERLAY_SHOW_TIME = 500;
-const int BORDER_OFFSET = 12;
-const int TOP_RIGHT_BORDER_OFFSET = 40;
-std::wstring cached_position = L"";
-
-Toolbar::Toolbar()
-{
- toolbar = this;
- darkImages.camOnMicOn = Gdiplus::Image::FromFile(L"Assets/VCM/On-On Dark.png");
- darkImages.camOffMicOn = Gdiplus::Image::FromFile(L"Assets/VCM/On-Off Dark.png");
- darkImages.camOnMicOff = Gdiplus::Image::FromFile(L"Assets/VCM/Off-On Dark.png");
- darkImages.camOffMicOff = Gdiplus::Image::FromFile(L"Assets/VCM/Off-Off Dark.png");
- darkImages.camUnusedMicOn = Gdiplus::Image::FromFile(L"Assets/VCM/On-NotInUse Dark.png");
- darkImages.camUnusedMicOff = Gdiplus::Image::FromFile(L"Assets/VCM/Off-NotInUse Dark.png");
-
- lightImages.camOnMicOn = Gdiplus::Image::FromFile(L"Assets/VCM/On-On Light.png");
- lightImages.camOffMicOn = Gdiplus::Image::FromFile(L"Assets/VCM/On-Off Light.png");
- lightImages.camOnMicOff = Gdiplus::Image::FromFile(L"Assets/VCM/Off-On Light.png");
- lightImages.camOffMicOff = Gdiplus::Image::FromFile(L"Assets/VCM/Off-Off Light.png");
- lightImages.camUnusedMicOn = Gdiplus::Image::FromFile(L"Assets/VCM/On-NotInUse Light.png");
- lightImages.camUnusedMicOff = Gdiplus::Image::FromFile(L"Assets/VCM/Off-NotInUse Light.png");
-}
-
-void Toolbar::scheduleModuleSettingsUpdate()
-{
- moduleSettingsUpdateScheduled = true;
-}
-
-void Toolbar::scheduleGeneralSettingsUpdate()
-{
- generalSettingsUpdateScheduled = true;
-}
-
-inline POINT calculateToolbarPositioning(Box const& screenSize, std::wstring& position, const int desiredWidth, const int desiredHeight)
-{
- POINT p;
- p.x = p.y = 0;
-
- if (position == L"Top left corner")
- {
- p.x = screenSize.left() + BORDER_OFFSET;
- p.y = screenSize.top() + BORDER_OFFSET;
- }
- else if (position == L"Top center")
- {
- p.x = screenSize.middle().x - desiredWidth / 2;
- p.y = screenSize.top() + BORDER_OFFSET;
- }
- else if (position == L"Bottom left corner")
- {
- p.x = screenSize.left() + BORDER_OFFSET;
- p.y = screenSize.bottom() - desiredHeight - BORDER_OFFSET;
- }
- else if (position == L"Bottom center")
- {
- p.x = screenSize.middle().x - desiredWidth / 2;
- p.y = screenSize.bottom() - desiredHeight - BORDER_OFFSET;
- }
- else if (position == L"Bottom right corner")
- {
- p.x = screenSize.right() - desiredWidth - BORDER_OFFSET;
- p.y = screenSize.bottom() - desiredHeight - BORDER_OFFSET;
- }
- else //"Top right corner" or non-present
- {
- p.x = screenSize.right() - desiredWidth - BORDER_OFFSET;
- p.y = screenSize.top() + TOP_RIGHT_BORDER_OFFSET;
- }
- return p;
-}
-
-LRESULT Toolbar::WindowProcessMessages(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
-{
- switch (msg)
- {
- case WM_DESTROY:
- return 0;
- case WM_LBUTTONDOWN:
- {
- int x = GET_X_LPARAM(lparam);
- int y = GET_Y_LPARAM(lparam);
- UINT dpi = DPIAware::DEFAULT_DPI;
- DPIAware::GetScreenDPIForWindow(hwnd, dpi);
-
- if (x < 322 * static_cast(dpi) / static_cast(DPIAware::DEFAULT_DPI) / 2)
- {
- VideoConferenceModule::reverseMicrophoneMute();
- }
- else
- {
- VideoConferenceModule::reverseVirtualCameraMuteState();
- }
-
- return DefWindowProcW(hwnd, msg, wparam, lparam);
- }
- case WM_DPICHANGED:
- {
- UINT dpi = LOWORD(wparam);
- RECT* prcNewWindow = reinterpret_cast(lparam);
-
- POINT suggestedPosition;
- suggestedPosition.x = prcNewWindow->left;
- suggestedPosition.y = prcNewWindow->top;
-
- int desiredWidth = prcNewWindow->right - prcNewWindow->left;
- int desiredHeight = prcNewWindow->bottom - prcNewWindow->top;
-
- HMONITOR hMonitor = MonitorFromPoint(suggestedPosition, MONITOR_DEFAULTTONEAREST);
-
- MonitorInfo info{ hMonitor };
-
- suggestedPosition = calculateToolbarPositioning(info.GetScreenSize(false), cached_position, desiredWidth, desiredHeight);
-
- SetWindowPos(hwnd,
- NULL,
- suggestedPosition.x,
- suggestedPosition.y,
- desiredWidth,
- desiredHeight,
- SWP_NOZORDER | SWP_NOACTIVATE);
- return DefWindowProcW(hwnd, msg, wparam, lparam);
- }
- case WM_CREATE:
- case WM_PAINT:
- {
- PAINTSTRUCT ps;
- HDC hdc;
- UINT dpi = DPIAware::DEFAULT_DPI;
-
- DPIAware::GetScreenDPIForWindow(hwnd, dpi);
-
- hdc = BeginPaint(hwnd, &ps);
-
- Gdiplus::Graphics graphic(hdc);
-
- ToolbarImages* themeImages = &toolbar->darkImages;
-
- if (toolbar->theme == L"light" || (toolbar->theme == L"system" && !WindowsColors::is_dark_mode()))
- {
- themeImages = &toolbar->lightImages;
- }
- else
- {
- themeImages = &toolbar->darkImages;
- }
- Gdiplus::Image* toolbarImage = nullptr;
- if (!toolbar->cameraInUse)
- {
- if (toolbar->microphoneMuted)
- {
- toolbarImage = themeImages->camUnusedMicOff;
- }
- else
- {
- toolbarImage = themeImages->camUnusedMicOn;
- }
- }
- else if (toolbar->microphoneMuted)
- {
- if (toolbar->cameraMuted)
- {
- toolbarImage = themeImages->camOffMicOff;
- }
- else
- {
- toolbarImage = themeImages->camOnMicOff;
- }
- }
- else
- {
- if (toolbar->cameraMuted)
- {
- toolbarImage = themeImages->camOffMicOn;
- }
- else
- {
- toolbarImage = themeImages->camOnMicOn;
- }
- }
- // Images are scaled by 4 to support higher dpi values.
- graphic.DrawImage(toolbarImage, 0, 0, toolbarImage->GetWidth() / 4 * dpi / DPIAware::DEFAULT_DPI, toolbarImage->GetHeight() / 4 * dpi / DPIAware::DEFAULT_DPI);
-
- EndPaint(hwnd, &ps);
- break;
- }
- case WM_TIMER:
- {
- if (toolbar->audioConfChangesNotifier.PullPendingNotifications())
- {
- instance->onMicrophoneConfigurationChanged();
- }
- toolbar->microphoneMuted = instance->getMicrophoneMuteState();
-
- if (toolbar->generalSettingsUpdateScheduled)
- {
- instance->onGeneralSettingsChanged();
- toolbar->generalSettingsUpdateScheduled = false;
- }
- if (toolbar->moduleSettingsUpdateScheduled)
- {
- instance->onModuleSettingsChanged();
- toolbar->moduleSettingsUpdateScheduled = false;
- }
-
- toolbar->cameraInUse = VideoConferenceModule::getVirtualCameraInUse();
-
- InvalidateRect(hwnd, NULL, NULL);
-
- using namespace std::chrono;
- const auto nowMillis = duration_cast(system_clock::now().time_since_epoch()).count();
- const bool showOverlayTimeout = nowMillis - toolbar->lastTimeCamOrMicMuteStateChanged > OVERLAY_SHOW_TIME;
-
- static bool previousShow = false;
- bool show = toolbar->ToolbarHide == L"Never";
-
- const bool cameraJustStoppedInUse = toolbar->previouscameraInUse && !toolbar->cameraInUse;
- bool shouldUnmuteAll = cameraJustStoppedInUse;
-
- if (toolbar->ToolbarHide == L"When both camera and microphone are muted")
- {
- // We shouldn't unmute devices, since we'd like to only show the toolbar only
- // when something is unmuted -> the use case is to keep everything muted by default and track it
- shouldUnmuteAll = false;
- show = (!toolbar->cameraMuted && toolbar->cameraInUse) || !toolbar->microphoneMuted;
- }
- else if (toolbar->ToolbarHide == L"When both camera and microphone are unmuted")
- show = (toolbar->cameraMuted && toolbar->cameraInUse) || toolbar->microphoneMuted;
-
- if (shouldUnmuteAll && !toolbar->moduleSettingsUpdateScheduled)
- VideoConferenceModule::unmuteAll();
-
- show = show || !showOverlayTimeout;
- ShowWindow(hwnd, show ? SW_SHOW : SW_HIDE);
-
- if (previousShow != show)
- {
- previousShow = show;
- LOG(show ? "Toolbar visibility changed to shown" : "Toolbar visibility changed to hidden");
- }
-
- KillTimer(hwnd, toolbar->nTimerId);
- toolbar->previouscameraInUse = toolbar->cameraInUse;
- break;
- }
- default:
- return DefWindowProcW(hwnd, msg, wparam, lparam);
- }
-
- toolbar->nTimerId = SetTimer(hwnd, 101, REFRESH_RATE, nullptr);
-
- return DefWindowProcW(hwnd, msg, wparam, lparam);
-}
-
-void Toolbar::show(std::wstring position, std::wstring monitorString)
-{
- cached_position = position;
- for (auto& hwnd : hwnds)
- {
- PostMessageW(hwnd, WM_CLOSE, 0, 0);
- }
- hwnds.clear();
-
- // Images are scaled by 4 to support higher dpi values.
- int overlayWidth = darkImages.camOffMicOff->GetWidth() / 4;
- int overlayHeight = darkImages.camOffMicOff->GetHeight() / 4;
-
- // Register the window class
- LPCWSTR CLASS_NAME = L"MuteNotificationWindowClass";
- WNDCLASS wc{};
- wc.hInstance = GetModuleHandleW(nullptr);
- wc.lpszClassName = CLASS_NAME;
- wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
- wc.hbrBackground = reinterpret_cast(COLOR_WINDOW);
- wc.lpfnWndProc = WindowProcessMessages;
- RegisterClassW(&wc);
-
- // Create the window
- DWORD dwExtStyle = 0;
- DWORD dwStyle = WS_POPUPWINDOW;
-
- std::vector monitorInfos;
-
- if (monitorString == L"All monitors")
- {
- monitorInfos = MonitorInfo::GetMonitors(false);
- }
- else //"Main monitor" or non-present
- {
- monitorInfos.push_back(MonitorInfo::GetPrimaryMonitor());
- }
-
- for (auto& monitorInfo : monitorInfos)
- {
- const auto screenSize = monitorInfo.GetScreenSize(false);
- UINT dpi = DPIAware::DEFAULT_DPI;
- DPIAware::GetScreenDPIForMonitor(monitorInfo.GetHandle(), dpi);
-
- int scaledOverlayWidth = overlayWidth * dpi / DPIAware::DEFAULT_DPI;
- int scaledOverlayHeight = overlayHeight * dpi / DPIAware::DEFAULT_DPI;
-
- POINT p = calculateToolbarPositioning(screenSize, position, scaledOverlayWidth, scaledOverlayHeight);
-
- HWND hwnd;
- hwnd = CreateWindowExW(
- WS_EX_TOOLWINDOW | WS_EX_LAYERED,
- CLASS_NAME,
- CLASS_NAME,
- WS_POPUP,
- static_cast(p.x),
- static_cast(p.y),
- scaledOverlayWidth,
- scaledOverlayHeight,
- nullptr,
- nullptr,
- GetModuleHandleW(nullptr),
- nullptr);
-
- auto transparentColorKey = RGB(0, 0, 255);
- HBRUSH brush = CreateSolidBrush(transparentColorKey);
- SetClassLongPtr(hwnd, GCLP_HBRBACKGROUND, reinterpret_cast(brush));
-
- SetLayeredWindowAttributes(hwnd, transparentColorKey, 0, LWA_COLORKEY);
-
- SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
-
- hwnds.push_back(hwnd);
- }
-}
-
-void Toolbar::hide()
-{
- for (auto& hwnd : hwnds)
- {
- PostMessage(hwnd, WM_CLOSE, 0, 0);
- }
- hwnds.clear();
-}
-
-bool Toolbar::getCameraMute()
-{
- return cameraMuted;
-}
-
-void Toolbar::setCameraMute(bool mute)
-{
- if (mute != cameraMuted)
- {
- lastTimeCamOrMicMuteStateChanged = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count();
- }
- cameraMuted = mute;
-}
-
-bool Toolbar::getMicrophoneMute()
-{
- return microphoneMuted;
-}
-
-void Toolbar::setMicrophoneMute(bool mute)
-{
- if (mute != microphoneMuted)
- {
- lastTimeCamOrMicMuteStateChanged = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count();
- }
-
- microphoneMuted = mute;
-}
-
-void Toolbar::setToolbarHide(std::wstring hide)
-{
- ToolbarHide = hide;
-}
-
-void Toolbar::setTheme(std::wstring theme)
-{
- Toolbar::theme = theme;
-}
diff --git a/src/modules/videoconference/VideoConferenceModule/Toolbar.h b/src/modules/videoconference/VideoConferenceModule/Toolbar.h
deleted file mode 100644
index 04b1c28a23..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/Toolbar.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#pragma once
-
-#include
-#include
-#include
-
-#include
-
-#include "AudioDeviceNotificationClient.h"
-
-struct ToolbarImages
-{
- Gdiplus::Image* camOnMicOn = nullptr;
- Gdiplus::Image* camOffMicOn = nullptr;
- Gdiplus::Image* camOnMicOff = nullptr;
- Gdiplus::Image* camOffMicOff = nullptr;
- Gdiplus::Image* camUnusedMicOn = nullptr;
- Gdiplus::Image* camUnusedMicOff = nullptr;
-};
-
-class Toolbar
-{
-public:
- Toolbar();
-
- void scheduleModuleSettingsUpdate();
- void scheduleGeneralSettingsUpdate();
-
- void show(std::wstring position, std::wstring monitorString);
- void hide();
-
- bool getCameraMute();
- void setCameraMute(bool mute);
- bool getMicrophoneMute();
- void setMicrophoneMute(bool mute);
-
- void setTheme(std::wstring theme);
- void setToolbarHide(std::wstring hide);
-
-private:
- static LRESULT CALLBACK WindowProcessMessages(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
-
- // Window callback can't be non-static so this members can't as well
- std::vector hwnds;
-
- ToolbarImages darkImages;
- ToolbarImages lightImages;
- AudioDeviceNotificationClient audioConfChangesNotifier;
-
- bool cameraMuted = false;
- bool cameraInUse = false;
- bool previouscameraInUse = false;
- bool microphoneMuted = false;
-
- std::wstring theme = L"system";
-
- std::wstring ToolbarHide = L"When both camera and microphone are unmuted";
-
- uint64_t lastTimeCamOrMicMuteStateChanged{};
-
- std::atomic_bool moduleSettingsUpdateScheduled = false;
- std::atomic_bool generalSettingsUpdateScheduled = false;
- UINT_PTR nTimerId{};
-};
diff --git a/src/modules/videoconference/VideoConferenceModule/VideoConference.filters b/src/modules/videoconference/VideoConferenceModule/VideoConference.filters
deleted file mode 100644
index e19316f1bd..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/VideoConference.filters
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
-
-
-
- {2c7c97f7-0d87-4230-a4b2-baf2cfc35d58}
-
-
- {aa4b6713-589d-42ef-804d-3a045833f83f}
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/modules/videoconference/VideoConferenceModule/VideoConference.vcxproj b/src/modules/videoconference/VideoConferenceModule/VideoConference.vcxproj
deleted file mode 100644
index e043322021..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/VideoConference.vcxproj
+++ /dev/null
@@ -1,189 +0,0 @@
-
-
-
-
- 15.0
- {5ABA70DE-3A3F-41F6-A1F5-D1F74F54F9BB}
- Win32Proj
- overlaywindow
- VideoConferenceModule
- ..\..\..\..\$(Platform)\$(Configuration)\
- PowerToys.VideoConferenceModule
-
-
-
- DynamicLibrary
- true
- v143
- Unicode
- Spectre
-
-
- DynamicLibrary
- false
- v143
- true
- Unicode
- Spectre
-
-
-
-
-
-
-
-
-
-
- false
-
-
- true
-
-
-
- Level3
- MaxSpeed
- true
- true
- true
- NDEBUG;OVERLAYWINDOW_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
- MultiThreaded
- ..\..\..\;..\..\;..\VideoConferenceShared\;%(AdditionalIncludeDirectories)
- stdcpplatest
-
-
- Windows
- true
- true
- true
- $(OutDir)$(TargetName)$(TargetExt)
- shlwapi.lib;gdiplus.lib;dwmapi.lib;uxtheme.lib;shcore.lib;Wtsapi32.lib;%(AdditionalDependencies)
-
-
-
-
- Level3
- Disabled
- true
- _DEBUG;OVERLAYWINDOW_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
- MultiThreadedDebug
- ..\..\..\common\inc;..\..\..\common\Telemetry;..\..\..\;..\..\;..\VideoConferenceShared\;%(AdditionalIncludeDirectories)
- stdcpplatest
-
-
- Windows
- true
- $(OutDir)$(TargetName)$(TargetExt)
- shlwapi.lib;gdiplus.lib;dwmapi.lib;uxtheme.lib;shcore.lib;Wtsapi32.lib;dxguid.lib;%(AdditionalDependencies)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Create
-
-
-
-
-
- {459e0768-7ebd-4c41-bba1-6db3b3815e0a}
-
-
-
-
- true
- PreserveNewest
-
-
- true
- PreserveNewest
-
-
- true
- PreserveNewest
-
-
- true
- PreserveNewest
-
-
- true
- PreserveNewest
-
-
- true
- PreserveNewest
-
-
- true
- PreserveNewest
-
-
- true
- PreserveNewest
-
-
- true
- PreserveNewest
-
-
- true
- PreserveNewest
-
-
- true
- PreserveNewest
-
-
- true
- PreserveNewest
-
-
- true
- PreserveNewest
-
-
-
-
-
-
-
-
-
- This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
-
-
-
- {caba8dfb-823b-4bf2-93ac-3f31984150d9}
-
-
- {6955446d-23f7-4023-9bb3-8657f904af99}
-
-
- {98537082-0fdb-40de-abd8-0dc5a4269bab}
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/modules/videoconference/VideoConferenceModule/VideoConference.vcxproj.filters b/src/modules/videoconference/VideoConferenceModule/VideoConference.vcxproj.filters
deleted file mode 100644
index fea3b28290..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/VideoConference.vcxproj.filters
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {efd98846-4568-41d4-a425-451c246802cd}
-
-
- {e79f8c1a-b78b-4ba5-b923-f7db79eba776}
-
-
-
-
-
-
-
- Assets\VCM
-
-
- Assets\VCM
-
-
- Assets\VCM
-
-
- Assets\VCM
-
-
- Assets\VCM
-
-
- Assets\VCM
-
-
- Assets\VCM
-
-
- Assets\VCM
-
-
- Assets\VCM
-
-
- Assets\VCM
-
-
- Assets\VCM
-
-
- Assets\VCM
-
-
- Assets\VCM
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/modules/videoconference/VideoConferenceModule/VideoConferenceModule.cpp b/src/modules/videoconference/VideoConferenceModule/VideoConferenceModule.cpp
deleted file mode 100644
index aab538e883..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/VideoConferenceModule.cpp
+++ /dev/null
@@ -1,733 +0,0 @@
-#include "pch.h"
-
-#include "VideoConferenceModule.h"
-
-#include
-
-#include
-#include
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-
-#include "logging.h"
-#include "trace.h"
-
-extern "C" IMAGE_DOS_HEADER __ImageBase;
-
-VideoConferenceModule* instance = nullptr;
-
-VideoConferenceSettings VideoConferenceModule::settings;
-Toolbar VideoConferenceModule::toolbar;
-bool VideoConferenceModule::pushToTalkPressed = false;
-
-HHOOK VideoConferenceModule::hook_handle;
-
-IAudioEndpointVolume* endpointVolume = NULL;
-
-bool VideoConferenceModule::isKeyPressed(unsigned int keyCode)
-{
- return (GetKeyState(keyCode) & 0x8000);
-}
-
-namespace fs = std::filesystem;
-
-bool VideoConferenceModule::isHotkeyPressed(DWORD code, PowerToysSettings::HotkeyObject& hotkey)
-{
- return code == hotkey.get_code() &&
- isKeyPressed(VK_SHIFT) == hotkey.shift_pressed() &&
- isKeyPressed(VK_CONTROL) == hotkey.ctrl_pressed() &&
- isKeyPressed(VK_LWIN) == hotkey.win_pressed() &&
- (isKeyPressed(VK_LMENU)) == hotkey.alt_pressed();
-}
-
-void VideoConferenceModule::reverseMicrophoneMute()
-{
- // All controlled mic should same state with _microphoneTrackedInUI
- // Avoid manually change in Control Panel make controlled mic has different state
- bool muted = !getMicrophoneMuteState();
- for (auto& controlledMic : instance->_controlledMicrophones)
- {
- controlledMic->set_muted(muted);
- }
- if (muted)
- {
- Trace::MicrophoneMuted();
- }
- instance->_mic_muted_state_during_disconnect = !instance->_mic_muted_state_during_disconnect;
-
- toolbar.setMicrophoneMute(muted);
-}
-
-bool VideoConferenceModule::getMicrophoneMuteState()
-{
- return instance->_microphoneTrackedInUI ? instance->_microphoneTrackedInUI->muted() : instance->_mic_muted_state_during_disconnect;
-}
-
-void VideoConferenceModule::reverseVirtualCameraMuteState()
-{
- bool muted = false;
- if (!instance->_settingsUpdateChannel.has_value())
- {
- return;
- }
-
- instance->_settingsUpdateChannel->access([&muted](auto settingsMemory) {
- auto settings = reinterpret_cast(settingsMemory._data);
- settings->useOverlayImage = !settings->useOverlayImage;
- muted = settings->useOverlayImage;
- });
-
- if (muted)
- {
- Trace::CameraMuted();
- }
- toolbar.setCameraMute(muted);
-}
-
-bool VideoConferenceModule::getVirtualCameraMuteState()
-{
- bool disabled = false;
- if (!instance->_settingsUpdateChannel.has_value())
- {
- return disabled;
- }
- instance->_settingsUpdateChannel->access([&disabled](auto settingsMemory) {
- auto settings = reinterpret_cast(settingsMemory._data);
- disabled = settings->useOverlayImage;
- });
- return disabled;
-}
-
-bool VideoConferenceModule::getVirtualCameraInUse()
-{
- if (!instance->_settingsUpdateChannel.has_value())
- {
- return false;
- }
- bool inUse = false;
- instance->_settingsUpdateChannel->access([&inUse](auto settingsMemory) {
- auto settings = reinterpret_cast(settingsMemory._data);
- inUse = settings->cameraInUse;
- });
- return inUse;
-}
-
-LRESULT CALLBACK VideoConferenceModule::LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
-{
- if (nCode == HC_ACTION)
- {
- KBDLLHOOKSTRUCT* kbd = reinterpret_cast(lParam);
- switch (wParam)
- {
- case WM_KEYDOWN:
-
- if (isHotkeyPressed(kbd->vkCode, settings.cameraAndMicrophoneMuteHotkey))
- {
- const bool cameraInUse = getVirtualCameraInUse();
- const bool microphoneIsMuted = getMicrophoneMuteState();
- const bool cameraIsMuted = cameraInUse && getVirtualCameraMuteState();
- if (cameraInUse)
- {
- // we're likely on a video call, so we must mute the unmuted cam/mic or reverse the mute state
- // of everything, if cam and mic mute states are the same
- if (microphoneIsMuted == cameraIsMuted)
- {
- reverseMicrophoneMute();
- reverseVirtualCameraMuteState();
- }
- else if (cameraIsMuted)
- {
- reverseMicrophoneMute();
- }
- else if (microphoneIsMuted)
- {
- reverseVirtualCameraMuteState();
- }
- }
- else
- {
- // if the camera is not in use, we just mute/unmute the mic
- reverseMicrophoneMute();
- }
- return 1;
- }
- else if (isHotkeyPressed(kbd->vkCode, settings.microphoneMuteHotkey))
- {
- reverseMicrophoneMute();
- return 1;
- }
- else if (isHotkeyPressed(kbd->vkCode, settings.microphonePushToTalkHotkey))
- {
- if (!pushToTalkPressed)
- {
- if (settings.pushToReverseEnabled || getMicrophoneMuteState())
- {
- reverseMicrophoneMute();
- }
- pushToTalkPressed = true;
- }
- return 1;
- }
- else if (isHotkeyPressed(kbd->vkCode, settings.cameraMuteHotkey))
- {
- reverseVirtualCameraMuteState();
- return 1;
- }
- break;
- case WM_KEYUP:
- if (pushToTalkPressed && (kbd->vkCode == settings.microphonePushToTalkHotkey.get_code()))
- {
- reverseMicrophoneMute();
- pushToTalkPressed = false;
- return 1;
- }
- }
- }
-
- return CallNextHookEx(hook_handle, nCode, wParam, lParam);
-}
-
-void VideoConferenceModule::onGeneralSettingsChanged()
-{
- auto settings = PTSettingsHelper::load_general_settings();
- bool enabled = false;
- try
- {
- if (json::has(settings, L"enabled"))
- {
- for (const auto& mod : settings.GetNamedObject(L"enabled"))
- {
- const auto value = mod.Value();
- if (value.ValueType() != json::JsonValueType::Boolean)
- {
- continue;
- }
- if (mod.Key() == get_key())
- {
- enabled = value.GetBoolean();
- break;
- }
- }
- }
- }
- catch (...)
- {
- LOG("Couldn't get enabled state");
- }
- if (enabled)
- {
- enable();
- }
- else
- {
- disable();
- }
-}
-
-void VideoConferenceModule::onModuleSettingsChanged()
-{
- try
- {
- PowerToysSettings::PowerToyValues values = PowerToysSettings::PowerToyValues::load_from_settings_file(get_key());
- //Trace::SettingsChanged(pressTime.value, overlayOpacity.value, theme.value);
-
- if (_enabled)
- {
- if (const auto val = values.get_json(L"mute_camera_and_microphone_hotkey"))
- {
- settings.cameraAndMicrophoneMuteHotkey = PowerToysSettings::HotkeyObject::from_json(*val);
- }
- if (const auto val = values.get_json(L"mute_microphone_hotkey"))
- {
- settings.microphoneMuteHotkey = PowerToysSettings::HotkeyObject::from_json(*val);
- }
- if (const auto val = values.get_json(L"push_to_talk_microphone_hotkey"))
- {
- settings.microphonePushToTalkHotkey = PowerToysSettings::HotkeyObject::from_json(*val);
- }
- if (const auto val = values.get_bool_value(L"push_to_reverse_enabled"))
- {
- settings.pushToReverseEnabled = *val;
- }
- if (const auto val = values.get_json(L"mute_camera_hotkey"))
- {
- settings.cameraMuteHotkey = PowerToysSettings::HotkeyObject::from_json(*val);
- }
- if (const auto val = values.get_string_value(L"toolbar_position"))
- {
- settings.toolbarPositionString = val.value();
- }
- if (const auto val = values.get_string_value(L"toolbar_monitor"))
- {
- settings.toolbarMonitorString = val.value();
- }
- if (const auto val = values.get_string_value(L"selected_camera"); val && val != settings.selectedCamera)
- {
- settings.selectedCamera = val.value();
- sendSourceCameraNameUpdate();
- }
- if (const auto val = values.get_string_value(L"camera_overlay_image_path"); val && val != settings.imageOverlayPath)
- {
- settings.imageOverlayPath = val.value();
- sendOverlayImageUpdate();
- }
- if (const auto val = values.get_string_value(L"toolbar_hide"))
- {
- toolbar.setToolbarHide(val.value());
- }
- if (const auto val = values.get_string_value(L"startup_action"))
- {
- settings.startupAction = val.value();
- }
-
- const auto selectedMic = values.get_string_value(L"selected_mic");
- if (selectedMic && selectedMic != settings.selectedMicrophone)
- {
- settings.selectedMicrophone = *selectedMic;
- updateControlledMicrophones(settings.selectedMicrophone);
- }
-
- toolbar.show(settings.toolbarPositionString, settings.toolbarMonitorString);
- }
- }
- catch (...)
- {
- LOG("onModuleSettingsChanged encountered an exception");
- }
-}
-
-void VideoConferenceModule::onMicrophoneConfigurationChanged()
-{
- if (!_controllingAllMics)
- {
- // Don't care if we don't control all the mics
- return;
- }
-
- const bool mutedStateForNewMics = getMicrophoneMuteState();
- std::unordered_set currentlyTrackedMicsIds;
- for (const auto& controlledMic : _controlledMicrophones)
- {
- currentlyTrackedMicsIds.emplace(controlledMic->id());
- }
-
- auto allMics = MicrophoneDevice::getAllActive();
- for (auto& newMic : allMics)
- {
- if (currentlyTrackedMicsIds.contains(newMic->id()))
- {
- continue;
- }
-
- if (mutedStateForNewMics)
- {
- newMic->set_muted(true);
- }
-
- _controlledMicrophones.emplace_back(std::move(newMic));
- }
- // Restore invalidated pointer
- _microphoneTrackedInUI = controlledDefaultMic();
- if (_microphoneTrackedInUI)
- {
- _microphoneTrackedInUI->set_mute_changed_callback([](const bool muted) {
- toolbar.setMicrophoneMute(muted);
- });
- }
-}
-
-VideoConferenceModule::VideoConferenceModule()
-{
- init_settings();
- _settingsUpdateChannel =
- SerializedSharedMemory::create(CameraSettingsUpdateChannel::endpoint(), sizeof(CameraSettingsUpdateChannel), false);
- if (_settingsUpdateChannel)
- {
- _settingsUpdateChannel->access([](auto memory) {
-
-// Suppress warning 26403 - Reset or explicitly delete an owner pointer 'variable' (r.3)
-// the video conference class should be only instantiated once and it is using placement new
-// the access to the data can be done through memory._data
-#pragma warning(push)
-#pragma warning(disable : 26403)
- auto updatesChannel = new (memory._data) CameraSettingsUpdateChannel{};
-#pragma warning(pop)
- });
- }
- sendSourceCameraNameUpdate();
- sendOverlayImageUpdate();
-}
-
-inline VideoConferenceModule::~VideoConferenceModule()
-{
- toolbar.hide();
-}
-
-const wchar_t* VideoConferenceModule::get_name()
-{
- return L"Video Conference";
-}
-
-const wchar_t* VideoConferenceModule::get_key()
-{
- return L"Video Conference";
-}
-
-// Return the configured status for the gpo policy for the module
-powertoys_gpo::gpo_rule_configured_t VideoConferenceModule::gpo_policy_enabled_configuration()
-{
- return powertoys_gpo::getConfiguredVideoConferenceMuteEnabledValue();
-}
-
-bool VideoConferenceModule::get_config(wchar_t* buffer, int* buffer_size)
-{
- return true;
-}
-
-void VideoConferenceModule::set_config(const wchar_t* config)
-{
- try
- {
- PowerToysSettings::PowerToyValues values = PowerToysSettings::PowerToyValues::from_json_string(config, get_key());
- values.save_to_settings_file();
- }
- catch (...)
- {
- LOG("VideoConferenceModule::set_config: exception during saving new settings values");
- }
-}
-
-void VideoConferenceModule::init_settings()
-{
- try
- {
- PowerToysSettings::PowerToyValues powerToysSettings = PowerToysSettings::PowerToyValues::load_from_settings_file(L"Video Conference");
-
- if (const auto val = powerToysSettings.get_json(L"mute_camera_and_microphone_hotkey"))
- {
- settings.cameraAndMicrophoneMuteHotkey = PowerToysSettings::HotkeyObject::from_json(*val);
- }
- if (const auto val = powerToysSettings.get_json(L"mute_microphone_hotkey"))
- {
- settings.microphoneMuteHotkey = PowerToysSettings::HotkeyObject::from_json(*val);
- }
- if (const auto val = powerToysSettings.get_json(L"push_to_talk_microphone_hotkey"))
- {
- settings.microphonePushToTalkHotkey = PowerToysSettings::HotkeyObject::from_json(*val);
- }
- if (const auto val = powerToysSettings.get_bool_value(L"push_to_reverse_enabled"))
- {
- settings.pushToReverseEnabled = *val;
- }
- if (const auto val = powerToysSettings.get_json(L"mute_camera_hotkey"))
- {
- settings.cameraMuteHotkey = PowerToysSettings::HotkeyObject::from_json(*val);
- }
- if (const auto val = powerToysSettings.get_string_value(L"toolbar_position"))
- {
- settings.toolbarPositionString = val.value();
- }
- if (const auto val = powerToysSettings.get_string_value(L"toolbar_monitor"))
- {
- settings.toolbarMonitorString = val.value();
- }
- if (const auto val = powerToysSettings.get_string_value(L"selected_camera"))
- {
- settings.selectedCamera = val.value();
- }
- if (const auto val = powerToysSettings.get_string_value(L"camera_overlay_image_path"))
- {
- settings.imageOverlayPath = val.value();
- }
- if (const auto val = powerToysSettings.get_string_value(L"toolbar_hide"))
- {
- toolbar.setToolbarHide(val.value());
- }
- if (const auto val = powerToysSettings.get_string_value(L"startup_action"))
- {
- settings.startupAction = val.value();
- }
- if (const auto val = powerToysSettings.get_string_value(L"selected_mic"); val && *val != settings.selectedMicrophone)
- {
- settings.selectedMicrophone = *val;
- updateControlledMicrophones(settings.selectedMicrophone);
- }
- }
- catch (std::exception&)
- {
- // Error while loading from the settings file. Just let default values stay as they are.
- }
-
- try
- {
- auto loaded = PTSettingsHelper::load_general_settings();
- std::wstring settings_theme{ static_cast(loaded.GetNamedString(L"theme", L"system")) };
- if (settings_theme != L"dark" && settings_theme != L"light")
- {
- settings_theme = L"system";
- }
- toolbar.setTheme(settings_theme);
- }
- catch (...)
- {
- }
-}
-
-void VideoConferenceModule::updateControlledMicrophones(const std::wstring_view new_mic)
-{
- for (auto& controlledMic : _controlledMicrophones)
- {
- controlledMic->set_muted(false);
- }
- _controlledMicrophones.clear();
- _microphoneTrackedInUI = nullptr;
- auto allMics = MicrophoneDevice::getAllActive();
- if (new_mic == L"[All]")
- {
- _controllingAllMics = true;
- _controlledMicrophones = std::move(allMics);
- _microphoneTrackedInUI = controlledDefaultMic();
- }
- else
- {
- _controllingAllMics = false;
- for (auto& controlledMic : allMics)
- {
- if (controlledMic->name() == new_mic)
- {
- _controlledMicrophones.emplace_back(std::move(controlledMic));
- _microphoneTrackedInUI = _controlledMicrophones[0].get();
- break;
- }
- }
- }
-
- if (_microphoneTrackedInUI)
- {
- _microphoneTrackedInUI->set_mute_changed_callback([](const bool muted) {
- toolbar.setMicrophoneMute(muted);
- });
- toolbar.setMicrophoneMute(_microphoneTrackedInUI->muted());
- }
-
- if (settings.startupAction == L"Unmute")
- {
- for (auto& controlledMic : _controlledMicrophones)
- {
- controlledMic->set_muted(false);
- }
- }
- else if (settings.startupAction == L"Mute")
- {
- for (auto& controlledMic : _controlledMicrophones)
- {
- controlledMic->set_muted(true);
- }
- }
-}
-
-MicrophoneDevice* VideoConferenceModule::controlledDefaultMic()
-{
- if (auto defaultMic = MicrophoneDevice::getDefault())
- {
- for (auto& controlledMic : _controlledMicrophones)
- {
- if (controlledMic->id() == defaultMic->id())
- {
- return controlledMic.get();
- }
- }
- }
-
- return nullptr;
-}
-
-void toggleProxyCamRegistration(const bool enable)
-{
- if (!is_process_elevated())
- {
- return;
- }
-
- auto vcmRoot = fs::path{ get_module_folderpath() };
-#if defined(_M_ARM64)
- std::array proxyFilters = { vcmRoot / "PowerToys.VideoConferenceProxyFilter_ARM64.dll", vcmRoot / "PowerToys.VideoConferenceProxyFilter_x86.dll" };
-#else
- std::array proxyFilters = { vcmRoot / "PowerToys.VideoConferenceProxyFilter_x64.dll", vcmRoot / "PowerToys.VideoConferenceProxyFilter_x86.dll" };
-#endif
- for (const auto filter : proxyFilters)
- {
- std::wstring params{ L"/s " };
- if (!enable)
- {
- params += L"/u ";
- }
- params += '"';
- params += filter;
- params += '"';
- SHELLEXECUTEINFOW sei{ sizeof(sei) };
- sei.fMask = { SEE_MASK_FLAG_NO_UI | SEE_MASK_NOASYNC };
- sei.lpFile = L"regsvr32";
- sei.lpParameters = params.c_str();
- sei.nShow = SW_SHOWNORMAL;
- ShellExecuteExW(&sei);
- }
-}
-
-void VideoConferenceModule::enable()
-{
- if (!_enabled)
- {
- _generalSettingsWatcher = std::make_unique(
- PTSettingsHelper::get_powertoys_general_save_file_location(), [this] {
- toolbar.scheduleGeneralSettingsUpdate();
- });
- _moduleSettingsWatcher = std::make_unique(
- PTSettingsHelper::get_module_save_file_location(get_key()), [this] {
- toolbar.scheduleModuleSettingsUpdate();
- });
-
- toggleProxyCamRegistration(true);
- toolbar.setMicrophoneMute(getMicrophoneMuteState());
- toolbar.setCameraMute(getVirtualCameraMuteState());
-
- toolbar.show(settings.toolbarPositionString, settings.toolbarMonitorString);
-
- _enabled = true;
-
-#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
- if (IsDebuggerPresent())
- {
- return;
- }
-#endif
- hook_handle = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, GetModuleHandle(NULL), NULL);
- }
- Trace::EnableVideoConference(true);
-}
-
-void VideoConferenceModule::unmuteAll()
-{
- if (getVirtualCameraMuteState())
- {
- reverseVirtualCameraMuteState();
- }
-
- if (getMicrophoneMuteState())
- {
- reverseMicrophoneMute();
- }
-}
-
-void VideoConferenceModule::muteAll()
-{
- if (!getVirtualCameraMuteState())
- {
- reverseVirtualCameraMuteState();
- }
-
- if (!getMicrophoneMuteState())
- {
- reverseMicrophoneMute();
- }
-}
-
-void VideoConferenceModule::disable()
-{
- if (_enabled)
- {
- _generalSettingsWatcher.reset();
- _moduleSettingsWatcher.reset();
- toggleProxyCamRegistration(false);
- if (hook_handle)
- {
- bool success = UnhookWindowsHookEx(hook_handle);
- if (success)
- {
- hook_handle = nullptr;
- }
- }
-
- if (getVirtualCameraMuteState())
- {
- reverseVirtualCameraMuteState();
- }
-
- toolbar.hide();
-
- _enabled = false;
- }
- Trace::EnableVideoConference(false);
-}
-
-bool VideoConferenceModule::is_enabled()
-{
- return _enabled;
-}
-
-void VideoConferenceModule::destroy()
-{
- delete this;
- instance = nullptr;
-}
-
-bool VideoConferenceModule::is_enabled_by_default() const
-{
- return false;
-}
-
-void VideoConferenceModule::sendSourceCameraNameUpdate()
-{
- if (!_settingsUpdateChannel.has_value() || settings.selectedCamera.empty())
- {
- return;
- }
- _settingsUpdateChannel->access([](auto memory) {
- auto updatesChannel = reinterpret_cast(memory._data);
- updatesChannel->sourceCameraName.emplace();
- std::copy(begin(settings.selectedCamera), end(settings.selectedCamera), begin(*updatesChannel->sourceCameraName));
- if (settings.startupAction == L"Unmute")
- {
- updatesChannel->useOverlayImage = false;
- }
- else if (settings.startupAction == L"Mute")
- {
- updatesChannel->useOverlayImage = true;
- }
- });
-}
-
-void VideoConferenceModule::sendOverlayImageUpdate()
-{
- if (!_settingsUpdateChannel.has_value())
- {
- return;
- }
- _imageOverlayChannel.reset();
-
- wchar_t powertoysDirectory[MAX_PATH + 1];
-
- DWORD length = GetModuleFileNameW(nullptr, powertoysDirectory, MAX_PATH);
- PathRemoveFileSpecW(powertoysDirectory);
-
- std::wstring blankImagePath(powertoysDirectory);
- blankImagePath += L"\\Assets\\VCM\\black.bmp";
-
- _imageOverlayChannel = SerializedSharedMemory::create_readonly(CameraOverlayImageChannel::endpoint(),
- settings.imageOverlayPath != L"" ? settings.imageOverlayPath : blankImagePath);
-
- const auto imageSize = static_cast(_imageOverlayChannel->size());
- _settingsUpdateChannel->access([imageSize](auto memory) {
- auto updatesChannel = reinterpret_cast(memory._data);
- updatesChannel->overlayImageSize.emplace(imageSize);
- updatesChannel->newOverlayImagePosted = true;
- });
-}
diff --git a/src/modules/videoconference/VideoConferenceModule/VideoConferenceModule.h b/src/modules/videoconference/VideoConferenceModule/VideoConferenceModule.h
deleted file mode 100644
index f3b835867a..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/VideoConferenceModule.h
+++ /dev/null
@@ -1,102 +0,0 @@
-#pragma once
-
-#include
-
-#include
-#include
-
-#include
-
-#include
-#include
-
-#include "Toolbar.h"
-
-#include
-
-extern class VideoConferenceModule* instance;
-
-struct VideoConferenceSettings
-{
- PowerToysSettings::HotkeyObject cameraAndMicrophoneMuteHotkey = PowerToysSettings::HotkeyObject::from_settings(true, false, false, true, 81);
- PowerToysSettings::HotkeyObject microphoneMuteHotkey = PowerToysSettings::HotkeyObject::from_settings(true, false, false, true, 65);
- PowerToysSettings::HotkeyObject microphonePushToTalkHotkey = PowerToysSettings::HotkeyObject::from_settings(true, false, false, true, 73);
- PowerToysSettings::HotkeyObject cameraMuteHotkey = PowerToysSettings::HotkeyObject::from_settings(true, false, false, true, 79);
-
- std::wstring toolbarPositionString;
- std::wstring toolbarMonitorString;
-
- std::wstring selectedCamera;
- std::wstring imageOverlayPath;
- std::wstring selectedMicrophone;
-
- std::wstring startupAction;
-
- bool pushToReverseEnabled = false;
-};
-
-class VideoConferenceModule : public PowertoyModuleIface
-{
-public:
- VideoConferenceModule();
- ~VideoConferenceModule();
- virtual const wchar_t* get_name() override;
-
- virtual powertoys_gpo::gpo_rule_configured_t gpo_policy_enabled_configuration() override;
-
- virtual bool get_config(wchar_t* buffer, int* buffer_size) override;
-
- virtual void set_config(const wchar_t* config) override;
-
- virtual void enable() override;
- virtual void disable() override;
- virtual bool is_enabled() override;
- virtual void destroy() override;
- virtual bool is_enabled_by_default() const override;
-
- virtual const wchar_t * get_key() override;
-
- void sendSourceCameraNameUpdate();
- void sendOverlayImageUpdate();
-
- static void unmuteAll();
- static void muteAll();
- static void reverseMicrophoneMute();
- static bool getMicrophoneMuteState();
- static void reverseVirtualCameraMuteState();
- static bool getVirtualCameraMuteState();
- static bool getVirtualCameraInUse();
-
- void onGeneralSettingsChanged();
- void onModuleSettingsChanged();
- void onMicrophoneConfigurationChanged();
-
-private:
-
- void init_settings();
- void updateControlledMicrophones(const std::wstring_view new_mic);
- MicrophoneDevice* controlledDefaultMic();
-
- // all callback methods and used by callback have to be static
- static LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam);
- static bool isKeyPressed(unsigned int keyCode);
- static bool isHotkeyPressed(DWORD code, PowerToysSettings::HotkeyObject& hotkey);
-
- static HHOOK hook_handle;
- bool _enabled = false;
-
- bool _mic_muted_state_during_disconnect = false;
- bool _controllingAllMics = false;
- std::vector> _controlledMicrophones;
- MicrophoneDevice* _microphoneTrackedInUI = nullptr;
-
- std::optional _imageOverlayChannel;
- std::optional _settingsUpdateChannel;
-
- std::unique_ptr _generalSettingsWatcher;
- std::unique_ptr _moduleSettingsWatcher;
-
- static VideoConferenceSettings settings;
- static Toolbar toolbar;
- static bool pushToTalkPressed;
-};
diff --git a/src/modules/videoconference/VideoConferenceModule/VideoConferenceModule.rc b/src/modules/videoconference/VideoConferenceModule/VideoConferenceModule.rc
deleted file mode 100644
index 5fa3c8b90d..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/VideoConferenceModule.rc
+++ /dev/null
@@ -1,40 +0,0 @@
-#include
-#include "resource.h"
-#include "../../../common/version/version.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-#include "winres.h"
-#undef APSTUDIO_READONLY_SYMBOLS
-
-1 VERSIONINFO
-FILEVERSION FILE_VERSION
-PRODUCTVERSION PRODUCT_VERSION
-FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
-#ifdef _DEBUG
-FILEFLAGS VS_FF_DEBUG
-#else
-FILEFLAGS 0x0L
-#endif
-FILEOS VOS_NT_WINDOWS32
-FILETYPE VFT_DLL
-FILESUBTYPE VFT2_UNKNOWN
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0" // US English (0x0409), Unicode (0x04B0) charset
- BEGIN
- VALUE "CompanyName", COMPANY_NAME
- VALUE "FileDescription", FILE_DESCRIPTION
- VALUE "FileVersion", FILE_VERSION_STRING
- VALUE "InternalName", INTERNAL_NAME
- VALUE "LegalCopyright", COPYRIGHT_NOTE
- VALUE "OriginalFilename", ORIGINAL_FILENAME
- VALUE "ProductName", PRODUCT_NAME
- VALUE "ProductVersion", PRODUCT_VERSION_STRING
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200 // US English (0x0409), Unicode (1200) charset
- END
-END
diff --git a/src/modules/videoconference/VideoConferenceModule/dllmain.cpp b/src/modules/videoconference/VideoConferenceModule/dllmain.cpp
deleted file mode 100644
index c3d012cd6c..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/dllmain.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-// dllmain.cpp : Defines the entry point for the DLL application.
-#include "pch.h"
-#include
-#include "trace.h"
-#include "VideoConferenceModule.h"
-
-BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- Trace::RegisterProvider();
- break;
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- break;
- case DLL_PROCESS_DETACH:
- Trace::UnregisterProvider();
- break;
- }
- return TRUE;
-}
-
-extern "C" __declspec(dllexport) PowertoyModuleIface* __cdecl powertoy_create()
-{
- if (!instance)
- {
- instance = new VideoConferenceModule();
- return instance;
- }
- else
- {
- return nullptr;
- }
-}
diff --git a/src/modules/videoconference/VideoConferenceModule/framework.h b/src/modules/videoconference/VideoConferenceModule/framework.h
deleted file mode 100644
index 54b83e94fd..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/framework.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files
-#include
diff --git a/src/modules/videoconference/VideoConferenceModule/packages.config b/src/modules/videoconference/VideoConferenceModule/packages.config
deleted file mode 100644
index ff4b059648..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/src/modules/videoconference/VideoConferenceModule/pch.cpp b/src/modules/videoconference/VideoConferenceModule/pch.cpp
deleted file mode 100644
index 64b7eef6d6..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/pch.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-// pch.cpp: source file corresponding to the pre-compiled header
-
-#include "pch.h"
-
-// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.
diff --git a/src/modules/videoconference/VideoConferenceModule/pch.h b/src/modules/videoconference/VideoConferenceModule/pch.h
deleted file mode 100644
index 7c614d9a5c..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/pch.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#pragma once
-#define WIN32_LEAN_AND_MEAN
-#include
-#include
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
diff --git a/src/modules/videoconference/VideoConferenceModule/resource.h b/src/modules/videoconference/VideoConferenceModule/resource.h
deleted file mode 100644
index 6073efd0c3..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/resource.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by VideoConferenceModule.rc
-
-//////////////////////////////
-// Non-localizable
-
-#define FILE_DESCRIPTION "PowerToys VideoConferenceMute Module"
-#define INTERNAL_NAME "PowerToys.VideoConferenceModule"
-#define ORIGINAL_FILENAME "PowerToys.VideoConferenceModule.dll"
-
-// Non-localizable
-//////////////////////////////
diff --git a/src/modules/videoconference/VideoConferenceModule/trace.cpp b/src/modules/videoconference/VideoConferenceModule/trace.cpp
deleted file mode 100644
index 043c6b30e7..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/trace.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-#include "pch.h"
-
-#include "trace.h"
-
-#include
-
-TRACELOGGING_DEFINE_PROVIDER(
- g_hProvider,
- "Microsoft.PowerToys",
- // {38e8889b-9731-53f5-e901-e8a7c1753074}
- (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74),
- TraceLoggingOptionProjectTelemetry());
-
-// Log if the user has VCM enabled or disabled
-void Trace::EnableVideoConference(const bool enabled) noexcept
-{
- TraceLoggingWriteWrapper(
- g_hProvider,
- "VideoConference_EnableVideoConference",
- ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
- TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE),
- TraceLoggingBoolean(enabled, "Enabled"));
-}
-
-void Trace::SettingsChanged(const struct VideoConferenceSettings& settings) noexcept
-{
- bool CustomOverlayImage = (settings.imageOverlayPath.length() > 0);
-
- TraceLoggingWriteWrapper(
- g_hProvider,
- "VideoConference_SettingsChanged",
- TraceLoggingWideString(settings.toolbarPositionString.c_str(), "ToolbarPosition"),
- TraceLoggingWideString(settings.toolbarMonitorString.c_str(), "ToolbarMonitorSelection"),
- TraceLoggingBool(CustomOverlayImage, "CustomImageOverlayUsed"),
- ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
- TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"),
- TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
-}
-
-void Trace::MicrophoneMuted() noexcept
-{
- TraceLoggingWriteWrapper(
- g_hProvider,
- "VideoConference_MicrophoneMuted",
- TraceLoggingBoolean(true, "MicrophoneMuted"),
- ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
- TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"),
- TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
-}
-
-void Trace::CameraMuted() noexcept
-{
- TraceLoggingWriteWrapper(
- g_hProvider,
- "VideoConference_CameraMuted",
- TraceLoggingBoolean(true, "CameraMuted"),
- ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
- TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"),
- TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
-}
diff --git a/src/modules/videoconference/VideoConferenceModule/trace.h b/src/modules/videoconference/VideoConferenceModule/trace.h
deleted file mode 100644
index 0a9f193e69..0000000000
--- a/src/modules/videoconference/VideoConferenceModule/trace.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#pragma once
-#include "VideoConferenceModule.h"
-
-#include
-
-class Trace : public telemetry::TraceBase
-{
-public:
- static void EnableVideoConference(const bool enabled) noexcept;
- static void SettingsChanged(const struct VideoConferenceSettings &settings) noexcept;
- static void MicrophoneMuted() noexcept;
- static void CameraMuted() noexcept;
-};
diff --git a/src/modules/videoconference/VideoConferenceProxyFilter/DirectShowUtils.cpp b/src/modules/videoconference/VideoConferenceProxyFilter/DirectShowUtils.cpp
deleted file mode 100644
index ef2d3f76ea..0000000000
--- a/src/modules/videoconference/VideoConferenceProxyFilter/DirectShowUtils.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-#include "DirectShowUtils.h"
-
-#include
-
-unique_media_type_ptr CopyMediaType(const AM_MEDIA_TYPE* source)
-{
- unique_media_type_ptr target{ static_cast(CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE))) };
- *target = *source;
- if (source->cbFormat)
- {
- target->pbFormat = static_cast(CoTaskMemAlloc(source->cbFormat));
- std::copy(source->pbFormat, source->pbFormat + source->cbFormat, target->pbFormat);
- }
-
- if (target->pUnk)
- {
- target->pUnk->AddRef();
- }
-
- return target;
-}
-
-wil::com_ptr_nothrow GetPinAllocator(wil::com_ptr_nothrow& inputPin)
-{
- if (!inputPin)
- {
- return nullptr;
- }
- wil::com_ptr_nothrow allocator;
- if (auto memInput = inputPin.try_query(); memInput)
- {
- memInput->GetAllocator(&allocator);
- return allocator;
- }
-
- return nullptr;
-}
-
-void MyFreeMediaType(AM_MEDIA_TYPE& mt)
-{
- if (mt.cbFormat != 0)
- {
- CoTaskMemFree(mt.pbFormat);
- mt.cbFormat = 0;
- mt.pbFormat = nullptr;
- }
-
- if (mt.pUnk != nullptr)
- {
- mt.pUnk->Release();
- mt.pUnk = nullptr;
- }
-}
-
-void MyDeleteMediaType(AM_MEDIA_TYPE* pmt)
-{
- if (!pmt)
- {
- return;
- }
-
- MyFreeMediaType(*pmt);
- CoTaskMemFree(const_cast(pmt));
-}
-
-HRESULT MediaTypeEnumerator::Next(ULONG cObjects, AM_MEDIA_TYPE** outObjects, ULONG* pcFetched)
-{
- if (!outObjects)
- {
- return E_POINTER;
- }
-
- ULONG fetched = 0;
- ULONG toFetch = cObjects;
- while (toFetch-- && _pos < _objects.size())
- {
- auto copy = CopyMediaType(_objects[_pos++].get());
- outObjects[fetched++] = copy.release();
- }
-
- if (pcFetched)
- {
- *pcFetched = fetched;
- }
-
- return fetched == cObjects ? S_OK : S_FALSE;
-}
-
-HRESULT MediaTypeEnumerator::Skip(ULONG cObjects)
-{
- _pos += cObjects;
- return _pos < _objects.size() ? S_OK : S_FALSE;
-}
-
-HRESULT MediaTypeEnumerator::Reset()
-{
- _pos = 0;
- return S_OK;
-}
-
-HRESULT MediaTypeEnumerator::Clone(IEnumMediaTypes** ppEnum)
-{
- auto cloned = winrt::make_self();
- cloned->_objects.resize(_objects.size());
- for (size_t i = 0; i < _objects.size(); ++i)
- {
- cloned->_objects[i] = CopyMediaType(_objects[i].get());
- }
-
- cloned->_pos = _pos;
- cloned.as().copy_to(ppEnum);
- return S_OK;
-}
\ No newline at end of file
diff --git a/src/modules/videoconference/VideoConferenceProxyFilter/DirectShowUtils.h b/src/modules/videoconference/VideoConferenceProxyFilter/DirectShowUtils.h
deleted file mode 100644
index d8c35a54b6..0000000000
--- a/src/modules/videoconference/VideoConferenceProxyFilter/DirectShowUtils.h
+++ /dev/null
@@ -1,87 +0,0 @@
-#pragma once
-#include
-
-#define WIN32_LEAN_AND_MEAN
-#include
-#include
-
-#include
-#include
-
-#include
-
-#include "Logging.h"
-
-void MyDeleteMediaType(AM_MEDIA_TYPE* pmt);
-
-using unique_media_type_ptr =
- wistd::unique_ptr>;
-
-unique_media_type_ptr CopyMediaType(const AM_MEDIA_TYPE* source);
-
-template
-struct ObjectEnumerator : public winrt::implements, EnumeratorInterface>
-{
- std::vector> _objects;
- ULONG _pos = 0;
-
- HRESULT STDMETHODCALLTYPE Next(ULONG cObjects, ObjectInterface** outObjects, ULONG* pcFetched) override
- {
- if (!outObjects)
- {
- return E_POINTER;
- }
-
- ULONG fetched = 0;
- ULONG toFetch = cObjects;
- while (toFetch-- && _pos < _objects.size())
- {
- _objects[_pos++].copy_to(&outObjects[fetched++]);
- }
-
- if (pcFetched)
- {
- *pcFetched = fetched;
- }
-
- return fetched == cObjects ? S_OK : S_FALSE;
- }
-
- HRESULT STDMETHODCALLTYPE Skip(ULONG cObjects) override
- {
- _pos += cObjects;
- return _pos < _objects.size() ? S_OK : S_FALSE;
- }
-
- HRESULT STDMETHODCALLTYPE Reset() override
- {
- _pos = 0;
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE Clone(EnumeratorInterface** ppEnum) override
- {
- auto cloned = winrt::make_self();
- cloned->_objects = _objects;
- cloned->_pos = _pos;
- cloned.as().copy_to(ppEnum);
- return S_OK;
- }
-
- virtual ~ObjectEnumerator() = default;
-};
-
-struct MediaTypeEnumerator : public winrt::implements
-{
- std::vector _objects;
- ULONG _pos = 0;
-
- HRESULT STDMETHODCALLTYPE Next(ULONG cObjects, AM_MEDIA_TYPE** outObjects, ULONG* pcFetched) override;
- HRESULT STDMETHODCALLTYPE Skip(ULONG cObjects) override;
- HRESULT STDMETHODCALLTYPE Reset() override;
- HRESULT STDMETHODCALLTYPE Clone(IEnumMediaTypes** ppEnum) override;
-
- virtual ~MediaTypeEnumerator() = default;
-};
-
-wil::com_ptr_nothrow GetPinAllocator(wil::com_ptr_nothrow& inputPin);
diff --git a/src/modules/videoconference/VideoConferenceProxyFilter/ImageLoading.cpp b/src/modules/videoconference/VideoConferenceProxyFilter/ImageLoading.cpp
deleted file mode 100644
index 4887801154..0000000000
--- a/src/modules/videoconference/VideoConferenceProxyFilter/ImageLoading.cpp
+++ /dev/null
@@ -1,424 +0,0 @@
-#include
-
-#include
-#include
-#include
-
-#pragma warning(push)
-#pragma warning(disable : 4005)
-#include
-#pragma warning(pop)
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-
-#include "Logging.h"
-
-IWICImagingFactory* _GetWIC() noexcept
-{
- static IWICImagingFactory* s_Factory = nullptr;
-
- if (s_Factory)
- {
- return s_Factory;
- }
-
- OK_OR_BAIL(CoCreateInstance(
- CLSID_WICImagingFactory, nullptr, CLSCTX_INPROC_SERVER, __uuidof(IWICImagingFactory), (LPVOID*)&s_Factory));
-
- return s_Factory;
-}
-
-bool ReencodeJPGImage(BYTE* imageBuf, const DWORD imageSize, DWORD& reencodedSize)
-{
- auto pWIC = _GetWIC();
- wil::com_ptr_nothrow imageStream = SHCreateMemStream(imageBuf, imageSize);
- if (!imageStream)
- {
- return false;
- }
-
- // Decode jpg into bitmap
- wil::com_ptr_nothrow bitmapDecoder;
- OK_OR_BAIL(pWIC->CreateDecoderFromStream(imageStream.get(), nullptr, WICDecodeMetadataCacheOnLoad, &bitmapDecoder));
- wil::com_ptr_nothrow decodedFrame;
- OK_OR_BAIL(bitmapDecoder->GetFrame(0, &decodedFrame));
- wil::com_ptr_nothrow bitmap;
- bitmap.attach(decodedFrame.detach());
- UINT width = 0, height = 0;
- OK_OR_BAIL(bitmap->GetSize(&width, &height));
-
- // Initialize jpg encoder
- wil::com_ptr_nothrow encoder;
- OK_OR_BAIL(pWIC->CreateEncoder(GUID_ContainerFormatJpeg, nullptr, &encoder));
-
- wil::com_ptr_nothrow outputStream;
- OK_OR_BAIL(CreateStreamOnHGlobal(nullptr, true, &outputStream));
- OK_OR_BAIL(encoder->Initialize(outputStream.get(), WICBitmapEncoderNoCache));
- wil::com_ptr_nothrow encodedFrame;
- wil::com_ptr_nothrow encoderOptions;
- OK_OR_BAIL(encoder->CreateNewFrame(&encodedFrame, &encoderOptions));
-
- ULONG nProperties = 0;
- OK_OR_BAIL(encoderOptions->CountProperties(&nProperties));
- for (ULONG propIdx = 0; propIdx < nProperties; ++propIdx)
- {
- PROPBAG2 propBag{};
- ULONG _;
- OK_OR_BAIL(encoderOptions->GetPropertyInfo(propIdx, 1, &propBag, &_));
- if (propBag.pstrName == std::wstring_view{ L"ImageQuality" })
- {
- wil::unique_variant variant;
- variant.vt = VT_R4;
- variant.fltVal = 0.1f;
- OK_OR_BAIL(encoderOptions->Write(1, &propBag, &variant));
- LOG("Successfully set jpg compression quality");
- // skip the rest of the properties
- propIdx = nProperties;
- }
- CoTaskMemFree(propBag.pstrName);
- }
-
- OK_OR_BAIL(encodedFrame->Initialize(encoderOptions.get()));
- WICPixelFormatGUID intermediateFormat = GUID_WICPixelFormat24bppRGB;
-
- OK_OR_BAIL(encodedFrame->SetPixelFormat(&intermediateFormat));
- OK_OR_BAIL(encodedFrame->SetSize(width, height));
-
- // Commit the image encoding
- OK_OR_BAIL(encodedFrame->WriteSource(bitmap.get(), nullptr));
- OK_OR_BAIL(encodedFrame->Commit());
- OK_OR_BAIL(encoder->Commit());
-
- STATSTG intermediateStreamStat{};
- OK_OR_BAIL(outputStream->Stat(&intermediateStreamStat, STATFLAG_NONAME));
- const ULONGLONG jpgStreamSize = intermediateStreamStat.cbSize.QuadPart;
- HGLOBAL streamMemoryHandle{};
- OK_OR_BAIL(GetHGlobalFromStream(outputStream.get(), &streamMemoryHandle));
-
- auto jpgStreamMemory = static_cast(GlobalLock(streamMemoryHandle));
- std::copy(jpgStreamMemory, jpgStreamMemory + jpgStreamSize, imageBuf);
- auto unlockJpgStreamMemory = wil::scope_exit([jpgStreamMemory] { GlobalUnlock(jpgStreamMemory); });
- reencodedSize = static_cast(jpgStreamSize);
- return true;
-}
-
-wil::com_ptr_nothrow LoadAsRGB24BitmapWithSize(IWICImagingFactory* pWIC,
- wil::com_ptr_nothrow image,
- const UINT targetWidth,
- const UINT targetHeight)
-{
- wil::com_ptr_nothrow bitmap;
- // Initialize image bitmap decoder from filename and get the image frame
- wil::com_ptr_nothrow bitmapDecoder;
- OK_OR_BAIL(pWIC->CreateDecoderFromStream(image.get(), nullptr, WICDecodeMetadataCacheOnLoad, &bitmapDecoder));
-
- wil::com_ptr_nothrow decodedFrame;
- OK_OR_BAIL(bitmapDecoder->GetFrame(0, &decodedFrame));
-
- UINT imageWidth = 0, imageHeight = 0;
- OK_OR_BAIL(decodedFrame->GetSize(&imageWidth, &imageHeight));
-
- // Scale the image if required
- if (targetWidth != imageWidth || targetHeight != imageHeight)
- {
- wil::com_ptr_nothrow scaler;
- OK_OR_BAIL(pWIC->CreateBitmapScaler(&scaler));
- OK_OR_BAIL(
- scaler->Initialize(decodedFrame.get(), targetWidth, targetHeight, WICBitmapInterpolationModeHighQualityCubic));
- bitmap.attach(scaler.detach());
- }
- else
- {
- bitmap.attach(decodedFrame.detach());
- }
- WICPixelFormatGUID pixelFormat{};
- OK_OR_BAIL(bitmap->GetPixelFormat(&pixelFormat));
-
- const auto targetPixelFormat = GUID_WICPixelFormat24bppBGR;
- if (pixelFormat != targetPixelFormat)
- {
- wil::com_ptr_nothrow convertedBitmap;
- if (SUCCEEDED(WICConvertBitmapSource(targetPixelFormat, bitmap.get(), &convertedBitmap)))
- {
- return convertedBitmap;
- }
- }
-
- return bitmap;
-}
-
-wil::com_ptr_nothrow EncodeBitmapToContainer(IWICImagingFactory* pWIC,
- wil::com_ptr_nothrow bitmap,
- const GUID& containerGUID,
- const UINT width,
- const UINT height,
- const float quality)
-{
- wil::com_ptr_nothrow encoder;
- pWIC->CreateEncoder(containerGUID, nullptr, &encoder);
-
- if (!encoder)
- {
- return nullptr;
- }
-
- // Prepare the encoder output memory stream and encoding params
- wil::com_ptr_nothrow encodedBitmap;
- OK_OR_BAIL(CreateStreamOnHGlobal(nullptr, true, &encodedBitmap));
- OK_OR_BAIL(encoder->Initialize(encodedBitmap.get(), WICBitmapEncoderNoCache));
- wil::com_ptr_nothrow encodedFrame;
-
- wil::com_ptr_nothrow encoderOptions;
- OK_OR_BAIL(encoder->CreateNewFrame(&encodedFrame, &encoderOptions));
-
- ULONG nProperties = 0;
- OK_OR_BAIL(encoderOptions->CountProperties(&nProperties));
- for (ULONG propIdx = 0; propIdx < nProperties; ++propIdx)
- {
- PROPBAG2 propBag{};
- ULONG _;
- OK_OR_BAIL(encoderOptions->GetPropertyInfo(propIdx, 1, &propBag, &_));
- if (propBag.pstrName == std::wstring_view{ L"ImageQuality" })
- {
- wil::unique_variant variant;
- variant.vt = VT_R4;
- variant.fltVal = quality;
- OK_OR_BAIL(encoderOptions->Write(1, &propBag, &variant));
- LOG("Successfully set jpg compression quality");
- // skip the rest of the properties
- propIdx = nProperties;
- }
- CoTaskMemFree(propBag.pstrName);
- }
-
- OK_OR_BAIL(encodedFrame->Initialize(encoderOptions.get()));
-
- WICPixelFormatGUID intermediateFormat = GUID_WICPixelFormat24bppRGB;
- OK_OR_BAIL(encodedFrame->SetPixelFormat(&intermediateFormat));
- OK_OR_BAIL(encodedFrame->SetSize(width, height));
-
- // Commit the image encoding
- OK_OR_BAIL(encodedFrame->WriteSource(bitmap.get(), nullptr));
- OK_OR_BAIL(encodedFrame->Commit());
- OK_OR_BAIL(encoder->Commit());
- return encodedBitmap;
-}
-
-IMFSample* ConvertIMFVideoSample(const MFT_REGISTER_TYPE_INFO& inputType,
- IMFMediaType* outputMediaType,
- const wil::com_ptr_nothrow& inputSample,
- const UINT width,
- const UINT height)
-{
- IMFActivate** ppVDActivate = nullptr;
- UINT32 count = 0;
-
- MFT_REGISTER_TYPE_INFO outputType = { MFMediaType_Video, {} };
- outputMediaType->GetGUID(MF_MT_SUBTYPE, &outputType.guidSubtype);
-
- const std::array transformerCategories = {
- MFT_CATEGORY_VIDEO_PROCESSOR, MFT_CATEGORY_VIDEO_DECODER, MFT_CATEGORY_VIDEO_ENCODER
- };
-
- for (const auto& transformerCategory : transformerCategories)
- {
- OK_OR_BAIL(MFTEnumEx(transformerCategory, MFT_ENUM_FLAG_SYNCMFT, &inputType, &outputType, &ppVDActivate, &count));
- if (count != 0)
- {
- break;
- }
- }
-
- wil::com_ptr_nothrow videoTransformer;
-
- bool videoDecoderActivated = false;
- for (UINT32 i = 0; i < count; ++i)
- {
- if (!videoDecoderActivated && !FAILED(ppVDActivate[i]->ActivateObject(IID_PPV_ARGS(&videoTransformer))))
- {
- videoDecoderActivated = true;
- }
- ppVDActivate[i]->Release();
- }
-
- if (count)
- {
- CoTaskMemFree(ppVDActivate);
- }
-
- if (!videoDecoderActivated)
- {
- LOG("No converter available for the selected format");
- return nullptr;
- }
-
- auto shutdownVideoDecoder = wil::scope_exit([&videoTransformer] { MFShutdownObject(videoTransformer.get()); });
- // Set input/output types for the decoder
- wil::com_ptr_nothrow intermediateFrameMediaType;
- OK_OR_BAIL(MFCreateMediaType(&intermediateFrameMediaType));
- intermediateFrameMediaType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video);
- intermediateFrameMediaType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_RGB24);
- intermediateFrameMediaType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive);
- intermediateFrameMediaType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
- OK_OR_BAIL(MFSetAttributeSize(intermediateFrameMediaType.get(), MF_MT_FRAME_SIZE, width, height));
- OK_OR_BAIL(MFSetAttributeRatio(intermediateFrameMediaType.get(), MF_MT_PIXEL_ASPECT_RATIO, width, height));
- OK_OR_BAIL(videoTransformer->SetInputType(0, intermediateFrameMediaType.get(), 0));
- OK_OR_BAIL(videoTransformer->SetOutputType(0, outputMediaType, 0));
-
- // Process the input sample
- OK_OR_BAIL(videoTransformer->ProcessInput(0, inputSample.get(), 0));
-
- // Check whether we need to allocate output sample and buffer ourselves
- MFT_OUTPUT_STREAM_INFO outputStreamInfo{};
- OK_OR_BAIL(videoTransformer->GetOutputStreamInfo(0, &outputStreamInfo));
- const bool onlyProvidesSamples = outputStreamInfo.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES;
- const bool canProvideSamples = outputStreamInfo.dwFlags & MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES;
- const bool mustAllocateSample =
- (!onlyProvidesSamples && !canProvideSamples) ||
- (!onlyProvidesSamples && (outputStreamInfo.dwFlags & MFT_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER));
-
- MFT_OUTPUT_DATA_BUFFER outputSamples{};
- IMFSample* outputSample = nullptr;
-
- // If so, do the allocation
- if (mustAllocateSample)
- {
- OK_OR_BAIL(MFCreateSample(&outputSample));
- OK_OR_BAIL(outputSample->SetSampleDuration(333333));
- OK_OR_BAIL(outputSample->SetSampleTime(1));
- OK_OR_BAIL(outputSample->SetUINT32(MF_MT_VIDEO_ROTATION, MFVideoRotationFormat::MFVideoRotationFormat_0));
- IMFMediaBuffer* outputMediaBuffer = nullptr;
- OK_OR_BAIL(
- MFCreateAlignedMemoryBuffer(outputStreamInfo.cbSize, outputStreamInfo.cbAlignment - 1, &outputMediaBuffer));
- OK_OR_BAIL(outputMediaBuffer->SetCurrentLength(outputStreamInfo.cbSize));
- OK_OR_BAIL(outputSample->AddBuffer(outputMediaBuffer));
- outputSamples.pSample = outputSample;
- }
-
- // Finally, produce the output sample
- DWORD processStatus = 0;
- if (failed(videoTransformer->ProcessOutput(0, 1, &outputSamples, &processStatus)))
- {
- LOG("Failed to convert image frame");
- }
- if (outputSamples.pEvents)
- {
- outputSamples.pEvents->Release();
- }
-
- return outputSamples.pSample;
-}
-
-wil::com_ptr_nothrow LoadImageAsSample(wil::com_ptr_nothrow imageStream,
- IMFMediaType* sampleMediaType,
- const float quality) noexcept
-{
- UINT targetWidth = 0;
- UINT targetHeight = 0;
- OK_OR_BAIL(MFGetAttributeSize(sampleMediaType, MF_MT_FRAME_SIZE, &targetWidth, &targetHeight));
- MFT_REGISTER_TYPE_INFO outputType = { MFMediaType_Video, {} };
- OK_OR_BAIL(sampleMediaType->GetGUID(MF_MT_SUBTYPE, &outputType.guidSubtype));
-
- IWICImagingFactory* pWIC = _GetWIC();
- if (!pWIC)
- {
- LOG("Failed to create IWICImagingFactory");
- return nullptr;
- }
-
- if (!imageStream)
- {
- return nullptr;
- }
-
- const auto srcImageBitmap = LoadAsRGB24BitmapWithSize(pWIC, imageStream, targetWidth, targetHeight);
- if (!srcImageBitmap)
- {
- return nullptr;
- }
-
- // First, let's create a sample containing RGB24 bitmap
- IMFSample* outputSample = nullptr;
- OK_OR_BAIL(MFCreateSample(&outputSample));
- OK_OR_BAIL(outputSample->SetUINT32(MF_MT_VIDEO_ROTATION, MFVideoRotationFormat::MFVideoRotationFormat_0));
- OK_OR_BAIL(outputSample->SetSampleDuration(333333));
- OK_OR_BAIL(outputSample->SetSampleTime(1));
- IMFMediaBuffer* outputMediaBuffer = nullptr;
- const DWORD nPixelBytes = targetWidth * targetHeight * 3;
- OK_OR_BAIL(MFCreateAlignedMemoryBuffer(nPixelBytes, MF_64_BYTE_ALIGNMENT, &outputMediaBuffer));
-
- const UINT stride = 3 * targetWidth;
-
- DWORD max_length = 0, current_length = 0;
- BYTE* sampleBufferMemory = nullptr;
- OK_OR_BAIL(outputMediaBuffer->Lock(&sampleBufferMemory, &max_length, ¤t_length));
- OK_OR_BAIL(srcImageBitmap->CopyPixels(nullptr, stride, nPixelBytes, sampleBufferMemory));
- OK_OR_BAIL(outputMediaBuffer->Unlock());
-
- OK_OR_BAIL(outputMediaBuffer->SetCurrentLength(nPixelBytes));
- OK_OR_BAIL(outputSample->AddBuffer(outputMediaBuffer));
-
- if (outputType.guidSubtype == MFVideoFormat_RGB24)
- {
- return outputSample;
- }
-
- // Special case for mjpg, since we need to use jpg container for it instead of supplying raw pixels
- if (outputType.guidSubtype == MFVideoFormat_MJPG)
- {
- // Use an intermediate jpg container sample which will be transcoded to the target format
- wil::com_ptr_nothrow jpgStream =
- EncodeBitmapToContainer(pWIC, srcImageBitmap, GUID_ContainerFormatJpeg, targetWidth, targetHeight, quality);
-
- // Obtain stream size and lock its memory pointer
- STATSTG intermediateStreamStat{};
- OK_OR_BAIL(jpgStream->Stat(&intermediateStreamStat, STATFLAG_NONAME));
- const ULONGLONG jpgStreamSize = intermediateStreamStat.cbSize.QuadPart;
- HGLOBAL streamMemoryHandle{};
- OK_OR_BAIL(GetHGlobalFromStream(jpgStream.get(), &streamMemoryHandle));
-
- auto jpgStreamMemory = static_cast(GlobalLock(streamMemoryHandle));
- auto unlockJpgStreamMemory = wil::scope_exit([jpgStreamMemory] { GlobalUnlock(jpgStreamMemory); });
-
- // Create a sample from the input image buffer
- wil::com_ptr_nothrow jpgSample;
- OK_OR_BAIL(MFCreateSample(&jpgSample));
- OK_OR_BAIL(jpgSample->SetUINT32(MF_MT_VIDEO_ROTATION, MFVideoRotationFormat::MFVideoRotationFormat_0));
- IMFMediaBuffer* inputMediaBuffer = nullptr;
- OK_OR_BAIL(MFCreateAlignedMemoryBuffer(static_cast(jpgStreamSize), MF_64_BYTE_ALIGNMENT, &inputMediaBuffer));
- BYTE* inputBuf = nullptr;
- OK_OR_BAIL(inputMediaBuffer->Lock(&inputBuf, &max_length, ¤t_length));
- if (max_length < jpgStreamSize)
- {
- return nullptr;
- }
-
- std::copy(jpgStreamMemory, jpgStreamMemory + jpgStreamSize, inputBuf);
- unlockJpgStreamMemory.reset();
- OK_OR_BAIL(inputMediaBuffer->Unlock());
- OK_OR_BAIL(inputMediaBuffer->SetCurrentLength(static_cast(jpgStreamSize)));
- OK_OR_BAIL(jpgSample->AddBuffer(inputMediaBuffer));
-
- return jpgSample;
- }
-
- // Now we are ready to convert it to the requested media type
- MFT_REGISTER_TYPE_INFO intermediateType = { MFMediaType_Video, MFVideoFormat_RGB24 };
-
- // But if no conversion is needed, just return the input sample
-
- return ConvertIMFVideoSample(intermediateType, sampleMediaType, outputSample, targetWidth, targetHeight);
-}
\ No newline at end of file
diff --git a/src/modules/videoconference/VideoConferenceProxyFilter/Resources.resx b/src/modules/videoconference/VideoConferenceProxyFilter/Resources.resx
deleted file mode 100644
index 4770a524fe..0000000000
--- a/src/modules/videoconference/VideoConferenceProxyFilter/Resources.resx
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- VideoCaptureProxyFilter
- do not loc, product name
-
-
diff --git a/src/modules/videoconference/VideoConferenceProxyFilter/VideoCaptureDevice.cpp b/src/modules/videoconference/VideoConferenceProxyFilter/VideoCaptureDevice.cpp
deleted file mode 100644
index 7b97891c5b..0000000000
--- a/src/modules/videoconference/VideoConferenceProxyFilter/VideoCaptureDevice.cpp
+++ /dev/null
@@ -1,636 +0,0 @@
-#include "Logging.h"
-#include "VideoCaptureDevice.h"
-
-#include
-#include
-
-struct VideoCaptureReceiverFilter : winrt::implements
-{
- FILTER_STATE _state = State_Stopped;
- IFilterGraph* _graph = nullptr;
- wil::com_ptr_nothrow _videoReceiverPin;
-
- ULONG STDMETHODCALLTYPE GetMiscFlags() override { return AM_FILTER_MISC_FLAGS_IS_RENDERER; }
-
- HRESULT STDMETHODCALLTYPE GetClassID(CLSID*) override { return E_NOTIMPL; }
-
- HRESULT STDMETHODCALLTYPE Stop() override
- {
- _state = State_Stopped;
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE Pause() override
- {
- _state = State_Paused;
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE Run(REFERENCE_TIME) override
- {
- _state = State_Running;
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE GetState(DWORD, FILTER_STATE* outState) override
- {
- *outState = _state;
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE GetSyncSource(IReferenceClock** outRefClock) override
- {
- *outRefClock = nullptr;
- return NOERROR;
- }
-
- HRESULT STDMETHODCALLTYPE SetSyncSource(IReferenceClock*) override { return S_OK; }
-
- HRESULT STDMETHODCALLTYPE EnumPins(IEnumPins** ppEnum) override
- {
- auto enumerator = winrt::make_self>();
- enumerator->_objects.emplace_back(_videoReceiverPin);
- *ppEnum = enumerator.detach();
-
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE FindPin(LPCWSTR, IPin**) override { return E_NOTIMPL; }
-
- HRESULT STDMETHODCALLTYPE JoinFilterGraph(IFilterGraph* pGraph, LPCWSTR) override
- {
- _graph = pGraph;
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE QueryFilterInfo(FILTER_INFO* pInfo) override
- {
- std::copy(std::begin(NAME), std::end(NAME), pInfo->achName);
- if (_graph)
- {
- pInfo->pGraph = _graph;
- _graph->AddRef();
- }
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE QueryVendorInfo(LPWSTR* pVendorInfo) override
- {
- auto info = static_cast(CoTaskMemAlloc(sizeof(VENDOR)));
- std::copy(std::begin(VENDOR), std::end(VENDOR), info);
- *pVendorInfo = info;
- return S_OK;
- }
-
- virtual ~VideoCaptureReceiverFilter() = default;
-
- constexpr static inline wchar_t NAME[] = L"PowerToysVCMCaptureFilter";
- constexpr static inline wchar_t VENDOR[] = L"Microsoft Corporation";
-};
-
-struct VideoCaptureReceiverPin : winrt::implements
-{
- VideoCaptureReceiverFilter* _owningFilter = nullptr;
- unique_media_type_ptr _expectedMediaType;
- wil::com_ptr_nothrow _captureInputPin;
- unique_media_type_ptr _inputCaptureMediaType;
- std::atomic_bool _flushing = false;
- VideoCaptureDevice::callback_t _frameCallback;
-
- wil::com_ptr_nothrow _allocator;
-
- VideoCaptureReceiverPin(unique_media_type_ptr mediaType, VideoCaptureReceiverFilter* filter) :
- _expectedMediaType{ std::move(mediaType) }, _owningFilter{ filter }
- {
- }
-
- HRESULT STDMETHODCALLTYPE Connect(IPin*, const AM_MEDIA_TYPE* pmt) override
- {
- if (_owningFilter->_state == State_Running)
- {
- return VFW_E_NOT_STOPPED;
- }
-
- if (_captureInputPin)
- {
- return VFW_E_ALREADY_CONNECTED;
- }
-
- if (!pmt || pmt->majortype == GUID_NULL)
- {
- return S_OK;
- }
-
- if (pmt->majortype != _expectedMediaType->majortype || pmt->subtype != _expectedMediaType->subtype)
- {
- return S_FALSE;
- }
-
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE ReceiveConnection(IPin* pConnector, const AM_MEDIA_TYPE* pmt) override
- {
- if (!pConnector || !pmt)
- {
- return E_POINTER;
- }
-
- if (_captureInputPin)
- {
- return VFW_E_ALREADY_CONNECTED;
- }
-
- if (_owningFilter->_state != State_Stopped)
- {
- return VFW_E_NOT_STOPPED;
- }
-
- if (QueryAccept(pmt) != S_OK)
- {
- return VFW_E_TYPE_NOT_ACCEPTED;
- }
-
- _captureInputPin = pConnector;
- _inputCaptureMediaType = CopyMediaType(pmt);
-
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE Disconnect() override
- {
- _allocator.reset();
- _captureInputPin.reset();
- _inputCaptureMediaType.reset();
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE ConnectedTo(IPin** pPin) override
- {
- if (!_captureInputPin)
- {
- return VFW_E_NOT_CONNECTED;
- }
-
- return _captureInputPin.try_copy_to(pPin) ? S_OK : E_FAIL;
- }
-
- HRESULT STDMETHODCALLTYPE ConnectionMediaType(AM_MEDIA_TYPE* pmt) override
- {
- if (!pmt)
- {
- return E_POINTER;
- }
-
- if (!_inputCaptureMediaType)
- {
- return VFW_E_NOT_CONNECTED;
- }
-
- *pmt = *CopyMediaType(_inputCaptureMediaType.get()).release();
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE QueryPinInfo(PIN_INFO* pInfo) override
- {
- if (!pInfo)
- {
- return E_POINTER;
- }
-
- pInfo->pFilter = _owningFilter;
- if (_owningFilter)
- {
- _owningFilter->AddRef();
- }
-
- pInfo->dir = PINDIR_INPUT;
- std::copy(std::begin(NAME), std::end(NAME), pInfo->achName);
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE QueryDirection(PIN_DIRECTION* pPinDir) override
- {
- if (!pPinDir)
- {
- return E_POINTER;
- }
-
- *pPinDir = PINDIR_INPUT;
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE QueryId(LPWSTR* lpId) override
- {
- if (!lpId)
- {
- return E_POINTER;
- }
-
- *lpId = static_cast(CoTaskMemAlloc(sizeof(NAME)));
-
- std::copy(std::begin(NAME), std::end(NAME), *lpId);
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE QueryAccept(const AM_MEDIA_TYPE* pmt) override
- {
- if (!pmt)
- {
- return E_POINTER;
- }
-
- if (pmt->majortype != _expectedMediaType->majortype || pmt->subtype != _expectedMediaType->subtype)
- {
- return S_FALSE;
- }
-
- if (_captureInputPin)
- {
-// disable warning 26492 - Don't use const_cast to cast away const
-// reset needs 'pmt' to be non-const, we can't easily change the query accept prototype
-// because of the inheritance.
-#pragma warning(suppress : 26492)
- _inputCaptureMediaType.reset(const_cast(pmt));
- }
-
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE EnumMediaTypes(IEnumMediaTypes** ppEnum) override
- {
- if (!ppEnum)
- {
- return E_POINTER;
- }
-
- auto enumerator = winrt::make_self();
- enumerator->_objects.emplace_back(CopyMediaType(_expectedMediaType.get()));
- *ppEnum = enumerator.detach();
-
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE QueryInternalConnections(IPin**, ULONG*) override { return E_NOTIMPL; }
-
- HRESULT STDMETHODCALLTYPE EndOfStream() override { return S_OK; }
-
- HRESULT STDMETHODCALLTYPE BeginFlush() override
- {
- _flushing = true;
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE EndFlush() override
- {
- _flushing = false;
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE NewSegment(REFERENCE_TIME, REFERENCE_TIME, double) override { return S_OK; }
-
- HRESULT STDMETHODCALLTYPE GetAllocator(IMemAllocator** allocator) override
- {
- VERBOSE_LOG;
- if (!_allocator)
- {
- return VFW_E_NO_ALLOCATOR;
- }
-
- return _allocator.try_copy_to(allocator) ? S_OK : E_FAIL;
- }
-
- HRESULT STDMETHODCALLTYPE NotifyAllocator(IMemAllocator* allocator, BOOL readOnly) override
- {
- VERBOSE_LOG;
- LOG(readOnly ? "Allocator READONLY: true" : "Allocator READONLY: false");
- _allocator = allocator;
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE GetAllocatorRequirements(ALLOCATOR_PROPERTIES*) override { return E_NOTIMPL; }
-
- HRESULT STDMETHODCALLTYPE Receive(IMediaSample* pSample) override
- {
- if (_flushing)
- {
- return S_FALSE;
- }
-
- if (!pSample)
- {
- return E_POINTER;
- }
-
- if (pSample && _frameCallback)
- {
- _frameCallback(pSample);
- }
-
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE ReceiveMultiple(IMediaSample** pSamples, long nSamples, long* nSamplesProcessed) override
- {
- if (!pSamples && nSamples)
- {
- return E_POINTER;
- }
-
- if (_flushing)
- {
- return S_FALSE;
- }
-
- for (long i = 0; i < nSamples; i++)
- {
- Receive(pSamples[i]);
- }
-
- *nSamplesProcessed = nSamples;
- return S_OK;
- }
-
- HRESULT STDMETHODCALLTYPE ReceiveCanBlock() override { return S_FALSE; }
-
- virtual ~VideoCaptureReceiverPin() = default;
-
- constexpr static inline wchar_t NAME[] = L"PowerToysVCMCapturePin";
-};
-
-constexpr long MINIMAL_FPS_ALLOWED = 29;
-
-const char* GetMediaSubTypeString(const GUID& guid)
-{
- if (guid == MEDIASUBTYPE_RGB24)
- {
- return "MEDIASUBTYPE_RGB24";
- }
-
- if (guid == MEDIASUBTYPE_YUY2)
- {
- return "MEDIASUBTYPE_YUY2";
- }
-
- if (guid == MEDIASUBTYPE_MJPG)
- {
- return "MEDIASUBTYPE_MJPG";
- }
-
- if (guid == MEDIASUBTYPE_NV12)
- {
- return "MEDIASUBTYPE_NV12";
- }
-
- return "MEDIASUBTYPE_UNKNOWN";
-}
-
-std::optional SelectBestMediaType(wil::com_ptr_nothrow& pin)
-{
- VERBOSE_LOG;
- wil::com_ptr_nothrow mediaTypeEnum;
- if (pin->EnumMediaTypes(&mediaTypeEnum); !mediaTypeEnum)
- {
- return std::nullopt;
- }
-
- ULONG _ = 0;
- VideoStreamFormat bestFormat;
- unique_media_type_ptr mt;
- while (mediaTypeEnum->Next(1, wil::out_param(mt), &_) == S_OK)
- {
- if (mt->majortype != MEDIATYPE_Video)
- {
- continue;
- }
-
- auto format = reinterpret_cast(mt->pbFormat);
- if (!format || !format->AvgTimePerFrame)
- {
- LOG("VideoInfoHeader not found");
- continue;
- }
-
- const auto formatAvgFPS = 10000000LL / format->AvgTimePerFrame;
- if (format->AvgTimePerFrame > bestFormat.avgFrameTime || formatAvgFPS < MINIMAL_FPS_ALLOWED)
- {
- continue;
- }
-
- if (format->bmiHeader.biWidth < bestFormat.width || format->bmiHeader.biHeight < bestFormat.height)
- {
- continue;
- }
-
- if (mt->subtype != MEDIASUBTYPE_YUY2 && mt->subtype != MEDIASUBTYPE_MJPG && mt->subtype != MEDIASUBTYPE_RGB24)
- {
- OLECHAR* guidString;
- StringFromCLSID(mt->subtype, &guidString);
- LOG("Skipping mediatype due to unsupported subtype: ");
- LOG(guidString);
- ::CoTaskMemFree(guidString);
- continue;
- }
-
- bestFormat.avgFrameTime = format->AvgTimePerFrame;
- bestFormat.width = format->bmiHeader.biWidth;
- bestFormat.height = format->bmiHeader.biHeight;
- bestFormat.mediaType = std::move(mt);
- }
-
- if (!bestFormat.mediaType)
- {
- LOG(L"Couldn't select a suitable media format");
- return std::nullopt;
- }
-
- char selectedFormat[512]{};
- sprintf_s(selectedFormat, "Selected media format: %s %ldx%ld %lld fps", GetMediaSubTypeString(bestFormat.mediaType->subtype), bestFormat.width, bestFormat.height, 10000000LL / bestFormat.avgFrameTime);
- LOG(selectedFormat);
-
- return std::move(bestFormat);
-}
-
-std::vector VideoCaptureDevice::ListAll()
-{
- std::vector devices;
- auto enumeratorFactory = wil::CoCreateInstanceNoThrow(CLSID_SystemDeviceEnum);
- if (!enumeratorFactory)
- {
- LOG("Couldn't create devenum factory");
- return devices;
- }
-
- wil::com_ptr_nothrow enumMoniker;
- enumeratorFactory->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &enumMoniker, CDEF_DEVMON_PNP_DEVICE);
- if (!enumMoniker)
- {
- LOG("Couldn't create class enumerator");
- return devices;
- }
-
- ULONG _ = 0;
- wil::com_ptr_nothrow moniker;
- while (enumMoniker->Next(1, &moniker, &_) == S_OK)
- {
- LOG("Inspecting moniker");
- VideoCaptureDeviceInfo deviceInfo;
-
- wil::com_ptr_nothrow propertyData;
- moniker->BindToStorage(nullptr, nullptr, IID_IPropertyBag, reinterpret_cast(&propertyData));
- if (!propertyData)
- {
- LOG("BindToStorage failed");
- continue;
- }
-
- wil::unique_variant propVal;
- propVal.vt = VT_BSTR;
-
- if (FAILED(propertyData->Read(L"FriendlyName", &propVal, nullptr)))
- {
- LOG("Couldn't obtain FriendlyName property");
- continue;
- }
-
- deviceInfo.friendlyName = { propVal.bstrVal, SysStringLen(propVal.bstrVal) };
- LOG(deviceInfo.friendlyName);
-
- propVal.reset();
- propVal.vt = VT_BSTR;
-
- if (FAILED(propertyData->Read(L"DevicePath", &propVal, nullptr)))
- {
- LOG("Couldn't obtain DevicePath property");
- continue;
- }
- deviceInfo.devicePath = { propVal.bstrVal, SysStringLen(propVal.bstrVal) };
-
- wil::com_ptr_nothrow filter;
- moniker->BindToObject(nullptr, nullptr, IID_IBaseFilter, reinterpret_cast(&filter));
- if (!filter)
- {
- LOG("Couldn't BindToObject");
- continue;
- }
-
- wil::com_ptr_nothrow pinsEnum;
- if (FAILED(filter->EnumPins(&pinsEnum)))
- {
- LOG("BindToObject EnumPins");
- continue;
- }
-
- wil::com_ptr_nothrow pin;
- while (pinsEnum->Next(1, &pin, &_) == S_OK)
- {
- LOG("Inspecting pin");
- // Skip pins which do not belong to capture category
- GUID category{};
- DWORD __;
- if (auto props = pin.try_copy();
- !props ||
- FAILED(props->Get(AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY, nullptr, 0, &category, sizeof(GUID), &__)) ||
- category != PIN_CATEGORY_CAPTURE)
- {
- continue;
- }
-
- // Skip non-output pins
- if (PIN_DIRECTION direction = {}; FAILED(pin->QueryDirection(&direction)) || direction != PINDIR_OUTPUT)
- {
- continue;
- }
-
- LOG("Found a pin of suitable category and direction, selecting format");
- auto bestFormat = SelectBestMediaType(pin);
- if (!bestFormat)
- {
- continue;
- }
-
- deviceInfo.captureOutputPin = std::move(pin);
- deviceInfo.bestFormat = std::move(bestFormat.value());
- deviceInfo.captureOutputFilter = std::move(filter);
- devices.emplace_back(std::move(deviceInfo));
- }
- }
-
- return devices;
-}
-
-std::optional VideoCaptureDevice::Create(VideoCaptureDeviceInfo&& vdi, callback_t callback)
-{
- VERBOSE_LOG;
- VideoCaptureDevice result;
-
- result._graph = wil::CoCreateInstanceNoThrow(CLSID_FilterGraph);
- result._builder = wil::CoCreateInstanceNoThrow(CLSID_CaptureGraphBuilder2);
- if (!result._graph || !result._builder)
- {
- return std::nullopt;
- }
-
- if (FAILED(result._builder->SetFiltergraph(result._graph.get())))
- {
- return std::nullopt;
- }
-
- result._control = result._graph.try_query();
- if (!result._control)
- {
- return std::nullopt;
- }
-
- auto pinConfig = vdi.captureOutputPin.try_query();
- if (!pinConfig)
- {
- return std::nullopt;
- }
-
- if (FAILED(pinConfig->SetFormat(vdi.bestFormat.mediaType.get())))
- {
- return std::nullopt;
- }
-
- auto captureInputFilter = winrt::make_self();
- auto receiverPin = winrt::make_self(std::move(vdi.bestFormat.mediaType), captureInputFilter.get());
- receiverPin->_frameCallback = std::move(callback);
- captureInputFilter->_videoReceiverPin.attach(receiverPin.get());
- auto detachReceiverPin = wil::scope_exit([&receiverPin]() { receiverPin.detach(); });
-
- if (FAILED(result._graph->AddFilter(captureInputFilter.get(), nullptr)))
- {
- return std::nullopt;
- }
-
- if (FAILED(result._graph->AddFilter(vdi.captureOutputFilter.get(), nullptr)))
- {
- return std::nullopt;
- }
-
- if (FAILED(result._graph->ConnectDirect(vdi.captureOutputPin.get(), captureInputFilter->_videoReceiverPin.get(), nullptr)))
- {
- return std::nullopt;
- }
-
- result._allocator = receiverPin->_allocator;
- return std::make_optional(std::move(result));
-}
-
-bool VideoCaptureDevice::StartCapture()
-{
- VERBOSE_LOG;
- return SUCCEEDED(_control->Run());
-}
-
-bool VideoCaptureDevice::StopCapture()
-{
- VERBOSE_LOG;
- return SUCCEEDED(_control->Stop());
-}
-
-VideoCaptureDevice::~VideoCaptureDevice()
-{
- StopCapture();
-}
diff --git a/src/modules/videoconference/VideoConferenceProxyFilter/VideoCaptureDevice.h b/src/modules/videoconference/VideoConferenceProxyFilter/VideoCaptureDevice.h
deleted file mode 100644
index 3af63691a6..0000000000
--- a/src/modules/videoconference/VideoConferenceProxyFilter/VideoCaptureDevice.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#pragma once
-#include
-#define WIN32_LEAN_AND_MEAN
-
-#include
-#include
-
-#include
-
-#include
-#include
-#include
-#include
-
-#include "DirectShowUtils.h"
-
-struct VideoStreamFormat
-{
- long width = 0;
- long height = 0;
- REFERENCE_TIME avgFrameTime = std::numeric_limits::max();
- unique_media_type_ptr mediaType;
-
- VideoStreamFormat() = default;
-
- VideoStreamFormat(const VideoStreamFormat&) = delete;
- VideoStreamFormat& operator=(const VideoStreamFormat&) = delete;
-
- VideoStreamFormat(VideoStreamFormat&&) = default;
- VideoStreamFormat& operator=(VideoStreamFormat&&) = default;
-};
-
-struct VideoCaptureDeviceInfo
-{
- std::wstring friendlyName;
- std::wstring devicePath;
- wil::com_ptr_nothrow captureOutputPin;
- wil::com_ptr_nothrow captureOutputFilter;
- VideoStreamFormat bestFormat;
-};
-
-class VideoCaptureDevice final
-{
-public:
- wil::com_ptr_nothrow _allocator;
-
- using callback_t = std::function;
-
- static std::vector ListAll();
- static std::optional Create(VideoCaptureDeviceInfo&& vdi, callback_t callback);
-
- bool StartCapture();
- bool StopCapture();
-
- ~VideoCaptureDevice();
-
-private:
- wil::com_ptr_nothrow _graph;
- wil::com_ptr_nothrow _builder;
- wil::com_ptr_nothrow _control;
- callback_t _callback;
-};
diff --git a/src/modules/videoconference/VideoConferenceProxyFilter/VideoCaptureProxyFilter.cpp b/src/modules/videoconference/VideoConferenceProxyFilter/VideoCaptureProxyFilter.cpp
deleted file mode 100644
index 2a860a72fa..0000000000
--- a/src/modules/videoconference/VideoConferenceProxyFilter/VideoCaptureProxyFilter.cpp
+++ /dev/null
@@ -1,937 +0,0 @@
-#include "VideoCaptureProxyFilter.h"
-
-#include "VideoCaptureDevice.h"
-#include
-#include
-#include
-#include
-
-constexpr static inline wchar_t FILTER_NAME[] = L"PowerToysVCMProxyFilter";
-constexpr static inline wchar_t PIN_NAME[] = L"PowerToysVCMProxyPIN";
-constexpr static inline wchar_t VENDOR[] = L"Microsoft Corporation";
-
-namespace
-{
- constexpr float initialJpgQuality = 0.5f;
- constexpr std::array overlayColor = { 0, 0, 0 };
- // clang-format off
- unsigned char bmpPixelData[58] = {
- 0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00,
- 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
- 0x00, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, overlayColor[0], overlayColor[1], overlayColor[2], 0x00
- };
- // clang-format on
-}
-
-wil::com_ptr_nothrow VideoCaptureProxyPin::FindAllocator()
-{
- auto allocator = GetPinAllocator(_connectedInputPin);
- if (!allocator && _owningFilter->_captureDevice)
- {
- allocator = _owningFilter->_captureDevice->_allocator;
- }
-
- return allocator;
-}
-
-wil::com_ptr_nothrow LoadImageAsSample(wil::com_ptr_nothrow imageStream,
- IMFMediaType* sampleMediaType,
- const float quality) noexcept;
-bool ReencodeJPGImage(BYTE* imageBuf, const DWORD imageSize, DWORD& reencodedSize);
-
-HRESULT VideoCaptureProxyPin::Connect(IPin* pReceivePin, const AM_MEDIA_TYPE*)
-{
- if (!pReceivePin)
- {
- LOG("VideoCaptureProxyPin::Connect FAILED pReceivePin");
- return E_POINTER;
- }
-
- if (_owningFilter->_state == State_Running)
- {
- LOG("VideoCaptureProxyPin::Connect FAILED _owningFilter->_state");
- return VFW_E_NOT_STOPPED;
- }
-
- if (_connectedInputPin)
- {
- LOG("VideoCaptureProxyPin::Connect FAILED _connectedInputPin");
- return VFW_E_ALREADY_CONNECTED;
- }
-
- if (FAILED(pReceivePin->ReceiveConnection(this, _mediaFormat.get())))
- {
- LOG("VideoCaptureProxyPin::Connect FAILED pReceivePin->ReceiveConnection");
- return E_POINTER;
- }
-
- _connectedInputPin = pReceivePin;
-
- auto memInput = _connectedInputPin.try_query();
- if (!memInput)
- {
- LOG("VideoCaptureProxyPin::Connect FAILED _connectedInputPin.try_query");
- return VFW_E_NO_TRANSPORT;
- }
-
- auto allocator = FindAllocator();
- if (allocator == nullptr)
- {
- LOG("VideoCaptureProxyPin::Connect FAILED FindAllocator");
- return VFW_E_NO_TRANSPORT;
- }
-
- if (FAILED(memInput->NotifyAllocator(allocator.get(), false)))
- {
- LOG("VideoCaptureProxyPin::Connect FAILED memInput->NotifyAllocator");
- return VFW_E_NO_TRANSPORT;
- }
-
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::ReceiveConnection(IPin*, const AM_MEDIA_TYPE*)
-{
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::Disconnect(void)
-{
- if (!_connectedInputPin)
- {
- LOG("VideoCaptureProxyPin::Disconnect FAILED _connectedInputPin");
- return S_FALSE;
- }
-
- _connectedInputPin.reset();
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::ConnectedTo(IPin** pPin)
-{
- if (!_connectedInputPin)
- {
- *pPin = nullptr;
- return VFW_E_NOT_CONNECTED;
- }
-
- return _connectedInputPin.try_copy_to(pPin) ? S_OK : E_FAIL;
-}
-
-HRESULT VideoCaptureProxyPin::ConnectionMediaType(AM_MEDIA_TYPE* pmt)
-{
- if (!_connectedInputPin)
- {
- LOG("VideoCaptureProxyPin::ConnectionMediaType FAILED _connectedInputPin");
- return VFW_E_NOT_CONNECTED;
- }
-
- *pmt = *CopyMediaType(_mediaFormat.get()).release();
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::QueryPinInfo(PIN_INFO* pInfo)
-{
- if (!pInfo)
- {
- LOG("VideoCaptureProxyPin::QueryPinInfo FAILED pInfo");
- return E_POINTER;
- }
-
- pInfo->pFilter = _owningFilter;
- if (_owningFilter)
- {
- _owningFilter->AddRef();
- }
-
- if (_mediaFormat->majortype == MEDIATYPE_Video)
- {
- std::copy(std::begin(PIN_NAME), std::end(PIN_NAME), pInfo->achName);
- }
-
- pInfo->dir = PINDIR_OUTPUT;
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::QueryDirection(PIN_DIRECTION* pPinDir)
-{
- if (!pPinDir)
- {
- LOG("VideoCaptureProxyPin::QueryDirection FAILED pPinDir");
- return E_POINTER;
- }
-
- *pPinDir = PINDIR_OUTPUT;
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::QueryId(LPWSTR* Id)
-{
- if (!Id)
- {
- LOG("VideoCaptureProxyPin::QueryId FAILED Id");
- return E_POINTER;
- }
-
- *Id = static_cast(CoTaskMemAlloc(sizeof(PIN_NAME)));
- std::copy(std::begin(PIN_NAME), std::end(PIN_NAME), *Id);
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::QueryAccept(const AM_MEDIA_TYPE*)
-{
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::EnumMediaTypes(IEnumMediaTypes** ppEnum)
-{
- if (!ppEnum)
- {
- LOG("VideoCaptureProxyPin::EnumMediaTypes FAILED ppEnum");
- return E_POINTER;
- }
-
- *ppEnum = nullptr;
-
- auto enumerator = winrt::make_self();
- enumerator->_objects.emplace_back(CopyMediaType(_mediaFormat.get()));
- *ppEnum = enumerator.detach();
-
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::QueryInternalConnections(IPin** pins, ULONG*)
-{
- if (pins)
- {
- *pins = nullptr;
- }
- return E_NOTIMPL;
-}
-
-HRESULT VideoCaptureProxyPin::EndOfStream(void)
-{
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::BeginFlush(void)
-{
- _flushing = true;
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::EndFlush(void)
-{
- _flushing = false;
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::NewSegment(REFERENCE_TIME, REFERENCE_TIME, double)
-{
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::SetFormat(AM_MEDIA_TYPE* pmt)
-{
- if (pmt == nullptr)
- {
- return S_OK;
- }
-
- _mediaFormat = CopyMediaType(pmt);
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::GetFormat(AM_MEDIA_TYPE** ppmt)
-{
- if (!ppmt)
- {
- LOG("VideoCaptureProxyPin::GetFormat FAILED ppmt");
- return E_POINTER;
- }
- *ppmt = CopyMediaType(_mediaFormat.get()).release();
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::GetNumberOfCapabilities(int* piCount, int* piSize)
-{
- if (!piCount || !piSize)
- {
- LOG("VideoCaptureProxyPin::GetNumberOfCapabilities FAILED piCount || piSize");
- return E_POINTER;
- }
-
- *piCount = 1;
- *piSize = sizeof(VIDEO_STREAM_CONFIG_CAPS);
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::GetStreamCaps(int iIndex, AM_MEDIA_TYPE** ppmt, BYTE* pSCC)
-{
- if (!ppmt || !pSCC)
- {
- LOG("VideoCaptureProxyPin::GetStreamCaps FAILED ppmt || pSCC");
- return E_POINTER;
- }
-
- if (iIndex != 0)
- {
- LOG("VideoCaptureProxyPin::GetStreamCaps FAILED iIndex");
- return S_FALSE;
- }
-
- VIDEOINFOHEADER* vih = reinterpret_cast(_mediaFormat->pbFormat);
-
- VIDEO_STREAM_CONFIG_CAPS caps{};
- caps.guid = FORMAT_VideoInfo;
- caps.MinFrameInterval = vih->AvgTimePerFrame;
- caps.MaxFrameInterval = vih->AvgTimePerFrame;
- caps.MinOutputSize.cx = vih->bmiHeader.biWidth;
- caps.MinOutputSize.cy = vih->bmiHeader.biHeight;
- caps.MaxOutputSize = caps.MinOutputSize;
- caps.InputSize = caps.MinOutputSize;
- caps.MinCroppingSize = caps.MinOutputSize;
- caps.MaxCroppingSize = caps.MinOutputSize;
- caps.CropGranularityX = vih->bmiHeader.biWidth;
- caps.CropGranularityY = vih->bmiHeader.biHeight;
- caps.MinBitsPerSecond = vih->dwBitRate;
- caps.MaxBitsPerSecond = caps.MinBitsPerSecond;
-
- *ppmt = CopyMediaType(_mediaFormat.get()).release();
-
- const auto caps_begin = reinterpret_cast(&caps);
- std::copy(caps_begin, caps_begin + sizeof(caps), pSCC);
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::Set(REFGUID, DWORD, LPVOID, DWORD, LPVOID, DWORD)
-{
- return E_NOTIMPL;
-}
-
-HRESULT VideoCaptureProxyPin::Get(
- REFGUID guidPropSet,
- DWORD dwPropID,
- LPVOID,
- DWORD,
- LPVOID pPropData,
- DWORD cbPropData,
- DWORD* pcbReturned)
-{
- if (guidPropSet != AMPROPSETID_Pin)
- {
- LOG("VideoCaptureProxyPin::Get FAILED guidPropSet");
- return E_PROP_SET_UNSUPPORTED;
- }
-
- if (dwPropID != AMPROPERTY_PIN_CATEGORY)
- {
- LOG("VideoCaptureProxyPin::Get FAILED dwPropID");
- return E_PROP_ID_UNSUPPORTED;
- }
-
- if (!pPropData)
- {
- LOG("VideoCaptureProxyPin::Get FAILED pPropData || pcbReturned");
- return E_POINTER;
- }
-
- if (pcbReturned)
- {
- *pcbReturned = sizeof(GUID);
- }
-
- if (cbPropData < sizeof(GUID))
- {
- LOG("VideoCaptureProxyPin::Get FAILED cbPropData");
- return E_UNEXPECTED;
- }
-
- *static_cast(pPropData) = PIN_CATEGORY_CAPTURE;
-
- LOG("VideoCaptureProxyPin::Get SUCCESS");
- return S_OK;
-}
-
-HRESULT VideoCaptureProxyPin::QuerySupported(REFGUID guidPropSet, DWORD dwPropID, DWORD* pTypeSupport)
-{
- if (guidPropSet != AMPROPSETID_Pin)
- {
- LOG("VideoCaptureProxyPin::QuerySupported FAILED guidPropSet");
- return E_PROP_SET_UNSUPPORTED;
- }
-
- if (dwPropID != AMPROPERTY_PIN_CATEGORY)
- {
- LOG("VideoCaptureProxyPin::QuerySupported FAILED dwPropID");
- return E_PROP_ID_UNSUPPORTED;
- }
-
- if (pTypeSupport)
- {
- *pTypeSupport = KSPROPERTY_SUPPORT_GET;
- }
-
- return S_OK;
-}
-
-long GetImageSize(wil::com_ptr_nothrow