diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..1b710cf --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,15 @@ +# CMakeList.txt : Top-level CMake project file, do global configuration +# and include sub-projects here. +# +cmake_minimum_required (VERSION 3.8) + +# Enable Hot Reload for MSVC compilers if supported. +if (POLICY CMP0141) + cmake_policy(SET CMP0141 NEW) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") +endif() + +project ("OpenH264Wrapper2") + +# Include sub-projects. +add_subdirectory ("H264SharpNative") diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..ee6b66f --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,121 @@ +{ + "version": 3, + "configurePresets": [ + { + "name": "windows-base", + "hidden": true, + "generator": "Ninja", + "binaryDir": "${sourceDir}/out/build/${presetName}", + "installDir": "${sourceDir}/out/install/${presetName}", + "cacheVariables": { + "CMAKE_C_COMPILER": "cl.exe", + "CMAKE_CXX_COMPILER": "cl.exe" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "x64-debug", + "displayName": "x64 Debug", + "inherits": "windows-base", + "architecture": { + "value": "x64", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "x64-release", + "displayName": "x64 Release", + "inherits": "x64-debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "x86-debug", + "displayName": "x86 Debug", + "inherits": "windows-base", + "architecture": { + "value": "x86", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "x86-release", + "displayName": "x86 Release", + "inherits": "x86-debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "linux-debug", + "displayName": "Linux Debug", + "generator": "Ninja", + "binaryDir": "${sourceDir}/out/build/${presetName}", + "installDir": "${sourceDir}/out/install/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + }, + "vendor": { + "microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { + "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" + } + } + }, + { + "name": "linux-release", + "displayName": "Linux Release", + "generator": "Ninja", + "binaryDir": "${sourceDir}/out/build/${presetName}", + "installDir": "${sourceDir}/out/install/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + }, + "vendor": { + "microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { + "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" + } + } + }, + { + "name": "macos-debug", + "displayName": "macOS Debug", + "generator": "Ninja", + "binaryDir": "${sourceDir}/out/build/${presetName}", + "installDir": "${sourceDir}/out/install/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "vendor": { + "microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { + "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" + } + } + } + ] +} diff --git a/CrossPlatformTest/CrossPlatformTest.csproj b/CrossPlatformTest/CrossPlatformTest.csproj index 0729a9e..8ca44ee 100644 --- a/CrossPlatformTest/CrossPlatformTest.csproj +++ b/CrossPlatformTest/CrossPlatformTest.csproj @@ -9,19 +9,13 @@ - + - - PreserveNewest - PreserveNewest - - PreserveNewest - PreserveNewest diff --git a/CrossPlatformTest/H264SharpNative-linux64.so b/CrossPlatformTest/H264SharpNative-linux64.so deleted file mode 100644 index 093c101..0000000 Binary files a/CrossPlatformTest/H264SharpNative-linux64.so and /dev/null differ diff --git a/CrossPlatformTest/H264SharpNative-win64.dll b/CrossPlatformTest/H264SharpNative-win64.dll deleted file mode 100644 index 5d581f8..0000000 Binary files a/CrossPlatformTest/H264SharpNative-win64.dll and /dev/null differ diff --git a/CrossPlatformTest/libopenh264-2.4.1-linux64.7.so b/CrossPlatformTest/libopenh264-2.4.1-linux64.7.so deleted file mode 100644 index ff2db14..0000000 Binary files a/CrossPlatformTest/libopenh264-2.4.1-linux64.7.so and /dev/null differ diff --git a/CrossPlatformTest/openh264-2.4.1-win64.dll b/CrossPlatformTest/openh264-2.4.1-win64.dll deleted file mode 100644 index 7541285..0000000 Binary files a/CrossPlatformTest/openh264-2.4.1-win64.dll and /dev/null differ diff --git a/H264Sharp/Defines.cs b/H264Sharp/Defines.cs index 98ca547..d295c1a 100644 --- a/H264Sharp/Defines.cs +++ b/H264Sharp/Defines.cs @@ -11,8 +11,8 @@ public class Defines public const string WrapperDllName64bit = "H264SharpNative-win64.dll"; public const string WrapperDllName32bit = "H264SharpNative-win32.dll"; #elif OS_LINUX - public static string CiscoDllName64bit = "libopenh264-2.4.1-linux64.7.so"; - public static string CiscoDllName32bit = "libopenh264-2.4.1-linux32.7.so"; + public static string CiscoDllName64bit = "./libopenh264-2.4.1-linux64.7.so"; + public static string CiscoDllName32bit = "./libopenh264-2.4.1-linux32.7.so"; public const string WrapperDllName64bit = "H264SharpNative-linux64.so"; public const string WrapperDllName32bit = "H264SharpNative-linux32.so"; diff --git a/H264Sharp/H264Sharp.csproj b/H264Sharp/H264Sharp.csproj index 5119037..e13d2a4 100644 --- a/H264Sharp/H264Sharp.csproj +++ b/H264Sharp/H264Sharp.csproj @@ -1,17 +1,32 @@  + + + + + + H264SharpNative-linux64.so + Always + + + - netstandard2.0 + netstandard2.0;net8.0 True True - H264Sharp - 1.2.1 + H264Sharp-linux + 1.3.0 https://github.com/ReferenceType/H264Sharp ReferenceType https://github.com/ReferenceType/H264Sharp h264;openh264;transcoder;h264sharp https://github.com/ReferenceType/H264Sharp/releases/ - H264Sharp + H264Sharp-linux Cisco's OpenH264 wrapper for .Net with SIMD color model conversion support @@ -24,18 +39,56 @@ - - $(DefineConstants);OS_WINDOWS - - + + OS_WINDOWS + + + OS_LINUX + + + OS_FREEBSD + + + OS_MAC + + + - - - - + + + + + true + true + true + contentFiles\any\asset;content\any\asset + + + true + true + true + contentFiles\any\asset;content\any\asset + + + + + + + + + + + + + + + + True + \ + @@ -48,3 +101,4 @@ + \ No newline at end of file diff --git a/H264Sharp/Publish.zip b/H264Sharp/Publish.zip deleted file mode 100644 index f029cee..0000000 Binary files a/H264Sharp/Publish.zip and /dev/null differ diff --git a/H264Sharp/runtimes/linux64/native/H264SharpNative-linux64.so b/H264Sharp/runtimes/linux64/native/H264SharpNative-linux64.so index 093c101..65a6176 100644 Binary files a/H264Sharp/runtimes/linux64/native/H264SharpNative-linux64.so and b/H264Sharp/runtimes/linux64/native/H264SharpNative-linux64.so differ diff --git a/H264Sharp/runtimes/win-x64/native/H264SharpNative-win64.dll b/H264Sharp/runtimes/win-x64/native/H264SharpNative-win64.dll index 439c47a..2338517 100644 Binary files a/H264Sharp/runtimes/win-x64/native/H264SharpNative-win64.dll and b/H264Sharp/runtimes/win-x64/native/H264SharpNative-win64.dll differ diff --git a/H264Sharp/runtimes/win-x86/native/H264SharpNative-win32.dll b/H264Sharp/runtimes/win-x86/native/H264SharpNative-win32.dll index 097ad16..7998082 100644 Binary files a/H264Sharp/runtimes/win-x86/native/H264SharpNative-win32.dll and b/H264Sharp/runtimes/win-x86/native/H264SharpNative-win32.dll differ diff --git a/H264SharpNative/CMakeLists.txt b/H264SharpNative/CMakeLists.txt index 18e8697..6662f0d 100644 --- a/H264SharpNative/CMakeLists.txt +++ b/H264SharpNative/CMakeLists.txt @@ -27,6 +27,8 @@ else() set(CMAKE_CXX_COMPILER "clang-cl") endif() +#H264SharpNative-linux64.so + # Add source to this project's executable. #add_executable (CMakeProject1 "CMakeProject1.cpp" "CMakeProject1.h") add_library (CMakeProject1 SHARED @@ -52,5 +54,8 @@ add_library (CMakeProject1 SHARED if (CMAKE_VERSION VERSION_GREATER 3.12) set_property(TARGET CMakeProject1 PROPERTY CXX_STANDARD 20) endif() - +set_target_properties(CMakeProject1 PROPERTIES PREFIX "") +set_target_properties(CMakeProject1 PROPERTIES OUTPUT_NAME "H264SharpNative-linux64") +set_target_properties(CMakeProject1 PROPERTIES SUFFIX ".so") +#set_target_properties(CMakeProject1 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32") # TODO: Add tests and install targets if needed. diff --git a/H264SharpNative/ConverterLocal.h b/H264SharpNative/ConverterLocal.h index ccf02c2..370d27d 100644 --- a/H264SharpNative/ConverterLocal.h +++ b/H264SharpNative/ConverterLocal.h @@ -1,6 +1,5 @@ #ifndef CONVERTER_LOCAL #define CONVERTER_LOCAL -#include #include #ifndef __arm__ #include diff --git a/H264SharpNative/H264SharpNative.vcxproj b/H264SharpNative/H264SharpNative.vcxproj index 57fe01f..0a177ef 100644 --- a/H264SharpNative/H264SharpNative.vcxproj +++ b/H264SharpNative/H264SharpNative.vcxproj @@ -153,7 +153,7 @@ true WIN32;_DEBUG;H264SHARPNATIVE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true - Use + NotUsing pch.h @@ -170,7 +170,7 @@ true WIN32;NDEBUG;H264SHARPNATIVE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true - Use + NotUsing pch.h AdvancedVectorExtensions2 Full diff --git a/H264Sharp/Licence.txt b/Resources/Licence.txt similarity index 100% rename from H264Sharp/Licence.txt rename to Resources/Licence.txt