mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-28 16:41:52 +08:00
init
This commit is contained in:
31
libs/hwcodec/dev/vs/AMFTest/AMFTest.sln
Normal file
31
libs/hwcodec/dev/vs/AMFTest/AMFTest.sln
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.33627.172
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AMFTest", "AMFTest.vcxproj", "{59599E6A-52F7-44DD-9EC5-487342FF33F8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{59599E6A-52F7-44DD-9EC5-487342FF33F8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{59599E6A-52F7-44DD-9EC5-487342FF33F8}.Debug|x64.Build.0 = Debug|x64
|
||||
{59599E6A-52F7-44DD-9EC5-487342FF33F8}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{59599E6A-52F7-44DD-9EC5-487342FF33F8}.Debug|x86.Build.0 = Debug|Win32
|
||||
{59599E6A-52F7-44DD-9EC5-487342FF33F8}.Release|x64.ActiveCfg = Release|x64
|
||||
{59599E6A-52F7-44DD-9EC5-487342FF33F8}.Release|x64.Build.0 = Release|x64
|
||||
{59599E6A-52F7-44DD-9EC5-487342FF33F8}.Release|x86.ActiveCfg = Release|Win32
|
||||
{59599E6A-52F7-44DD-9EC5-487342FF33F8}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E1168B32-184A-4268-AC43-21E66A82F076}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
154
libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj
Normal file
154
libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj
Normal file
@@ -0,0 +1,154 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{59599e6a-52f7-44dd-9ec5-487342ff33f8}</ProjectGuid>
|
||||
<RootNamespace>AMFTest</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;CSO_DIR="../../render/res";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>..\..\externals\AMF_v1.4.29\amf;..\..\externals\AMF_v1.4.29\amf\public\common;..\..\common\src;..\..\common\src\platform\win;..\..\externals\nvEncDXGIOutputDuplicationSample;..\..\codec\src;..\..\externals\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\..\externals\SDL\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>SDL2.lib;dxgi.lib;d3d11.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\amf\src\common.cpp" />
|
||||
<ClCompile Include="..\..\amf\src\decode.cpp" />
|
||||
<ClCompile Include="..\..\amf\src\encode.cpp" />
|
||||
<ClCompile Include="..\..\capture\src\dxgi.cpp" />
|
||||
<ClCompile Include="..\..\codec\src\data.c" />
|
||||
<ClCompile Include="..\..\codec\src\utils.c" />
|
||||
<ClCompile Include="..\..\common\src\log.cpp" />
|
||||
<ClCompile Include="..\..\common\src\platform\win\win.cpp" />
|
||||
<ClCompile Include="..\..\externals\AMF_v1.4.29\amf\public\common\AMFFactory.cpp" />
|
||||
<ClCompile Include="..\..\externals\AMF_v1.4.29\amf\public\common\AMFSTL.cpp" />
|
||||
<ClCompile Include="..\..\externals\AMF_v1.4.29\amf\public\common\Thread.cpp" />
|
||||
<ClCompile Include="..\..\externals\AMF_v1.4.29\amf\public\common\TraceAdapter.cpp" />
|
||||
<ClCompile Include="..\..\externals\AMF_v1.4.29\amf\public\common\Windows\ThreadWindows.cpp" />
|
||||
<ClCompile Include="..\..\externals\nvEncDXGIOutputDuplicationSample\DDAImpl.cpp" />
|
||||
<ClCompile Include="..\..\externals\nvEncDXGIOutputDuplicationSample\Preproc.cpp" />
|
||||
<ClCompile Include="..\..\render\src\dxgi_sdl.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
83
libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj.filters
Normal file
83
libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj.filters
Normal file
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="source">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="source\externals">
|
||||
<UniqueIdentifier>{a09eabb2-ceac-4062-b19e-244b29176c2b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="source\externals\AMF_v1.4.29">
|
||||
<UniqueIdentifier>{8adb5a7a-3fba-4330-9a43-dc4251f2ff2f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="source\externals\nvEncDXGIOutputDuplicationSample">
|
||||
<UniqueIdentifier>{2bc8fd1a-5082-40fb-a6b5-ac8c3b84d450}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="source\render">
|
||||
<UniqueIdentifier>{6edc9023-4c96-4474-b544-20059b2e32ac}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="source\codec">
|
||||
<UniqueIdentifier>{ccee2176-d5f2-46b3-b138-538ac9bd7d13}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="source\common">
|
||||
<UniqueIdentifier>{8a1b8e43-9bdb-4e28-98d9-854c8e8bf107}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="source\capture">
|
||||
<UniqueIdentifier>{a65898d7-8992-40d0-9141-7b4f10415e1f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>source</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\externals\AMF_v1.4.29\amf\public\common\AMFFactory.cpp">
|
||||
<Filter>source\externals\AMF_v1.4.29</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\externals\AMF_v1.4.29\amf\public\common\AMFSTL.cpp">
|
||||
<Filter>source\externals\AMF_v1.4.29</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\externals\AMF_v1.4.29\amf\public\common\Thread.cpp">
|
||||
<Filter>source\externals\AMF_v1.4.29</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\externals\AMF_v1.4.29\amf\public\common\Windows\ThreadWindows.cpp">
|
||||
<Filter>source\externals\AMF_v1.4.29</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\externals\AMF_v1.4.29\amf\public\common\TraceAdapter.cpp">
|
||||
<Filter>source\externals\AMF_v1.4.29</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\externals\nvEncDXGIOutputDuplicationSample\DDAImpl.cpp">
|
||||
<Filter>source\externals\nvEncDXGIOutputDuplicationSample</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\externals\nvEncDXGIOutputDuplicationSample\Preproc.cpp">
|
||||
<Filter>source\externals\nvEncDXGIOutputDuplicationSample</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\common\src\platform\win\win.cpp">
|
||||
<Filter>source\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\capture\src\dxgi.cpp">
|
||||
<Filter>source\capture</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\render\src\dxgi_sdl.cpp">
|
||||
<Filter>source\render</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\codec\src\data.c">
|
||||
<Filter>source\codec</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\codec\src\utils.c">
|
||||
<Filter>source\codec</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\amf\src\common.cpp">
|
||||
<Filter>source\codec</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\amf\src\decode.cpp">
|
||||
<Filter>source\codec</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\amf\src\encode.cpp">
|
||||
<Filter>source\codec</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\common\src\log.cpp">
|
||||
<Filter>source\common</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
4
libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj.user
Normal file
4
libs/hwcodec/dev/vs/AMFTest/AMFTest.vcxproj.user
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
||||
109
libs/hwcodec/dev/vs/AMFTest/main.cpp
Normal file
109
libs/hwcodec/dev/vs/AMFTest/main.cpp
Normal file
@@ -0,0 +1,109 @@
|
||||
#include <Windows.h>
|
||||
#include <callback.h>
|
||||
#include <common.h>
|
||||
#include <iostream>
|
||||
#include <stdint.h>
|
||||
#include <system.h>
|
||||
|
||||
extern "C" {
|
||||
void *dxgi_new_capturer(int64_t luid);
|
||||
void *dxgi_device(void *self);
|
||||
int dxgi_width(const void *self);
|
||||
int dxgi_height(const void *self);
|
||||
void *dxgi_capture(void *self, int wait_ms);
|
||||
void destroy_dxgi_capturer(void *self);
|
||||
void *amf_new_encoder(void *hdl, int64_t luid, API api, DataFormat dataFormat,
|
||||
int32_t width, int32_t height, int32_t kbs,
|
||||
int32_t framerate, int32_t gop);
|
||||
int amf_encode(void *e, void *tex, EncodeCallback callback, void *obj);
|
||||
int amf_destroy_encoder(void *e);
|
||||
void *amf_new_decoder(void *device, int64_t luid, int32_t api,
|
||||
int32_t dataFormat, bool outputSharedHandle);
|
||||
int amf_decode(void *decoder, uint8_t *data, int32_t length,
|
||||
DecodeCallback callback, void *obj);
|
||||
int amf_destroy_decoder(void *decoder);
|
||||
void *CreateDXGIRender(long long luid, bool inputSharedHandle);
|
||||
int DXGIRenderTexture(void *render, HANDLE shared_handle);
|
||||
void DestroyDXGIRender(void *render);
|
||||
void *DXGIDevice(void *render);
|
||||
}
|
||||
|
||||
static const uint8_t *encode_data;
|
||||
static int32_t encode_len;
|
||||
static void *decode_shared_handle;
|
||||
|
||||
extern "C" static void encode_callback(const uint8_t *data, int32_t len,
|
||||
int32_t key, const void *obj) {
|
||||
encode_data = data;
|
||||
encode_len = len;
|
||||
std::cerr << "encode len" << len << std::endl;
|
||||
}
|
||||
|
||||
extern "C" static void decode_callback(void *shared_handle, const void *obj) {
|
||||
decode_shared_handle = shared_handle;
|
||||
}
|
||||
|
||||
extern "C" void log_gpucodec(int level, const char *message) {
|
||||
std::cout << message << std::endl;
|
||||
}
|
||||
|
||||
int main() {
|
||||
Adapters adapters;
|
||||
adapters.Init(ADAPTER_VENDOR_AMD);
|
||||
if (adapters.adapters_.size() == 0) {
|
||||
std::cout << "no amd adapter" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
int64_t luid = LUID(adapters.adapters_[0].get()->desc1_);
|
||||
DataFormat dataFormat = H264;
|
||||
void *dup = dxgi_new_capturer(luid);
|
||||
if (!dup) {
|
||||
std::cerr << "create duplicator failed" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
int width = dxgi_width(dup);
|
||||
int height = dxgi_height(dup);
|
||||
std::cout << "width: " << width << " height: " << height << std::endl;
|
||||
void *device = dxgi_device(dup);
|
||||
void *encoder = amf_new_encoder(device, luid, API_DX11, dataFormat, width,
|
||||
height, 4000, 30, 0xFFFF);
|
||||
if (!encoder) {
|
||||
std::cerr << "create encoder failed" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
void *render = CreateDXGIRender(luid, false);
|
||||
if (!render) {
|
||||
std::cerr << "create render failed" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void *decoder =
|
||||
amf_new_decoder(DXGIDevice(render), luid, API_DX11, dataFormat, false);
|
||||
if (!decoder) {
|
||||
std::cerr << "create decoder failed" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
void *texture = dxgi_capture(dup, 100);
|
||||
if (!texture) {
|
||||
std::cerr << "texture is NULL" << std::endl;
|
||||
continue;
|
||||
}
|
||||
if (0 != amf_encode(encoder, texture, encode_callback, NULL)) {
|
||||
std::cerr << "encode failed" << std::endl;
|
||||
continue;
|
||||
}
|
||||
if (0 != amf_decode(decoder, (uint8_t *)encode_data, encode_len,
|
||||
decode_callback, NULL)) {
|
||||
std::cerr << "decode failed" << std::endl;
|
||||
continue;
|
||||
}
|
||||
if (0 != DXGIRenderTexture(render, decode_shared_handle)) {
|
||||
std::cerr << "render failed" << std::endl;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// no release temporarily
|
||||
}
|
||||
31
libs/hwcodec/dev/vs/MFXTest/MFXTest.sln
Normal file
31
libs/hwcodec/dev/vs/MFXTest/MFXTest.sln
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.33627.172
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MFXTest", "MFXTest.vcxproj", "{1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Debug|x64.Build.0 = Debug|x64
|
||||
{1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Debug|x86.Build.0 = Debug|Win32
|
||||
{1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Release|x64.ActiveCfg = Release|x64
|
||||
{1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Release|x64.Build.0 = Release|x64
|
||||
{1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Release|x86.ActiveCfg = Release|Win32
|
||||
{1FBDACB6-9142-40DA-9B50-5F591F1DD0AD}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {0B559C12-4403-4530-9A4E-7F4DF6235164}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
175
libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj
Normal file
175
libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj
Normal file
@@ -0,0 +1,175 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{1fbdacb6-9142-40da-9b50-5f591f1dd0ad}</ProjectGuid>
|
||||
<RootNamespace>MFXTest</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;CSO_DIR="../../render/res";MFX_D3D11_SUPPORT;NOMINMAX=1;MFX_DEPRECATED_OFF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>D:\rustdesk\gpucodec\externals\libvpl_v2023.4.0\tools\legacy\media_sdk_compatibility_headers;..\..\..\externals\libvpl_v2023.4.0\libvpl;..\..\..\externals\libvpl_v2023.4.0\api;..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src;..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\include;..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\include\vm;..\..\..\externals\nvEncDXGIOutputDuplicationSample;..\..\..\native\common;..\..\..\native\gpucodec;..\..\..\externals\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\..\..\externals\SDL\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>SDL2.lib;dxgi.lib;d3d11.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_config_interface\mfx_config_interface.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_config_interface\mfx_config_interface_string_api.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_dispatcher_vpl.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_dispatcher_vpl_config.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_dispatcher_vpl_loader.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_dispatcher_vpl_log.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_dispatcher_vpl_lowlatency.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_dispatcher_vpl_msdk.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_critical_section.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_dispatcher.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_dispatcher_log.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_dispatcher_main.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_driver_store_loader.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_dxva2_device.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_function_table.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_library_iterator.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_load_dll.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_win_reg_key.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\avc_bitstream.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\avc_nal_spl.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\avc_spl.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\base_allocator.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\d3d11_allocator.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\sample_utils.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\vm\atomic.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\vm\shared_object.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\vm\thread_windows.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\vm\time.cpp" />
|
||||
<ClCompile Include="..\..\..\externals\nvEncDXGIOutputDuplicationSample\DDAImpl.cpp" />
|
||||
<ClCompile Include="..\..\..\native\common\log.cpp" />
|
||||
<ClCompile Include="..\..\..\native\common\platform\win\win.cpp" />
|
||||
<ClCompile Include="..\..\..\native\gpucodec\data.c" />
|
||||
<ClCompile Include="..\..\..\native\gpucodec\gpucodec_utils.c" />
|
||||
<ClCompile Include="..\..\..\native\vpl\vpl_decode.cpp" />
|
||||
<ClCompile Include="..\..\..\native\vpl\vpl_encode.cpp" />
|
||||
<ClCompile Include="..\..\capture\src\dxgi.cpp" />
|
||||
<ClCompile Include="..\..\render\src\dxgi_sdl.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
172
libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj.filters
Normal file
172
libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj.filters
Normal file
@@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\capture">
|
||||
<UniqueIdentifier>{bd78eb0e-0894-4f11-a2f5-2cc02731bc52}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\codec">
|
||||
<UniqueIdentifier>{dd2d68d6-6559-413b-948b-f718b34cde0a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\external">
|
||||
<UniqueIdentifier>{fd52358a-9b99-43b4-b717-f3a77580a52b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\external\nvEncDXGIOutputDuplicationSample">
|
||||
<UniqueIdentifier>{bdbd71f9-8ed4-4bdd-a8c3-612f5858504d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\render">
|
||||
<UniqueIdentifier>{2089080f-479d-4d89-8cf5-7ac8e52b11d1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\common">
|
||||
<UniqueIdentifier>{3514d21d-4a74-44b9-b21b-bea909cda0b2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\external\vpl">
|
||||
<UniqueIdentifier>{ad9c7b01-cd0a-40a2-afe6-f81133ac0e15}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\external\vpl\libvpl">
|
||||
<UniqueIdentifier>{ad00df31-d9af-432b-b452-b3ab9c2b381c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\external\vpl\libvpl\src">
|
||||
<UniqueIdentifier>{b5498eaa-1ff8-4c2b-b5c3-7c71a0a2efcc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\external\vpl\libvpl\src\windows">
|
||||
<UniqueIdentifier>{bbca452b-a73f-4d37-a393-627c0db2617c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\external\vpl\libvpl\src\mfx_config_interface">
|
||||
<UniqueIdentifier>{cb497035-08af-4b38-9abd-e4616861d366}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\external\vpl\sample_common">
|
||||
<UniqueIdentifier>{85b55a79-fab7-428c-bc6c-fdf0a58b4704}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\external\vpl\sample_common\vm">
|
||||
<UniqueIdentifier>{a3824aee-0800-467f-964b-61a76000e160}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\capture\src\dxgi.cpp">
|
||||
<Filter>Source Files\capture</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\render\src\dxgi_sdl.cpp">
|
||||
<Filter>Source Files\render</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\native\common\log.cpp">
|
||||
<Filter>Source Files\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\native\common\platform\win\win.cpp">
|
||||
<Filter>Source Files\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\native\gpucodec\data.c">
|
||||
<Filter>Source Files\codec</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\native\gpucodec\gpucodec_utils.c">
|
||||
<Filter>Source Files\codec</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_critical_section.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_dispatcher.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_dispatcher_log.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_dispatcher_main.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_driver_store_loader.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_dxva2_device.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_function_table.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_library_iterator.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_load_dll.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\windows\mfx_win_reg_key.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_config_interface\mfx_config_interface.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src\mfx_config_interface</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_config_interface\mfx_config_interface_string_api.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src\mfx_config_interface</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_dispatcher_vpl.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_dispatcher_vpl_config.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_dispatcher_vpl_loader.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_dispatcher_vpl_log.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_dispatcher_vpl_lowlatency.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\libvpl\src\mfx_dispatcher_vpl_msdk.cpp">
|
||||
<Filter>Source Files\external\vpl\libvpl\src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\avc_bitstream.cpp">
|
||||
<Filter>Source Files\external\vpl\sample_common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\avc_nal_spl.cpp">
|
||||
<Filter>Source Files\external\vpl\sample_common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\avc_spl.cpp">
|
||||
<Filter>Source Files\external\vpl\sample_common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\base_allocator.cpp">
|
||||
<Filter>Source Files\external\vpl\sample_common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\sample_utils.cpp">
|
||||
<Filter>Source Files\external\vpl\sample_common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\vm\atomic.cpp">
|
||||
<Filter>Source Files\external\vpl\sample_common\vm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\vm\shared_object.cpp">
|
||||
<Filter>Source Files\external\vpl\sample_common\vm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\vm\thread_windows.cpp">
|
||||
<Filter>Source Files\external\vpl\sample_common\vm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\vm\time.cpp">
|
||||
<Filter>Source Files\external\vpl\sample_common\vm</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\nvEncDXGIOutputDuplicationSample\DDAImpl.cpp">
|
||||
<Filter>Source Files\external\nvEncDXGIOutputDuplicationSample</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\native\vpl\vpl_decode.cpp">
|
||||
<Filter>Source Files\codec</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\native\vpl\vpl_encode.cpp">
|
||||
<Filter>Source Files\codec</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\externals\libvpl_v2023.4.0\tools\legacy\sample_common\src\d3d11_allocator.cpp">
|
||||
<Filter>Source Files\external\vpl\sample_common</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
4
libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj.user
Normal file
4
libs/hwcodec/dev/vs/MFXTest/MFXTest.vcxproj.user
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
||||
111
libs/hwcodec/dev/vs/MFXTest/main.cpp
Normal file
111
libs/hwcodec/dev/vs/MFXTest/main.cpp
Normal file
@@ -0,0 +1,111 @@
|
||||
#include <Windows.h>
|
||||
#include <callback.h>
|
||||
#include <common.h>
|
||||
#include <iostream>
|
||||
#include <stdint.h>
|
||||
#include <system.h>
|
||||
|
||||
extern "C" {
|
||||
void *dxgi_new_capturer(int64_t luid);
|
||||
void *dxgi_device(void *self);
|
||||
int dxgi_width(const void *self);
|
||||
int dxgi_height(const void *self);
|
||||
void *dxgi_capture(void *self, int wait_ms);
|
||||
void destroy_dxgi_capturer(void *self);
|
||||
|
||||
void *vpl_new_encoder(void *hdl, int64_t luid, API api, DataFormat dataFormat,
|
||||
int32_t width, int32_t height, int32_t kbs,
|
||||
int32_t framerate, int32_t gop);
|
||||
int vpl_encode(void *e, void *tex, EncodeCallback callback, void *obj);
|
||||
int vpl_destroy_encoder(void *e);
|
||||
|
||||
void *vpl_new_decoder(void *device, int64_t luid, int32_t api,
|
||||
int32_t dataFormat, bool outputSharedHandle);
|
||||
int vpl_decode(void *decoder, uint8_t *data, int32_t length,
|
||||
DecodeCallback callback, void *obj);
|
||||
int vpl_destroy_decoder(void *decoder);
|
||||
|
||||
void *CreateDXGIRender(long long luid, bool inputSharedHandle);
|
||||
int DXGIRenderTexture(void *render, HANDLE shared_handle);
|
||||
void DestroyDXGIRender(void *render);
|
||||
void *DXGIDevice(void *render);
|
||||
}
|
||||
|
||||
static const uint8_t *encode_data;
|
||||
static int32_t encode_len;
|
||||
static void *decode_shared_handle;
|
||||
|
||||
extern "C" static void encode_callback(const uint8_t *data, int32_t len,
|
||||
int32_t key, const void *obj) {
|
||||
encode_data = data;
|
||||
encode_len = len;
|
||||
}
|
||||
|
||||
extern "C" static void decode_callback(void *shared_handle, const void *obj) {
|
||||
decode_shared_handle = shared_handle;
|
||||
}
|
||||
|
||||
extern "C" void log_gpucodec(int level, const char *message) {
|
||||
std::cout << message << std::endl;
|
||||
}
|
||||
int main() {
|
||||
Adapters adapters;
|
||||
adapters.Init(ADAPTER_VENDOR_INTEL);
|
||||
if (adapters.adapters_.size() == 0) {
|
||||
std::cout << "no intel adapter" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
int64_t luid = LUID(adapters.adapters_[0].get()->desc1_);
|
||||
DataFormat dataFormat = H264;
|
||||
void *dup = dxgi_new_capturer(luid);
|
||||
if (!dup) {
|
||||
std::cerr << "create duplicator failed" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
int width = dxgi_width(dup);
|
||||
int height = dxgi_height(dup);
|
||||
std::cout << "width: " << width << " height: " << height << std::endl;
|
||||
void *device = dxgi_device(dup);
|
||||
void *encoder = vpl_new_encoder(device, luid, API_DX11, dataFormat, width,
|
||||
height, 4000, 30, 0xFFFF);
|
||||
if (!encoder) {
|
||||
std::cerr << "create encoder failed" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void *render = CreateDXGIRender(luid, false);
|
||||
if (!render) {
|
||||
std::cerr << "create render failed" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void *decoder =
|
||||
vpl_new_decoder(DXGIDevice(render), luid, API_DX11, dataFormat, false);
|
||||
if (!decoder) {
|
||||
std::cerr << "create decoder failed" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
void *texture = dxgi_capture(dup, 100);
|
||||
if (!texture) {
|
||||
std::cerr << "texture is NULL" << std::endl;
|
||||
continue;
|
||||
}
|
||||
if (0 != vpl_encode(encoder, texture, encode_callback, NULL)) {
|
||||
std::cerr << "encode failed" << std::endl;
|
||||
continue;
|
||||
}
|
||||
if (0 != vpl_decode(decoder, (uint8_t *)encode_data, encode_len,
|
||||
decode_callback, NULL)) {
|
||||
std::cerr << "decode failed" << std::endl;
|
||||
continue;
|
||||
}
|
||||
if (0 != DXGIRenderTexture(render, decode_shared_handle)) {
|
||||
std::cerr << "render failed" << std::endl;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// no release temporarily
|
||||
}
|
||||
31
libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.sln
Normal file
31
libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.sln
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.33627.172
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ShaderCompileTool", "ShaderCompileTool.vcxproj", "{AB626EFE-F38C-4587-B79C-29FC898FBC96}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{AB626EFE-F38C-4587-B79C-29FC898FBC96}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{AB626EFE-F38C-4587-B79C-29FC898FBC96}.Debug|x64.Build.0 = Debug|x64
|
||||
{AB626EFE-F38C-4587-B79C-29FC898FBC96}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{AB626EFE-F38C-4587-B79C-29FC898FBC96}.Debug|x86.Build.0 = Debug|Win32
|
||||
{AB626EFE-F38C-4587-B79C-29FC898FBC96}.Release|x64.ActiveCfg = Release|x64
|
||||
{AB626EFE-F38C-4587-B79C-29FC898FBC96}.Release|x64.Build.0 = Release|x64
|
||||
{AB626EFE-F38C-4587-B79C-29FC898FBC96}.Release|x86.ActiveCfg = Release|Win32
|
||||
{AB626EFE-F38C-4587-B79C-29FC898FBC96}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {9A483A95-1588-48EF-A2C9-2B4731AFCAB2}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
150
libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.vcxproj
Normal file
150
libs/hwcodec/dev/vs/ShaderCompileTool/ShaderCompileTool.vcxproj
Normal file
@@ -0,0 +1,150 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{ab626efe-f38c-4587-b79c-29fc898fbc96}</ProjectGuid>
|
||||
<RootNamespace>ShaderCompileTool</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<FxCompile Include="nv_vertex_shader.hlsl">
|
||||
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
</ObjectFileOutput>
|
||||
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">VS</EntryPointName>
|
||||
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</DisableOptimizations>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
|
||||
<HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(Filename).h</HeaderFileOutput>
|
||||
</FxCompile>
|
||||
<FxCompile Include="nv_pixel_shader_601.hlsl">
|
||||
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
</ObjectFileOutput>
|
||||
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">PS</EntryPointName>
|
||||
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</DisableOptimizations>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
|
||||
<HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(Filename).h</HeaderFileOutput>
|
||||
</FxCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<FxCompile Include="nv_pixel_shader_601.hlsl" />
|
||||
<FxCompile Include="nv_vertex_shader.hlsl" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
||||
@@ -0,0 +1,20 @@
|
||||
Texture2D g_txFrame0 : register(t0);
|
||||
Texture2D g_txFrame1 : register(t1);
|
||||
SamplerState g_Sam : register(s0);
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float4 Pos : SV_POSITION;
|
||||
float2 Tex : TEXCOORD0;
|
||||
};
|
||||
float4 PS(PS_INPUT input) : SV_TARGET{
|
||||
float y = g_txFrame0.Sample(g_Sam, input.Tex).r;
|
||||
y = 1.164383561643836 * (y - 0.0625);
|
||||
float2 uv = g_txFrame1.Sample(g_Sam, input.Tex).rg - float2(0.5f, 0.5f);
|
||||
float u = uv.x;
|
||||
float v = uv.y;
|
||||
float r = saturate(y + 1.596026785714286 * v);
|
||||
float g = saturate(y - 0.812967647237771 * v - 0.391762290094914 * u);
|
||||
float b = saturate(y + 2.017232142857142 * u);
|
||||
return float4(r, g, b, 1.0f);
|
||||
}
|
||||
15
libs/hwcodec/dev/vs/ShaderCompileTool/nv_vertex_shader.hlsl
Normal file
15
libs/hwcodec/dev/vs/ShaderCompileTool/nv_vertex_shader.hlsl
Normal file
@@ -0,0 +1,15 @@
|
||||
struct VS_INPUT
|
||||
{
|
||||
float4 Pos : POSITION;
|
||||
float2 Tex : TEXCOORD;
|
||||
};
|
||||
|
||||
struct VS_OUTPUT
|
||||
{
|
||||
float4 Pos : SV_POSITION;
|
||||
float2 Tex : TEXCOORD;
|
||||
};
|
||||
VS_OUTPUT VS(VS_INPUT input)
|
||||
{
|
||||
return input;
|
||||
}
|
||||
Reference in New Issue
Block a user