Skip to content
Snippets Groups Projects
Commit 184178da authored by Andreas Traczyk's avatar Andreas Traczyk Committed by gerrit2
Browse files

build(UWP): add x264 support

- Adds x264 as a UWP dependency and patches it to pass the WACK
  test.

- Configures ffmpeg to build with x264 support

Change-Id: I3de4a45ba0df73b9217b0a73d8f006b631f71e00
Tuleap: #790
parent 51009e0d
Branches
Tags
No related merge requests found
...@@ -55,6 +55,8 @@ build\portaudio\MSVC\portaudio-UWP\portaudio-UWP.vcxproj, ^ ...@@ -55,6 +55,8 @@ build\portaudio\MSVC\portaudio-UWP\portaudio-UWP.vcxproj, ^
build\yaml-cpp\MSVC\yaml-cpp.vcxproj, ^ build\yaml-cpp\MSVC\yaml-cpp.vcxproj, ^
) )
rem * build libx264 *
call :build build\x264\SMP\libx264.vcxproj
rem * build ffmpeg * rem * build ffmpeg *
cd build\FFmpegInterop cd build\FFmpegInterop
SET LIB="%VSINSTALLDIR%VC\lib\store\amd64;%VSINSTALLDIR%VC\atlmfc\lib\amd64;%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64;;%UniversalCRTSdkDir%lib\%UCRTVersion%\um\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\lib\um\x64;;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\Lib\um\x64" SET LIB="%VSINSTALLDIR%VC\lib\store\amd64;%VSINSTALLDIR%VC\atlmfc\lib\amd64;%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64;;%UniversalCRTSdkDir%lib\%UCRTVersion%\um\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\lib\um\x64;;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\Lib\um\x64"
......
...@@ -21,6 +21,7 @@ pthreads, ^ ...@@ -21,6 +21,7 @@ pthreads, ^
restbed, ^ restbed, ^
samplerate, ^ samplerate, ^
upnp, ^ upnp, ^
x264, ^
yaml-cpp, ^ yaml-cpp, ^
zlib ^ zlib ^
) )
......
...@@ -84,5 +84,30 @@ ...@@ -84,5 +84,30 @@
if (st->first_dts == AV_NOPTS_VALUE && if (st->first_dts == AV_NOPTS_VALUE &&
!(ic->iformat->flags & AVFMT_NOTIMESTAMPS) && !(ic->iformat->flags & AVFMT_NOTIMESTAMPS) &&
-- --
--- a/FFmpegConfig.sh
+++ b/FFmpegConfig.sh
@@ -33,6 +33,7 @@ if [ "$1" == "Win10" ]; then
cd Output/Windows10/x64
../../../configure \
--toolchain=msvc \
+ --enable-gpl \
--disable-programs \
--disable-d3d11va \
--disable-dxva2 \
@@ -40,8 +41,12 @@ if [ "$1" == "Win10" ]; then
--enable-shared \
--enable-cross-compile \
--target-os=win32 \
- --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00" \
- --extra-ldflags="-APPCONTAINER WindowsApp.lib" \
+ --enable-encoder=libx264 \
+ --enable-decoder=h264 \
+ --enable-parser=h264 \
+ --enable-libx264 \
+ --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00 -I../../../../../x264/SMP/output/Release/include" \
+ --extra-ldflags="-APPCONTAINER WindowsApp.lib -LIBPATH:../../../../../x264/SMP/output/Release/lib/x64" \
--prefix=../../../Build/Windows10/x64
make -j install
popd
2.8.1.windows.1 2.8.1.windows.1
set BUILD=%SRC%..\build
set X264_VERSION=78c7e3dbb6f832f8775d81acedb3793e414b4dd3
set X264_URL=https://github.com/ShiftMediaProject/x264/archive/%X264_VERSION%.tar.gz
mkdir %BUILD%
if %USE_CACHE%==1 (
copy %CACHE_DIR%\%X264_VERSION%.tar.gz %cd%
) else (
wget %X264_URL%
)
7z -y x %X264_VERSION%.tar.gz && 7z -y x %X264_VERSION%.tar -o%BUILD%
del %X264_VERSION%.tar && del %X264_VERSION%.tar.gz && del %BUILD%\pax_global_header
rename %BUILD%\x264-%X264_VERSION% x264
cd %BUILD%\x264
git apply --reject --whitespace=fix %SRC%\x264\x264-uwp.patch
cd %SRC%
\ No newline at end of file
--- a/SMP/config.h
+++ b/SMP/config.h
@@ -21,7 +21,7 @@
#define ftell _ftelli64
#define HAVE_GPL 1
#define HAVE_INTERLACED 1
-#define HAVE_OPENCL 1
+#define HAVE_OPENCL 0
#define HAVE_MALLOC_H 0
#define HAVE_ALTIVEC 0
#define HAVE_ALTIVEC_H 0
@@ -42,4 +42,4 @@
#else
# define HAVE_X86_INLINE_ASM 0
#endif
-#define HAVE_WINRT 0
\ No newline at end of file
+#define HAVE_WINRT 1
\ No newline at end of file
--- a/SMP/libx264.vcxproj
+++ b/SMP/libx264.vcxproj
@@ -45,6 +45,7 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{20179127-853B-4FE9-B7C0-9E817E6A3A72}</ProjectGuid>
<RootNamespace>libx264</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -205,7 +206,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IntDir>$(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<TargetName>libx264</TargetName>
- <OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
+ <OutDir>$(ProjectDir)output\$(Configuration)\</OutDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTO|x64'">
@@ -1007,7 +1008,9 @@ del /f /q $(OutDir)\licenses\x264.txt
<ClCompile Include="..\common\macroblock.c" />
<ClCompile Include="..\common\mc.c" />
<ClCompile Include="..\common\mvpred.c" />
- <ClCompile Include="..\common\opencl.c" />
+ <ClCompile Include="..\common\opencl.c">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="..\common\osdep.c" />
<ClCompile Include="..\common\pixel.c" />
<ClCompile Include="..\common\predict.c" />
--
2.8.1.windows.1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment