Skip to content

Instantly share code, notes, and snippets.

@gus33000
Last active December 5, 2021 19:13
Show Gist options
  • Save gus33000/7a7f310528082d5b7ba555fed6379e03 to your computer and use it in GitHub Desktop.
Save gus33000/7a7f310528082d5b7ba555fed6379e03 to your computer and use it in GitHub Desktop.
How to build the WebRTC/WinRTC fork Unigram uses from available source. This is based on current source available as of 2021-12-05.

Given Unigram reliance on WebRTC (and more precisely WinRTC) and forked changes, that are not clearly documented, this guide will help you build WinRTC yourself with the right changes that Unigram needs in order to work.

Preliminary

In order to make some file replacements easy, feel free to download a copy of this gist.

image

Build Status for Unigram.WinRTC

Target Status
UWP x64
Win32 x64
UWP arm64
Win32 arm64
UWP x86
Win32 x86
UWP arm
Win32 arm

ARM32 Windows is not currently supported by the WebRTC source and would likely require more patches

Getting started

Install Latest vs_buildtools.exe for Visual Studio 2019 (Include UWP workload, and VC++ build tools for x64 x86 and arm64, as well as 18362 SDK and 22000 SDK)

Make sure you install it under C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview as the scripts depend on this specific path.

Run the following commands

cd c:
git clone https://github.com/FrayxRulez/winrtc.git winrtc

Replace the following files with attached copies:

  • c:\winrtc\.pipelines\restore-acquiring_code.cmd
  • c:\winrtc\.pipelines\restore-applying_patches.cmd
  • c:\winrtc\.pipelines\build.cmd
  • C:\winrtc\patches_for_WebRTC_org\m84\patchWebRTCM84.cmd

Run the following commands

c:\winrtc\.pipelines\restore-acquiring_code.cmd
c:\winrtc\.pipelines\restore-applying_patches.cmd

If you want to have ARM64 support

The original WinRTC repo had a patch for disabling neon due to it being broken and not buildable with MS compiler. Unfortunately WebRTC changed a lot since then and the patch doesn't apply, and is too little to fix the issue. Below are guidance on how to fix it yourself. (Ignore if you do not care about arm64)

See ARM64 File Changes

Building time!

Run c:\winrtc\.pipelines\build.cmd

Packaging time!

set CDP_PACKAGE_VERSION_NUMERIC=91.0.0
set CDP_BUILD_TAG=pre
.pipelines\package.cmd

You should get .nupkg files under C:\winrtc\NuSpecs :)

image

