├── .gitignore ├── LICENSE ├── README.md ├── nuget └── templates │ ├── WebRtc.Nuget.sln │ ├── WebRtc.nuspec │ └── WebRtc.targets ├── projects └── msvc │ ├── Org.WebRtc.NetStandard │ └── Org.WebRtc.csproj │ ├── Org.WebRtc.Universal │ ├── Org.WebRtc.vcxproj │ ├── Org.WebRtc.vcxproj.filters │ ├── Org_WebRtc.def │ ├── packages.config │ ├── pch.cpp │ ├── pch.h │ └── readme.txt │ ├── Org.WebRtc.WrapperC.Win32 │ ├── Org.WebRtc.WrapperC.cpp │ ├── Org.WebRtc.WrapperC.filters │ ├── Org.WebRtc.WrapperC.vcxproj │ ├── dllmain.cpp │ ├── stdafx.cpp │ ├── stdafx.h │ └── targetver.h │ ├── Org.WebRtc.WrapperGlue.Universal │ ├── Org.WebRtc.WrapperGlue.vcxproj │ ├── Org.WebRtc.WrapperGlue.vcxproj.filters │ └── targetver.h │ ├── Org.WebRtc.WrapperGlue.Win32 │ ├── Org.WebRtc.WrapperGlue.vcxproj │ ├── Org.WebRtc.WrapperGlue.vcxproj.filters │ ├── stdafx.cpp │ ├── stdafx.h │ └── targetver.h │ ├── PeerConnectionServer.Utility.Universal │ └── PeerConnectionServer.Utility.vcxproj │ ├── PeerConnectionServer.Utility │ ├── PeerConnectionServer.Utility.vcxproj │ └── PeerConnectionServer.Utility.vcxproj.filters │ ├── WebRtc.UWP.Native.Builder │ ├── DummyClass.cpp │ ├── DummyClass.h │ └── WebRtc.UWP.Native.Builder.vcxproj │ └── WebRtc.Win32.Native.Builder │ ├── WebRtc.Win32.Native.Builder.vcxproj │ ├── WebRtc.Win32.Native.Builder.vcxproj.filters │ ├── stdafx.cpp │ ├── stdafx.h │ └── targetver.h ├── solutions ├── WebRtc.Universal.sln ├── WebRtc.Win32.sln └── WebRtcUnity.Universal.sln ├── templates ├── gns │ └── args.gn ├── libs │ └── webrtc │ │ ├── WebRtc.x64.sln │ │ ├── WebRtc.x86.sln │ │ └── webrtcLib.sln ├── samples │ ├── ChatterBox │ │ └── ChatterBox.Background │ │ │ ├── ChatterBox.Background.csproj │ │ │ └── project.json │ └── PeerCC │ │ ├── AssemblyInfo.cs │ │ ├── Package.WebRtc.appxmanifest │ │ ├── PeerConnectionClient.WebRtc.csproj │ │ └── project.json └── solutions │ ├── WebRtc.Wrapper.Universal.sln │ └── WebRtc.Wrapper.Win32.sln └── third_party ├── winuwp_compat ├── BUILD.gn ├── gflags │ └── gen │ │ └── win │ │ └── include │ │ └── private │ │ └── config.h ├── winuwp_compat_internal.cc ├── winuwp_compat_internal.h ├── winuwp_compat_noop.cc ├── winuwp_compat_std.cc ├── winuwp_compat_std.h ├── winuwp_compat_win.cc ├── winuwp_compat_win.h ├── winuwp_compat_wrap_main_plain_c.cc ├── winuwp_compat_wrap_main_plain_c.h ├── winuwp_compat_wrap_main_plain_cc.cc ├── winuwp_compat_wrap_main_plain_cc.h ├── winuwp_compat_wrap_main_utf16_c.cc ├── winuwp_compat_wrap_main_utf16_c.h ├── winuwp_compat_wrap_main_utf16_cc.cc ├── winuwp_compat_wrap_main_utf16_cc.h ├── winuwp_compat_wrap_main_utf8_c.cc ├── winuwp_compat_wrap_main_utf8_c.h ├── winuwp_compat_wrap_main_utf8_cc.cc └── winuwp_compat_wrap_main_utf8_cc.h └── winuwp_h264 ├── BUILD.gn ├── H264Decoder ├── H264Decoder.cc └── H264Decoder.h ├── H264Encoder ├── H264Encoder.cc ├── H264Encoder.h ├── H264MediaSink.cc ├── H264MediaSink.h ├── H264StreamSink.cc ├── H264StreamSink.h └── IH264EncodingCallback.h ├── Utils ├── Async.h ├── CritSec.h ├── OpQueue.h ├── SampleAttributeQueue.h └── Utils.h ├── native_handle_buffer.h ├── winuwp_h264_factory.cc └── winuwp_h264_factory.h /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | *.VC.VC.opendb 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | # TODO: Comment the next line if you want to checkin your web deploy settings 144 | # but database connection strings (with potential passwords) will be unencrypted 145 | *.pubxml 146 | *.publishproj 147 | 148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 149 | # checkin your Azure Web App publish settings, but sensitive information contained 150 | # in these scripts will be unencrypted 151 | PublishScripts/ 152 | 153 | # NuGet Packages 154 | *.nupkg 155 | # The packages folder can be ignored because of Package Restore 156 | **/packages/* 157 | # except build/, which is used as an MSBuild target. 158 | !**/packages/build/ 159 | # Uncomment if necessary however generally it will be regenerated when needed 160 | #!**/packages/repositories.config 161 | # NuGet v3's project.json files produces more ignoreable files 162 | *.nuget.props 163 | *.nuget.targets 164 | 165 | Build/ 166 | nuget/package 167 | nuget/Output 168 | nuget/*.version 169 | NugetOutput/ 170 | 171 | # Microsoft Azure Build Output 172 | csx/ 173 | *.build.csdef 174 | 175 | # Microsoft Azure Emulator 176 | ecf/ 177 | rcf/ 178 | 179 | # Windows Store app package directories and files 180 | AppPackages/ 181 | BundleArtifacts/ 182 | Package.StoreAssociation.xml 183 | _pkginfo.txt 184 | 185 | # Visual Studio cache files 186 | # files ending in .cache can be ignored 187 | *.[Cc]ache 188 | # but keep track of directories ending in .cache 189 | !*.[Cc]ache/ 190 | 191 | # Others 192 | ClientBin/ 193 | ~$* 194 | *~ 195 | *.dbmdl 196 | *.dbproj.schemaview 197 | *.pfx 198 | *.publishsettings 199 | node_modules/ 200 | orleans.codegen.cs 201 | 202 | # Since there are multiple workflows, uncomment next line to ignore bower_components 203 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 204 | #bower_components/ 205 | 206 | # RIA/Silverlight projects 207 | Generated_Code/ 208 | 209 | # Backup & report files from converting an old project file 210 | # to a newer Visual Studio version. Backup files are not needed, 211 | # because we have git ;-) 212 | _UpgradeReport_Files/ 213 | Backup*/ 214 | UpgradeLog*.XML 215 | UpgradeLog*.htm 216 | 217 | # SQL Server files 218 | *.mdf 219 | *.ldf 220 | 221 | # Business Intelligence projects 222 | *.rdl.data 223 | *.bim.layout 224 | *.bim_*.settings 225 | 226 | # Microsoft Fakes 227 | FakesAssemblies/ 228 | 229 | # GhostDoc plugin setting file 230 | *.GhostDoc.xml 231 | 232 | # Node.js Tools for Visual Studio 233 | .ntvs_analysis.dat 234 | 235 | # Visual Studio 6 build log 236 | *.plg 237 | 238 | # Visual Studio 6 workspace options file 239 | *.opt 240 | 241 | # Visual Studio LightSwitch build output 242 | **/*.HTMLClient/GeneratedArtifacts 243 | **/*.DesktopClient/GeneratedArtifacts 244 | **/*.DesktopClient/ModelManifest.xml 245 | **/*.Server/GeneratedArtifacts 246 | **/*.Server/ModelManifest.xml 247 | _Pvt_Extensions 248 | 249 | # Paket dependency manager 250 | .paket/paket.exe 251 | paket-files/ 252 | 253 | # FAKE - F# Make 254 | .fake/ 255 | 256 | # JetBrains Rider 257 | .idea/ 258 | *.sln.iml 259 | *.bak 260 | 261 | # Eventing 262 | projects/msvc/WebRtc.Stats.Observer.Universal/etw_providers.h 263 | projects/msvc/WebRtc.Stats.Observer.Universal/etw_providers.rc 264 | projects/msvc/WebRtc.Stats.Observer.Universal/etw_providersTEMP.BIN 265 | projects/msvc/Org.WebRtc.Universal/Generated Files/ 266 | 267 | # Python 268 | *.pyc 269 | 270 | # Prepare scripts 271 | userdef.py 272 | nuget.exe -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 WebRTC for UWP 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # This project has been deprecated 2 | 3 | We are currently focusing our efforts on getting out of the fork business. This effort is happening in the [WinRTC GitHub repo](https://github.com/microsoft/winrtc). Keeping WebRTC-UWP fork doesn't allow us to move fast enough. We are contributing back the changes needed to build WebRTC.org code base for UWP. Here are some of the changes we're contributing back: 4 | 5 | - https://webrtc-review.googlesource.com/c/src/+/167021 6 | - https://boringssl-review.googlesource.com/c/boringssl/+/39584 7 | - https://chromium-review.googlesource.com/c/chromium/src/+/1962509 8 | - [abseil/abseil-cpp#594](https://github.com/abseil/abseil-cpp/pull/594) 9 | - [abseil/abseil-cpp#596](https://github.com/abseil/abseil-cpp/pull/596) 10 | 11 | Besides the new video capturing module that is being reviewed, we're also creating a new audio capturing module. There are more changes in the pipeline to be contributed back and more changes required for finishing the port. After having WebRTC.org code base compatible with UWP, we're going to work on a WinRT abstraction layer allowing easy consumption of WebRTC capabilities by WinRT projections. 12 | 13 | That said, keep in mind we are contributing back the changes and we have no control over when/if the changes will be accepted by their teams. 14 | # webrtc-wrapper-uwp 15 | WebRTC wrapper API for exposing API to UWP platform (C# / WinJS) 16 | -------------------------------------------------------------------------------- /nuget/templates/WebRtc.Nuget.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2020 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Org.WebRtc", "..\projects\msvc\Org.WebRtc.Universal\Org.WebRtc.vcxproj", "{3DD8FDCD-B703-4B75-826A-2C7E844F903E}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Org.WebRtc.WrapperGlue", "..\projects\msvc\Org.WebRtc.WrapperGlue.Universal\Org.WebRtc.WrapperGlue.vcxproj", "{76CC41B9-4027-4330-A139-0CFA7AA34768}" 9 | ProjectSection(ProjectDependencies) = postProject 10 | {08C8FB57-A433-44AD-AE99-4AF554F02BED} = {08C8FB57-A433-44AD-AE99-4AF554F02BED} 11 | EndProjectSection 12 | EndProject 13 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebRtc.UWP.Native.Builder", "..\projects\msvc\WebRtc.UWP.Native.Builder\WebRtc.UWP.Native.Builder.vcxproj", "{08C8FB57-A433-44AD-AE99-4AF554F02BED}" 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|ARM = Debug|ARM 18 | Debug|x64 = Debug|x64 19 | Debug|x86 = Debug|x86 20 | Release|ARM = Release|ARM 21 | Release|x64 = Release|x64 22 | Release|x86 = Release|x86 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|ARM.ActiveCfg = Debug|ARM 26 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|ARM.Build.0 = Debug|ARM 27 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|x64.ActiveCfg = Debug|x64 28 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|x64.Build.0 = Debug|x64 29 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|x86.ActiveCfg = Debug|Win32 30 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|x86.Build.0 = Debug|Win32 31 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|ARM.ActiveCfg = Release|ARM 32 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|ARM.Build.0 = Release|ARM 33 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|x64.ActiveCfg = Release|x64 34 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|x64.Build.0 = Release|x64 35 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|x86.ActiveCfg = Release|Win32 36 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|x86.Build.0 = Release|Win32 37 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|ARM.ActiveCfg = Debug|ARM 38 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|ARM.Build.0 = Debug|ARM 39 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|x64.ActiveCfg = Debug|x64 40 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|x64.Build.0 = Debug|x64 41 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|x86.ActiveCfg = Debug|Win32 42 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|x86.Build.0 = Debug|Win32 43 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|ARM.ActiveCfg = Release|ARM 44 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|ARM.Build.0 = Release|ARM 45 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|x64.ActiveCfg = Release|x64 46 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|x64.Build.0 = Release|x64 47 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|x86.ActiveCfg = Release|Win32 48 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|x86.Build.0 = Release|Win32 49 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Debug|ARM.ActiveCfg = Debug|ARM 50 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Debug|ARM.Build.0 = Debug|ARM 51 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Debug|x64.ActiveCfg = Debug|x64 52 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Debug|x64.Build.0 = Debug|x64 53 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Debug|x86.ActiveCfg = Debug|Win32 54 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Debug|x86.Build.0 = Debug|Win32 55 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Release|ARM.ActiveCfg = Release|ARM 56 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Release|ARM.Build.0 = Release|ARM 57 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Release|x64.ActiveCfg = Release|x64 58 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Release|x64.Build.0 = Release|x64 59 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Release|x86.ActiveCfg = Release|Win32 60 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Release|x86.Build.0 = Release|Win32 61 | EndGlobalSection 62 | GlobalSection(SolutionProperties) = preSolution 63 | HideSolutionNode = FALSE 64 | EndGlobalSection 65 | GlobalSection(ExtensibilityGlobals) = postSolution 66 | SolutionGuid = {AB6E9440-A4CC-4AB1-87E2-7E9EF75FABC6} 67 | EndGlobalSection 68 | EndGlobal 69 | -------------------------------------------------------------------------------- /nuget/templates/WebRtc.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WebRtc 5 | WebRtc Library 6 | LICENSE.txt 7 | Optical Tone 8 | false 9 | WebRtc Library is a secure, fast and highly performant developer toolkit enabling real-time voice calling, video chat and data functionality (file transfer etc.) for mobile, desktop and web 10 | Built as a productionn ready reference to the Object RTC specification (originally designed in the W3C WebRtc Community Group), WebRtc Lib is a secure, fast and highly performant developer toolkit enabling real-time voice calling, video chat and data functionality (file transfer etc.) for mobile, desktop and web. If you are integrating real-time voice, video or data into your mobile or web app and want WebRtc and WebRTC compatibility, WebRtc Lib is the solution for you. 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /nuget/templates/WebRtc.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | x86 5 | $(Platform) 6 | 7 | 8 | 9 | Org.WebRtc.dll 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/msvc/Org.WebRtc.Universal/Org_WebRtc.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE 3 | DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE 4 | -------------------------------------------------------------------------------- /projects/msvc/Org.WebRtc.Universal/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/msvc/Org.WebRtc.Universal/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /projects/msvc/Org.WebRtc.Universal/pch.h: -------------------------------------------------------------------------------- 1 | // 2 | // pch.h 3 | // Header for platform projection include files 4 | // 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | #include "winrt/Windows.Foundation.h" 11 | -------------------------------------------------------------------------------- /projects/msvc/Org.WebRtc.Universal/readme.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | C++/WinRT Org.WebRtc Project Overview 3 | ======================================================================== 4 | 5 | This project demonstrates how to get started authoring Windows Runtime 6 | classes directly with standard C++, using the C++/WinRT SDK component 7 | to generate implementation headers from interface (IDL) files. The 8 | generated Windows Runtime component binary and WinMD files should then 9 | be bundled with the Universal Windows Platform (UWP) app consuming them. 10 | 11 | Steps: 12 | 1. Create an interface (IDL) file to define your Windows Runtime class, 13 | its default interface, and any other interfaces it implements. 14 | 2. Build the project once to generate module.g.cpp, module.h.cpp, and 15 | implementation templates under the "Generated Files" folder, as 16 | well as skeleton class definitions under "Generated Files\sources". 17 | 3. Use the skeleton class definitions for reference to implement your 18 | Windows Runtime classes. 19 | 20 | ======================================================================== 21 | Learn more about C++/WinRT here: 22 | https://github.com/microsoft/cppwinrt/ 23 | ======================================================================== 24 | -------------------------------------------------------------------------------- /projects/msvc/Org.WebRtc.WrapperC.Win32/Org.WebRtc.WrapperC.cpp: -------------------------------------------------------------------------------- 1 | // Org.WebRtc.WrapperC.cpp : Defines the exported functions for the DLL application. 2 | // 3 | 4 | #include "stdafx.h" 5 | 6 | 7 | -------------------------------------------------------------------------------- /projects/msvc/Org.WebRtc.WrapperC.Win32/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /projects/msvc/Org.WebRtc.WrapperC.Win32/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /projects/msvc/Org.WebRtc.WrapperC.Win32/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files 12 | #include 13 | 14 | 15 | 16 | // reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /projects/msvc/Org.WebRtc.WrapperC.Win32/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /projects/msvc/Org.WebRtc.WrapperGlue.Universal/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /projects/msvc/Org.WebRtc.WrapperGlue.Win32/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /projects/msvc/Org.WebRtc.WrapperGlue.Win32/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | 12 | 13 | 14 | // reference additional headers your program requires here 15 | -------------------------------------------------------------------------------- /projects/msvc/Org.WebRtc.WrapperGlue.Win32/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /projects/msvc/PeerConnectionServer.Utility.Universal/PeerConnectionServer.Utility.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | ARM 7 | 8 | 9 | Debug 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | ARM 19 | 20 | 21 | Release 22 | Win32 23 | 24 | 25 | Release 26 | x64 27 | 28 | 29 | 30 | {569b4976-fd18-45cc-9a6a-cdbe71fbf4ee} 31 | StaticLibrary 32 | PeerConnectionServer_Utility 33 | en-US 34 | 14.0 35 | true 36 | Windows Store 37 | 10.0.17134.0 38 | 10.0.15063.0 39 | 10.0 40 | 41 | 42 | 43 | StaticLibrary 44 | true 45 | v141 46 | 47 | 48 | StaticLibrary 49 | true 50 | v141 51 | 52 | 53 | StaticLibrary 54 | true 55 | v141 56 | 57 | 58 | StaticLibrary 59 | false 60 | true 61 | v141 62 | 63 | 64 | StaticLibrary 65 | false 66 | true 67 | v141 68 | 69 | 70 | StaticLibrary 71 | false 72 | true 73 | v141 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | false 102 | 103 | 104 | false 105 | 106 | 107 | false 108 | 109 | 110 | false 111 | 112 | 113 | false 114 | 115 | 116 | false 117 | 118 | 119 | 120 | NotUsing 121 | false 122 | true 123 | 124 | 125 | Console 126 | false 127 | false 128 | 129 | 130 | pushd "$(ProjectDir)..\..\..\..\..\" && call bin\prepare.bat -logLevel 4 -platform win32 -cpu $(PlatformTarget) -config $(Configuration) -target webrtc && call bin\buildWebRTC.bat $(Configuration) win32 $(PlatformTarget) peerconnection_server && popd 131 | Building native PeerCC Server 132 | 133 | 134 | 135 | 136 | NotUsing 137 | false 138 | true 139 | 140 | 141 | Console 142 | false 143 | false 144 | 145 | 146 | pushd "$(ProjectDir)..\..\..\..\..\" && call bin\prepare.bat -logLevel 4 -platform win32 -cpu $(PlatformTarget) -config $(Configuration) -target webrtc && call bin\buildWebRTC.bat $(Configuration) win32 $(PlatformTarget) peerconnection_server && popd 147 | Building native PeerCC Server 148 | 149 | 150 | 151 | 152 | NotUsing 153 | false 154 | true 155 | 156 | 157 | Console 158 | false 159 | false 160 | 161 | 162 | pushd "$(ProjectDir)..\..\..\..\..\" && call bin\prepare.bat -logLevel 4 -platform win32 -cpu $(PlatformTarget) -config $(Configuration) -target webrtc && call bin\buildWebRTC.bat $(Configuration) win32 $(PlatformTarget) peerconnection_server && popd 163 | Building native PeerCC Server 164 | 165 | 166 | 167 | 168 | NotUsing 169 | false 170 | true 171 | 172 | 173 | Console 174 | false 175 | false 176 | 177 | 178 | pushd "$(ProjectDir)..\..\..\..\..\" && call bin\prepare.bat -logLevel 4 -platform win32 -cpu $(PlatformTarget) -config $(Configuration) -target webrtc && call bin\buildWebRTC.bat $(Configuration) win32 $(PlatformTarget) peerconnection_server && popd 179 | Building native PeerCC Server 180 | 181 | 182 | 183 | 184 | NotUsing 185 | false 186 | true 187 | 188 | 189 | Console 190 | false 191 | false 192 | 193 | 194 | pushd "$(ProjectDir)..\..\..\..\..\" && call bin\prepare.bat -logLevel 4 -platform win32 -cpu $(PlatformTarget) -config $(Configuration) -target webrtc && call bin\buildWebRTC.bat $(Configuration) win32 $(PlatformTarget) peerconnection_server && popd 195 | Building native PeerCC Server 196 | 197 | 198 | 199 | 200 | NotUsing 201 | false 202 | true 203 | 204 | 205 | Console 206 | false 207 | false 208 | 209 | 210 | pushd "$(ProjectDir)..\..\..\..\..\" && call bin\prepare.bat -logLevel 4 -platform win32 -cpu $(PlatformTarget) -config $(Configuration) -target webrtc && call bin\buildWebRTC.bat $(Configuration) win32 $(PlatformTarget) peerconnection_server && popd 211 | Building native PeerCC Server 212 | 213 | 214 | 215 | 216 | 217 | -------------------------------------------------------------------------------- /projects/msvc/PeerConnectionServer.Utility/PeerConnectionServer.Utility.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | ARM64 7 | 8 | 9 | Debug 10 | Win32 11 | 12 | 13 | Release 14 | ARM64 15 | 16 | 17 | Release 18 | Win32 19 | 20 | 21 | Debug 22 | x64 23 | 24 | 25 | Release 26 | x64 27 | 28 | 29 | 30 | 15.0 31 | {0919F2A5-9CB1-48B0-B080-EAC6AF4EB024} 32 | PeerConnectionServerUtility 33 | 10.0.17763.0 34 | 35 | 36 | 37 | Application 38 | true 39 | v141 40 | MultiByte 41 | 42 | 43 | Application 44 | true 45 | v141 46 | MultiByte 47 | 48 | 49 | Application 50 | false 51 | v141 52 | true 53 | MultiByte 54 | 55 | 56 | Application 57 | false 58 | v141 59 | true 60 | MultiByte 61 | 62 | 63 | Application 64 | true 65 | v141 66 | MultiByte 67 | 68 | 69 | Application 70 | false 71 | v141 72 | true 73 | MultiByte 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | Level3 103 | Disabled 104 | true 105 | true 106 | 107 | 108 | call python "$(ProjectDir)..\..\..\..\..\scripts\run.py" -a prepare build -u peercc_server -p win --cpus $(PlatformTarget) -c $(Configuration) --noColor 109 | 110 | 111 | 112 | 113 | Level3 114 | Disabled 115 | true 116 | true 117 | 118 | 119 | call python "$(ProjectDir)..\..\..\..\..\scripts\run.py" -a prepare build -u peercc_server -p win --cpus $(PlatformTarget) -c $(Configuration) --noColor 120 | 121 | 122 | 123 | 124 | Level3 125 | Disabled 126 | true 127 | true 128 | 129 | 130 | call python "$(ProjectDir)..\..\..\..\..\scripts\run.py" -a prepare build -u peercc_server -p win --cpus $(PlatformTarget) -c $(Configuration) --noColor 131 | 132 | 133 | 134 | 135 | Level3 136 | MaxSpeed 137 | true 138 | true 139 | true 140 | true 141 | 142 | 143 | true 144 | true 145 | 146 | 147 | call python "$(ProjectDir)..\..\..\..\..\scripts\run.py" -a prepare build -u peercc_server -p win --cpus $(PlatformTarget) -c $(Configuration) --noColor 148 | 149 | 150 | 151 | 152 | Level3 153 | MaxSpeed 154 | true 155 | true 156 | true 157 | true 158 | 159 | 160 | true 161 | true 162 | 163 | 164 | call python "$(ProjectDir)..\..\..\..\..\scripts\run.py" -a prepare build -u peercc_server -p win --cpus $(PlatformTarget) -c $(Configuration) --noColor 165 | 166 | 167 | 168 | 169 | Level3 170 | MaxSpeed 171 | true 172 | true 173 | true 174 | true 175 | 176 | 177 | true 178 | true 179 | 180 | 181 | call python "$(ProjectDir)..\..\..\..\..\scripts\run.py" -a prepare build -u peercc_server -p win --cpus $(PlatformTarget) -c $(Configuration) --noColor 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /projects/msvc/PeerConnectionServer.Utility/PeerConnectionServer.Utility.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | -------------------------------------------------------------------------------- /projects/msvc/WebRtc.UWP.Native.Builder/DummyClass.cpp: -------------------------------------------------------------------------------- 1 | #include "DummyClass.h" 2 | 3 | 4 | 5 | DummyClass::DummyClass() 6 | { 7 | } 8 | 9 | 10 | DummyClass::~DummyClass() 11 | { 12 | } 13 | -------------------------------------------------------------------------------- /projects/msvc/WebRtc.UWP.Native.Builder/DummyClass.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class DummyClass 3 | { 4 | public: 5 | DummyClass(); 6 | ~DummyClass(); 7 | }; 8 | 9 | -------------------------------------------------------------------------------- /projects/msvc/WebRtc.Win32.Native.Builder/WebRtc.Win32.Native.Builder.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 15.0 23 | {A87281D7-B483-4526-8943-5C40D8E00AA7} 24 | Win32Proj 25 | WebRtcWin32NativeBuilder 26 | 10.0.17763.0 27 | 28 | 29 | 30 | StaticLibrary 31 | true 32 | v141 33 | Unicode 34 | 35 | 36 | StaticLibrary 37 | false 38 | v141 39 | true 40 | Unicode 41 | 42 | 43 | StaticLibrary 44 | true 45 | v141 46 | Unicode 47 | 48 | 49 | StaticLibrary 50 | false 51 | v141 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | $(SolutionDir)Build\Intermediate\$(MSBuildProjectName)\$(Configuration)\$(PlatformTarget)\ 74 | $(SolutionDir)Build\Output\$(MSBuildProjectName)\$(Configuration)\$(PlatformTarget)\ 75 | 76 | 77 | $(SolutionDir)Build\Intermediate\$(MSBuildProjectName)\$(Configuration)\$(PlatformTarget)\ 78 | $(SolutionDir)Build\Output\$(MSBuildProjectName)\$(Configuration)\$(PlatformTarget)\ 79 | 80 | 81 | $(SolutionDir)Build\Intermediate\$(MSBuildProjectName)\$(Configuration)\$(PlatformTarget)\ 82 | $(SolutionDir)Build\Output\$(MSBuildProjectName)\$(Configuration)\$(PlatformTarget)\ 83 | 84 | 85 | $(SolutionDir)Build\Intermediate\$(MSBuildProjectName)\$(Configuration)\$(PlatformTarget)\ 86 | $(SolutionDir)Build\Output\$(MSBuildProjectName)\$(Configuration)\$(PlatformTarget)\ 87 | 88 | 89 | 90 | true 91 | 92 | 93 | true 94 | 95 | 96 | false 97 | 98 | 99 | false 100 | 101 | 102 | 103 | Use 104 | Level3 105 | Disabled 106 | true 107 | _DEBUG;_LIB;%(PreprocessorDefinitions) 108 | true 109 | 110 | 111 | Windows 112 | true 113 | 114 | 115 | call python "$(ProjectDir)..\..\..\..\..\scripts\run.py" -a prepare build -t webrtc -p win --cpus $(PlatformTarget) -c $(Configuration) --noColor --noWrapper 116 | 117 | 118 | 119 | 120 | Use 121 | Level3 122 | Disabled 123 | true 124 | WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) 125 | true 126 | 127 | 128 | Windows 129 | true 130 | 131 | 132 | call python "$(ProjectDir)..\..\..\..\..\scripts\run.py" -a prepare build -t webrtc -p win --cpus $(PlatformTarget) -c $(Configuration) --noColor --noWrapper 133 | 134 | 135 | 136 | 137 | Use 138 | Level3 139 | MaxSpeed 140 | true 141 | true 142 | true 143 | WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) 144 | true 145 | 146 | 147 | Windows 148 | true 149 | true 150 | true 151 | 152 | 153 | call python "$(ProjectDir)..\..\..\..\..\scripts\run.py" -a prepare build -t webrtc -p win --cpus $(PlatformTarget) -c $(Configuration) --noColor --noWrapper 154 | 155 | 156 | 157 | 158 | Use 159 | Level3 160 | MaxSpeed 161 | true 162 | true 163 | true 164 | NDEBUG;_LIB;%(PreprocessorDefinitions) 165 | true 166 | 167 | 168 | Windows 169 | true 170 | true 171 | true 172 | 173 | 174 | call python "$(ProjectDir)..\..\..\..\..\scripts\run.py" -a prepare build -t webrtc -p win --cpus $(PlatformTarget) -c $(Configuration) --noColor --noWrapper 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | Create 184 | Create 185 | Create 186 | Create 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | -------------------------------------------------------------------------------- /projects/msvc/WebRtc.Win32.Native.Builder/WebRtc.Win32.Native.Builder.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | 26 | 27 | Source Files 28 | 29 | 30 | -------------------------------------------------------------------------------- /projects/msvc/WebRtc.Win32.Native.Builder/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /projects/msvc/WebRtc.Win32.Native.Builder/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | 12 | 13 | 14 | // reference additional headers your program requires here 15 | -------------------------------------------------------------------------------- /projects/msvc/WebRtc.Win32.Native.Builder/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /solutions/WebRtc.Universal.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{61AB7485-B7E2-4D1F-8A38-BCB027FC1C10}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PeerCC", "PeerCC", "{82F36D17-1986-4A2A-B71F-94B852778141}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PeerConnectionClient.WebRtc", "..\..\..\common\windows\samples\PeerCC\Client\PeerConnectionClient.WebRtc.csproj", "{A2EA7350-EE59-42C5-9323-C942B058B217}" 11 | EndProject 12 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{B75554FF-2598-4F34-B11F-027282FB26CD}" 13 | EndProject 14 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{F01290E5-AA5F-4AB6-938F-674BEDC720F4}" 15 | EndProject 16 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Api", "Api", "{A247AD4E-D83A-40C1-8BB6-6B72F3A1EE5C}" 17 | EndProject 18 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Org.WebRtc", "Org.WebRtc", "{507EFBC7-5B0B-4ACB-A67A-7F24A2340A86}" 19 | EndProject 20 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utility", "Utility", "{F3CEBBE9-B35F-40D1-B62E-5FA923D9456C}" 21 | EndProject 22 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebRtc.UWP.Native.Builder", "..\projects\msvc\WebRtc.UWP.Native.Builder\WebRtc.UWP.Native.Builder.vcxproj", "{08C8FB57-A433-44AD-AE99-4AF554F02BED}" 23 | EndProject 24 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Org.WebRtc.WrapperGlue", "..\projects\msvc\Org.WebRtc.WrapperGlue.Universal\Org.WebRtc.WrapperGlue.vcxproj", "{76CC41B9-4027-4330-A139-0CFA7AA34768}" 25 | ProjectSection(ProjectDependencies) = postProject 26 | {08C8FB57-A433-44AD-AE99-4AF554F02BED} = {08C8FB57-A433-44AD-AE99-4AF554F02BED} 27 | EndProjectSection 28 | EndProject 29 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Org.WebRtc", "..\projects\msvc\Org.WebRtc.Universal\Org.WebRtc.vcxproj", "{3DD8FDCD-B703-4B75-826A-2C7E844F903E}" 30 | ProjectSection(ProjectDependencies) = postProject 31 | {76CC41B9-4027-4330-A139-0CFA7AA34768} = {76CC41B9-4027-4330-A139-0CFA7AA34768} 32 | EndProjectSection 33 | EndProject 34 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PeerConnectionServer.Utility", "..\projects\msvc\PeerConnectionServer.Utility\PeerConnectionServer.Utility.vcxproj", "{0919F2A5-9CB1-48B0-B080-EAC6AF4EB024}" 35 | EndProject 36 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PeerConnectionClientCore", "..\..\..\common\windows\samples\PeerCC\ClientCore\PeerConnectionClientCore.csproj", "{217FAA3A-8FC1-4663-BA00-2F842B3FF4E1}" 37 | EndProject 38 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Org.WebRtc.Callstats", "..\..\..\common\windows\samples\PeerCC\Org.WebRtc.Callstats\Org.WebRtc.Callstats.csproj", "{FC4BC853-ED03-404C-AE51-D52D8BCDF134}" 39 | EndProject 40 | Global 41 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 42 | Debug|ARM = Debug|ARM 43 | Debug|x64 = Debug|x64 44 | Debug|x86 = Debug|x86 45 | Release|ARM = Release|ARM 46 | Release|x64 = Release|x64 47 | Release|x86 = Release|x86 48 | EndGlobalSection 49 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 50 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Debug|ARM.ActiveCfg = Debug|ARM 51 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Debug|ARM.Build.0 = Debug|ARM 52 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Debug|ARM.Deploy.0 = Debug|ARM 53 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Debug|x64.ActiveCfg = Debug|x64 54 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Debug|x64.Build.0 = Debug|x64 55 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Debug|x64.Deploy.0 = Debug|x64 56 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Debug|x86.ActiveCfg = Debug|x86 57 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Debug|x86.Build.0 = Debug|x86 58 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Debug|x86.Deploy.0 = Debug|x86 59 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Release|ARM.ActiveCfg = Release|ARM 60 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Release|ARM.Build.0 = Release|ARM 61 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Release|ARM.Deploy.0 = Release|ARM 62 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Release|x64.ActiveCfg = Release|x64 63 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Release|x64.Build.0 = Release|x64 64 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Release|x64.Deploy.0 = Release|x64 65 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Release|x86.ActiveCfg = Release|x86 66 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Release|x86.Build.0 = Release|x86 67 | {A2EA7350-EE59-42C5-9323-C942B058B217}.Release|x86.Deploy.0 = Release|x86 68 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Debug|ARM.ActiveCfg = Debug|ARM 69 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Debug|ARM.Build.0 = Debug|ARM 70 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Debug|x64.ActiveCfg = Debug|x64 71 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Debug|x64.Build.0 = Debug|x64 72 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Debug|x86.ActiveCfg = Debug|Win32 73 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Debug|x86.Build.0 = Debug|Win32 74 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Release|ARM.ActiveCfg = Release|ARM 75 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Release|ARM.Build.0 = Release|ARM 76 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Release|x64.ActiveCfg = Release|x64 77 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Release|x64.Build.0 = Release|x64 78 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Release|x86.ActiveCfg = Release|Win32 79 | {08C8FB57-A433-44AD-AE99-4AF554F02BED}.Release|x86.Build.0 = Release|Win32 80 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|ARM.ActiveCfg = Debug|ARM 81 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|ARM.Build.0 = Debug|ARM 82 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|x64.ActiveCfg = Debug|x64 83 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|x64.Build.0 = Debug|x64 84 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|x86.ActiveCfg = Debug|Win32 85 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|x86.Build.0 = Debug|Win32 86 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|ARM.ActiveCfg = Release|ARM 87 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|ARM.Build.0 = Release|ARM 88 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|x64.ActiveCfg = Release|x64 89 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|x64.Build.0 = Release|x64 90 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|x86.ActiveCfg = Release|Win32 91 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|x86.Build.0 = Release|Win32 92 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|ARM.ActiveCfg = Debug|ARM 93 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|ARM.Build.0 = Debug|ARM 94 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|x64.ActiveCfg = Debug|x64 95 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|x64.Build.0 = Debug|x64 96 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|x86.ActiveCfg = Debug|Win32 97 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|x86.Build.0 = Debug|Win32 98 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|ARM.ActiveCfg = Release|ARM 99 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|ARM.Build.0 = Release|ARM 100 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|x64.ActiveCfg = Release|x64 101 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|x64.Build.0 = Release|x64 102 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|x86.ActiveCfg = Release|Win32 103 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|x86.Build.0 = Release|Win32 104 | {0919F2A5-9CB1-48B0-B080-EAC6AF4EB024}.Debug|ARM.ActiveCfg = Debug|Win32 105 | {0919F2A5-9CB1-48B0-B080-EAC6AF4EB024}.Debug|x64.ActiveCfg = Debug|x64 106 | {0919F2A5-9CB1-48B0-B080-EAC6AF4EB024}.Debug|x64.Build.0 = Debug|x64 107 | {0919F2A5-9CB1-48B0-B080-EAC6AF4EB024}.Debug|x86.ActiveCfg = Debug|Win32 108 | {0919F2A5-9CB1-48B0-B080-EAC6AF4EB024}.Debug|x86.Build.0 = Debug|Win32 109 | {0919F2A5-9CB1-48B0-B080-EAC6AF4EB024}.Release|ARM.ActiveCfg = Release|Win32 110 | {0919F2A5-9CB1-48B0-B080-EAC6AF4EB024}.Release|x64.ActiveCfg = Release|x64 111 | {0919F2A5-9CB1-48B0-B080-EAC6AF4EB024}.Release|x64.Build.0 = Release|x64 112 | {0919F2A5-9CB1-48B0-B080-EAC6AF4EB024}.Release|x86.ActiveCfg = Release|Win32 113 | {0919F2A5-9CB1-48B0-B080-EAC6AF4EB024}.Release|x86.Build.0 = Release|Win32 114 | {217FAA3A-8FC1-4663-BA00-2F842B3FF4E1}.Debug|ARM.ActiveCfg = Debug|ARM 115 | {217FAA3A-8FC1-4663-BA00-2F842B3FF4E1}.Debug|ARM.Build.0 = Debug|ARM 116 | {217FAA3A-8FC1-4663-BA00-2F842B3FF4E1}.Debug|x64.ActiveCfg = Debug|x64 117 | {217FAA3A-8FC1-4663-BA00-2F842B3FF4E1}.Debug|x64.Build.0 = Debug|x64 118 | {217FAA3A-8FC1-4663-BA00-2F842B3FF4E1}.Debug|x86.ActiveCfg = Debug|x86 119 | {217FAA3A-8FC1-4663-BA00-2F842B3FF4E1}.Debug|x86.Build.0 = Debug|x86 120 | {217FAA3A-8FC1-4663-BA00-2F842B3FF4E1}.Release|ARM.ActiveCfg = Release|ARM 121 | {217FAA3A-8FC1-4663-BA00-2F842B3FF4E1}.Release|ARM.Build.0 = Release|ARM 122 | {217FAA3A-8FC1-4663-BA00-2F842B3FF4E1}.Release|x64.ActiveCfg = Release|x64 123 | {217FAA3A-8FC1-4663-BA00-2F842B3FF4E1}.Release|x64.Build.0 = Release|x64 124 | {217FAA3A-8FC1-4663-BA00-2F842B3FF4E1}.Release|x86.ActiveCfg = Release|x86 125 | {217FAA3A-8FC1-4663-BA00-2F842B3FF4E1}.Release|x86.Build.0 = Release|x86 126 | {FC4BC853-ED03-404C-AE51-D52D8BCDF134}.Debug|ARM.ActiveCfg = Debug|Any CPU 127 | {FC4BC853-ED03-404C-AE51-D52D8BCDF134}.Debug|ARM.Build.0 = Debug|Any CPU 128 | {FC4BC853-ED03-404C-AE51-D52D8BCDF134}.Debug|x64.ActiveCfg = Debug|Any CPU 129 | {FC4BC853-ED03-404C-AE51-D52D8BCDF134}.Debug|x64.Build.0 = Debug|Any CPU 130 | {FC4BC853-ED03-404C-AE51-D52D8BCDF134}.Debug|x86.ActiveCfg = Debug|Any CPU 131 | {FC4BC853-ED03-404C-AE51-D52D8BCDF134}.Debug|x86.Build.0 = Debug|Any CPU 132 | {FC4BC853-ED03-404C-AE51-D52D8BCDF134}.Release|ARM.ActiveCfg = Release|Any CPU 133 | {FC4BC853-ED03-404C-AE51-D52D8BCDF134}.Release|ARM.Build.0 = Release|Any CPU 134 | {FC4BC853-ED03-404C-AE51-D52D8BCDF134}.Release|x64.ActiveCfg = Release|Any CPU 135 | {FC4BC853-ED03-404C-AE51-D52D8BCDF134}.Release|x64.Build.0 = Release|Any CPU 136 | {FC4BC853-ED03-404C-AE51-D52D8BCDF134}.Release|x86.ActiveCfg = Release|Any CPU 137 | {FC4BC853-ED03-404C-AE51-D52D8BCDF134}.Release|x86.Build.0 = Release|Any CPU 138 | EndGlobalSection 139 | GlobalSection(SolutionProperties) = preSolution 140 | HideSolutionNode = FALSE 141 | EndGlobalSection 142 | GlobalSection(NestedProjects) = preSolution 143 | {82F36D17-1986-4A2A-B71F-94B852778141} = {61AB7485-B7E2-4D1F-8A38-BCB027FC1C10} 144 | {A2EA7350-EE59-42C5-9323-C942B058B217} = {B75554FF-2598-4F34-B11F-027282FB26CD} 145 | {B75554FF-2598-4F34-B11F-027282FB26CD} = {82F36D17-1986-4A2A-B71F-94B852778141} 146 | {F01290E5-AA5F-4AB6-938F-674BEDC720F4} = {82F36D17-1986-4A2A-B71F-94B852778141} 147 | {507EFBC7-5B0B-4ACB-A67A-7F24A2340A86} = {A247AD4E-D83A-40C1-8BB6-6B72F3A1EE5C} 148 | {08C8FB57-A433-44AD-AE99-4AF554F02BED} = {F3CEBBE9-B35F-40D1-B62E-5FA923D9456C} 149 | {76CC41B9-4027-4330-A139-0CFA7AA34768} = {507EFBC7-5B0B-4ACB-A67A-7F24A2340A86} 150 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E} = {507EFBC7-5B0B-4ACB-A67A-7F24A2340A86} 151 | {0919F2A5-9CB1-48B0-B080-EAC6AF4EB024} = {F01290E5-AA5F-4AB6-938F-674BEDC720F4} 152 | {217FAA3A-8FC1-4663-BA00-2F842B3FF4E1} = {B75554FF-2598-4F34-B11F-027282FB26CD} 153 | {FC4BC853-ED03-404C-AE51-D52D8BCDF134} = {B75554FF-2598-4F34-B11F-027282FB26CD} 154 | EndGlobalSection 155 | GlobalSection(ExtensibilityGlobals) = postSolution 156 | SolutionGuid = {36335805-B335-4845-8EEB-77E32101A75D} 157 | EndGlobalSection 158 | EndGlobal 159 | -------------------------------------------------------------------------------- /solutions/WebRtc.Win32.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.421 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Org.WebRtc.WrapperGlue", "..\projects\msvc\Org.WebRtc.WrapperGlue.Win32\Org.WebRtc.WrapperGlue.vcxproj", "{8AC9B3E6-0A18-492C-BABE-D142A6204E59}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {A87281D7-B483-4526-8943-5C40D8E00AA7} = {A87281D7-B483-4526-8943-5C40D8E00AA7} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Org.WebRtc.WrapperC", "..\projects\msvc\Org.WebRtc.WrapperC.Win32\Org.WebRtc.WrapperC.vcxproj", "{1C8AC697-1C78-497A-9893-EE037B236C79}" 12 | ProjectSection(ProjectDependencies) = postProject 13 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59} = {8AC9B3E6-0A18-492C-BABE-D142A6204E59} 14 | EndProjectSection 15 | EndProject 16 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Org.WebRtc", "..\projects\msvc\Org.WebRtc.NetStandard\Org.WebRtc.csproj", "{0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}" 17 | ProjectSection(ProjectDependencies) = postProject 18 | {1C8AC697-1C78-497A-9893-EE037B236C79} = {1C8AC697-1C78-497A-9893-EE037B236C79} 19 | EndProjectSection 20 | EndProject 21 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utility", "Utility", "{1A07999C-3A4A-462F-B9E5-ECD8F5F3D0FB}" 22 | EndProject 23 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebRtc.Win32.Native.Builder", "..\projects\msvc\WebRtc.Win32.Native.Builder\WebRtc.Win32.Native.Builder.vcxproj", "{A87281D7-B483-4526-8943-5C40D8E00AA7}" 24 | EndProject 25 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Api", "Api", "{7D7CC034-D8B9-42D4-84BB-24B831D7F0E0}" 26 | EndProject 27 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Org.WebRtc", "Org.WebRtc", "{9953E383-C117-427F-B415-9B13B62F5276}" 28 | EndProject 29 | Global 30 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 31 | Debug|Any CPU = Debug|Any CPU 32 | Debug|x64 = Debug|x64 33 | Debug|x86 = Debug|x86 34 | Release|Any CPU = Release|Any CPU 35 | Release|x64 = Release|x64 36 | Release|x86 = Release|x86 37 | EndGlobalSection 38 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 39 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Debug|Any CPU.ActiveCfg = Debug|Win32 40 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Debug|x64.ActiveCfg = Debug|x64 41 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Debug|x64.Build.0 = Debug|x64 42 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Debug|x86.ActiveCfg = Debug|Win32 43 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Debug|x86.Build.0 = Debug|Win32 44 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Release|Any CPU.ActiveCfg = Release|Win32 45 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Release|x64.ActiveCfg = Release|x64 46 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Release|x64.Build.0 = Release|x64 47 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Release|x86.ActiveCfg = Release|Win32 48 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Release|x86.Build.0 = Release|Win32 49 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Debug|Any CPU.ActiveCfg = Debug|Win32 50 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Debug|x64.ActiveCfg = Debug|x64 51 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Debug|x64.Build.0 = Debug|x64 52 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Debug|x86.ActiveCfg = Debug|Win32 53 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Debug|x86.Build.0 = Debug|Win32 54 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Release|Any CPU.ActiveCfg = Release|Win32 55 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Release|x64.ActiveCfg = Release|x64 56 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Release|x64.Build.0 = Release|x64 57 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Release|x86.ActiveCfg = Release|Win32 58 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Release|x86.Build.0 = Release|Win32 59 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 60 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Debug|Any CPU.Build.0 = Debug|Any CPU 61 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Debug|x64.ActiveCfg = Debug|Any CPU 62 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Debug|x64.Build.0 = Debug|Any CPU 63 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Debug|x86.ActiveCfg = Debug|Any CPU 64 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Debug|x86.Build.0 = Debug|Any CPU 65 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Release|Any CPU.ActiveCfg = Release|Any CPU 66 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Release|Any CPU.Build.0 = Release|Any CPU 67 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Release|x64.ActiveCfg = Release|Any CPU 68 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Release|x64.Build.0 = Release|Any CPU 69 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Release|x86.ActiveCfg = Release|Any CPU 70 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Release|x86.Build.0 = Release|Any CPU 71 | {A87281D7-B483-4526-8943-5C40D8E00AA7}.Debug|Any CPU.ActiveCfg = Debug|Win32 72 | {A87281D7-B483-4526-8943-5C40D8E00AA7}.Debug|x64.ActiveCfg = Debug|x64 73 | {A87281D7-B483-4526-8943-5C40D8E00AA7}.Debug|x64.Build.0 = Debug|x64 74 | {A87281D7-B483-4526-8943-5C40D8E00AA7}.Debug|x86.ActiveCfg = Debug|Win32 75 | {A87281D7-B483-4526-8943-5C40D8E00AA7}.Debug|x86.Build.0 = Debug|Win32 76 | {A87281D7-B483-4526-8943-5C40D8E00AA7}.Release|Any CPU.ActiveCfg = Release|Win32 77 | {A87281D7-B483-4526-8943-5C40D8E00AA7}.Release|x64.ActiveCfg = Release|x64 78 | {A87281D7-B483-4526-8943-5C40D8E00AA7}.Release|x64.Build.0 = Release|x64 79 | {A87281D7-B483-4526-8943-5C40D8E00AA7}.Release|x86.ActiveCfg = Release|Win32 80 | {A87281D7-B483-4526-8943-5C40D8E00AA7}.Release|x86.Build.0 = Release|Win32 81 | EndGlobalSection 82 | GlobalSection(SolutionProperties) = preSolution 83 | HideSolutionNode = FALSE 84 | EndGlobalSection 85 | GlobalSection(NestedProjects) = preSolution 86 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59} = {9953E383-C117-427F-B415-9B13B62F5276} 87 | {1C8AC697-1C78-497A-9893-EE037B236C79} = {9953E383-C117-427F-B415-9B13B62F5276} 88 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC} = {9953E383-C117-427F-B415-9B13B62F5276} 89 | {A87281D7-B483-4526-8943-5C40D8E00AA7} = {1A07999C-3A4A-462F-B9E5-ECD8F5F3D0FB} 90 | {9953E383-C117-427F-B415-9B13B62F5276} = {7D7CC034-D8B9-42D4-84BB-24B831D7F0E0} 91 | EndGlobalSection 92 | GlobalSection(ExtensibilityGlobals) = postSolution 93 | SolutionGuid = {9D1FC43F-9CB2-46B3-BF66-48B0975F111B} 94 | EndGlobalSection 95 | EndGlobal 96 | -------------------------------------------------------------------------------- /templates/gns/args.gn: -------------------------------------------------------------------------------- 1 | # Build arguments go here. 2 | # See "gn args --list" for available build arguments. 3 | 4 | target_os="-target_os-" 5 | target_cpu="-target_cpu-" 6 | is_debug=-is_debug- 7 | use_rtti=true 8 | is_clang=-is_clang- 9 | rtc_include_tests=-is_include_tests- 10 | -------------------------------------------------------------------------------- /templates/samples/ChatterBox/ChatterBox.Background/ChatterBox.Background.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {E982C08B-4F8F-47C4-AB8C-8B7F36CCB682} 8 | winmdobj 9 | Properties 10 | ChatterBox.Background 11 | ChatterBox.Background 12 | en-US 13 | UAP 14 | 10.0.10586.0 15 | 10.0.10240.0 16 | 14 17 | 512 18 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 19 | false 20 | 21 | 22 | x86 23 | true 24 | ..\Output\$(MSBuildProjectName)\bin\$(Platform)\$(Configuration)\ 25 | ..\Output\$(MSBuildProjectName)\obj\$(Platform)\$(Configuration)\ 26 | TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;_APP_PERFORMANCE_ 27 | ;2008 28 | full 29 | x86 30 | false 31 | prompt 32 | 33 | 34 | x86 35 | ..\Output\$(MSBuildProjectName)\bin\$(Platform)\$(Configuration)\ 36 | ..\Output\$(MSBuildProjectName)\obj\$(Platform)\$(Configuration)\ 37 | TRACE;NETFX_CORE;WINDOWS_UWP;_APP_PERFORMANCE_ 38 | true 39 | ;2008 40 | pdbonly 41 | x86 42 | false 43 | prompt 44 | 45 | 46 | ARM 47 | true 48 | ..\Output\$(MSBuildProjectName)\bin\$(Platform)\$(Configuration)\ 49 | ..\Output\$(MSBuildProjectName)\obj\$(Platform)\$(Configuration)\ 50 | TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;USE_WIN10_PHONE_DLL;_APP_PERFORMANCE_ 51 | ;2008 52 | full 53 | ARM 54 | false 55 | prompt 56 | 57 | 58 | ARM 59 | ..\Output\$(MSBuildProjectName)\bin\$(Platform)\$(Configuration)\ 60 | ..\Output\$(MSBuildProjectName)\obj\$(Platform)\$(Configuration)\ 61 | TRACE;NETFX_CORE;WINDOWS_UWP;USE_WIN10_PHONE_DLL;_APP_PERFORMANCE_ 62 | true 63 | ;2008 64 | pdbonly 65 | ARM 66 | false 67 | prompt 68 | 69 | 70 | x64 71 | true 72 | ..\Output\$(MSBuildProjectName)\bin\$(Platform)\$(Configuration)\ 73 | ..\Output\$(MSBuildProjectName)\obj\$(Platform)\$(Configuration)\ 74 | TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;_APP_PERFORMANCE_ 75 | ;2008 76 | full 77 | x64 78 | false 79 | prompt 80 | 81 | 82 | x64 83 | ..\Output\$(MSBuildProjectName)\bin\$(Platform)\$(Configuration)\ 84 | ..\Output\$(MSBuildProjectName)\obj\$(Platform)\$(Configuration)\ 85 | TRACE;NETFX_CORE;WINDOWS_UWP 86 | true 87 | ;2008 88 | pdbonly 89 | x64 90 | false 91 | prompt 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | {724446B9-496E-4B7A-B944-0F79ECDE77F0} 213 | ChatterBox.Communication 214 | 215 | 216 | {974fcab6-06ed-40d5-954b-11157513f077} 217 | ChatterBoxClient.Universal.BackgroundRenderer 218 | 219 | 220 | 221 | 14.0 222 | 223 | 224 | 231 | -------------------------------------------------------------------------------- /templates/samples/ChatterBox/ChatterBox.Background/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "CommonServiceLocator": "1.3.0", 4 | "Microsoft.ApplicationInsights": "1.2.3", 5 | "Microsoft.ApplicationInsights.PersistenceChannel": "1.2.3", 6 | "Microsoft.ApplicationInsights.WindowsApps": "1.1.1", 7 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0", 8 | "Newtonsoft.Json": "8.0.2", 9 | "Unity": "4.0.1", 10 | "WebRtc": "Nuget.Version" 11 | }, 12 | "frameworks": { 13 | "uap10.0": {} 14 | }, 15 | "runtimes": { 16 | "win10-arm": {}, 17 | "win10-arm-aot": {}, 18 | "win10-x86": {}, 19 | "win10-x86-aot": {}, 20 | "win10-x64": {}, 21 | "win10-x64-aot": {} 22 | } 23 | } -------------------------------------------------------------------------------- /templates/samples/PeerCC/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PeerConnectionClient.WebRtc")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PeerConnectionClient.WebRtc")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.*")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /templates/samples/PeerCC/Package.WebRtc.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | PeerConnectionClient.WebRtc 7 | Optical Tone Ltd. 8 | Assets\StoreLogo.png 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /templates/samples/PeerCC/PeerConnectionClient.WebRtc.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x86 7 | {A2EA7350-EE59-42C5-9323-C942B058B217} 8 | AppContainerExe 9 | Properties 10 | PeerConnectionClient 11 | PeerConnectionClient.WebRtc 12 | en 13 | UAP 14 | 10.0.14393.0 15 | 10.0.10586.0 16 | 14 17 | 512 18 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 19 | PeerConnectionClient.WebRtc_TemporaryKey.pfx 20 | $(Platform) 21 | BB8A06CAEDBC89DD4FD493DAE421659FB98BEEB9 22 | 23 | 24 | true 25 | ..\Output\PeerCC.Client\WebRtc\bin\$(Platform)\$(Configuration)\ 26 | ..\Output\PeerCC.Client\WebRtc\obj\$(Platform)\$(Configuration)\ 27 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 28 | ;2008 29 | full 30 | x86 31 | false 32 | prompt 33 | true 34 | 35 | 36 | ..\Output\PeerCC.Client\WebRtc\bin\$(Platform)\$(Configuration)\ 37 | ..\Output\PeerCC.Client\WebRtc\obj\$(Platform)\$(Configuration)\ 38 | TRACE;NETFX_CORE;WINDOWS_UWP 39 | true 40 | ;2008 41 | pdbonly 42 | x86 43 | false 44 | prompt 45 | true 46 | true 47 | 48 | 49 | true 50 | ..\Output\PeerCC.Client\WebRtc\bin\$(Platform)\$(Configuration)\ 51 | ..\Output\PeerCC.Client\WebRtc\obj\$(Platform)\$(Configuration)\ 52 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 53 | ;2008 54 | full 55 | ARM 56 | false 57 | prompt 58 | true 59 | 60 | 61 | ..\Output\PeerCC.Client\WebRtc\bin\$(Platform)\$(Configuration)\ 62 | ..\Output\PeerCC.Client\WebRtc\obj\$(Platform)\$(Configuration)\ 63 | TRACE;NETFX_CORE;WINDOWS_UWP 64 | true 65 | ;2008 66 | pdbonly 67 | ARM 68 | false 69 | prompt 70 | true 71 | true 72 | 73 | 74 | true 75 | ..\Output\PeerCC.Client\WebRtc\bin\$(Platform)\$(Configuration)\ 76 | ..\Output\PeerCC.Client\WebRtc\obj\$(Platform)\$(Configuration)\ 77 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 78 | ;2008 79 | full 80 | x64 81 | false 82 | prompt 83 | true 84 | 85 | 86 | ..\Output\PeerCC.Client\WebRtc\bin\$(Platform)\$(Configuration)\ 87 | ..\Output\PeerCC.Client\WebRtc\obj\$(Platform)\$(Configuration)\ 88 | TRACE;NETFX_CORE;WINDOWS_UWP 89 | true 90 | ;2008 91 | pdbonly 92 | x64 93 | false 94 | prompt 95 | true 96 | true 97 | 98 | 99 | 100 | MainPage.xaml 101 | 102 | 103 | App.xaml 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | ErrorControl.xaml 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | Designer 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | MSBuild:Compile 161 | Designer 162 | 163 | 164 | 165 | 166 | MSBuild:Compile 167 | Designer 168 | 169 | 170 | MSBuild:Compile 171 | Designer 172 | 173 | 174 | 175 | 14.0 176 | 177 | 178 | 185 | -------------------------------------------------------------------------------- /templates/samples/PeerCC/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "HockeySDK.WINRT": "4.1.5", 4 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0", 5 | "WebRtc": "Nuget.Version" 6 | }, 7 | "frameworks": { 8 | "uap10.0": {} 9 | }, 10 | "runtimes": { 11 | "win10-arm": {}, 12 | "win10-arm-aot": {}, 13 | "win10-x86": {}, 14 | "win10-x86-aot": {}, 15 | "win10-x64": {}, 16 | "win10-x64-aot": {} 17 | } 18 | } -------------------------------------------------------------------------------- /templates/solutions/WebRtc.Wrapper.Universal.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2020 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Api", "Api", "{A247AD4E-D83A-40C1-8BB6-6B72F3A1EE5C}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Org.WebRtc", "Org.WebRtc", "{507EFBC7-5B0B-4ACB-A67A-7F24A2340A86}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Org.WebRtc.WrapperGlue", "..\projects\msvc\Org.WebRtc.WrapperGlue.Universal\Org.WebRtc.WrapperGlue.vcxproj", "{76CC41B9-4027-4330-A139-0CFA7AA34768}" 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Org.WebRtc", "..\projects\msvc\Org.WebRtc.Universal\Org.WebRtc.vcxproj", "{3DD8FDCD-B703-4B75-826A-2C7E844F903E}" 13 | ProjectSection(ProjectDependencies) = postProject 14 | {76CC41B9-4027-4330-A139-0CFA7AA34768} = {76CC41B9-4027-4330-A139-0CFA7AA34768} 15 | EndProjectSection 16 | EndProject 17 | Global 18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 19 | Debug|ARM = Debug|ARM 20 | Debug|x64 = Debug|x64 21 | Debug|x86 = Debug|x86 22 | Release|ARM = Release|ARM 23 | Release|x64 = Release|x64 24 | Release|x86 = Release|x86 25 | EndGlobalSection 26 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 27 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|ARM.ActiveCfg = Debug|ARM 28 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|ARM.Build.0 = Debug|ARM 29 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|x64.ActiveCfg = Debug|x64 30 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|x64.Build.0 = Debug|x64 31 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|x86.ActiveCfg = Debug|Win32 32 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Debug|x86.Build.0 = Debug|Win32 33 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|ARM.ActiveCfg = Release|ARM 34 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|ARM.Build.0 = Release|ARM 35 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|x64.ActiveCfg = Release|x64 36 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|x64.Build.0 = Release|x64 37 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|x86.ActiveCfg = Release|Win32 38 | {76CC41B9-4027-4330-A139-0CFA7AA34768}.Release|x86.Build.0 = Release|Win32 39 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|ARM.ActiveCfg = Debug|ARM 40 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|ARM.Build.0 = Debug|ARM 41 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|x64.ActiveCfg = Debug|x64 42 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|x64.Build.0 = Debug|x64 43 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|x86.ActiveCfg = Debug|Win32 44 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Debug|x86.Build.0 = Debug|Win32 45 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|ARM.ActiveCfg = Release|ARM 46 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|ARM.Build.0 = Release|ARM 47 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|x64.ActiveCfg = Release|x64 48 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|x64.Build.0 = Release|x64 49 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|x86.ActiveCfg = Release|Win32 50 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E}.Release|x86.Build.0 = Release|Win32 51 | EndGlobalSection 52 | GlobalSection(SolutionProperties) = preSolution 53 | HideSolutionNode = FALSE 54 | EndGlobalSection 55 | GlobalSection(NestedProjects) = preSolution 56 | {507EFBC7-5B0B-4ACB-A67A-7F24A2340A86} = {A247AD4E-D83A-40C1-8BB6-6B72F3A1EE5C} 57 | {76CC41B9-4027-4330-A139-0CFA7AA34768} = {507EFBC7-5B0B-4ACB-A67A-7F24A2340A86} 58 | {3DD8FDCD-B703-4B75-826A-2C7E844F903E} = {507EFBC7-5B0B-4ACB-A67A-7F24A2340A86} 59 | EndGlobalSection 60 | GlobalSection(ExtensibilityGlobals) = postSolution 61 | SolutionGuid = {36335805-B335-4845-8EEB-77E32101A75D} 62 | EndGlobalSection 63 | EndGlobal 64 | -------------------------------------------------------------------------------- /templates/solutions/WebRtc.Wrapper.Win32.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.421 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Org.WebRtc.WrapperGlue", "..\projects\msvc\Org.WebRtc.WrapperGlue.Win32\Org.WebRtc.WrapperGlue.vcxproj", "{8AC9B3E6-0A18-492C-BABE-D142A6204E59}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Org.WebRtc.WrapperC", "..\projects\msvc\Org.WebRtc.WrapperC.Win32\Org.WebRtc.WrapperC.vcxproj", "{1C8AC697-1C78-497A-9893-EE037B236C79}" 9 | ProjectSection(ProjectDependencies) = postProject 10 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59} = {8AC9B3E6-0A18-492C-BABE-D142A6204E59} 11 | EndProjectSection 12 | EndProject 13 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Org.WebRtc", "..\projects\msvc\Org.WebRtc.NetStandard\Org.WebRtc.csproj", "{0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}" 14 | EndProject 15 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Api", "Api", "{7D7CC034-D8B9-42D4-84BB-24B831D7F0E0}" 16 | EndProject 17 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Org.WebRtc", "Org.WebRtc", "{9953E383-C117-427F-B415-9B13B62F5276}" 18 | EndProject 19 | Global 20 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 21 | Debug|Any CPU = Debug|Any CPU 22 | Debug|x64 = Debug|x64 23 | Debug|x86 = Debug|x86 24 | Release|Any CPU = Release|Any CPU 25 | Release|x64 = Release|x64 26 | Release|x86 = Release|x86 27 | EndGlobalSection 28 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 29 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Debug|Any CPU.ActiveCfg = Debug|Win32 30 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Debug|x64.ActiveCfg = Debug|x64 31 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Debug|x64.Build.0 = Debug|x64 32 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Debug|x86.ActiveCfg = Debug|Win32 33 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Debug|x86.Build.0 = Debug|Win32 34 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Release|Any CPU.ActiveCfg = Release|Win32 35 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Release|x64.ActiveCfg = Release|x64 36 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Release|x64.Build.0 = Release|x64 37 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Release|x86.ActiveCfg = Release|Win32 38 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59}.Release|x86.Build.0 = Release|Win32 39 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Debug|Any CPU.ActiveCfg = Debug|Win32 40 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Debug|x64.ActiveCfg = Debug|x64 41 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Debug|x64.Build.0 = Debug|x64 42 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Debug|x86.ActiveCfg = Debug|Win32 43 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Debug|x86.Build.0 = Debug|Win32 44 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Release|Any CPU.ActiveCfg = Release|Win32 45 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Release|x64.ActiveCfg = Release|x64 46 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Release|x64.Build.0 = Release|x64 47 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Release|x86.ActiveCfg = Release|Win32 48 | {1C8AC697-1C78-497A-9893-EE037B236C79}.Release|x86.Build.0 = Release|Win32 49 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 50 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Debug|Any CPU.Build.0 = Debug|Any CPU 51 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Debug|x64.ActiveCfg = Debug|Any CPU 52 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Debug|x64.Build.0 = Debug|Any CPU 53 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Debug|x86.ActiveCfg = Debug|Any CPU 54 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Debug|x86.Build.0 = Debug|Any CPU 55 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Release|Any CPU.ActiveCfg = Release|Any CPU 56 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Release|Any CPU.Build.0 = Release|Any CPU 57 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Release|x64.ActiveCfg = Release|Any CPU 58 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Release|x64.Build.0 = Release|Any CPU 59 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Release|x86.ActiveCfg = Release|Any CPU 60 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC}.Release|x86.Build.0 = Release|Any CPU 61 | EndGlobalSection 62 | GlobalSection(SolutionProperties) = preSolution 63 | HideSolutionNode = FALSE 64 | EndGlobalSection 65 | GlobalSection(NestedProjects) = preSolution 66 | {8AC9B3E6-0A18-492C-BABE-D142A6204E59} = {9953E383-C117-427F-B415-9B13B62F5276} 67 | {1C8AC697-1C78-497A-9893-EE037B236C79} = {9953E383-C117-427F-B415-9B13B62F5276} 68 | {0B74A9FC-4A55-41B3-8B66-BF37FE4BB6EC} = {9953E383-C117-427F-B415-9B13B62F5276} 69 | {9953E383-C117-427F-B415-9B13B62F5276} = {7D7CC034-D8B9-42D4-84BB-24B831D7F0E0} 70 | EndGlobalSection 71 | GlobalSection(ExtensibilityGlobals) = postSolution 72 | SolutionGuid = {9D1FC43F-9CB2-46B3-BF66-48B0975F111B} 73 | EndGlobalSection 74 | EndGlobal 75 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/BUILD.gn: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | config("config_winuwp") { 6 | if (current_os == "winuwp") { 7 | include_dirs = [ "." ] 8 | } 9 | } 10 | 11 | config("config_force_include_std") { 12 | if (current_os == "winuwp") { 13 | cflags_c = [ 14 | "/FIwinuwp_compat_std.h" 15 | ] 16 | cflags = [ 17 | "/FIwinuwp_compat_std.h" 18 | ] 19 | } 20 | } 21 | 22 | source_set("force_include_std") { 23 | if (current_os == "winuwp") { 24 | public_configs = [ 25 | ":config_force_include_std", 26 | ":config_winuwp", 27 | ] 28 | public_deps = [ ":winuwp_compat" ] 29 | } 30 | } 31 | 32 | config("config_force_include_win") { 33 | if (current_os == "winuwp") { 34 | cflags_c = [ 35 | "/FIwinuwp_compat_win.h" 36 | ] 37 | cflags = [ 38 | "/FIwinuwp_compat_win.h" 39 | ] 40 | } 41 | } 42 | 43 | source_set("force_include_win") { 44 | if (current_os == "winuwp") { 45 | public_configs = [ 46 | ":config_force_include_win", 47 | ":config_winuwp", 48 | ] 49 | public_deps = [ ":winuwp_compat" ] 50 | } 51 | } 52 | 53 | source_set("force_include_all") { 54 | if (current_os == "winuwp") { 55 | public_configs = [ 56 | ":config_force_include_std", 57 | ":config_force_include_win", 58 | ":config_winuwp", 59 | ] 60 | public_deps = [ ":winuwp_compat" ] 61 | } 62 | } 63 | 64 | config("ignore_threading_model_warning") { 65 | if (current_os == "winuwp") { 66 | cflags_c = [ 67 | "/wd4447" 68 | ] 69 | cflags = [ 70 | "/wd4447" 71 | ] 72 | } 73 | } 74 | 75 | static_library("winuwp_compat") { 76 | if (current_os == "winuwp") { 77 | sources = [ 78 | "winuwp_compat_std.cc", 79 | "winuwp_compat_std.h", 80 | "winuwp_compat_win.cc", 81 | "winuwp_compat_win.h", 82 | "winuwp_compat_internal.cc", 83 | "winuwp_compat_internal.h", 84 | ] 85 | 86 | public_configs = [ ":config_winuwp" ] 87 | 88 | include_dirs = [ "./" ] 89 | } else { 90 | sources = [] 91 | } 92 | sources += [ "winuwp_compat_noop.cc" ] 93 | } 94 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/gflags/gen/win/include/private/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This source is for use with injecting into gflags build for the winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #include "../../../../../../webrtc/third_party/gflags/gen/win/include/private/config.h" 27 | 28 | #ifdef HAVE_SHLWAPI_H 29 | #undef HAVE_SHLWAPI_H 30 | #endif /* HAVE_SHLWAPI_H */ 31 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_internal.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * This source is for use with injected /FI cl.exe header for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | /* 27 | This header is injected using /FI cl.exe flag for yasm project. 28 | */ 29 | 30 | #include "winuwp_compat_internal.h" 31 | 32 | #ifdef WINUWP 33 | 34 | #include 35 | 36 | #include 37 | #include 38 | #include 39 | 40 | namespace WinUWP 41 | { 42 | //--------------------------------------------------------------------------- 43 | //--------------------------------------------------------------------------- 44 | //--------------------------------------------------------------------------- 45 | //--------------------------------------------------------------------------- 46 | 47 | //--------------------------------------------------------------------------- 48 | StringConvertToUTF8::StringConvertToUTF8(const wchar_t *str) 49 | { 50 | if (!str) return; 51 | 52 | auto count = wcslen(str); 53 | auto len8 = WideCharToMultiByte(CP_UTF8, 0, str, static_cast(count), NULL, 0, NULL, NULL); 54 | 55 | if (len8 < 1) return; 56 | freeBuffer_ = (char *)malloc((len8 + 1) * sizeof(char)); // callee must free 57 | memset(freeBuffer_, 0, (len8 + 1) * sizeof(char)); 58 | 59 | auto result = WideCharToMultiByte(CP_UTF8, 0, str, static_cast(count), freeBuffer_, len8, NULL, NULL); 60 | if (0 == result) return; 61 | length_ = static_cast(len8); 62 | buffer_ = freeBuffer_; 63 | } 64 | 65 | //--------------------------------------------------------------------------- 66 | StringConvertToUTF8::~StringConvertToUTF8() 67 | { 68 | if (NULL == freeBuffer_) return; 69 | free(freeBuffer_); 70 | freeBuffer_ = NULL; 71 | } 72 | 73 | //--------------------------------------------------------------------------- 74 | const char *StringConvertToUTF8::result() const 75 | { 76 | return buffer_; 77 | } 78 | 79 | //--------------------------------------------------------------------------- 80 | char *StringConvertToUTF8::result(char *buffer, size_t size) const 81 | { 82 | if (!buffer_) return NULL; 83 | 84 | if (NULL == buffer) { 85 | buffer = (char *)malloc((length_ + 1) * sizeof(char)); 86 | memset(buffer, 0, (length_ + 1) * sizeof(char)); 87 | size = length_; 88 | } 89 | 90 | if (size < length_) return NULL; 91 | 92 | memcpy(buffer, buffer_, length_ * sizeof(char)); 93 | if (length_ < size) { 94 | buffer[length_] = '\0'; 95 | } 96 | return buffer; 97 | } 98 | 99 | //--------------------------------------------------------------------------- 100 | //--------------------------------------------------------------------------- 101 | //--------------------------------------------------------------------------- 102 | //--------------------------------------------------------------------------- 103 | 104 | //--------------------------------------------------------------------------- 105 | StringConvertToUTF16::StringConvertToUTF16(const char *str) 106 | { 107 | if (!str) return; 108 | 109 | auto count = strlen(str); 110 | auto len16 = MultiByteToWideChar(CP_UTF8, 0, str, static_cast(count), NULL, 0); 111 | 112 | if (len16 < 1) return; 113 | freeBuffer_ = (wchar_t *)malloc((len16 + 1) * sizeof(wchar_t)); // callee must free 114 | memset(freeBuffer_, 0, (len16 + 1) * sizeof(wchar_t)); 115 | 116 | auto result = MultiByteToWideChar(CP_UTF8, 0, str, static_cast(count), freeBuffer_, len16); 117 | if (0 == result) return; 118 | length_ = static_cast(len16); 119 | buffer_ = freeBuffer_; 120 | } 121 | 122 | //--------------------------------------------------------------------------- 123 | StringConvertToUTF16::~StringConvertToUTF16() 124 | { 125 | } 126 | 127 | //--------------------------------------------------------------------------- 128 | const wchar_t *StringConvertToUTF16::result() const 129 | { 130 | return buffer_; 131 | } 132 | 133 | //--------------------------------------------------------------------------- 134 | wchar_t *StringConvertToUTF16::result(wchar_t *buffer, size_t size) const 135 | { 136 | if (!buffer_) return NULL; 137 | 138 | if (NULL == buffer) { 139 | buffer = (wchar_t *)malloc((length_ + 1) * sizeof(wchar_t)); 140 | memset(buffer, 0, (length_ + 1) * sizeof(wchar_t)); 141 | size = length_; 142 | } 143 | 144 | if (size < length_) return NULL; 145 | 146 | memcpy(buffer, buffer_, length_ * sizeof(wchar_t)); 147 | if (length_ < size) { 148 | buffer[length_] = static_cast(0); 149 | } 150 | return buffer; 151 | } 152 | 153 | //--------------------------------------------------------------------------- 154 | //--------------------------------------------------------------------------- 155 | //--------------------------------------------------------------------------- 156 | //--------------------------------------------------------------------------- 157 | 158 | //--------------------------------------------------------------------------- 159 | Environment::Environment() 160 | { 161 | InitializeCriticalSection(&lock_); 162 | } 163 | 164 | //--------------------------------------------------------------------------- 165 | Environment::~Environment() 166 | { 167 | EnterCriticalSection(&lock_); 168 | clearEnv(); 169 | LeaveCriticalSection(&lock_); 170 | 171 | DeleteCriticalSection(&lock_); 172 | } 173 | 174 | //--------------------------------------------------------------------------- 175 | Environment &Environment::singleton() 176 | { 177 | static Environment singleton; 178 | return singleton; 179 | } 180 | 181 | //--------------------------------------------------------------------------- 182 | char *Environment::getEnv(const char *name) 183 | { 184 | char *result = NULL; 185 | 186 | EnterCriticalSection(&lock_); 187 | if (totalInfos_ < 1) goto done; 188 | 189 | for (size_t loop = 0; loop < totalInfos_; ++loop) { 190 | auto info = infos_[loop]; 191 | if (!info) continue; 192 | 193 | if (info->get(name, result)) goto done; 194 | } 195 | 196 | done: 197 | {} 198 | 199 | LeaveCriticalSection(&lock_); 200 | 201 | return result; 202 | } 203 | 204 | 205 | //--------------------------------------------------------------------------- 206 | errno_t Environment::dupEnv( 207 | char * &outBuffer, 208 | size_t *numberOfElements, 209 | const char *varname 210 | ) 211 | { 212 | errno_t result = 0; 213 | 214 | outBuffer = NULL; 215 | if (NULL != numberOfElements) numberOfElements = NULL; 216 | 217 | EnterCriticalSection(&lock_); 218 | 219 | auto found = getEnv(varname); 220 | if (found) { 221 | auto len = strlen(found); 222 | outBuffer = (char *)malloc(sizeof(char)*(len + 1)); 223 | if (outBuffer) { 224 | memset(outBuffer, 0, sizeof(char)*(len + 1)); 225 | memcpy(outBuffer, found, sizeof(char)*(len + 1)); 226 | if (numberOfElements) *numberOfElements = len; 227 | } else { 228 | result = ENOMEM; 229 | errno = result; 230 | } 231 | } 232 | 233 | LeaveCriticalSection(&lock_); 234 | 235 | return result; 236 | } 237 | 238 | //--------------------------------------------------------------------------- 239 | int Environment::setEnv(const char *nameValue) 240 | { 241 | if (NULL == nameValue) return -1; 242 | 243 | auto len = strlen(nameValue); 244 | char *nameValuePair = (char *)malloc(sizeof(char)*(len+1)); 245 | memset(nameValuePair, 0, sizeof(char)*(len+1)); 246 | memcpy(nameValuePair, nameValue, sizeof(char)*len); 247 | 248 | char *value = nameValuePair; 249 | while ('\0' != *value) { 250 | if ('=' == *value) { 251 | *value = '\0'; 252 | ++value; 253 | break; 254 | } 255 | ++value; 256 | } 257 | if ('\0' == *value) value = NULL; 258 | 259 | auto info = new Info(nameValuePair, value); 260 | 261 | EnterCriticalSection(&lock_); 262 | 263 | resizePlusOne(); 264 | infos_[0] = info; 265 | 266 | LeaveCriticalSection(&lock_); 267 | 268 | free(nameValuePair); 269 | nameValuePair = NULL; 270 | 271 | return 0; 272 | } 273 | 274 | //--------------------------------------------------------------------------- 275 | void Environment::clearEnv() 276 | { 277 | if (NULL == infos_) return; 278 | 279 | for (size_t loop = 0; loop < totalInfos_; ++loop) { 280 | if (NULL == infos_[loop]) continue; 281 | 282 | delete infos_[loop]; 283 | infos_[loop] = NULL; 284 | } 285 | 286 | delete [] infos_; 287 | infos_ = NULL; 288 | } 289 | 290 | //--------------------------------------------------------------------------- 291 | void Environment::resizePlusOne() 292 | { 293 | typedef Info * InfoPtr; 294 | if (NULL == infos_) { 295 | totalInfos_ = 1; 296 | infos_ = new InfoPtr[totalInfos_]; 297 | infos_[0] = NULL; 298 | return; 299 | } 300 | 301 | size_t oldTotalInfos = totalInfos_; 302 | auto oldInfos = infos_; 303 | 304 | ++totalInfos_; 305 | infos_ = new InfoPtr[totalInfos_]; 306 | infos_[0] = NULL; 307 | 308 | Info **sourcePos = oldInfos; 309 | Info **destPos = infos_; 310 | 311 | for (size_t loop = 0; loop < oldTotalInfos; ++loop) { 312 | destPos[loop+1] = sourcePos[loop]; 313 | } 314 | 315 | delete [] oldInfos; 316 | oldInfos = NULL; 317 | } 318 | 319 | //--------------------------------------------------------------------------- 320 | Environment::Info::Info( 321 | const char *name, 322 | const char *value 323 | ) 324 | { 325 | if (NULL != name) { 326 | size_t len = strlen(name); 327 | name_ = (char *)malloc(sizeof(char)*(len+1)); 328 | memset(name_,0,sizeof(char)*(len+1)); 329 | memcpy(name_, name,sizeof(char)*(len+1)); 330 | } 331 | if (NULL != value) { 332 | size_t len = strlen(value); 333 | value_ = (char *)malloc(sizeof(char)*(len+1)); 334 | memset(value_,0,sizeof(char)*(len+1)); 335 | memcpy(value_, value,sizeof(char)*(len+1)); 336 | } 337 | } 338 | 339 | //--------------------------------------------------------------------------- 340 | Environment::Info::~Info() 341 | { 342 | if (NULL != name_) { 343 | free(name_); 344 | name_ = NULL; 345 | } 346 | if (NULL != value_) { 347 | free(value_); 348 | value_ = NULL; 349 | } 350 | } 351 | 352 | //--------------------------------------------------------------------------- 353 | bool Environment::Info::get( 354 | const char *name, 355 | char * &outResult 356 | ) const 357 | { 358 | if (NULL == name_) return false; 359 | 360 | if (0 != _stricmp(name, name_)) return false; 361 | 362 | outResult = value_; 363 | 364 | return true; 365 | } 366 | 367 | } /* namespace WinUWP */ 368 | 369 | #endif /* WINUWP */ 370 | 371 | void winuwp_compat_internal_noop() {} 372 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This header is injected using /FI cl.exe flag for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #pragma once 27 | 28 | #ifdef WINUWP 29 | 30 | #include 31 | 32 | namespace WinUWP 33 | { 34 | struct StringConvertToUTF8 35 | { 36 | StringConvertToUTF8(const wchar_t *str); 37 | ~StringConvertToUTF8(); 38 | 39 | const char *result() const; 40 | char *result(char *buffer, size_t size) const; 41 | size_t length() const { return length_; } 42 | 43 | protected: 44 | char *freeBuffer_{}; 45 | const char *buffer_ {}; 46 | size_t length_ {}; 47 | }; 48 | 49 | struct StringConvertToUTF16 50 | { 51 | StringConvertToUTF16(const char *str); 52 | ~StringConvertToUTF16(); 53 | 54 | const wchar_t *result() const; 55 | wchar_t *result(wchar_t *buffer, size_t size) const; 56 | size_t length() const { return length_; } 57 | 58 | protected: 59 | wchar_t *freeBuffer_ {}; 60 | const wchar_t *buffer_ {}; 61 | size_t length_ {}; 62 | }; 63 | 64 | struct Environment 65 | { 66 | Environment(); 67 | ~Environment(); 68 | 69 | static Environment &singleton(); 70 | 71 | char *getEnv(const char *name); 72 | errno_t dupEnv( 73 | char * &outBuffer, 74 | size_t *outSize, 75 | const char *varname 76 | ); 77 | int setEnv(const char *nameValue); 78 | 79 | protected: 80 | void clearEnv(); 81 | void resizePlusOne(); 82 | 83 | protected: 84 | CRITICAL_SECTION lock_ {}; 85 | 86 | struct Info 87 | { 88 | Info( 89 | const char *name, 90 | const char *value 91 | ); 92 | ~Info(); 93 | 94 | bool get( 95 | const char *name, 96 | char * &outResult 97 | ) const; 98 | 99 | protected: 100 | char *name_ {}; 101 | char *value_ {}; 102 | }; 103 | 104 | Info **infos_ {}; 105 | size_t totalInfos_ {}; 106 | }; 107 | 108 | } 109 | 110 | #endif /* WINUWP */ 111 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_noop.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * This source is for use with injected /FI cl.exe header for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | void winuwp_compat_noop() 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_std.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * This source is for use with injected /FI cl.exe header for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #include "winuwp_compat_std.h" 27 | #include "winuwp_compat_internal.h" 28 | 29 | #ifdef WINUWP 30 | 31 | #include 32 | 33 | #if !defined(NTDDI_WIN10_RS4) || (WDK_NTDDI_VERSION < NTDDI_WIN10_RS4) 34 | 35 | static char *winuwpInternalGetEnvA(const char *envstring) 36 | { 37 | auto singleton = WinUWP::Environment::singleton(); 38 | return singleton.getEnv(envstring); 39 | } 40 | 41 | errno_t winuwpInternalDupEnv( 42 | char **buffer, 43 | size_t *numberOfElements, 44 | const char *varname 45 | ) 46 | { 47 | if ((NULL == buffer) || 48 | (NULL == varname)) { 49 | errno = EINVAL; 50 | return EINVAL; 51 | } 52 | auto singleton = WinUWP::Environment::singleton(); 53 | return singleton.dupEnv(*buffer, numberOfElements, varname); 54 | } 55 | 56 | static int winuwpInternalPutEnvA(const char *envstring) 57 | { 58 | auto singleton = WinUWP::Environment::singleton(); 59 | return singleton.setEnv(envstring); 60 | } 61 | 62 | static int winuwpInternalPutEnvW(const wchar_t *envstring) 63 | { 64 | WinUWP::StringConvertToUTF8 str(envstring); 65 | return winuwpInternalPutEnvA(str.result()); 66 | } 67 | 68 | #endif // !defined(NTDDI_WIN10_RS4) || (WDK_NTDDI_VERSION < NTDDI_WIN10_RS4) 69 | 70 | #ifdef __cplusplus 71 | extern "C" { 72 | #endif /* __cplusplus */ 73 | 74 | #if !defined(NTDDI_WIN10_RS4) || (WDK_NTDDI_VERSION < NTDDI_WIN10_RS4) 75 | char *winuwpGetEnv(const char *varname) 76 | { 77 | return winuwpInternalGetEnvA(varname); 78 | } 79 | 80 | errno_t winuwpDupEnv( 81 | char **buffer, 82 | size_t *numberOfElements, 83 | const char *varname 84 | ) 85 | { 86 | return winuwpInternalDupEnv(buffer, numberOfElements, varname); 87 | } 88 | 89 | int winuwpPutEvnA(const char *envstring) 90 | { 91 | return winuwpInternalPutEnvA(envstring); 92 | } 93 | 94 | int winuwpPutEvnW(const wchar_t *envstring) 95 | { 96 | return winuwpInternalPutEnvW(envstring); 97 | } 98 | #endif // !defined(NTDDI_WIN10_RS4) || (WDK_NTDDI_VERSION < NTDDI_WIN10_RS4) 99 | pid_t winuwpGetPid() 100 | { 101 | return static_cast(GetCurrentProcessId()); 102 | } 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif /* __cplusplus */ 107 | 108 | #endif /* WINUWP */ 109 | 110 | void winuwp_compat_std_noop() {} 111 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_std.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This header is injected using /FI cl.exe flag for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #pragma once 27 | 28 | #ifdef WINUWP 29 | 30 | #include 31 | #include 32 | 33 | #ifdef __cplusplus 34 | namespace webrtc 35 | { 36 | namespace TickTime 37 | { 38 | inline void DisableFakeClock() {} 39 | } 40 | } 41 | #endif /* __cplusplus */ 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif /* __cplusplus */ 46 | 47 | /* ------------------------------------------------------------------------- */ 48 | /* ------------------------------------------------------------------------- */ 49 | /* ------------------------------------------------------------------------- */ 50 | /* ------------------------------------------------------------------------- */ 51 | #if !defined(NTDDI_WIN10_RS4) || (WDK_NTDDI_VERSION < NTDDI_WIN10_RS4) 52 | char *winuwpGetEnv( 53 | const char *varname 54 | ); 55 | 56 | inline char *getenv(const char *varname) 57 | { 58 | return winuwpGetEnv(varname); 59 | } 60 | 61 | /* ------------------------------------------------------------------------- */ 62 | /* ------------------------------------------------------------------------- */ 63 | /* ------------------------------------------------------------------------- */ 64 | /* ------------------------------------------------------------------------- */ 65 | errno_t winuwpDupEnv( 66 | char **buffer, 67 | size_t *numberOfElements, 68 | const char *varname 69 | ); 70 | 71 | inline errno_t _dupenv_s( 72 | char **buffer, 73 | size_t *numberOfElements, 74 | const char *varname 75 | ) 76 | { 77 | return winuwpDupEnv(buffer, numberOfElements, varname); 78 | } 79 | /* ------------------------------------------------------------------------- */ 80 | /* ------------------------------------------------------------------------- */ 81 | /* ------------------------------------------------------------------------- */ 82 | /* ------------------------------------------------------------------------- */ 83 | int winuwpPutEvnA(const char *envstring); 84 | int winuwpPutEvnW(const wchar_t *envstring); 85 | 86 | inline int _putenv(const char *envstring) 87 | { 88 | return winuwpPutEvnA(envstring); 89 | } 90 | 91 | 92 | inline int _wputenv(const wchar_t *envstring) 93 | { 94 | return winuwpPutEvnW(envstring); 95 | } 96 | #endif // !defined(NTDDI_WIN10_RS4) || (WDK_NTDDI_VERSION < NTDDI_WIN10_RS4) 97 | 98 | /* ------------------------------------------------------------------------- */ 99 | /* ------------------------------------------------------------------------- */ 100 | /* ------------------------------------------------------------------------- */ 101 | /* ------------------------------------------------------------------------- */ 102 | typedef int pid_t; 103 | 104 | pid_t winuwpGetPid(); 105 | 106 | inline pid_t getpid(void) 107 | { 108 | return winuwpGetPid(); 109 | } 110 | 111 | inline int _getpid(void) 112 | { 113 | return winuwpGetPid(); 114 | } 115 | 116 | #ifdef __cplusplus 117 | } 118 | #endif /* __cplusplus */ 119 | 120 | #endif /* WINUWP */ 121 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_wrap_main_plain_c.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * This source is for use with injected /FI cl.exe header for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #include "winuwp_compat_internal.h" 27 | 28 | #ifdef WINUWP 29 | 30 | #ifdef main 31 | #undef main 32 | #endif /* main */ 33 | 34 | #include 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif /* __cplusplus */ 39 | 40 | int winuwpMainC(); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif /* __cplusplus */ 45 | 46 | int main(Platform::Array^ args) 47 | { 48 | return winuwpMainC(); 49 | } 50 | 51 | #endif /* WINUWP */ 52 | 53 | void winuwp_compat_main_plain_c() {} 54 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_wrap_main_plain_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This header is injected using /FI cl.exe flag for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #pragma once 27 | 28 | #ifdef WINUWP 29 | 30 | #define main(...) winuwpMainC() 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif /* __cplusplus */ 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif /* __cplusplus */ 39 | 40 | #endif /* WINUWP */ 41 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_wrap_main_plain_cc.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * This source is for use with injected /FI cl.exe header for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #include "winuwp_compat_internal.h" 27 | 28 | #ifdef WINUWP 29 | 30 | #ifdef main 31 | #undef main 32 | #endif /* main */ 33 | 34 | #include 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif /* __cplusplus */ 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif /* __cplusplus */ 43 | 44 | int winuwpMainCC(); 45 | 46 | 47 | int main(Platform::Array^ args) 48 | { 49 | return winuwpMainCC(); 50 | } 51 | 52 | #endif /* WINUWP */ 53 | 54 | void winuwp_compat_main_plain_cc() {} 55 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_wrap_main_plain_cc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This header is injected using /FI cl.exe flag for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #pragma once 27 | 28 | #ifdef WINUWP 29 | 30 | #define main(...) winuwpMainCC() 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif /* __cplusplus */ 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif /* __cplusplus */ 39 | 40 | #endif /* WINUWP */ 41 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_wrap_main_utf16_c.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * This source is for use with injected /FI cl.exe header for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #include "winuwp_compat_internal.h" 27 | 28 | #ifdef WINUWP 29 | 30 | #ifdef main 31 | #undef main 32 | #endif /* main */ 33 | 34 | #include 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif /* __cplusplus */ 39 | 40 | int winuwpMainC(int argc, wchar_t *argv[]); 41 | 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif /* __cplusplus */ 46 | 47 | 48 | int main(Platform::Array^ args) 49 | { 50 | WinUWP::MainConvertToUTF16 conv(args); 51 | return winuwpMainC(conv.argc(), conv.argv()); 52 | } 53 | 54 | 55 | #endif /* WINUWP */ 56 | 57 | void winuwp_compat_main_utf16_c() {} 58 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_wrap_main_utf16_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This header is injected using /FI cl.exe flag for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #pragma once 27 | 28 | #ifdef WINUWP 29 | 30 | #define main(xArgc,xArgv) winuwpMainC(xArgc,xArgv) 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif /* __cplusplus */ 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif /* __cplusplus */ 39 | 40 | #endif /* WINUWP */ 41 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_wrap_main_utf16_cc.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * This source is for use with injected /FI cl.exe header for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #include "winuwp_compat_internal.h" 27 | 28 | #ifdef WINUWP 29 | 30 | #ifdef main 31 | #undef main 32 | #endif /* main */ 33 | 34 | #include 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif /* __cplusplus */ 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif /* __cplusplus */ 43 | 44 | 45 | int winuwpMainCC(int argc, wchar_t *argv[]); 46 | 47 | int main(Platform::Array^ args) 48 | { 49 | WinUWP::MainConvertToUTF16 conv(args); 50 | return winuwpMainCC(conv.argc(), conv.argv()); 51 | } 52 | 53 | 54 | #endif /* WINUWP */ 55 | 56 | void winuwp_compat_main_utf16_cc() {} 57 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_wrap_main_utf16_cc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This header is injected using /FI cl.exe flag for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #pragma once 27 | 28 | #ifdef WINUWP 29 | 30 | #define main(xArgc,xArgv) winuwpMainCC(xArgc,xArgv) 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif /* __cplusplus */ 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif /* __cplusplus */ 39 | 40 | #endif /* WINUWP */ 41 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_wrap_main_utf8_c.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * This source is for use with injected /FI cl.exe header for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #include "winuwp_compat_internal.h" 27 | 28 | #ifdef WINUWP 29 | 30 | #ifdef main 31 | #undef main 32 | #endif /* main */ 33 | 34 | #include 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif /* __cplusplus */ 39 | 40 | int winuwpMainC(int argc, char *argv[]); 41 | 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif /* __cplusplus */ 46 | 47 | 48 | int main(Platform::Array^ args) 49 | { 50 | WinUWP::MainConvertToUTF8 conv(args); 51 | return winuwpMainC(conv.argc(), conv.argv()); 52 | } 53 | 54 | 55 | #endif /* WINUWP */ 56 | 57 | void winuwp_compat_main_utf8_c() {} 58 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_wrap_main_utf8_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This header is injected using /FI cl.exe flag for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #pragma once 27 | 28 | #ifdef WINUWP 29 | 30 | #define main(xArgc,xArgv) winuwpMainC(xArgc,xArgv) 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif /* __cplusplus */ 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif /* __cplusplus */ 39 | 40 | #endif /* WINUWP */ 41 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_wrap_main_utf8_cc.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * This source is for use with injected /FI cl.exe header for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #include "winuwp_compat_internal.h" 27 | 28 | #ifdef WINUWP 29 | 30 | #ifdef main 31 | #undef main 32 | #endif /* main */ 33 | 34 | #include 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif /* __cplusplus */ 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif /* __cplusplus */ 43 | 44 | 45 | int winuwpMainCC(int argc, char *argv[]); 46 | 47 | int main(Platform::Array^ args) 48 | { 49 | WinUWP::MainConvertToUTF8 conv(args); 50 | return winuwpMainCC(conv.argc(), conv.argv()); 51 | } 52 | 53 | 54 | #endif /* WINUWP */ 55 | 56 | void winuwp_compat_main_utf8_cc() {} 57 | -------------------------------------------------------------------------------- /third_party/winuwp_compat/winuwp_compat_wrap_main_utf8_cc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This header is injected using /FI cl.exe flag for winuwp project. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE 17 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | * POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #pragma once 27 | 28 | #ifdef WINUWP 29 | 30 | #define main(xArgc,xArgv) winuwpMainCC(xArgc,xArgv) 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif /* __cplusplus */ 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif /* __cplusplus */ 39 | 40 | #endif /* WINUWP */ 41 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/BUILD.gn: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | static_library("winuwp_h264") { 6 | sources = [ 7 | "winuwp_h264_factory.cc", 8 | "winuwp_h264_factory.h", 9 | "native_handle_buffer.h", 10 | "Utils/Utils.h", 11 | "Utils/Async.h", 12 | "Utils/CritSec.h", 13 | "Utils/OpQueue.h", 14 | "Utils/SampleAttributeQueue.h", 15 | "H264Encoder/H264Encoder.h", 16 | "H264Encoder/H264Encoder.cc", 17 | "H264Encoder/H264MediaSink.h", 18 | "H264Encoder/H264MediaSink.cc", 19 | "H264Encoder/H264StreamSink.h", 20 | "H264Encoder/H264StreamSink.cc", 21 | "H264Encoder/IH264EncodingCallback.h", 22 | "H264Decoder/H264Decoder.h", 23 | "H264Decoder/H264Decoder.cc", 24 | ] 25 | 26 | deps = [ 27 | "//:webrtc_common", 28 | "//common_video:common_video", 29 | "//modules/video_coding:video_coding_utility", 30 | "//system_wrappers:system_wrappers", 31 | ] 32 | 33 | #Added because of warning C4467: usage of ATL attributes is deprecated. 34 | #Problem is usage of uuid attribute for IAsyncStreamSinkOperation in H264StreamSink.h file. 35 | #It is planned to be modified, so this is temporrary fix. 36 | if (target_os == "winuwp") { 37 | cflags = [ "/wd4467" ] 38 | cflags_cc = [ "/wd4467" ] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/H264Decoder/H264Decoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef THIRD_PARTY_H264_WINUWP_H264DECODER_H264DECODER_H_ 12 | #define THIRD_PARTY_H264_WINUWP_H264DECODER_H264DECODER_H_ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include "../Utils/SampleAttributeQueue.h" 20 | #include "api/video_codecs/video_decoder.h" 21 | #include "common_video/include/i420_buffer_pool.h" 22 | #include "modules/video_coding/codecs/h264/include/h264.h" 23 | #include "rtc_base/criticalsection.h" 24 | 25 | #pragma comment(lib, "mfreadwrite") 26 | #pragma comment(lib, "mfplat") 27 | #pragma comment(lib, "mfuuid") 28 | 29 | using Microsoft::WRL::ComPtr; 30 | 31 | namespace webrtc { 32 | 33 | class WinUWPH264DecoderImpl : public H264Decoder { 34 | public: 35 | WinUWPH264DecoderImpl(); 36 | 37 | virtual ~WinUWPH264DecoderImpl(); 38 | 39 | int InitDecode(const VideoCodec* codec_settings, int number_of_cores) override; 40 | 41 | int Decode(const EncodedImage& input_image, 42 | bool missing_frames, 43 | const CodecSpecificInfo* codec_specific_info, 44 | int64_t /*render_time_ms*/) override; 45 | 46 | int RegisterDecodeCompleteCallback(DecodedImageCallback* callback) override; 47 | 48 | int Release() override; 49 | 50 | const char* ImplementationName() const override; 51 | 52 | private: 53 | HRESULT FlushFrames(uint32_t timestamp, uint64_t ntp_time_ms); 54 | HRESULT EnqueueFrame(const EncodedImage& input_image, bool missing_frames); 55 | 56 | private: 57 | ComPtr decoder_; 58 | I420BufferPool buffer_pool_; 59 | 60 | bool inited_ = false; 61 | bool require_keyframe_ = true; 62 | uint32_t first_frame_rtp_ = 0; 63 | absl::optional width_; 64 | absl::optional height_; 65 | rtc::CriticalSection crit_; 66 | DecodedImageCallback* decode_complete_callback_; 67 | }; // end of WinUWPH264DecoderImpl class 68 | 69 | } // namespace webrtc 70 | 71 | #endif // THIRD_PARTY_H264_WINUWP_H264DECODER_H264DECODER_H_ 72 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/H264Encoder/H264Encoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef THIRD_PARTY_H264_WINUWP_H264ENCODER_H264ENCODER_H_ 12 | #define THIRD_PARTY_H264_WINUWP_H264ENCODER_H264ENCODER_H_ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include "H264MediaSink.h" 20 | #include "IH264EncodingCallback.h" 21 | #include "../Utils/SampleAttributeQueue.h" 22 | #include "api/video_codecs/video_encoder.h" 23 | #include "rtc_base/criticalsection.h" 24 | #include "modules/video_coding/utility/quality_scaler.h" 25 | #include "common_video/h264/h264_bitstream_parser.h" 26 | 27 | #pragma comment(lib, "mfreadwrite") 28 | #pragma comment(lib, "mfplat") 29 | #pragma comment(lib, "mfuuid") 30 | 31 | namespace webrtc { 32 | 33 | class H264MediaSink; 34 | 35 | class WinUWPH264EncoderImpl : public VideoEncoder, public IH264EncodingCallback { 36 | public: 37 | WinUWPH264EncoderImpl(); 38 | 39 | ~WinUWPH264EncoderImpl(); 40 | 41 | // === VideoEncoder overrides === 42 | int InitEncode(const VideoCodec* codec_settings, 43 | int number_of_cores, size_t max_payload_size) override; 44 | int RegisterEncodeCompleteCallback(EncodedImageCallback* callback) override; 45 | int Release() override; 46 | int Encode(const VideoFrame& input_image, 47 | const CodecSpecificInfo* codec_specific_info, 48 | const std::vector* frame_types) override; 49 | int SetChannelParameters(uint32_t packet_loss, int64_t rtt) override; 50 | int SetRates(uint32_t new_bitrate_kbit, uint32_t frame_rate) override; 51 | ScalingSettings GetScalingSettings() const override; 52 | const char* ImplementationName() const override; 53 | 54 | // === IH264EncodingCallback overrides === 55 | void OnH264Encoded(ComPtr sample) override; 56 | 57 | private: 58 | ComPtr FromVideoFrame(const VideoFrame& frame); 59 | int InitEncoderWithSettings(const VideoCodec* codec_settings); 60 | 61 | private: 62 | rtc::CriticalSection crit_; 63 | rtc::CriticalSection callbackCrit_; 64 | bool inited_ {}; 65 | const CodecSpecificInfo* codecSpecificInfo_ {}; 66 | ComPtr sinkWriter_; 67 | ComPtr sinkWriterCreationAttributes_; 68 | ComPtr sinkWriterEncoderAttributes_; 69 | ComPtr mediaSink_; 70 | EncodedImageCallback* encodedCompleteCallback_ {}; 71 | DWORD streamIndex_ {}; 72 | LONGLONG startTime_ {}; 73 | LONGLONG lastTimestampHns_ {}; 74 | bool firstFrame_ {true}; 75 | int framePendingCount_ {}; 76 | DWORD frameCount_ {}; 77 | bool lastFrameDropped_ {}; 78 | //These fields are never used 79 | /* 80 | UINT32 currentWidth_ {}; 81 | UINT32 currentHeight_ {}; 82 | UINT32 currentBitrateBps_ {}; 83 | UINT32 currentFps_ {}; 84 | */ 85 | UINT32 max_bitrate_; 86 | 87 | UINT32 width_; 88 | UINT32 height_; 89 | UINT32 max_frame_rate_; 90 | UINT32 target_bps_; 91 | VideoCodecMode mode_; 92 | // H.264 specifc parameters 93 | bool frame_dropping_on_; 94 | int key_frame_interval_; 95 | 96 | int64_t lastTimeSettingsChanged_ {}; 97 | 98 | struct CachedFrameAttributes { 99 | uint32_t timestamp; 100 | uint64_t ntpTime; 101 | uint64_t captureRenderTime; 102 | uint32_t frameWidth; 103 | uint32_t frameHeight; 104 | }; 105 | SampleAttributeQueue _sampleAttributeQueue; 106 | 107 | // Caching the codec received in InitEncode(). 108 | VideoCodec codec_; 109 | }; // end of WinUWPH264EncoderImpl class 110 | 111 | } // namespace webrtc 112 | #endif // THIRD_PARTY_H264_WINUWP_H264ENCODER_H264ENCODER_H_ 113 | 114 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/H264Encoder/H264MediaSink.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "third_party/winuwp_h264/H264Encoder/H264MediaSink.h" 12 | #include 13 | #include 14 | 15 | namespace webrtc { 16 | 17 | H264MediaSink::H264MediaSink() 18 | : isShutdown_(false) { 19 | } 20 | 21 | 22 | H264MediaSink::~H264MediaSink() { 23 | OutputDebugString(L"H264MediaSink::~H264MediaSink()\r\n"); 24 | } 25 | 26 | HRESULT H264MediaSink::RuntimeClassInitialize() { 27 | return S_OK; 28 | } 29 | 30 | IFACEMETHODIMP H264MediaSink::GetCharacteristics(DWORD *pdwCharacteristics) { 31 | if (pdwCharacteristics == NULL) { 32 | return E_INVALIDARG; 33 | } 34 | AutoLock lock(critSec_); 35 | 36 | HRESULT hr = CheckShutdown(); 37 | 38 | if (SUCCEEDED(hr)) { 39 | // Rateless sink. 40 | *pdwCharacteristics = MEDIASINK_RATELESS; 41 | } 42 | 43 | return hr; 44 | } 45 | 46 | IFACEMETHODIMP H264MediaSink::AddStreamSink( 47 | DWORD dwStreamSinkIdentifier, 48 | IMFMediaType *pMediaType, 49 | IMFStreamSink **ppStreamSink) { 50 | AutoLock lock(critSec_); 51 | HRESULT hr = CheckShutdown(); 52 | 53 | if (outputStream_ != nullptr) { 54 | hr = MF_E_STREAMSINK_EXISTS; 55 | } 56 | 57 | if (SUCCEEDED(hr)) { 58 | hr = Microsoft::WRL::MakeAndInitialize( 59 | &outputStream_, dwStreamSinkIdentifier, this); 60 | } 61 | 62 | if (SUCCEEDED(hr) && pMediaType != nullptr) { 63 | hr = outputStream_->SetCurrentMediaType(pMediaType); 64 | } 65 | 66 | return hr; 67 | } 68 | 69 | IFACEMETHODIMP H264MediaSink::RemoveStreamSink(DWORD dwStreamSinkIdentifier) { 70 | AutoLock lock(critSec_); 71 | HRESULT hr = CheckShutdown(); 72 | 73 | if (SUCCEEDED(hr)) { 74 | if (outputStream_ == nullptr) { 75 | hr = E_INVALIDARG; 76 | } 77 | } 78 | 79 | if (SUCCEEDED(hr)) { 80 | DWORD currentSinkId; 81 | hr = outputStream_->GetIdentifier(¤tSinkId); 82 | if (FAILED(hr) || currentSinkId != dwStreamSinkIdentifier) { 83 | hr = E_INVALIDARG; 84 | } 85 | } 86 | 87 | if (SUCCEEDED(hr)) { 88 | hr = outputStream_->Shutdown(); 89 | } 90 | 91 | outputStream_.Reset(); 92 | 93 | return hr; 94 | } 95 | 96 | IFACEMETHODIMP H264MediaSink::GetStreamSinkCount( 97 | _Out_ DWORD *pcStreamSinkCount) { 98 | if (pcStreamSinkCount == NULL) { 99 | return E_INVALIDARG; 100 | } 101 | 102 | AutoLock lock(critSec_); 103 | 104 | HRESULT hr = CheckShutdown(); 105 | 106 | if (SUCCEEDED(hr)) { 107 | *pcStreamSinkCount = outputStream_ == nullptr ? 0 : 1; 108 | } 109 | 110 | return hr; 111 | } 112 | 113 | IFACEMETHODIMP H264MediaSink::GetStreamSinkByIndex( 114 | DWORD dwIndex, 115 | _Outptr_ IMFStreamSink **ppStreamSink) { 116 | if (ppStreamSink == NULL) { 117 | return E_INVALIDARG; 118 | } 119 | 120 | AutoLock lock(critSec_); 121 | 122 | if (dwIndex >= 1) { 123 | return MF_E_INVALIDINDEX; 124 | } 125 | 126 | HRESULT hr = CheckShutdown(); 127 | 128 | if (SUCCEEDED(hr)) { 129 | *ppStreamSink = outputStream_.Get(); 130 | (*ppStreamSink)->AddRef(); 131 | } 132 | 133 | return hr; 134 | } 135 | 136 | IFACEMETHODIMP H264MediaSink::GetStreamSinkById( 137 | DWORD dwStreamSinkIdentifier, 138 | IMFStreamSink **ppStreamSink) { 139 | if (ppStreamSink == NULL) { 140 | return E_INVALIDARG; 141 | } 142 | 143 | AutoLock lock(critSec_); 144 | HRESULT hr = CheckShutdown(); 145 | Microsoft::WRL::ComPtr spResult; 146 | 147 | if (SUCCEEDED(hr)) { 148 | if (outputStream_ == nullptr) { 149 | hr = MF_E_INVALIDSTREAMNUMBER; 150 | } 151 | } 152 | 153 | if (SUCCEEDED(hr)) { 154 | DWORD currentSinkId; 155 | hr = outputStream_->GetIdentifier(¤tSinkId); 156 | if (FAILED(hr) || currentSinkId != dwStreamSinkIdentifier) { 157 | hr = MF_E_INVALIDSTREAMNUMBER; 158 | } 159 | } 160 | 161 | if (SUCCEEDED(hr)) { 162 | *ppStreamSink = outputStream_.Get(); 163 | (*ppStreamSink)->AddRef(); 164 | } 165 | 166 | return hr; 167 | } 168 | 169 | IFACEMETHODIMP H264MediaSink::SetPresentationClock( 170 | IMFPresentationClock *pPresentationClock) { 171 | AutoLock lock(critSec_); 172 | 173 | HRESULT hr = CheckShutdown(); 174 | 175 | if (SUCCEEDED(hr)) { 176 | if (spClock_) { 177 | hr = spClock_->RemoveClockStateSink(this); 178 | } 179 | } 180 | 181 | if (SUCCEEDED(hr)) { 182 | if (pPresentationClock) { 183 | hr = pPresentationClock->AddClockStateSink(this); 184 | } 185 | } 186 | 187 | if (SUCCEEDED(hr)) { 188 | spClock_ = pPresentationClock; 189 | } 190 | 191 | return hr; 192 | } 193 | 194 | IFACEMETHODIMP H264MediaSink::GetPresentationClock( 195 | IMFPresentationClock **ppPresentationClock) { 196 | if (ppPresentationClock == NULL) { 197 | return E_INVALIDARG; 198 | } 199 | 200 | AutoLock lock(critSec_); 201 | 202 | HRESULT hr = CheckShutdown(); 203 | 204 | if (SUCCEEDED(hr)) { 205 | if (spClock_ == NULL) { 206 | hr = MF_E_NO_CLOCK; 207 | } else { 208 | *ppPresentationClock = spClock_.Get(); 209 | (*ppPresentationClock)->AddRef(); 210 | } 211 | } 212 | 213 | return hr; 214 | } 215 | 216 | IFACEMETHODIMP H264MediaSink::Shutdown() { 217 | AutoLock lock(critSec_); 218 | 219 | HRESULT hr = CheckShutdown(); 220 | 221 | if (SUCCEEDED(hr) && outputStream_ != nullptr) { 222 | outputStream_->Shutdown(); 223 | outputStream_.Reset(); 224 | 225 | spClock_.Reset(); 226 | 227 | isShutdown_ = true; 228 | } 229 | 230 | return S_OK; 231 | } 232 | 233 | IFACEMETHODIMP H264MediaSink::OnClockStart( 234 | MFTIME hnsSystemTime, 235 | LONGLONG llClockStartOffset) { 236 | AutoLock lock(critSec_); 237 | 238 | HRESULT hr = CheckShutdown(); 239 | 240 | if (SUCCEEDED(hr)) { 241 | hr = outputStream_->Start(llClockStartOffset); 242 | } 243 | 244 | return hr; 245 | } 246 | 247 | IFACEMETHODIMP H264MediaSink::OnClockStop( 248 | MFTIME hnsSystemTime) { 249 | AutoLock lock(critSec_); 250 | 251 | HRESULT hr = CheckShutdown(); 252 | 253 | if (SUCCEEDED(hr)) { 254 | hr = outputStream_->Stop(); 255 | } 256 | 257 | return hr; 258 | } 259 | 260 | IFACEMETHODIMP H264MediaSink::OnClockPause( 261 | MFTIME hnsSystemTime) { 262 | return MF_E_INVALID_STATE_TRANSITION; 263 | } 264 | 265 | IFACEMETHODIMP H264MediaSink::OnClockRestart( 266 | MFTIME hnsSystemTime) { 267 | return MF_E_INVALID_STATE_TRANSITION; 268 | } 269 | 270 | IFACEMETHODIMP H264MediaSink::OnClockSetRate( 271 | /* [in] */ MFTIME hnsSystemTime, 272 | /* [in] */ float flRate) { 273 | return S_OK; 274 | } 275 | 276 | HRESULT H264MediaSink::RegisterEncodingCallback( 277 | IH264EncodingCallback *callback) { 278 | return outputStream_->RegisterEncodingCallback(callback); 279 | } 280 | 281 | } // namespace webrtc 282 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/H264Encoder/H264MediaSink.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef THIRD_PARTY_H264_WINUWP_H264ENCODER_H264MEDIASINK_H_ 12 | #define THIRD_PARTY_H264_WINUWP_H264ENCODER_H264MEDIASINK_H_ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include "../Utils/CritSec.h" 22 | #include "IH264EncodingCallback.h" 23 | #include "H264StreamSink.h" 24 | 25 | namespace webrtc { 26 | 27 | class H264StreamSink; 28 | class H264MediaSink : public Microsoft::WRL::RuntimeClass< 29 | Microsoft::WRL::RuntimeClassFlags< 30 | Microsoft::WRL::RuntimeClassType::WinRtClassicComMix>, 31 | ABI::Windows::Media::IMediaExtension, 32 | Microsoft::WRL::FtmBase, 33 | IMFMediaSink, 34 | IMFClockStateSink> { 35 | InspectableClass(L"H264MediaSink", BaseTrust) 36 | 37 | public: 38 | H264MediaSink(); 39 | virtual ~H264MediaSink(); 40 | 41 | HRESULT RuntimeClassInitialize(); 42 | 43 | // IMediaExtension 44 | IFACEMETHOD(SetProperties) 45 | (ABI::Windows::Foundation::Collections::IPropertySet 46 | *pConfiguration) { 47 | return S_OK; 48 | } 49 | 50 | // IMFMediaSink methods 51 | IFACEMETHOD(GetCharacteristics) (DWORD *pdwCharacteristics); 52 | 53 | IFACEMETHOD(AddStreamSink)( 54 | /* [in] */ DWORD dwStreamSinkIdentifier, 55 | /* [in] */ IMFMediaType *pMediaType, 56 | /* [out] */ IMFStreamSink **ppStreamSink); 57 | 58 | IFACEMETHOD(RemoveStreamSink) (DWORD dwStreamSinkIdentifier); 59 | IFACEMETHOD(GetStreamSinkCount) (_Out_ DWORD *pcStreamSinkCount); 60 | IFACEMETHOD(GetStreamSinkByIndex) 61 | (DWORD dwIndex, _Outptr_ IMFStreamSink **ppStreamSink); 62 | IFACEMETHOD(GetStreamSinkById) 63 | (DWORD dwIdentifier, IMFStreamSink **ppStreamSink); 64 | IFACEMETHOD(SetPresentationClock) 65 | (IMFPresentationClock *pPresentationClock); 66 | IFACEMETHOD(GetPresentationClock) 67 | (IMFPresentationClock **ppPresentationClock); 68 | IFACEMETHOD(Shutdown) (); 69 | 70 | // IMFClockStateSink methods 71 | IFACEMETHOD(OnClockStart) 72 | (MFTIME hnsSystemTime, LONGLONG llClockStartOffset); 73 | IFACEMETHOD(OnClockStop) (MFTIME hnsSystemTime); 74 | IFACEMETHOD(OnClockPause) (MFTIME hnsSystemTime); 75 | IFACEMETHOD(OnClockRestart) (MFTIME hnsSystemTime); 76 | IFACEMETHOD(OnClockSetRate) (MFTIME hnsSystemTime, float flRate); 77 | 78 | HRESULT RegisterEncodingCallback(IH264EncodingCallback *callback); 79 | 80 | private: 81 | void HandleError(HRESULT hr); 82 | 83 | HRESULT CheckShutdown() const { 84 | if (isShutdown_) { 85 | return MF_E_SHUTDOWN; 86 | } else { 87 | return S_OK; 88 | } 89 | } 90 | 91 | private: 92 | CritSec critSec_; 93 | 94 | bool isShutdown_; 95 | 96 | Microsoft::WRL::ComPtr spClock_; 97 | Microsoft::WRL::ComPtr outputStream_; 98 | }; 99 | 100 | } // namespace webrtc 101 | 102 | #endif // THIRD_PARTY_H264_WINUWP_H264ENCODER_H264MEDIASINK_H_ 103 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/H264Encoder/H264StreamSink.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "third_party/winuwp_h264/H264Encoder/H264StreamSink.h" 12 | 13 | #include 14 | #include 15 | #include 16 | #include "../Utils/Utils.h" 17 | #include "rtc_base/logging.h" 18 | 19 | namespace webrtc { 20 | 21 | class H264MediaSink; 22 | 23 | H264StreamSink::H264StreamSink() 24 | : dwIdentifier_((DWORD)-1) 25 | , state_(State_TypeNotSet) 26 | , isShutdown_(false) 27 | , workQueueId_(0) 28 | , workQueueCB_(this, &H264StreamSink::OnDispatchWorkItem) { 29 | } 30 | 31 | H264StreamSink::~H264StreamSink() { 32 | OutputDebugString(L"H264StreamSink::~H264StreamSink()\r\n"); 33 | } 34 | 35 | HRESULT H264StreamSink::RuntimeClassInitialize( 36 | DWORD dwIdentifier, H264MediaSink *pParent) { 37 | HRESULT hr = S_OK; 38 | 39 | hr = MFCreateEventQueue(&spEventQueue_); 40 | 41 | // Allocate a new work queue for async operations. 42 | if (SUCCEEDED(hr)) { 43 | hr = MFAllocateSerialWorkQueue(MFASYNC_CALLBACK_QUEUE_STANDARD, 44 | &workQueueId_); 45 | } 46 | 47 | if (SUCCEEDED(hr)) { 48 | spSink_ = reinterpret_cast(pParent); 49 | dwIdentifier_ = dwIdentifier; 50 | } 51 | 52 | return hr; 53 | } 54 | 55 | IFACEMETHODIMP H264StreamSink::BeginGetEvent( 56 | IMFAsyncCallback *pCallback, IUnknown *punkState) { 57 | HRESULT hr = S_OK; 58 | 59 | AutoLock lock(critSec_); 60 | 61 | hr = CheckShutdown(); 62 | 63 | if (SUCCEEDED(hr)) { 64 | hr = spEventQueue_->BeginGetEvent(pCallback, punkState); 65 | } 66 | 67 | return hr; 68 | } 69 | 70 | IFACEMETHODIMP H264StreamSink::EndGetEvent( 71 | IMFAsyncResult *pResult, IMFMediaEvent **ppEvent) { 72 | HRESULT hr = S_OK; 73 | 74 | AutoLock lock(critSec_); 75 | 76 | hr = CheckShutdown(); 77 | 78 | if (SUCCEEDED(hr)) { 79 | hr = spEventQueue_->EndGetEvent(pResult, ppEvent); 80 | } 81 | 82 | return hr; 83 | } 84 | 85 | IFACEMETHODIMP H264StreamSink::GetEvent( 86 | DWORD dwFlags, IMFMediaEvent **ppEvent) { 87 | // NOTE: 88 | // GetEvent can block indefinitely, so we don't hold the lock. 89 | // This requires some juggling with the event queue pointer. 90 | 91 | HRESULT hr = S_OK; 92 | 93 | Microsoft::WRL::ComPtr spQueue; 94 | { 95 | AutoLock lock(critSec_); 96 | 97 | hr = CheckShutdown(); 98 | 99 | if (SUCCEEDED(hr)) { 100 | spQueue = spEventQueue_; 101 | } 102 | } 103 | 104 | if (SUCCEEDED(hr)) { 105 | hr = spQueue->GetEvent(dwFlags, ppEvent); 106 | } 107 | 108 | return hr; 109 | } 110 | 111 | IFACEMETHODIMP H264StreamSink::QueueEvent( 112 | MediaEventType met, REFGUID guidExtendedType, 113 | HRESULT hrStatus, PROPVARIANT const *pvValue) { 114 | HRESULT hr = S_OK; 115 | 116 | AutoLock lock(critSec_); 117 | 118 | hr = CheckShutdown(); 119 | 120 | if (SUCCEEDED(hr)) { 121 | hr = spEventQueue_->QueueEventParamVar(met, guidExtendedType, 122 | hrStatus, pvValue); 123 | } 124 | 125 | return hr; 126 | } 127 | 128 | /// IMFStreamSink methods 129 | IFACEMETHODIMP H264StreamSink::GetMediaSink(IMFMediaSink **ppMediaSink) { 130 | if (ppMediaSink == nullptr) { 131 | return E_INVALIDARG; 132 | } 133 | 134 | AutoLock lock(critSec_); 135 | 136 | HRESULT hr = CheckShutdown(); 137 | 138 | if (SUCCEEDED(hr)) { 139 | *ppMediaSink = spSink_.Get(); 140 | (*ppMediaSink)->AddRef(); 141 | } 142 | 143 | return hr; 144 | } 145 | 146 | IFACEMETHODIMP H264StreamSink::GetIdentifier(DWORD *pdwIdentifier) { 147 | if (pdwIdentifier == nullptr) { 148 | return E_INVALIDARG; 149 | } 150 | 151 | AutoLock lock(critSec_); 152 | 153 | HRESULT hr = CheckShutdown(); 154 | 155 | if (SUCCEEDED(hr)) { 156 | *pdwIdentifier = dwIdentifier_; 157 | } 158 | 159 | return hr; 160 | } 161 | 162 | IFACEMETHODIMP H264StreamSink::GetMediaTypeHandler( 163 | IMFMediaTypeHandler **ppHandler) { 164 | if (ppHandler == nullptr) { 165 | return E_INVALIDARG; 166 | } 167 | 168 | AutoLock lock(critSec_); 169 | 170 | HRESULT hr = CheckShutdown(); 171 | 172 | // This stream object acts as its own type handler, so we QI ourselves. 173 | if (SUCCEEDED(hr)) { 174 | hr = QueryInterface(IID_IMFMediaTypeHandler, (void**)ppHandler); 175 | } 176 | 177 | return hr; 178 | } 179 | 180 | IFACEMETHODIMP H264StreamSink::ProcessSample(IMFSample *pSample) { 181 | if (pSample == nullptr) { 182 | return E_INVALIDARG; 183 | } 184 | 185 | HRESULT hr = S_OK; 186 | 187 | AutoLock lock(critSec_); 188 | 189 | hr = CheckShutdown(); 190 | 191 | if (SUCCEEDED(hr)) { 192 | hr = ValidateOperation(OpProcessSample); 193 | } 194 | 195 | if (SUCCEEDED(hr)) { 196 | sampleQueue_.push_back(pSample); 197 | 198 | hr = QueueAsyncOperation(OpProcessSample); 199 | } 200 | 201 | return hr; 202 | } 203 | 204 | IFACEMETHODIMP H264StreamSink::PlaceMarker( 205 | MFSTREAMSINK_MARKER_TYPE eMarkerType, 206 | const PROPVARIANT *pvarMarkerValue, 207 | const PROPVARIANT *pvarContextValue) { 208 | AutoLock lock(critSec_); 209 | HRESULT hr = S_OK; 210 | hr = CheckShutdown(); 211 | if (SUCCEEDED(hr)) { 212 | hr = QueueAsyncOperation(OpPlaceMarker, pvarContextValue); 213 | } 214 | return hr; 215 | } 216 | 217 | IFACEMETHODIMP H264StreamSink::Flush() { 218 | AutoLock lock(critSec_); 219 | HRESULT hr = CheckShutdown(); 220 | 221 | if (SUCCEEDED(hr)) { 222 | DropSamplesFromQueue(); 223 | } 224 | 225 | return hr; 226 | } 227 | 228 | /// IMFMediaTypeHandler methods 229 | 230 | IFACEMETHODIMP H264StreamSink::IsMediaTypeSupported( 231 | /* [in] */ IMFMediaType *pMediaType, 232 | /* [out] */ IMFMediaType **ppMediaType) { 233 | if (pMediaType == nullptr) { 234 | return E_INVALIDARG; 235 | } 236 | 237 | AutoLock lock(critSec_); 238 | 239 | GUID majorType = GUID_NULL; 240 | 241 | HRESULT hr = CheckShutdown(); 242 | 243 | if (SUCCEEDED(hr)) { 244 | hr = pMediaType->GetGUID(MF_MT_MAJOR_TYPE, &majorType); 245 | } 246 | 247 | if (SUCCEEDED(hr)) { 248 | if (majorType != MFMediaType_Video && majorType != MFMediaType_Audio) { 249 | hr = MF_E_INVALIDTYPE; 250 | } 251 | } 252 | 253 | // Don't support changing subtype. 254 | if (SUCCEEDED(hr) && spCurrentType_ != nullptr) { 255 | GUID guiNewSubtype; 256 | if (FAILED(pMediaType->GetGUID(MF_MT_SUBTYPE, &guiNewSubtype)) || 257 | guiNewSubtype != guidCurrentSubtype_) { 258 | hr = MF_E_INVALIDTYPE; 259 | } 260 | } 261 | 262 | if (ppMediaType) { 263 | *ppMediaType = nullptr; 264 | } 265 | 266 | return hr; 267 | } 268 | 269 | IFACEMETHODIMP H264StreamSink::GetMediaTypeCount(DWORD *pdwTypeCount) { 270 | if (pdwTypeCount == nullptr) { 271 | return E_INVALIDARG; 272 | } 273 | 274 | AutoLock lock(critSec_); 275 | 276 | HRESULT hr = CheckShutdown(); 277 | 278 | if (SUCCEEDED(hr)) { 279 | *pdwTypeCount = 1; 280 | } 281 | 282 | return hr; 283 | } 284 | 285 | IFACEMETHODIMP H264StreamSink::GetMediaTypeByIndex( 286 | /* [in] */ DWORD dwIndex, 287 | /* [out] */ IMFMediaType **ppType) { 288 | if (ppType == nullptr) { 289 | return E_INVALIDARG; 290 | } 291 | 292 | AutoLock lock(critSec_); 293 | 294 | HRESULT hr = CheckShutdown(); 295 | 296 | if (dwIndex > 0) { 297 | hr = MF_E_NO_MORE_TYPES; 298 | } else { 299 | *ppType = spCurrentType_.Get(); 300 | if (*ppType != nullptr) { 301 | (*ppType)->AddRef(); 302 | } 303 | } 304 | 305 | return hr; 306 | } 307 | 308 | IFACEMETHODIMP H264StreamSink::SetCurrentMediaType( 309 | IMFMediaType *pMediaType) { 310 | HRESULT hr = S_OK; 311 | if (pMediaType == nullptr) { 312 | hr = E_INVALIDARG; 313 | } 314 | 315 | AutoLock lock(critSec_); 316 | 317 | ON_SUCCEEDED(CheckShutdown()); 318 | 319 | ON_SUCCEEDED(ValidateOperation(OpSetMediaType)); 320 | 321 | // We set media type already 322 | if (state_ >= State_Ready) { 323 | ON_SUCCEEDED(IsMediaTypeSupported(pMediaType, nullptr)); 324 | } 325 | 326 | ON_SUCCEEDED(MFCreateMediaType(spCurrentType_.ReleaseAndGetAddressOf())); 327 | ON_SUCCEEDED(pMediaType->CopyAllItems(spCurrentType_.Get())); 328 | ON_SUCCEEDED(spCurrentType_->GetGUID(MF_MT_SUBTYPE, &guidCurrentSubtype_)); 329 | if (SUCCEEDED(hr)) { 330 | if (state_ < State_Ready) { 331 | state_ = State_Ready; 332 | } else if (state_ > State_Ready) { 333 | if (SUCCEEDED(hr)) { 334 | ProcessFormatChange(); 335 | } 336 | } 337 | } 338 | return hr; 339 | } 340 | 341 | IFACEMETHODIMP H264StreamSink::GetCurrentMediaType( 342 | IMFMediaType **ppMediaType) { 343 | if (ppMediaType == nullptr) { 344 | return E_INVALIDARG; 345 | } 346 | 347 | AutoLock lock(critSec_); 348 | 349 | HRESULT hr = CheckShutdown(); 350 | 351 | if (SUCCEEDED(hr)) { 352 | if (spCurrentType_ == nullptr) { 353 | hr = MF_E_NOT_INITIALIZED; 354 | } 355 | } 356 | 357 | if (SUCCEEDED(hr)) { 358 | *ppMediaType = spCurrentType_.Get(); 359 | (*ppMediaType)->AddRef(); 360 | } 361 | 362 | return hr; 363 | } 364 | 365 | IFACEMETHODIMP H264StreamSink::GetMajorType(GUID *pguidMajorType) { 366 | if (pguidMajorType == nullptr) { 367 | return E_INVALIDARG; 368 | } 369 | 370 | if (!spCurrentType_) { 371 | return MF_E_NOT_INITIALIZED; 372 | } 373 | 374 | *pguidMajorType = MFMediaType_Video; 375 | 376 | return S_OK; 377 | } 378 | 379 | HRESULT H264StreamSink::Start(MFTIME start) { 380 | AutoLock lock(critSec_); 381 | 382 | HRESULT hr = S_OK; 383 | 384 | hr = ValidateOperation(OpStart); 385 | 386 | if (SUCCEEDED(hr)) { 387 | state_ = State_Started; 388 | hr = QueueAsyncOperation(OpStart); 389 | } 390 | 391 | return hr; 392 | } 393 | 394 | HRESULT H264StreamSink::Stop() { 395 | AutoLock lock(critSec_); 396 | 397 | HRESULT hr = S_OK; 398 | 399 | hr = ValidateOperation(OpStop); 400 | 401 | if (SUCCEEDED(hr)) { 402 | state_ = State_Stopped; 403 | hr = QueueAsyncOperation(OpStop); 404 | } 405 | 406 | return hr; 407 | } 408 | 409 | BOOL H264StreamSink::ValidStateMatrix 410 | [State::State_Count][StreamOperation::Op_Count] = { 411 | // States: Operations: 412 | // SetType Start Stop Sample 413 | /* NotSet */ {TRUE, FALSE, FALSE, FALSE}, 414 | /* Ready */ {TRUE, TRUE, TRUE, FALSE}, 415 | /* Start */ {TRUE, TRUE, TRUE, TRUE}, 416 | /* Stop */ {TRUE, TRUE, TRUE, FALSE} 417 | }; 418 | 419 | HRESULT H264StreamSink::ValidateOperation(StreamOperation op) { 420 | if (ValidStateMatrix[state_][op]) { 421 | return S_OK; 422 | } else if (state_ == State_TypeNotSet) { 423 | return MF_E_NOT_INITIALIZED; 424 | } else { 425 | return MF_E_INVALIDREQUEST; 426 | } 427 | } 428 | 429 | HRESULT H264StreamSink::Shutdown() { 430 | AutoLock lock(critSec_); 431 | 432 | if (!isShutdown_) { 433 | if (spEventQueue_) { 434 | spEventQueue_->Shutdown(); 435 | } 436 | 437 | MFUnlockWorkQueue(workQueueId_); 438 | 439 | sampleQueue_.clear(); 440 | 441 | spSink_.Reset(); 442 | spEventQueue_.Reset(); 443 | spCurrentType_.Reset(); 444 | 445 | encodingCallback_ = nullptr; 446 | 447 | isShutdown_ = true; 448 | } 449 | 450 | return S_OK; 451 | } 452 | 453 | HRESULT H264StreamSink::QueueAsyncOperation(StreamOperation op, const PROPVARIANT* propVariant) { 454 | HRESULT hr = S_OK; 455 | Microsoft::WRL::ComPtr spOp; 456 | hr = Microsoft::WRL::MakeAndInitialize(&spOp, op, propVariant); 457 | 458 | if (SUCCEEDED(hr)) { 459 | hr = MFPutWorkItem2(workQueueId_, 0, &workQueueCB_, spOp.Get()); 460 | } 461 | 462 | return hr; 463 | } 464 | 465 | HRESULT H264StreamSink::OnDispatchWorkItem(IMFAsyncResult *pAsyncResult) { 466 | HRESULT hr = S_OK; 467 | auto sample = ComPtr(); 468 | 469 | // Scope the AutoLock 470 | { 471 | AutoLock lock(critSec_); 472 | Microsoft::WRL::ComPtr spState; 473 | 474 | hr = pAsyncResult->GetState(&spState); 475 | 476 | if (SUCCEEDED(hr)) { 477 | ComPtr pOp; 478 | spState.As(&pOp); 479 | StreamOperation op; 480 | pOp->GetOp(&op); 481 | 482 | switch (op) { 483 | case OpStart: 484 | hr = QueueEvent(MEStreamSinkStarted, GUID_NULL, S_OK, nullptr); 485 | 486 | if (SUCCEEDED(hr)) { 487 | sample = ProcessSamplesFromQueue(); 488 | if (sample == nullptr) { 489 | hr = QueueEvent(MEStreamSinkRequestSample, 490 | GUID_NULL, S_OK, nullptr); 491 | } 492 | } 493 | break; 494 | 495 | case OpStop: 496 | DropSamplesFromQueue(); 497 | 498 | hr = QueueEvent(MEStreamSinkStopped, GUID_NULL, S_OK, nullptr); 499 | break; 500 | 501 | case OpProcessSample: 502 | hr = QueueEvent(MEStreamSinkRequestSample, GUID_NULL, S_OK, nullptr); 503 | if (SUCCEEDED(hr)) { 504 | sample = ProcessSamplesFromQueue(); 505 | } 506 | break; 507 | 508 | case OpPlaceMarker: { 509 | PROPVARIANT propVariant; 510 | PropVariantInit(&propVariant); 511 | if (SUCCEEDED(pOp->GetPropVariant(&propVariant))) { 512 | hr = QueueEvent(MEStreamSinkMarker, GUID_NULL, S_OK, &propVariant); 513 | } 514 | break; 515 | } 516 | 517 | case OpSetMediaType: 518 | hr = QueueEvent(MEStreamSinkFormatChanged, GUID_NULL, S_OK, nullptr); 519 | break; 520 | 521 | case Op_Count: break; 522 | } 523 | } 524 | } 525 | 526 | if (SUCCEEDED(hr) && sample != nullptr) { 527 | AutoLock lock(cbCritSec_); 528 | if (encodingCallback_ != nullptr) { 529 | encodingCallback_->OnH264Encoded(sample); 530 | } 531 | } 532 | 533 | return hr; 534 | } 535 | 536 | bool H264StreamSink::DropSamplesFromQueue() { 537 | sampleQueue_.clear(); 538 | 539 | return true; 540 | } 541 | 542 | ComPtr H264StreamSink::ProcessSamplesFromQueue() { 543 | Microsoft::WRL::ComPtr spunkSample; 544 | auto sample = ComPtr(); 545 | 546 | if (!sampleQueue_.empty()) { 547 | spunkSample = sampleQueue_.front(); 548 | sampleQueue_.pop_front(); 549 | spunkSample.As(&sample); 550 | } 551 | 552 | return sample; 553 | } 554 | 555 | void H264StreamSink::ProcessFormatChange() { 556 | HRESULT hr = S_OK; 557 | 558 | hr = QueueAsyncOperation(OpSetMediaType); 559 | } 560 | 561 | void H264StreamSink::HandleError(HRESULT hr) { 562 | if (!isShutdown_) { 563 | QueueEvent(MEError, GUID_NULL, hr, nullptr); 564 | } 565 | } 566 | 567 | 568 | HRESULT AsyncStreamSinkOperation::RuntimeClassInitialize( 569 | StreamOperation op, const PROPVARIANT* propVariant) { 570 | HRESULT hr = S_OK; 571 | m_op = op; 572 | if (propVariant != nullptr) { 573 | PropVariantCopy(&m_propVariant, propVariant); 574 | } 575 | else { 576 | PropVariantInit(&m_propVariant); 577 | } 578 | return hr; 579 | } 580 | 581 | AsyncStreamSinkOperation::~AsyncStreamSinkOperation() { 582 | } 583 | 584 | HRESULT AsyncStreamSinkOperation::GetOp(StreamOperation* op) { 585 | if (op == nullptr) 586 | return E_INVALIDARG; 587 | *op = m_op; 588 | return S_OK; 589 | } 590 | 591 | HRESULT AsyncStreamSinkOperation::GetPropVariant(PROPVARIANT* propVariant) { 592 | if (propVariant == nullptr) 593 | return E_INVALIDARG; 594 | PropVariantCopy(propVariant, &m_propVariant); 595 | return S_OK; 596 | } 597 | 598 | HRESULT H264StreamSink::RegisterEncodingCallback( 599 | IH264EncodingCallback *callback) { 600 | AutoLock lock(cbCritSec_); 601 | encodingCallback_ = callback; 602 | return S_OK; 603 | } 604 | 605 | } // namespace webrtc 606 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/H264Encoder/H264StreamSink.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef THIRD_PARTY_H264_WINUWP_H264ENCODER_H264STREAMSINK_H_ 12 | #define THIRD_PARTY_H264_WINUWP_H264ENCODER_H264STREAMSINK_H_ 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | #include "../Utils/Async.h" 19 | #include "../Utils/CritSec.h" 20 | #include "IH264EncodingCallback.h" 21 | 22 | using Microsoft::WRL::ComPtr; 23 | 24 | namespace webrtc { 25 | 26 | enum State { 27 | State_TypeNotSet = 0, // No media type is set 28 | State_Ready, // Media type is set, Start has never been called. 29 | State_Started, 30 | State_Stopped, 31 | State_Count // Number of states 32 | }; 33 | 34 | enum StreamOperation { 35 | OpSetMediaType = 0, 36 | OpStart, 37 | OpStop, 38 | OpProcessSample, 39 | OpPlaceMarker, 40 | Op_Count 41 | }; 42 | 43 | class H264MediaSink; 44 | 45 | class DECLSPEC_UUID("4b35435f-44ae-44a0-9ba0-b84f9f4a9c19") 46 | IAsyncStreamSinkOperation : public IUnknown { 47 | public: 48 | STDMETHOD(GetOp)(StreamOperation* op) PURE; 49 | STDMETHOD(GetPropVariant)(PROPVARIANT* propVariant) PURE; 50 | }; 51 | 52 | class DECLSPEC_UUID("0c89c2e1-79bb-4ad7-a34f-cc006225f8e1") 53 | AsyncStreamSinkOperation 54 | : public Microsoft::WRL::RuntimeClass< 55 | Microsoft::WRL::RuntimeClassFlags< 56 | Microsoft::WRL::RuntimeClassType::WinRtClassicComMix>, 57 | IAsyncStreamSinkOperation> { 58 | InspectableClass(L"AsyncStreamSinkOperation", BaseTrust) 59 | public: 60 | HRESULT RuntimeClassInitialize(StreamOperation op, const PROPVARIANT* propVariant); 61 | virtual ~AsyncStreamSinkOperation(); 62 | 63 | IFACEMETHOD(GetOp) (StreamOperation* op); 64 | IFACEMETHOD(GetPropVariant)(PROPVARIANT* propVariant); 65 | 66 | private: 67 | PROPVARIANT m_propVariant; 68 | StreamOperation m_op; 69 | }; 70 | 71 | class H264StreamSink : public Microsoft::WRL::RuntimeClass< 72 | Microsoft::WRL::RuntimeClassFlags< 73 | Microsoft::WRL::RuntimeClassType::WinRtClassicComMix>, 74 | IMFStreamSink, 75 | IMFMediaEventGenerator, 76 | IMFMediaTypeHandler> { 77 | InspectableClass(L"H264StreamSink", BaseTrust) 78 | 79 | public: 80 | HRESULT RuntimeClassInitialize(DWORD dwIdentifier, H264MediaSink *pParent); 81 | 82 | // IMFMediaEventGenerator 83 | IFACEMETHOD(BeginGetEvent)(IMFAsyncCallback *pCallback, IUnknown *punkState); 84 | IFACEMETHOD(EndGetEvent) (IMFAsyncResult *pResult, IMFMediaEvent **ppEvent); 85 | IFACEMETHOD(GetEvent) (DWORD dwFlags, IMFMediaEvent **ppEvent); 86 | IFACEMETHOD(QueueEvent) (MediaEventType met, REFGUID guidExtendedType, 87 | HRESULT hrStatus, PROPVARIANT const *pvValue); 88 | 89 | // IMFStreamSink 90 | IFACEMETHOD(GetMediaSink) (IMFMediaSink **ppMediaSink); 91 | IFACEMETHOD(GetIdentifier) (DWORD *pdwIdentifier); 92 | IFACEMETHOD(GetMediaTypeHandler) (IMFMediaTypeHandler **ppHandler); 93 | IFACEMETHOD(ProcessSample) (IMFSample *pSample); 94 | 95 | IFACEMETHOD(PlaceMarker) ( 96 | /* [in] */ MFSTREAMSINK_MARKER_TYPE eMarkerType, 97 | /* [in] */ PROPVARIANT const *pvarMarkerValue, 98 | /* [in] */ PROPVARIANT const *pvarContextValue); 99 | 100 | IFACEMETHOD(Flush)(); 101 | 102 | // IMFMediaTypeHandler 103 | IFACEMETHOD(IsMediaTypeSupported) (IMFMediaType *pMediaType, 104 | IMFMediaType **ppMediaType); 105 | IFACEMETHOD(GetMediaTypeCount) (DWORD *pdwTypeCount); 106 | IFACEMETHOD(GetMediaTypeByIndex) (DWORD dwIndex, IMFMediaType **ppType); 107 | IFACEMETHOD(SetCurrentMediaType) (IMFMediaType *pMediaType); 108 | IFACEMETHOD(GetCurrentMediaType) (IMFMediaType **ppMediaType); 109 | IFACEMETHOD(GetMajorType) (GUID *pguidMajorType); 110 | 111 | // ValidStateMatrix: Defines a look-up table that says which operations 112 | // are valid from which states. 113 | static BOOL ValidStateMatrix[State_Count][Op_Count]; 114 | 115 | HRESULT RegisterEncodingCallback(IH264EncodingCallback *callback); 116 | 117 | H264StreamSink(); 118 | virtual ~H264StreamSink(); 119 | 120 | HRESULT CheckShutdown() const { 121 | if (isShutdown_) { 122 | return MF_E_SHUTDOWN; 123 | } else { 124 | return S_OK; 125 | } 126 | } 127 | 128 | 129 | HRESULT Start(MFTIME start); 130 | HRESULT Stop(); 131 | HRESULT Shutdown(); 132 | 133 | private: 134 | HRESULT ValidateOperation(StreamOperation op); 135 | 136 | HRESULT QueueAsyncOperation(StreamOperation op, const PROPVARIANT* propVariant = nullptr); 137 | 138 | HRESULT OnDispatchWorkItem(IMFAsyncResult *pAsyncResult); 139 | 140 | bool DropSamplesFromQueue(); 141 | ComPtr ProcessSamplesFromQueue(); 142 | void ProcessFormatChange(); 143 | 144 | void HandleError(HRESULT hr); 145 | 146 | private: 147 | CritSec critSec_; 148 | CritSec cbCritSec_; 149 | 150 | DWORD dwIdentifier_; 151 | State state_; 152 | bool isShutdown_; 153 | GUID guidCurrentSubtype_; 154 | 155 | DWORD workQueueId_; 156 | 157 | ComPtr spSink_; 158 | ComPtr spEventQueue_; 159 | ComPtr spCurrentType_; 160 | 161 | std::list> sampleQueue_; 162 | 163 | AsyncCallback workQueueCB_; 164 | 165 | IH264EncodingCallback* encodingCallback_; 166 | }; 167 | 168 | } // namespace webrtc 169 | 170 | #endif // THIRD_PARTY_H264_WINUWP_H264ENCODER_H264STREAMSINK_H_ 171 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/H264Encoder/IH264EncodingCallback.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef THIRD_PARTY_H264_WINUWP_H264ENCODER_IH264ENCODINGCALLBACK_H_ 12 | #define THIRD_PARTY_H264_WINUWP_H264ENCODER_IH264ENCODINGCALLBACK_H_ 13 | 14 | #include 15 | 16 | 17 | namespace webrtc { 18 | 19 | interface IH264EncodingCallback { 20 | virtual void OnH264Encoded(Microsoft::WRL::ComPtr sample) = 0; 21 | }; 22 | 23 | } // namespace webrtc 24 | 25 | #endif // THIRD_PARTY_H264_WINUWP_H264ENCODER_IH264ENCODINGCALLBACK_H_ 26 | 27 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/Utils/Async.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef THIRD_PARTY_H264_WINUWP_UTILS_ASYNC_H_ 12 | #define THIRD_PARTY_H264_WINUWP_UTILS_ASYNC_H_ 13 | 14 | #include 15 | 16 | template 17 | class AsyncCallback : public IMFAsyncCallback { 18 | public: 19 | typedef HRESULT(T::*InvokeFn)(IMFAsyncResult *pAsyncResult); 20 | 21 | AsyncCallback(T *pParent, InvokeFn fn) : 22 | m_pParent(pParent), 23 | m_pInvokeFn(fn) { 24 | } 25 | 26 | // IUnknown 27 | STDMETHODIMP_(ULONG) AddRef() { 28 | // Delegate to parent class. 29 | return m_pParent->AddRef(); 30 | } 31 | STDMETHODIMP_(ULONG) Release() { 32 | // Delegate to parent class. 33 | return m_pParent->Release(); 34 | } 35 | STDMETHODIMP QueryInterface(REFIID iid, void** ppv) { 36 | if (!ppv) { 37 | return E_POINTER; 38 | } 39 | if (iid == __uuidof(IUnknown)) { 40 | *ppv = static_cast(static_cast(this)); 41 | } else if (iid == __uuidof(IMFAsyncCallback)) { 42 | *ppv = static_cast(this); 43 | } else { 44 | *ppv = NULL; 45 | return E_NOINTERFACE; 46 | } 47 | AddRef(); 48 | return S_OK; 49 | } 50 | 51 | 52 | // IMFAsyncCallback methods 53 | STDMETHODIMP GetParameters(DWORD*, DWORD*) { 54 | // Implementation of this method is optional. 55 | return E_NOTIMPL; 56 | } 57 | 58 | STDMETHODIMP Invoke(IMFAsyncResult* pAsyncResult) { 59 | if (m_pParent != nullptr && m_pInvokeFn != nullptr) { 60 | return (m_pParent->*m_pInvokeFn)(pAsyncResult); 61 | } 62 | return E_POINTER; 63 | } 64 | 65 | T *m_pParent; 66 | InvokeFn m_pInvokeFn; 67 | }; 68 | 69 | #endif // THIRD_PARTY_H264_WINUWP_UTILS_ASYNC_H_ 70 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/Utils/CritSec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef THIRD_PARTY_H264_WINUWP_UTILS_CRITSEC_H_ 12 | #define THIRD_PARTY_H264_WINUWP_UTILS_CRITSEC_H_ 13 | 14 | #include 15 | 16 | class CritSec { 17 | public: 18 | CRITICAL_SECTION m_criticalSection; 19 | public: 20 | CritSec() { 21 | InitializeCriticalSectionEx(&m_criticalSection, 100, 0); 22 | } 23 | 24 | ~CritSec() { 25 | DeleteCriticalSection(&m_criticalSection); 26 | } 27 | 28 | _Acquires_lock_(m_criticalSection) 29 | void Lock() { 30 | EnterCriticalSection(&m_criticalSection); 31 | } 32 | 33 | _Releases_lock_(m_criticalSection) 34 | void Unlock() { 35 | LeaveCriticalSection(&m_criticalSection); 36 | } 37 | }; 38 | 39 | ////////////////////////////////////////////////////////////////////////// 40 | // AutoLock 41 | // Description: Provides automatic locking and unlocking of a 42 | // of a critical section. 43 | // 44 | // Note: The AutoLock object must go out of scope before the CritSec. 45 | ////////////////////////////////////////////////////////////////////////// 46 | 47 | class AutoLock { 48 | private: 49 | CritSec *m_pCriticalSection; 50 | public: 51 | _Acquires_lock_(m_pCriticalSection) 52 | explicit AutoLock(CritSec& crit) { 53 | m_pCriticalSection = &crit; 54 | m_pCriticalSection->Lock(); 55 | } 56 | 57 | _Releases_lock_(m_pCriticalSection) 58 | ~AutoLock() { 59 | m_pCriticalSection->Unlock(); 60 | } 61 | }; 62 | 63 | #endif // THIRD_PARTY_H264_WINUWP_UTILS_CRITSEC_H_ 64 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/Utils/OpQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | /* 12 | This header file defines an object to help queue and serialize 13 | asynchronous operations. 14 | 15 | Background: 16 | 17 | To perform an operation asynchronously in Media Foundation, an object 18 | does one of the following: 19 | 20 | 1. Calls MFPutWorkItem(Ex), using either a standard work queue 21 | identifier or a caller-allocated work queue. The work-queue 22 | thread invokes the object's callback. 23 | 24 | 2. Creates an async result object (IMFAsyncResult) and calls 25 | MFInvokeCallback to invoke the object's callback. 26 | 27 | Ultimately, either of these cause the object's callback to be invoked 28 | from a work-queue thread. The object can then complete the operation 29 | inside the callback. 30 | 31 | However, the Media Foundation platform may dispatch async callbacks in 32 | parallel on several threads. Putting an item on a work queue does NOT 33 | guarantee that one operation will complete before the next one starts, 34 | or even that work items will be dispatched in the same order they were 35 | called. 36 | 37 | To serialize async operations that should not overlap, an object should 38 | use a queue. While one operation is pending, subsequent operations are 39 | put on the queue, and only dispatched after the previous operation is 40 | complete. 41 | 42 | The granularity of a single "operation" depends on the requirements of 43 | that particular object. A single operation might involve several 44 | asynchronous calls before the object dispatches the next operation on 45 | the queue. 46 | */ 47 | 48 | #ifndef THIRD_PARTY_H264_WINUWP_UTILS_OPQUEUE_H_ 49 | #define THIRD_PARTY_H264_WINUWP_UTILS_OPQUEUE_H_ 50 | 51 | 52 | //------------------------------------------------------------------- 53 | // OpQueue class template 54 | // 55 | // Base class for an async operation queue. 56 | // 57 | // TOperation: The class used to describe operations. This class must 58 | // implement IUnknown. 59 | // 60 | // The OpQueue class is an abstract class. The derived class must 61 | // implement the following pure-virtual methods: 62 | // 63 | // - IUnknown methods (AddRef, Release, QI) 64 | // 65 | // - DispatchOperation: 66 | // 67 | // Performs the asynchronous operation specified by pOp. 68 | // 69 | // At the end of each operation, the derived class must call 70 | // ProcessQueue to process the next operation in the queue. 71 | // 72 | // NOTE: An operation is not required to complete inside the 73 | // DispatchOperation method. A single operation might consist 74 | // of several asynchronous method calls. 75 | // 76 | // - ValidateOperation: 77 | // 78 | // Checks whether the object can perform the operation specified 79 | // by pOp at this time. 80 | // 81 | // If the object cannot perform the operation now (e.g., because 82 | // another operation is still in progress) the method should 83 | // return MF_E_NOTACCEPTING. 84 | // 85 | //------------------------------------------------------------------- 86 | 87 | #include 88 | #include 89 | 90 | #include "Async.h" 91 | #include "Utils/CritSec.h" 92 | 93 | using Microsoft::WRL::ComPtr; 94 | 95 | template 96 | class OpQueue { 97 | public: 98 | typedef std::list> OpList; 99 | 100 | HRESULT QueueOperation(ComPtr pOp); 101 | 102 | protected: 103 | HRESULT ProcessQueue(); 104 | HRESULT ProcessQueueAsync(IMFAsyncResult *pResult); 105 | 106 | virtual HRESULT DispatchOperation(ComPtr pOp) = 0; 107 | virtual HRESULT ValidateOperation(ComPtr pOp) = 0; 108 | 109 | OpQueue() 110 | : m_OnProcessQueue(static_cast(this), 111 | &OpQueue::ProcessQueueAsync) { 112 | } 113 | 114 | virtual ~OpQueue() { 115 | } 116 | 117 | protected: 118 | OpList m_OpQueue; // Queue of operations. 119 | CritSec m_critsec; // Protects the queue state. 120 | AsyncCallback m_OnProcessQueue; // ProcessQueueAsync callback. 121 | }; 122 | 123 | 124 | 125 | //------------------------------------------------------------------- 126 | // Place an operation on the queue. 127 | // Public method. 128 | //------------------------------------------------------------------- 129 | 130 | template 131 | HRESULT OpQueue::QueueOperation(ComPtr pOp) { 132 | HRESULT hr = S_OK; 133 | 134 | AutoLock lock(m_critsec); 135 | 136 | m_OpQueue.push_back(pOp); 137 | hr = ProcessQueue(); 138 | 139 | return hr; 140 | } 141 | 142 | 143 | //------------------------------------------------------------------- 144 | // Process the next operation on the queue. 145 | // Protected method. 146 | // 147 | // Note: This method dispatches the operation to a work queue. 148 | //------------------------------------------------------------------- 149 | 150 | template 151 | HRESULT OpQueue::ProcessQueue() { 152 | HRESULT hr = S_OK; 153 | if (m_OpQueue.GetCount() > 0) { 154 | hr = MFPutWorkItem2( 155 | MFASYNC_CALLBACK_QUEUE_STANDARD, // Use the standard work queue. 156 | 0, // Default priority 157 | &m_OnProcessQueue, // Callback method. 158 | nullptr); // State object. 159 | } 160 | return hr; 161 | } 162 | 163 | 164 | //------------------------------------------------------------------- 165 | // Process the next operation on the queue. 166 | // Protected method. 167 | // 168 | // Note: This method is called from a work-queue thread. 169 | //------------------------------------------------------------------- 170 | 171 | template 172 | HRESULT OpQueue::ProcessQueueAsync(IMFAsyncResult *pResult) { 173 | HRESULT hr = S_OK; 174 | ComPtr pOp; 175 | 176 | AutoLock lock(m_critsec); 177 | 178 | if (m_OpQueue.GetCount() > 0) { 179 | pOp = m_OpQueue.front(); 180 | 181 | hr = ValidateOperation(pOp); 182 | if (SUCCEEDED(hr)) { 183 | hr = m_OpQueue.RemoveFront(nullptr); 184 | } 185 | if (SUCCEEDED(hr)) { 186 | (void)DispatchOperation(pOp); 187 | } 188 | } 189 | 190 | return hr; 191 | } 192 | 193 | #endif // THIRD_PARTY_H264_WINUWP_UTILS_OPQUEUE_H_ 194 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/Utils/SampleAttributeQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef THIRD_PARTY_H264_WINUWP_UTILS_SAMPLEATTRIBUTEQUEUE_H_ 12 | #define THIRD_PARTY_H264_WINUWP_UTILS_SAMPLEATTRIBUTEQUEUE_H_ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include "rtc_base/criticalsection.h" 19 | 20 | // A sorted queue with certain properties which makes it 21 | // good for mapping attributes to frames and samples. 22 | // The ids have to be in increasing order. 23 | template 24 | class SampleAttributeQueue { 25 | public: 26 | SampleAttributeQueue() 27 | { 28 | } 29 | ~SampleAttributeQueue() {} 30 | 31 | void push(uint64_t id, const T& t) { 32 | rtc::CritScope lock(&_crit); 33 | _attributes.push(std::make_pair(id, t)); 34 | } 35 | 36 | bool pop(uint64_t id, T& outT) { 37 | rtc::CritScope lock(&_crit); 38 | while (!_attributes.empty()) { 39 | auto entry = _attributes.front(); 40 | if (entry.first > id) { 41 | outT = entry.second; 42 | return true; 43 | } else if (entry.first == id) { 44 | outT = entry.second; 45 | _attributes.pop(); 46 | return true; 47 | } else { 48 | _attributes.pop(); 49 | } 50 | } 51 | return false; 52 | } 53 | 54 | void clear() { 55 | rtc::CritScope lock(&_crit); 56 | while (!_attributes.empty()) { 57 | _attributes.pop(); 58 | } 59 | } 60 | 61 | uint32_t size() { 62 | rtc::CritScope lock(&_crit); 63 | return static_cast(_attributes.size()); 64 | } 65 | 66 | private: 67 | rtc::CriticalSection _crit; 68 | std::queue> _attributes; 69 | }; 70 | 71 | #endif // THIRD_PARTY_H264_WINUWP_UTILS_SAMPLEATTRIBUTEQUEUE_H_ 72 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/Utils/Utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef THIRD_PARTY_H264_WINUWP_UTILS_UTILS_H_ 12 | #define THIRD_PARTY_H264_WINUWP_UTILS_UTILS_H_ 13 | 14 | //#define ON_SUCCEEDED(act) SUCCEEDED(hr) && SUCCEEDED(hr = act) 15 | #define ON_SUCCEEDED(act) if (SUCCEEDED(hr)) { hr = act; if (FAILED(hr)) { RTC_LOG(LS_WARNING) << "ERROR:" << #act; } } 16 | 17 | #endif // THIRD_PARTY_H264_WINUWP_UTILS_UTILS_H_ 18 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/native_handle_buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef THIRD_PARTY_H264_WINUWP_NATIVE_FRAME_H_ 12 | #define THIRD_PARTY_H264_WINUWP_NATIVE_FRAME_H_ 13 | 14 | #include "api/video/video_frame_buffer.h" 15 | #include "media/base/videocommon.h" 16 | 17 | namespace webrtc { 18 | 19 | class NativeHandleBuffer : public VideoFrameBuffer { 20 | public: 21 | NativeHandleBuffer(void* native_handle, int width, int height) 22 | : native_handle_(native_handle), 23 | width_(width), 24 | height_(height) { } 25 | 26 | Type type() const override { 27 | return Type::kNative; 28 | } 29 | 30 | int width() const override { 31 | return width_; 32 | } 33 | int height() const override { 34 | return height_; 35 | } 36 | 37 | void* native_handle() const { 38 | return native_handle_; 39 | } 40 | 41 | virtual cricket::FourCC fourCC() const = 0; 42 | 43 | protected: 44 | void* native_handle_; 45 | const int width_; 46 | const int height_; 47 | }; 48 | } // namespace webrtc 49 | 50 | #endif // THIRD_PARTY_H264_WINUWP_NATIVE_FRAME_H_ 51 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/winuwp_h264_factory.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include 12 | #include "third_party/winuwp_h264/winuwp_h264_factory.h" 13 | #include "third_party/winuwp_h264/H264Encoder/H264Encoder.h" 14 | #include "third_party/winuwp_h264/H264Decoder/H264Decoder.h" 15 | #include "media/engine/webrtcvideoencoderfactory.h" 16 | #include "media/engine/webrtcvideodecoderfactory.h" 17 | 18 | 19 | namespace webrtc { 20 | 21 | WinUWPH264EncoderFactory::WinUWPH264EncoderFactory() { 22 | codecList_ = 23 | std::vector { 24 | cricket::VideoCodec("H264") 25 | }; 26 | } 27 | 28 | webrtc::VideoEncoder* WinUWPH264EncoderFactory::CreateVideoEncoder( 29 | const cricket::VideoCodec& codec) { 30 | if (codec.name == "H264") { 31 | return new WinUWPH264EncoderImpl(); 32 | } else { 33 | return nullptr; 34 | } 35 | } 36 | 37 | const std::vector& 38 | WinUWPH264EncoderFactory::supported_codecs() const { 39 | return codecList_; 40 | } 41 | 42 | void WinUWPH264EncoderFactory::DestroyVideoEncoder( 43 | webrtc::VideoEncoder* encoder) { 44 | encoder->Release(); 45 | delete encoder; 46 | } 47 | 48 | 49 | webrtc::VideoDecoder* WinUWPH264DecoderFactory::CreateVideoDecoder( 50 | webrtc::VideoCodecType type) { 51 | if (type == kVideoCodecH264) { 52 | return new WinUWPH264DecoderImpl(); 53 | } else { 54 | return nullptr; 55 | } 56 | } 57 | 58 | void WinUWPH264DecoderFactory::DestroyVideoDecoder( 59 | webrtc::VideoDecoder* decoder) { 60 | decoder->Release(); 61 | delete decoder; 62 | } 63 | 64 | } // namespace webrtc 65 | 66 | -------------------------------------------------------------------------------- /third_party/winuwp_h264/winuwp_h264_factory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef THIRD_PARTY_H264_WINUWP_H264_WINUWP_FACTORY_H_ 12 | #define THIRD_PARTY_H264_WINUWP_H264_WINUWP_FACTORY_H_ 13 | 14 | #include 15 | #include "media/engine/webrtcvideoencoderfactory.h" 16 | #include "media/engine/webrtcvideodecoderfactory.h" 17 | #include "media/base/codec.h" 18 | 19 | namespace webrtc { 20 | 21 | class WinUWPH264EncoderFactory : public cricket::WebRtcVideoEncoderFactory { 22 | public: 23 | WinUWPH264EncoderFactory(); 24 | 25 | webrtc::VideoEncoder* CreateVideoEncoder(const cricket::VideoCodec& codec) 26 | override; 27 | 28 | const std::vector& supported_codecs() 29 | const override; 30 | 31 | void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) override; 32 | 33 | private: 34 | std::vector codecList_; 35 | }; 36 | 37 | class WinUWPH264DecoderFactory : public cricket::WebRtcVideoDecoderFactory { 38 | webrtc::VideoDecoder* CreateVideoDecoder(webrtc::VideoCodecType type) 39 | override; 40 | 41 | void DestroyVideoDecoder(webrtc::VideoDecoder* decoder) override; 42 | }; 43 | } // namespace webrtc 44 | 45 | #endif // THIRD_PARTY_H264_WINUWP_H264_WINUWP_FACTORY_H_ 46 | --------------------------------------------------------------------------------