diff --git a/MSVC/config.h b/MSVC/config.h index f5222f2dbf9fed724140fdb2e714ffa0ed098e89..c9469ef608eb555d30cc7127ac1f3a746673c85e 100644 --- a/MSVC/config.h +++ b/MSVC/config.h @@ -7,6 +7,9 @@ systems. This function is required for `alloca.c' support on those systems. /* Define to 1 if using `alloca.c'. */ /* #undef C_ALLOCA */ +/* Define to 1 if you want hardware acceleration support. */ +#define RING_ACCEL 1 + /* Define to 1 if you have `alloca', as a function or macro. */ #define HAVE_ALLOCA 1 diff --git a/MSVC/ring-daemon.vcxproj b/MSVC/ring-daemon.vcxproj index 89c807d78b328aa1eafdd11f8c018672f872001f..eb9501c1017a18d04d3de623c6238c98a9a3468f 100644 --- a/MSVC/ring-daemon.vcxproj +++ b/MSVC/ring-daemon.vcxproj @@ -767,10 +767,7 @@ <ClCompile Include="..\src\media\socket_pair.cpp" /> <ClCompile Include="..\src\media\srtp.c" /> <ClCompile Include="..\src\media\system_codec_container.cpp" /> - <ClCompile Include="..\src\media\video\accel.cpp"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLib|x64'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLib_win32|x64'">true</ExcludedFromBuild> - </ClCompile> + <ClCompile Include="..\src\media\video\accel.cpp" /> <ClCompile Include="..\src\media\video\filter_transpose.cpp" /> <ClCompile Include="..\src\media\video\sinkclient.cpp" /> <ClCompile Include="..\src\media\video\uwpvideo\video_device_impl.cpp"> @@ -931,10 +928,7 @@ <ClInclude Include="..\src\media\socket_pair.h" /> <ClInclude Include="..\src\media\srtp.h" /> <ClInclude Include="..\src\media\system_codec_container.h" /> - <ClInclude Include="..\src\media\video\accel.h"> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLib|x64'">true</ExcludedFromBuild> - <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseLib_win32|x64'">true</ExcludedFromBuild> - </ClInclude> + <ClInclude Include="..\src\media\video\accel.h" /> <ClInclude Include="..\src\media\video\filter_transpose.h" /> <ClInclude Include="..\src\media\video\shm_header.h" /> <ClInclude Include="..\src\media\video\sinkclient.h" /> @@ -999,6 +993,7 @@ <ClInclude Include="..\src\utf8_utils.h" /> <ClInclude Include="..\src\windirent.h" /> <ClInclude Include="..\src\winsyslog.h" /> + <ClInclude Include="config.h" /> </ItemGroup> <ItemGroup> <None Include="..\src\jamidht\eth\libdevcore\Makefile.am" /> diff --git a/MSVC/ring-daemon.vcxproj.filters b/MSVC/ring-daemon.vcxproj.filters index 5a0f068fa340580f4bb5b93fb5ba70dbae4a2af0..4c833a9232a9b248cefeca595a54660fe476f93e 100644 --- a/MSVC/ring-daemon.vcxproj.filters +++ b/MSVC/ring-daemon.vcxproj.filters @@ -367,9 +367,6 @@ <ClCompile Include="..\src\jamidht\p2p.cpp"> <Filter>Source Files\jamidht</Filter> </ClCompile> - <ClCompile Include="..\src\media\video\accel.cpp"> - <Filter>Source Files\media\video</Filter> - </ClCompile> <ClCompile Include="..\src\security\diffie-hellman.cpp"> <Filter>Source Files\security</Filter> </ClCompile> @@ -409,6 +406,9 @@ <ClCompile Include="..\src\media\video\filter_transpose.cpp"> <Filter>Source Files\media\video</Filter> </ClCompile> + <ClCompile Include="..\src\media\video\accel.cpp"> + <Filter>Source Files\media\video</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\src\account.h"> @@ -711,9 +711,6 @@ <ClInclude Include="..\src\media\audio\sound\tonelist.h"> <Filter>Source Files\media\audio\sound</Filter> </ClInclude> - <ClInclude Include="..\src\media\video\accel.h"> - <Filter>Source Files\media\video</Filter> - </ClInclude> <ClInclude Include="..\src\media\video\shm_header.h"> <Filter>Source Files\media\video</Filter> </ClInclude> @@ -840,6 +837,12 @@ <ClInclude Include="..\src\media\video\filter_transpose.h"> <Filter>Source Files\media\video</Filter> </ClInclude> + <ClInclude Include="config.h"> + <Filter>Source Files</Filter> + </ClInclude> + <ClInclude Include="..\src\media\video\accel.h"> + <Filter>Source Files\media\video</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="..\src\jamidht\eth\libdevcore\Makefile.am"> diff --git a/contrib/src/fetch_all.bat b/contrib/src/fetch_all.bat index f708de0d992c644ca0a370a782088757c8e9f437..347537c5895cc69ae18bc88e2b2418b545f2c0cf 100644 --- a/contrib/src/fetch_all.bat +++ b/contrib/src/fetch_all.bat @@ -21,6 +21,7 @@ if "%1"=="uwp" ( :uwpDeps set DEPENDENCIES=( ^ +ffnvcodec, ^ ffmpeg, ^ argon2, ^ zlib ^ @@ -45,6 +46,7 @@ goto fetch :win32Deps set DEPENDENCIES=( ^ +ffnvcodec, ^ ffmpeg, ^ argon2, ^ zlib ^ diff --git a/contrib/src/ffmpeg/fetch_and_patch.bat b/contrib/src/ffmpeg/fetch_and_patch.bat index dd55796210372f458c013843147053ddc2d9827b..53213d8ace65b385468f744e6074031a6516ce55 100644 --- a/contrib/src/ffmpeg/fetch_and_patch.bat +++ b/contrib/src/ffmpeg/fetch_and_patch.bat @@ -31,5 +31,6 @@ set UNIXPATH=%ROOTPATH%%UNIXPATH:C:/=% bash -c "%PATCH_CMD% %UNIXPATH%ffmpeg/change-RTCP-ratio.patch" git apply --reject --whitespace=fix %SRC%\ffmpeg\windows-configure.patch +git apply --reject --whitespace=fix %SRC%\ffmpeg\windows-configure-ffnvcodec.patch cd %SRC% \ No newline at end of file diff --git a/contrib/src/ffmpeg/windows-configure-ffnvcodec.patch b/contrib/src/ffmpeg/windows-configure-ffnvcodec.patch new file mode 100644 index 0000000000000000000000000000000000000000..4be2ddf5a11a2d65c9bce40576140e8d6575c02a --- /dev/null +++ b/contrib/src/ffmpeg/windows-configure-ffnvcodec.patch @@ -0,0 +1,29 @@ +From 63d0edcee2744317fc0befad53000c206eb5ee31 Mon Sep 17 00:00:00 2001 +From: Eden Abitbol <eden.abitbol@savoirfairelinux.com> +Date: Tue, 9 Jul 2019 10:52:29 -0400 +Subject: [PATCH] Remove ffnvcodec linux style package check for windows + support. + +--- + configure | 7 ------- + 1 file changed, 7 deletions(-) + +--- a/configure ++++ b/configure +@@ -5897,13 +5897,6 @@ check_type "va/va.h va/va_enc_vp9.h" "VAEncPictureParameterBufferVP9" + + check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC" + +-if ! disabled ffnvcodec; then +- check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.2" \ +- "ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" "" || \ +- { test_pkg_config ffnvcodec_tmp "ffnvcodec < 8.1" "" "" && check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.2" \ +- "ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" ""; } +-fi +- + check_cpp_condition winrt windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" + + if ! disabled w32threads && ! enabled pthreads; then +-- +2.22.0.windows.1 + diff --git a/contrib/src/ffmpeg/windows-configure-make.sh b/contrib/src/ffmpeg/windows-configure-make.sh index 3070c729b2fd876e61f40a3e734b38296d181cc4..df50a11a42330cb2ec32a119216b932314445f48 100644 --- a/contrib/src/ffmpeg/windows-configure-make.sh +++ b/contrib/src/ffmpeg/windows-configure-make.sh @@ -142,7 +142,7 @@ if [ "$1" == "uwp" ]; then OUTDIR=Output/Windows10/x86 fi elif [ "$1" == "win32" ]; then - EXTRACFLAGS='-MD -D_WINDLL -I../../../../../msvc/include -I../../../../../msvc/include/opus -I../../../../../msvc/include/vpx' + EXTRACFLAGS='-MD -D_WINDLL -I../../../../../msvc/include -I../../../../../msvc/include/opus -I../../../../../msvc/include/vpx -I../../../../../msvc/include/ffnvcodec' FFMPEGCONF+=' --enable-libvpx --enable-encoder=libvpx_vp8 @@ -152,6 +152,17 @@ elif [ "$1" == "win32" ]; then --enable-indev=dshow --enable-indev=gdigrab --enable-dxva2' + FFMPEGCONF+=' + --enable-ffnvcodec + --enable-cuvid + --enable-nvdec + --enable-nvenc + --enable-hwaccel=h264_nvdec + --enable-hwaccel=hevc_nvdec + --enable-hwaccel=vp8_nvdec + --enable-hwaccel=mjpeg_nvdec + --enable-encoder=h264_nvenc + --enable-encoder=hevc_nvenc' if [ "$2" == "x64" ]; then echo "configure and make ffmpeg for win32-x64..." EXTRALDFLAGS='-APPCONTAINER:NO -MACHINE:x64 Ole32.lib Kernel32.lib Gdi32.lib User32.lib Strmiids.lib OleAut32.lib Shlwapi.lib Vfw32.lib Secur32.lib libopus.lib libx264.lib libvpx.lib -LIBPATH:../../../../../msvc/lib/x64' diff --git a/contrib/src/ffnvcodec/fetch_and_patch.bat b/contrib/src/ffnvcodec/fetch_and_patch.bat new file mode 100644 index 0000000000000000000000000000000000000000..6c4bcfb9c4b86d44644b132bba34915cd2cf86f7 --- /dev/null +++ b/contrib/src/ffnvcodec/fetch_and_patch.bat @@ -0,0 +1,28 @@ +set BUILD=%SRC%..\build + +mkdir %BUILD% +cd %BUILD% + +set FFNVCODEC_VERSION=5eeca8cc95267d55030e98a051effa47c45f13f3 +set FFNVCODEC_GITURL=https://github.com/FFmpeg/nv-codec-headers/archive/%FFNVCODEC_VERSION%.tar.gz + +if %USE_CACHE%==1 ( + copy %CACHE_DIR%\%FFNVCODEC_VERSION%.tar.gz %cd% +) else ( + wget --no-check-certificate %FFNVCODEC_GITURL% +) + +7z -y x %FFNVCODEC_VERSION%.tar.gz && 7z -y x %FFNVCODEC_VERSION%.tar +del %FFNVCODEC_VERSION%.tar && del %FFNVCODEC_VERSION%.tar.gz && del pax_global_header +rename nv-codec-headers-%FFNVCODEC_VERSION% ffnvcodec + +cd ffnvcodec\include\ffnvcodec + +mkdir ..\..\..\..\msvc\include + +mkdir ..\..\..\..\msvc\include\ffnvcodec + +xcopy /S /Y *.h ..\..\..\..\msvc\include\ffnvcodec + +cd %SRC% +