Add new VideoConference module for muting mic/cam (#11798)

* add new VideoConference module for muting mic/cam

Co-authored-by: PrzemyslawTusinski <61138537+PrzemyslawTusinski@users.noreply.github.com>
Co-authored-by: Niels Laute <niels.laute@live.nl>
This commit is contained in:
Andrey Nekrasov
2021-06-29 13:06:12 +03:00
committed by GitHub
parent e450669663
commit 4e23832d52
116 changed files with 7425 additions and 81 deletions

View File

@@ -245,6 +245,13 @@ void ReportDotNetInstallationInfo(const filesystem::path& tmpDir)
}
}
void ReportVCMLogs(const filesystem::path& tmpDir, const filesystem::path& reportDir)
{
error_code ec;
copy(tmpDir / "PowerToysVideoConference_x86.log", reportDir, ec);
copy(tmpDir / "PowerToysVideoConference_x64.log", reportDir, ec);
}
int wmain(int argc, wchar_t* argv[], wchar_t*)
{
// Get path to save zip
@@ -270,10 +277,9 @@ int wmain(int argc, wchar_t* argv[], wchar_t*)
auto settingsRootPath = PTSettingsHelper::get_root_save_folder_location();
settingsRootPath = settingsRootPath + L"\\";
// Copy to a temp folder
auto tmpDir = temp_directory_path();
tmpDir = tmpDir.append("PowerToys\\");
if (!DeleteFolder(tmpDir))
const auto tempDir = temp_directory_path();
auto reportDir = temp_directory_path() / "PowerToys\\";
if (!DeleteFolder(reportDir))
{
printf("Failed to delete temp folder\n");
return 1;
@@ -281,10 +287,10 @@ int wmain(int argc, wchar_t* argv[], wchar_t*)
try
{
copy(settingsRootPath, tmpDir, copy_options::recursive);
copy(settingsRootPath, reportDir, copy_options::recursive);
// Remove updates folder contents
DeleteFolder(tmpDir / "Updates");
DeleteFolder(reportDir / "Updates");
}
catch (...)
{
@@ -293,28 +299,30 @@ int wmain(int argc, wchar_t* argv[], wchar_t*)
}
// Hide sensitive information
HideUserPrivateInfo(tmpDir);
HideUserPrivateInfo(reportDir);
// Write windows settings to the temporary folder
ReportWindowsSettings(tmpDir);
ReportWindowsSettings(reportDir);
// Write monitors info to the temporary folder
ReportMonitorInfo(tmpDir);
ReportMonitorInfo(reportDir);
// Write windows version info to the temporary folder
ReportWindowsVersion(tmpDir);
ReportWindowsVersion(reportDir);
// Write dotnet installation info to the temporary folder
ReportDotNetInstallationInfo(tmpDir);
ReportDotNetInstallationInfo(reportDir);
// Write registry to the temporary folder
ReportRegistry(tmpDir);
ReportRegistry(reportDir);
// Write compatibility tab info to the temporary folder
ReportCompatibilityTab(tmpDir);
ReportCompatibilityTab(reportDir);
// Write event viewer logs info to the temporary folder
EventViewer::ReportEventViewerInfo(tmpDir);
EventViewer::ReportEventViewerInfo(reportDir);
ReportVCMLogs(tempDir, reportDir);
// Zip folder
auto zipPath = path::path(saveZipPath);
@@ -325,7 +333,7 @@ int wmain(int argc, wchar_t* argv[], wchar_t*)
try
{
ZipFolder(zipPath, tmpDir);
ZipFolder(zipPath, reportDir);
}
catch (...)
{
@@ -333,6 +341,6 @@ int wmain(int argc, wchar_t* argv[], wchar_t*)
return 1;
}
DeleteFolder(tmpDir);
DeleteFolder(reportDir);
return 0;
}

View File

@@ -10,6 +10,7 @@
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <Shlobj.h>
#include <Shlobj_core.h>
@@ -90,6 +91,15 @@ std::string GetMediaSubTypeString(const GUID& guid)
}
}
std::string asString(RECT r)
{
std::ostringstream s;
if (r.left == r.right && r.bottom == r.right && r.top == r.right && r.right == 0)
return "[ZEROES]";
s << '(' << r.left << ", " << r.top << ") - (" << r.right << ", " << r.bottom << ")";
return s.str();
}
void LogMediaTypes(wil::com_ptr_nothrow<IPin>& pin)
{
wil::com_ptr_nothrow<IEnumMediaTypes> mediaTypeEnum;
@@ -113,7 +123,9 @@ void LogMediaTypes(wil::com_ptr_nothrow<IPin>& pin)
}
const auto formatAvgFPS = 10000000LL / format->AvgTimePerFrame;
log() << GetMediaSubTypeString(mt->subtype) << '\t' << format->bmiHeader.biWidth << "x"
<< format->bmiHeader.biHeight << " - " << formatAvgFPS << "fps\n";
<< format->bmiHeader.biHeight << " - " << formatAvgFPS << "fps src rect: " << asString(format->rcSource)
<< " dst rect: " << asString(format->rcSource)
<< " flipped: " << std::boolalpha << (format->bmiHeader.biHeight < 0) << '\n';
}
log() << '\n';
}

View File

@@ -0,0 +1,13 @@
param (
[string]$arch = "x64",
[string]$configuration = "Release"
)
$PTRoot = "${PSScriptRoot}\..\.."
cd "$PTRoot\$arch\$configuration\modules\VideoConference\VideoConferenceVirtualDriver"
$ddf = Resolve-Path "$PTRoot\src\modules\videoconference\make_cab.ddf"
makecab.exe /v0 /F $ddf | Out-Null
Move-Item -Path driver\driver.cab -Destination VideoConference.cab -Force
Remove-Item -Force -Recurse -Path driver
Remove-Item -Force -Path setup.inf
Remove-Item -Force -Path setup.rpt