Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video Support #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,5 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

Unicord.Universal.Voice.Test/*
84 changes: 82 additions & 2 deletions Unicord.Universal.Voice.sln
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31717.71
# Visual Studio 15
VisualStudioVersion = 15.0.28307.1972
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Unicord.Universal.Voice", "Unicord.Universal.Voice\Unicord.Universal.Voice.vcxproj", "{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsodium", "externals\libsodium\libsodium.vcxproj", "{A185B162-6CB6-4502-B03F-B56F7699A8D9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unicord.Universal.Voice.Test", "Unicord.Universal.Voice.Test\Unicord.Universal.Voice.Test.csproj", "{8FBFA77D-3585-409A-8144-BEB332F8ED83}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{20D46490-32A1-44D5-8733-012419B7EE83}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DSharpPlus", "..\..\..\source\repos\Unicord\Libraries\DSharpPlus\DSharpPlus\DSharpPlus.csproj", "{78A5571C-618E-47C6-9703-92760BE77671}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Unicord", "..\..\..\source\repos\Unicord\Unicord\Unicord.csproj", "{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}.Debug|Any CPU.ActiveCfg = Debug|Win32
{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}.Debug|ARM.ActiveCfg = Debug|ARM
{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}.Debug|ARM.Build.0 = Debug|ARM
{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}.Debug|ARM64.ActiveCfg = Debug|ARM64
Expand All @@ -27,6 +38,7 @@ Global
{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}.Debug|x64.Build.0 = Debug|x64
{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}.Debug|x86.ActiveCfg = Debug|Win32
{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}.Debug|x86.Build.0 = Debug|Win32
{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}.Release|Any CPU.ActiveCfg = Release|Win32
{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}.Release|ARM.ActiveCfg = Release|ARM
{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}.Release|ARM.Build.0 = Release|ARM
{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}.Release|ARM64.ActiveCfg = Release|ARM64
Expand All @@ -35,6 +47,7 @@ Global
{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}.Release|x64.Build.0 = Release|x64
{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}.Release|x86.ActiveCfg = Release|Win32
{E3BC526E-DEBD-4F76-A669-9ADADE1D4FC8}.Release|x86.Build.0 = Release|Win32
{A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|Any CPU.ActiveCfg = Debug|Win32
{A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|ARM.ActiveCfg = DebugDLL|ARM
{A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|ARM.Build.0 = DebugDLL|ARM
{A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|ARM64.ActiveCfg = DebugDLL|ARM64
Expand All @@ -43,6 +56,7 @@ Global
{A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|x64.Build.0 = DebugDLL|x64
{A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|x86.ActiveCfg = DebugDLL|Win32
{A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|x86.Build.0 = DebugDLL|Win32
{A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|Any CPU.ActiveCfg = Release|Win32
{A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|ARM.ActiveCfg = ReleaseDLL|ARM
{A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|ARM.Build.0 = ReleaseDLL|ARM
{A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|ARM64.ActiveCfg = ReleaseDLL|ARM64
Expand All @@ -51,6 +65,72 @@ Global
{A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|x64.Build.0 = ReleaseDLL|x64
{A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|x86.ActiveCfg = ReleaseDLL|Win32
{A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|x86.Build.0 = ReleaseDLL|Win32
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Debug|Any CPU.ActiveCfg = Debug|x86
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Debug|ARM.ActiveCfg = Debug|ARM
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Debug|ARM.Build.0 = Debug|ARM
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Debug|ARM.Deploy.0 = Debug|ARM
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Debug|ARM64.ActiveCfg = Debug|ARM64
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Debug|ARM64.Build.0 = Debug|ARM64
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Debug|ARM64.Deploy.0 = Debug|ARM64
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Debug|x64.ActiveCfg = Debug|x64
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Debug|x64.Build.0 = Debug|x64
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Debug|x64.Deploy.0 = Debug|x64
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Debug|x86.ActiveCfg = Debug|x86
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Debug|x86.Build.0 = Debug|x86
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Debug|x86.Deploy.0 = Debug|x86
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Release|Any CPU.ActiveCfg = Release|x86
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Release|ARM.ActiveCfg = Release|ARM
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Release|ARM.Build.0 = Release|ARM
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Release|ARM.Deploy.0 = Release|ARM
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Release|ARM64.ActiveCfg = Release|ARM64
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Release|ARM64.Build.0 = Release|ARM64
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Release|ARM64.Deploy.0 = Release|ARM64
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Release|x64.ActiveCfg = Release|x64
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Release|x64.Build.0 = Release|x64
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Release|x64.Deploy.0 = Release|x64
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Release|x86.ActiveCfg = Release|x86
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Release|x86.Build.0 = Release|x86
{8FBFA77D-3585-409A-8144-BEB332F8ED83}.Release|x86.Deploy.0 = Release|x86
{78A5571C-618E-47C6-9703-92760BE77671}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Debug|ARM.ActiveCfg = Debug|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Debug|ARM.Build.0 = Debug|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Debug|ARM64.Build.0 = Debug|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Debug|x64.ActiveCfg = Debug|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Debug|x64.Build.0 = Debug|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Debug|x86.ActiveCfg = Debug|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Debug|x86.Build.0 = Debug|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Release|Any CPU.Build.0 = Release|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Release|ARM.ActiveCfg = Release|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Release|ARM.Build.0 = Release|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Release|ARM64.ActiveCfg = Release|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Release|ARM64.Build.0 = Release|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Release|x64.ActiveCfg = Release|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Release|x64.Build.0 = Release|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Release|x86.ActiveCfg = Release|Any CPU
{78A5571C-618E-47C6-9703-92760BE77671}.Release|x86.Build.0 = Release|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Debug|ARM.ActiveCfg = Debug|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Debug|ARM.Build.0 = Debug|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Debug|ARM64.Build.0 = Debug|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Debug|x64.ActiveCfg = Debug|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Debug|x64.Build.0 = Debug|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Debug|x86.ActiveCfg = Debug|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Debug|x86.Build.0 = Debug|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Release|Any CPU.Build.0 = Release|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Release|ARM.ActiveCfg = Release|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Release|ARM.Build.0 = Release|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Release|ARM64.ActiveCfg = Release|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Release|ARM64.Build.0 = Release|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Release|x64.ActiveCfg = Release|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Release|x64.Build.0 = Release|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Release|x86.ActiveCfg = Release|Any CPU
{F74F4E50-CED6-4EC0-816F-BC3FFEC04983}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
24 changes: 15 additions & 9 deletions Unicord.Universal.Voice/Unicord.Universal.Voice.vcxproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.props')" />
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.201201.7\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201201.7\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<CppWinRTOptimized>true</CppWinRTOptimized>
<MinimalCoreWin>true</MinimalCoreWin>
Expand All @@ -12,8 +12,8 @@
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.19041.0</WindowsTargetPlatformMinVersion>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.22000.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.22000.0</WindowsTargetPlatformMinVersion>
<CppWinRTNamespaceMergeDepth>3</CppWinRTNamespaceMergeDepth>
<CppWinRTFastAbi>true</CppWinRTFastAbi>
</PropertyGroup>
Expand Down Expand Up @@ -55,7 +55,7 @@
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v142</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<GenerateManifest>false</GenerateManifest>
Expand Down Expand Up @@ -125,13 +125,13 @@
<DisableSpecificWarnings>28204</DisableSpecificWarnings>
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>..\externals\libsodium\src\libsodium\include;..\externals\webrtc-uwp-sdk\webrtc\xplatform\webrtc;..\externals\webrtc-uwp-sdk\webrtc\xplatform\zsLib;..\externals\webrtc-uwp-sdk\webrtc\xplatform\chromium\third_party\abseil-cpp;..\externals\webrtc-uwp-sdk\webrtc\xplatform\chromium\third_party\opus\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\externals\libsodium\src\libsodium\include;..\externals\webrtc-uwp-sdk\webrtc\xplatform\webrtc;..\externals\webrtc-uwp-sdk\webrtc\xplatform\libyuv\include;..\externals\webrtc-uwp-sdk\webrtc\xplatform\zsLib;..\externals\webrtc-uwp-sdk\webrtc\xplatform\chromium\third_party\abseil-cpp;..\externals\webrtc-uwp-sdk\webrtc\xplatform\chromium\third_party\opus\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
<ModuleDefinitionFile>Unicord.Universal.Voice.def</ModuleDefinitionFile>
<AdditionalLibraryDirectories>$(SolutionDir)externals\libsodium\bin\$(Platform)\$(Configuration)DLL\libsodium;$(SolutionDir)externals\webrtc\$(PlatformTarget);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(SolutionDir)externals\libsodium\bin\$(Platform)\$(Configuration)DLL\libsodium;$(SolutionDir)externals\webrtc\$(PlatformTarget)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>WindowsApp.lib;libsodium.lib;webrtc.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
Expand Down Expand Up @@ -232,6 +232,7 @@
<ClInclude Include="SodiumWrapper.h" />
<ClInclude Include="SpeakingAudioAnalyzer.h" />
<ClInclude Include="VideoFrameSink.h" />
<ClInclude Include="VideoSurfaceCreatedEventArgs.h" />
<ClInclude Include="VoiceBackgroundTask.h">
<DependentUpon>VoiceBackgroundTask.idl</DependentUpon>
</ClInclude>
Expand All @@ -248,6 +249,9 @@
<ClInclude Include="VoiceTransport.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\externals\webrtc-uwp-sdk\webrtc\xplatform\webrtc\test\frame_generator.cc" />
<ClCompile Include="..\externals\webrtc-uwp-sdk\webrtc\xplatform\webrtc\test\frame_generator_capturer.cc" />
<ClCompile Include="..\externals\webrtc-uwp-sdk\webrtc\xplatform\webrtc\test\test_video_capturer.cc" />
<ClCompile Include="external\AudioDeviceWasapi.cpp" />
<ClCompile Include="OpusWrapper.cpp" />
<ClCompile Include="pch.cpp">
Expand All @@ -259,6 +263,7 @@
<ClCompile Include="SodiumWrapper.cpp" />
<ClCompile Include="SpeakingAudioAnalyzer.cpp" />
<ClCompile Include="VideoFrameSink.cpp" />
<ClCompile Include="VideoSurfaceCreatedEventArgs.cpp" />
<ClCompile Include="VoiceBackgroundTask.cpp">
<DependentUpon>VoiceBackgroundTask.idl</DependentUpon>
</ClCompile>
Expand All @@ -278,6 +283,7 @@
<ItemGroup>
<Midl Include="NoiseSuppressionLevel.idl" />
<Midl Include="ServiceBackgroundTask.idl" />
<Midl Include="VideoSurfaceCreatedEventArgs.idl" />
<Midl Include="VoiceBackgroundTask.idl" />
<Midl Include="VoiceClient.idl" />
<Midl Include="VoiceClientOptions.idl" />
Expand Down Expand Up @@ -311,13 +317,13 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.201201.7\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201201.7\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>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}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201201.7\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.201201.7\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201201.7\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.201201.7\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>
12 changes: 12 additions & 0 deletions Unicord.Universal.Voice/Unicord.Universal.Voice.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
<ClCompile Include="VoiceClientStats.cpp" />
<ClCompile Include="VideoFrameSink.cpp" />
<ClCompile Include="SpeakingAudioAnalyzer.cpp" />
<ClCompile Include="..\externals\webrtc-uwp-sdk\webrtc\xplatform\webrtc\test\test_video_capturer.cc">
<Filter>Externals</Filter>
</ClCompile>
<ClCompile Include="..\externals\webrtc-uwp-sdk\webrtc\xplatform\webrtc\test\frame_generator.cc">
<Filter>Externals</Filter>
</ClCompile>
<ClCompile Include="..\externals\webrtc-uwp-sdk\webrtc\xplatform\webrtc\test\frame_generator_capturer.cc">
<Filter>Externals</Filter>
</ClCompile>
<ClCompile Include="VideoSurfaceCreatedEventArgs.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
Expand Down Expand Up @@ -60,6 +70,7 @@
<ClInclude Include="VoiceClientStats.h" />
<ClInclude Include="VideoFrameSink.h" />
<ClInclude Include="SpeakingAudioAnalyzer.h" />
<ClInclude Include="VideoSurfaceCreatedEventArgs.h" />
</ItemGroup>
<ItemGroup>
<Midl Include="VoiceClient.idl" />
Expand All @@ -78,6 +89,7 @@
</Midl>
<Midl Include="VoiceClientStats.idl" />
<Midl Include="NoiseSuppressionLevel.idl" />
<Midl Include="VideoSurfaceCreatedEventArgs.idl" />
</ItemGroup>
<ItemGroup>
<None Include="Unicord.Universal.Voice.def" />
Expand Down
23 changes: 22 additions & 1 deletion Unicord.Universal.Voice/VideoFrameSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@

namespace winrt::Unicord::Universal::Voice::Render {
void VideoFrameSink::OnFrame(const webrtc::VideoFrame& frame) {
std::cout << "frame from " << videoSSRC << " w: " << frame.width() << " h: " << frame.height() << std::endl;
rtc::scoped_refptr<webrtc::I420BufferInterface> buffer(frame.video_frame_buffer()->ToI420());
webrtc::VideoRotation rotation = frame.rotation();

if (!_d3d11Texture || _width != frame.width() || _height != frame.height()) {

}

/*if (rotation != webrtc::kVideoRotation_0) {
buffer = webrtc::I420Buffer::Rotate(*buffer, rotation);
}*/

//int32_t width = buffer->width();
//int32_t height = buffer->height();

//size_t bits = 32;
//size_t size = width * height * (bits >> 3);

//std::unique_ptr<uint8_t[]> data(new uint8_t[size]);
//libyuv::I420ToARGB(buffer->DataY(), buffer->StrideY(), buffer->DataU(), buffer->StrideU(), buffer->DataV(),
// buffer->StrideV(), data.get(), width * bits / 8, width, height);

//PaintFrameAsync(std::move(data), size, width, height);
}
}
Loading