From 157530b8d95d6b0a9b12a8f61c44dfe1327cb351 Mon Sep 17 00:00:00 2001
From: Gustave Monce <gustave.monce@outlook.com>
Date: Sun, 5 Dec 2021 16:55:01 +0100
Subject: [PATCH] Disabling switch without case warning for aec3
---
modules/audio_processing/aec3/adaptive_fir_filter.cc | 9 +++++++++
modules/audio_processing/aec3/adaptive_fir_filter_erl.cc | 3 +++
modules/audio_processing/aec3/matched_filter.cc | 3 +++
modules/audio_processing/aec3/vector_math.h | 9 +++++++++
4 files changed, 24 insertions(+)
diff --git a/modules/audio_processing/aec3/adaptive_fir_filter.cc b/modules/audio_processing/aec3/adaptive_fir_filter.cc
index bf3a7809f4..167c5328b1 100644
--- a/modules/audio_processing/aec3/adaptive_fir_filter.cc
+++ b/modules/audio_processing/aec3/adaptive_fir_filter.cc
@@ -551,6 +551,8 @@ void AdaptiveFirFilter::UpdateSize() {
void AdaptiveFirFilter::Filter(const RenderBuffer& render_buffer,
FftData* S) const {
RTC_DCHECK(S);
+#pragma warning(push)
+#pragma warning(disable:4065)
switch (optimization_) {
#if defined(WEBRTC_ARCH_X86_FAMILY)
case Aec3Optimization::kSse2:
@@ -568,6 +570,7 @@ void AdaptiveFirFilter::Filter(const RenderBuffer& render_buffer,
default:
aec3::ApplyFilter(render_buffer, current_size_partitions_, H_, S);
}
+#pragma warning(pop)
}
void AdaptiveFirFilter::Adapt(const RenderBuffer& render_buffer,
@@ -595,6 +598,8 @@ void AdaptiveFirFilter::ComputeFrequencyResponse(
H2->resize(current_size_partitions_);
+#pragma warning(push)
+#pragma warning(disable:4065)
switch (optimization_) {
#if defined(WEBRTC_ARCH_X86_FAMILY)
case Aec3Optimization::kSse2:
@@ -612,6 +617,7 @@ void AdaptiveFirFilter::ComputeFrequencyResponse(
default:
aec3::ComputeFrequencyResponse(current_size_partitions_, H_, H2);
}
+#pragma warning(pop)
}
void AdaptiveFirFilter::AdaptAndUpdateSize(const RenderBuffer& render_buffer,
@@ -620,6 +626,8 @@ void AdaptiveFirFilter::AdaptAndUpdateSize(const RenderBuffer& render_buffer,
UpdateSize();
// Adapt the filter.
+#pragma warning(push)
+#pragma warning(disable:4065)
switch (optimization_) {
#if defined(WEBRTC_ARCH_X86_FAMILY)
case Aec3Optimization::kSse2:
@@ -640,6 +648,7 @@ void AdaptiveFirFilter::AdaptAndUpdateSize(const RenderBuffer& render_buffer,
default:
aec3::AdaptPartitions(render_buffer, G, current_size_partitions_, &H_);
}
+#pragma warning(pop)
}
// Constrains the partition of the frequency domain filter to be limited in
diff --git a/modules/audio_processing/aec3/adaptive_fir_filter_erl.cc b/modules/audio_processing/aec3/adaptive_fir_filter_erl.cc
index 45b8813979..d6ae61b2bf 100644
--- a/modules/audio_processing/aec3/adaptive_fir_filter_erl.cc
+++ b/modules/audio_processing/aec3/adaptive_fir_filter_erl.cc
@@ -80,6 +80,8 @@ void ComputeErl(const Aec3Optimization& optimization,
rtc::ArrayView<float> erl) {
RTC_DCHECK_EQ(kFftLengthBy2Plus1, erl.size());
// Update the frequency response and echo return loss for the filter.
+#pragma warning(push)
+#pragma warning(disable:4065)
switch (optimization) {
#if defined(WEBRTC_ARCH_X86_FAMILY)
case Aec3Optimization::kSse2:
@@ -97,6 +99,7 @@ void ComputeErl(const Aec3Optimization& optimization,
default:
aec3::ErlComputer(H2, erl);
}
+#pragma warning(pop)
}
} // namespace webrtc
diff --git a/modules/audio_processing/aec3/matched_filter.cc b/modules/audio_processing/aec3/matched_filter.cc
index 64b2d4e697..7f438cd9d8 100644
--- a/modules/audio_processing/aec3/matched_filter.cc
+++ b/modules/audio_processing/aec3/matched_filter.cc
@@ -357,6 +357,8 @@ void MatchedFilter::Update(const DownsampledRenderBuffer& render_buffer,
(render_buffer.read + alignment_shift + sub_block_size_ - 1) %
render_buffer.buffer.size();
+#pragma warning(push)
+#pragma warning(disable:4065)
switch (optimization_) {
#if defined(WEBRTC_ARCH_X86_FAMILY)
case Aec3Optimization::kSse2:
@@ -382,6 +384,7 @@ void MatchedFilter::Update(const DownsampledRenderBuffer& render_buffer,
render_buffer.buffer, y, filters_[n],
&filters_updated, &error_sum);
}
+#pragma warning(pop)
// Compute anchor for the matched filter error.
const float error_sum_anchor =
diff --git a/modules/audio_processing/aec3/vector_math.h b/modules/audio_processing/aec3/vector_math.h
index e4d1381ae1..a1caf27014 100644
--- a/modules/audio_processing/aec3/vector_math.h
+++ b/modules/audio_processing/aec3/vector_math.h
@@ -42,6 +42,8 @@ class VectorMath {
// Elementwise square root.
void SqrtAVX2(rtc::ArrayView<float> x);
void Sqrt(rtc::ArrayView<float> x) {
+#pragma warning(push)
+#pragma warning(disable:4065)
switch (optimization_) {
#if defined(WEBRTC_ARCH_X86_FAMILY)
case Aec3Optimization::kSse2: {
@@ -111,6 +113,7 @@ class VectorMath {
default:
std::for_each(x.begin(), x.end(), [](float& a) { a = sqrtf(a); });
}
+#pragma warning(pop)
}
// Elementwise vector multiplication z = x * y.
@@ -122,6 +125,8 @@ class VectorMath {
rtc::ArrayView<float> z) {
RTC_DCHECK_EQ(z.size(), x.size());
RTC_DCHECK_EQ(z.size(), y.size());
+#pragma warning(push)
+#pragma warning(disable:4065)
switch (optimization_) {
#if defined(WEBRTC_ARCH_X86_FAMILY)
case Aec3Optimization::kSse2: {
@@ -166,12 +171,15 @@ class VectorMath {
std::transform(x.begin(), x.end(), y.begin(), z.begin(),
std::multiplies<float>());
}
+#pragma warning(pop)
}
// Elementwise vector accumulation z += x.
void AccumulateAVX2(rtc::ArrayView<const float> x, rtc::ArrayView<float> z);
void Accumulate(rtc::ArrayView<const float> x, rtc::ArrayView<float> z) {
RTC_DCHECK_EQ(z.size(), x.size());
+#pragma warning(push)
+#pragma warning(disable:4065)
switch (optimization_) {
#if defined(WEBRTC_ARCH_X86_FAMILY)
case Aec3Optimization::kSse2: {
@@ -216,6 +224,7 @@ class VectorMath {
std::transform(x.begin(), x.end(), z.begin(), z.begin(),
std::plus<float>());
}
+#pragma warning(pop)
}
private:
--
2.33.0.windows.1

In C:\webrtc\src\third_party\boringssl\BUILD.gn

Locate

    } else if (current_cpu == "arm64") {
      if (is_linux || is_chromeos || is_android) {
        sources += crypto_sources_linux_aarch64
      } else if (is_apple) {
        # TODO(davidben): Rename all the file lists, etc., upstream from mac
        # and ios to apple.
        sources += crypto_sources_ios_aarch64
      } else if (is_win) {
        sources += crypto_sources_win_aarch64
      } else {
        public_configs = [ ":no_asm_config" ]
      }
    } else {

Replace with

    } else if (current_cpu == "arm64") {
      # if (is_linux || is_chromeos || is_android) {
      #   sources += crypto_sources_linux_aarch64
      # } else if (is_apple) {
      #   # TODO(davidben): Rename all the file lists, etc., upstream from mac
      #   # and ios to apple.
      #   sources += crypto_sources_ios_aarch64
      # } else if (is_win) {
      #   sources += crypto_sources_win_aarch64
      # } else {
        public_configs = [ ":no_asm_config" ]
      # }
    } else {

In c:\webrtc\src\BUILD.gn

Locate

  if (current_cpu == "arm64") {
    defines += [ "WEBRTC_ARCH_ARM64" ]
    defines += [ "WEBRTC_HAS_NEON" ]
  }

Replace with

  if (current_cpu == "arm64") {
    defines += [ "WEBRTC_ARCH_ARM64" ]
    # defines += [ "WEBRTC_HAS_NEON" ]
  }

In c:\webrtc\src\webrtc.gni

Locate

  # Determines whether NEON code will be built.
  rtc_build_with_neon =
      (current_cpu == "arm" && arm_use_neon) || current_cpu == "arm64"

Replace with

  # Determines whether NEON code will be built.
  rtc_build_with_neon = false

Apply [PATCH] Disabling switch without case warning for aec3

@echo on
set PYTHONPATH=
set PYTHONHOME=
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION=2019
set PATH=c:\depot_tools;%PATH%
c:
cd c:\webrtc\src
if errorlevel 1 goto :error
REM Setting the vs developer environment
echo.
echo Opening the developer command prompt...
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\Common7\Tools\VsDevCmd.bat" -arch=amd64
if errorlevel 1 goto :error
REM Setting up for UWP x64
echo.
echo Excluding the unnecessary modules and prepares to build the drop for UWP x64...
call gn gen --ide=vs2019 out\msvc\uwp\Release\x64 --filters=//:webrtc "--args=is_debug=false use_lld=false is_clang=false rtc_include_tests=false rtc_build_tools=false rtc_win_video_capture_winrt=true target_os=\"winuwp\" rtc_build_examples=false rtc_win_use_mf_h264=true enable_libaom=false rtc_enable_protobuf=false target_cpu=\"x64\" "
if errorlevel 1 goto :error
REM Building for UWP x64
echo.
echo Building the patched WebRTC...
ninja -C out\msvc\uwp\Release\x64
if errorlevel 1 goto :error
REM Setting up for UWP arm64
echo.
echo Excluding the unnecessary modules and prepares to build the drop for UWP arm64...
call gn gen --ide=vs2019 out\msvc\uwp\Release\arm64 --filters=//:webrtc "--args=is_debug=false use_lld=false is_clang=false rtc_include_tests=false rtc_build_tools=false rtc_win_video_capture_winrt=true target_os=\"winuwp\" rtc_build_examples=false rtc_win_use_mf_h264=true enable_libaom=false rtc_enable_protobuf=false target_cpu=\"arm64\" "
if errorlevel 1 goto :error
REM Building for UWP arm64
echo.
echo Building the patched WebRTC...
ninja -C out\msvc\uwp\Release\arm64
if errorlevel 1 goto :error
REM Setting up for UWP x86
echo.
echo Excluding the unnecessary modules and prepares to build the drop for UWP x86...
call gn gen --ide=vs2019 out\msvc\uwp\Release\x86 --filters=//:webrtc "--args=is_debug=false use_lld=false is_clang=false rtc_include_tests=false rtc_build_tools=false rtc_win_video_capture_winrt=true target_os=\"winuwp\" rtc_build_examples=false rtc_win_use_mf_h264=true enable_libaom=false rtc_enable_protobuf=false target_cpu=\"x86\" "
if errorlevel 1 goto :error
REM Building for UWP x86
echo.
echo Building the patched WebRTC...
ninja -C out\msvc\uwp\Release\x86
if errorlevel 1 goto :error
REM Setting up for Win32 x64
echo.
echo Excluding the unnecessary modules and prepares to build the drop for Win32 x64...
call gn gen --ide=vs2019 out\msvc\win32\Release\x64 --filters=//:webrtc "--args=is_debug=false use_lld=false is_clang=false rtc_include_tests=false rtc_build_tools=false rtc_win_video_capture_winrt=true rtc_build_examples=false rtc_win_use_mf_h264=true enable_libaom=false rtc_enable_protobuf=false target_cpu=\"x64\" "
if errorlevel 1 goto :error
REM Building for Win32 x64
echo.
echo Building the patched WebRTC...
ninja -C out\msvc\win32\Release\x64
if errorlevel 1 goto :error
REM Setting up for Win32 arm64
echo.
echo Excluding the unnecessary modules and prepares to build the drop for Win32 arm64...
call gn gen --ide=vs2019 out\msvc\win32\Release\arm64 --filters=//:webrtc "--args=is_debug=false use_lld=false is_clang=false rtc_include_tests=false rtc_build_tools=false rtc_win_video_capture_winrt=true rtc_build_examples=false rtc_win_use_mf_h264=true enable_libaom=false rtc_enable_protobuf=false target_cpu=\"arm64\" "
if errorlevel 1 goto :error
REM Building for Win32 arm64
echo.
echo Building the patched WebRTC...
ninja -C out\msvc\win32\Release\arm64
if errorlevel 1 goto :error
REM Setting up for Win32 x86
echo.
echo Excluding the unnecessary modules and prepares to build the drop for Win32 x86...
call gn gen --ide=vs2019 out\msvc\win32\Release\x86 --filters=//:webrtc "--args=is_debug=false use_lld=false is_clang=false rtc_include_tests=false rtc_build_tools=false rtc_win_video_capture_winrt=true rtc_build_examples=false rtc_win_use_mf_h264=true enable_libaom=false rtc_enable_protobuf=false target_cpu=\"x86\" "
if errorlevel 1 goto :error
REM Building for Win32 x86
echo.
echo Building the patched WebRTC...
ninja -C out\msvc\win32\Release\x86
if errorlevel 1 goto :error
REM Copying the binaries
echo.
echo Copying contents...
cd /D "%~dp0"
if errorlevel 1 goto :error
call :copyFiles c:\webrtc\src\out\msvc\uwp\Release\x64\obj\webrtc.lib ..\output\msvc\uwp\Release\x64\obj\
call :copyFiles c:\webrtc\src\out\msvc\uwp\Release\arm64\obj\webrtc.lib ..\output\msvc\uwp\Release\arm64\obj\
call :copyFiles c:\webrtc\src\out\msvc\uwp\Release\x86\obj\webrtc.lib ..\output\msvc\uwp\Release\x86\obj\
call :copyFiles c:\webrtc\src\out\msvc\win32\Release\x64\obj\webrtc.lib ..\output\msvc\win32\Release\x64\obj\
call :copyFiles c:\webrtc\src\out\msvc\win32\Release\arm64\obj\webrtc.lib ..\output\msvc\win32\Release\arm64\obj\
call :copyFiles c:\webrtc\src\out\msvc\win32\Release\x86\obj\webrtc.lib ..\output\msvc\win32\Release\x86\obj\
call :copyFiles c:\webrtc\src\api\*.h ..\include\api\
call :copyFiles c:\webrtc\src\audio\*.h ..\include\audio\
call :copyFiles c:\webrtc\src\base\*.h ..\include\base\
call :copyFiles c:\webrtc\src\call\*.h ..\include\call\
call :copyFiles c:\webrtc\src\common_audio\*.h ..\include\common_audio\
call :copyFiles c:\webrtc\src\common_video\*.h ..\include\common_video\
call :copyFiles c:\webrtc\src\logging\*.h ..\include\logging\
call :copyFiles c:\webrtc\src\media\*.h ..\include\media\
call :copyFiles c:\webrtc\src\modules\*.h ..\include\modules\
call :copyFiles c:\webrtc\src\p2p\*.h ..\include\p2p\
call :copyFiles c:\webrtc\src\pc\*.h ..\include\pc\
call :copyFiles c:\webrtc\src\rtc_base\*.h ..\include\rtc_base\
call :copyFiles c:\webrtc\src\rtc_tools\*.h ..\include\rtc_tools\
call :copyFiles c:\webrtc\src\stats\*.h ..\include\stats\
call :copyFiles c:\webrtc\src\system_wrappers\*.h ..\include\system_wrappers\
call :copyFiles c:\webrtc\src\third_party\abseil-cpp\absl\*.h ..\include\absl\
call :copyFiles c:\webrtc\src\third_party\libyuv\include\*.h ..\include\
call :copyFiles c:\webrtc\src\video\*.h ..\include\video\
call :copyFiles c:\webrtc\src\common_types.h ..\include\
goto :exit
:copyFiles
xcopy /s /i %~1 %~2
if errorlevel 1 goto :error
goto :exit
:error
echo Last command failed with erro code: %errorlevel%
:exit
exit /b %errorlevel%
@echo off
REM Prerequisities
echo.
echo Deleteing python from path...
set PYTHONPATH=
set PYTHONHOME=
echo.
echo Installing Visual Stuio 2019 workloads...
c:
mkdir c:\Downloads
if errorlevel 1 goto :error
cd c:\Downloads
if errorlevel 1 goto :error
curl -o vs_buildtools.exe -L "https://aka.ms/vs/16/pre/vs_buildtools.exe"
if errorlevel 1 goto :error
call C:\Downloads\vs_buildtools.exe modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview" --add Microsoft.VisualStudio.Component.VC.ATLMFC;includeRecommended --add Microsoft.VisualStudio.Component.VC.MFC.ARM64;includeRecommended --add Microsoft.VisualStudio.Component.VC.Tools.ARM64;includeRecommended --quiet --wait
REM if errorlevel 1 goto :error
echo.
echo Installing Windows Debugging Tools for Windows 10 SDK, version 1903 (10.0.18362.1)...
curl -o winsdksetup.exe -L "https://go.microsoft.com/fwlink/p/?linkid=2083338&clcid=0x409"
if errorlevel 1 goto :error
winsdksetup.exe /features OptionId.WindowsDesktopDebuggers /quiet
if errorlevel 1 goto :error
REM Getting depot_tools
echo.
echo Downloading the depot_tools...
curl https://storage.googleapis.com/chrome-infra/depot_tools.zip --output depot_tools.zip
if errorlevel 1 goto :error
echo.
echo Opening the zip file...
c:
mkdir c:\depot_tools
if errorlevel 1 goto :error
tar -xf depot_tools.zip -C /../depot_tools/
if errorlevel 1 goto :error
echo.
echo Deleting the depot_tools.zip file
del depot_tools.zip
echo.
echo Setting the path environment variable...
set PATH=c:\depot_tools;%PATH%
REM Setting up the environment
echo.
echo Informing depot_tools to use locally installed version of Visual Studio...
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
echo.
echo Informing GYP build tool about the version of the Visual Studio we're using...
set GYP_MSVS_VERSION=2019
echo.
echo Creating the folder where the code base will be placed...
c:
mkdir c:\webrtc
if errorlevel 1 goto :error
cd c:\webrtc
if errorlevel 1 goto :error
REM Downloading the bits
echo.
echo Telling the gclient tool to initialize your local copy of the repos...
call gclient
if errorlevel 1 goto :error
echo.
echo Requesting the tools to fetch the WebRTC code base...
call git clone https://github.com/FrayxRulez/webrtc-uwp.git src
if errorlevel 1 goto :error
call gclient config --name=src https://github.com/FrayxRulez/webrtc-uwp.git
if errorlevel 1 goto :error
echo.
echo Changing to the origin/m91 branch...
cd src
if errorlevel 1 goto :error
call git checkout origin/m91
if errorlevel 1 goto :error
echo.
echo Instructing the tools to bring the bits from all the sub repositories to your dev box...
gclient sync -D -r origin/m91
if errorlevel 1 goto :error
goto :exit
:error
echo Last command failed with erro code: %errorlevel%
:exit
exit /b %errorlevel%
@echo off
cd /D "%~dp0"
REM call git config --global user.name "WinRTC"
REM if errorlevel 1 goto :error
REM call git config --global user.email "<>"
REM if errorlevel 1 goto :error
echo.
echo Setting the WEBRTCM84_ROOT enviornment variable...
set WEBRTCM84_ROOT=c:\webrtc\src
echo.
echo Running the batch file that will patch all the necessary repos from the WebRTC code base...
..\patches_for_WebRTC_org\m84\patchWebRTCM84.cmd
if errorlevel 1 goto :error
goto :exit
:error
echo Last command failed with erro code: %errorlevel%
:exit
exit /b %errorlevel%
@echo on
if not exist %WEBRTCM84_ROOT% ( goto :missingenv )
set PATCH_DIR=%~dp0
pushd %WEBRTCM84_ROOT%\build
git.exe am "%PATCH_DIR%0001-Adding-flags-for-using-WinRT-C-projections-and-build.patch"
if errorlevel 1 goto :error
popd
pushd %WEBRTCM84_ROOT%\third_party
git.exe am "%PATCH_DIR%1001-Fixing-UWP-build-for-libvpx.patch"
if errorlevel 1 goto :error
popd
pushd %WEBRTCM84_ROOT%\third_party\libyuv
git.exe am "%PATCH_DIR%2001-Fixing-NV12-to-I420-conversion-with-strides-and-gap.patch"
if errorlevel 1 goto :error
popd
REM pushd %WEBRTCM84_ROOT%\third_party\boringssl\src
REM git.exe am "%PATCH_DIR%4001-Arm64-is-a-thing-and-has-intrinsic-to-mul-two-64bit-.patch"
REM if errorlevel 1 goto :error
REM popd
REM pushd %WEBRTCM84_ROOT%\third_party\libjpeg_turbo
REM git.exe am "%PATCH_DIR%5001-cl-aligns-differently-and-hack-for-extracting-first-.patch"
REM if errorlevel 1 goto :error
REM popd
REM pushd %WEBRTCM84_ROOT%
REM git.exe am "%PATCH_DIR%3001-Removing-unused-files-containing-Win32-APIs-from-rtc.patch"
REM if errorlevel 1 goto :error
REM git.exe am "%PATCH_DIR%3002-Fixing-UWP-build-for-file_rotating_stream.cc.patch"
REM if errorlevel 1 goto :error
REM git.exe am "%PATCH_DIR%3003-Allowing-no-contiguous-Y-and-UV-planes.patch"
REM if errorlevel 1 goto :error
REM git.exe am "%PATCH_DIR%3004-Changes-for-enabling-the-new-video-capture-module.patch"
REM if errorlevel 1 goto :error
REM git.exe am "%PATCH_DIR%3005-Adds-the-Media-Foundation-H264-encoder-and-decoder.patch"
REM if errorlevel 1 goto :error
REM git.exe am "%PATCH_DIR%3006-Disabling-switch-without-case-warning-for-aec3.patch"
REM if errorlevel 1 goto :error
REM git.exe am "%PATCH_DIR%3007-Do-not-push_back-in-foreach.patch"
REM if errorlevel 1 goto :error
REM git.exe am "%PATCH_DIR%3008-Fixing-UWP-build-for-time_utils.cc"
REM if errorlevel 1 goto :error
REM xcopy /Y /E /Q "%PATCH_DIR%\src" .
REM if errorlevel 1 goto :error
REM git.exe add modules/audio_device/win/audio_device_core_win.*
REM if errorlevel 1 goto :error
REM git.exe commit -m "Audio device for UWP"
REM if errorlevel 1 goto :error
REM git.exe add modules/video_capture/windows/*_winrt.*
REM if errorlevel 1 goto :error
REM git.exe commit -m "Video capture for UWP"
REM if errorlevel 1 goto :error
REM git.exe add modules/video_coding/codecs/h264/win/*.* modules/video_coding/codecs/h264/win_from_old_master/*.*
REM if errorlevel 1 goto :error
REM git.exe commit -m "MF based H264 codec"
REM if errorlevel 1 goto :error
REM popd
goto :exit
:missingenv
echo Please define WEBRTCM84_ROOT with the full path of WebRTC's src folder.
goto :exit
:error
echo Last command failed with erro code: %errorlevel%
:exit
exit /b %errorlevel%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment