Skip to content

Commit

Permalink
・[update] 開発環境を Visual Studio 2022 に更新
Browse files Browse the repository at this point in the history
・[fix] lwinput.auiに func_init、func_exitが実装されていれば、それぞれ呼ぶようにした (オリジナルはnullptrだったので呼んでいなかった)
・[change] 内部データ交換方式は、"共有メモリ"をデフォルトにした
・[fix] InputPipePlugin.aui から InputPipeMain.exe 実行時に、カレントディレクトリを設定するようにした (lsmash.iniを読み込めるようになったはず)
  • Loading branch information
amate committed Jun 13, 2022
1 parent a5e77ff commit 477b4f9
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 15 deletions.
5 changes: 5 additions & 0 deletions InputPipeMain/InputPipeMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
return 0;
}

BOOL b = Plugin_func_init();

// for Debug
CallFunc lastCallFunc;
bool activeLoop = true;
Expand Down Expand Up @@ -337,6 +339,9 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
}

};

b = Plugin_func_exit();

::FreeLibrary(g_hWinputDll);
g_hWinputDll = NULL;

Expand Down
12 changes: 8 additions & 4 deletions InputPipeMain/InputPipeMain.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<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>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand All @@ -73,13 +73,17 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)$(Configuration)\plugins\</OutDir>
<IncludePath>C:\Programing\#lib\boost_1_73_0\lib\include\boost-1_73;C:\Programing\#lib\WTL10_10320_Release\Include;$(IncludePath)</IncludePath>
<LibraryPath>C:\Programing\#lib\boost_1_73_0\lib\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IncludePath>C:\Programing\#lib\boost_1_73_0\lib\include\boost-1_73;C:\Programing\#lib\WTL10_10320_Release\Include;$(IncludePath)</IncludePath>
<LibraryPath>C:\Programing\#lib\boost_1_73_0\lib\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
Expand Down
12 changes: 8 additions & 4 deletions InputPipePlugin/InputPipePlugin.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand All @@ -74,13 +74,17 @@
<LinkIncremental>true</LinkIncremental>
<TargetExt>.aui</TargetExt>
<OutDir>$(SolutionDir)$(Configuration)\plugins\</OutDir>
<IncludePath>C:\Programing\#lib\boost_1_73_0\lib\include\boost-1_73;C:\Programing\#lib\WTL10_10320_Release\Include;$(IncludePath)</IncludePath>
<LibraryPath>C:\Programing\#lib\boost_1_73_0\lib\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetExt>.aui</TargetExt>
<IncludePath>C:\Programing\#lib\boost_1_73_0\lib\include\boost-1_73;C:\Programing\#lib\WTL10_10320_Release\Include;$(IncludePath)</IncludePath>
<LibraryPath>C:\Programing\#lib\boost_1_73_0\lib\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
Expand Down
12 changes: 10 additions & 2 deletions InputPipePlugin/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,12 @@ BOOL func_init( void )
m_config.bEnableIPC = false;
return TRUE;
}
return TRUE;

} else {
BOOL b = Plugin_func_init();
return b;
}
return TRUE;
}


Expand All @@ -222,8 +226,12 @@ BOOL func_exit( void )
g_audioSharedMemory.CloseHandle();

DisconnectPipeAndStopProcess();

return TRUE;
} else {
BOOL b = Plugin_func_exit();
return b;
}
return TRUE;
}

bool IsAlternativeFileName(const std::string& filePath)
Expand Down
11 changes: 9 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ aviutlのメモリ使用量削減を目論む、aviutlの入力プラグイン
・拡張編集 0.92
※ 拡張編集 0.93rc1 はシーン周りに不具合があるので推奨しません
・L-SMASH Works r935 release2
・L-SMASH-Works_rev1096_Mr-Ojii_Mr-Ojii_AviUtl
上記の環境で動作を確認しています
XPではたぶん動きません(コンパイラが対応していないため)

Expand Down Expand Up @@ -90,7 +91,7 @@ InputPipePluginConfig.ini を削除してください
https://ws.formzu.net/fgen/S37403840/

## ■著作権表示
Copyright (C) 2019-2020 amate
Copyright (C) 2019-2022 amate

私が書いた部分のソースコードは、MIT License とします。

Expand Down Expand Up @@ -123,7 +124,7 @@ AvidemuxのVideo OutputとAudio OutputをCopyに、Output FormatをMkv Muxerに
コンテナを変更するだけでなぜ直るのかは謎

## ■ビルドについて
Visual Studio 2019 が必要です
Visual Studio 2022 が必要です
ビルドには boost(1.70~)とWTL(10_9163) が必要なのでそれぞれ用意してください。

Boost::Logを使用しているので、事前にライブラリのビルドが必要になります
Expand All @@ -143,6 +144,12 @@ http://sourceforge.net/projects/wtl/
## ■更新履歴
<pre>

v1.9
・[update] 開発環境を Visual Studio 2022 に更新
・[fix] lwinput.auiに func_init、func_exitが実装されていれば、それぞれ呼ぶようにした (オリジナルはnullptrだったので呼んでいなかった)
・[change] 内部データ交換方式は、"共有メモリ"をデフォルトにした
・[fix] InputPipePlugin.aui から InputPipeMain.exe 実行時に、カレントディレクトリを設定するようにした (lsmash.iniを読み込めるようになったはず)

v1.8
・[add] 同一フレーム同一ファイル問題に対処、Altを押しながらのファイルドロップで、新規ファイルとして開く処理を追加

Expand Down
2 changes: 1 addition & 1 deletion Share/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ bool Config::LoadConfig()
auto ptree = ptreeWrapper::LoadIniPtree(kConfigFileName);
bEnableHandleCache = ptree.get<bool>(L"Config.bEnableHandleCache", true);
bEnableIPC = ptree.get<bool>(L"Config.bEnableIPC", true);
bUseSharedMemory = ptree.get<bool>(L"Config.bUseSharedMemory", false);
bUseSharedMemory = ptree.get<bool>(L"Config.bUseSharedMemory", true);

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion Share/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ BOOL func_config(HWND hwnd, HINSTANCE dll_hinst);

////////////////////////////////////////////////////////////////

#define PLUGIN_VERSION "1.8"
#define PLUGIN_VERSION "1.9"


constexpr int kVideoBufferSurplusBytes = 0x3FF;
Expand Down
2 changes: 1 addition & 1 deletion Share/IPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool BindProcess::StartProcess(const std::wstring& exePath, const std::wstring&
securityAttributes.bInheritHandle = TRUE;
std::wstring cmdLine = L" " + std::to_wstring((uint64_t)m_hEventKillSwitch) + L" " + commandLine;
BOOL bRet = ::CreateProcess(exePath.c_str(), (LPWSTR)cmdLine.data(),
nullptr, nullptr, TRUE, 0, nullptr, nullptr, &startUpInfo, &processInfo);
nullptr, nullptr, TRUE, 0, nullptr, GetExeDirectory().c_str(), &startUpInfo, &processInfo);
ATLASSERT(bRet);
::CloseHandle(processInfo.hThread);
::CloseHandle(processInfo.hProcess);
Expand Down
22 changes: 22 additions & 0 deletions Share/PluginWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,28 @@

extern INPUT_PLUGIN_TABLE* g_winputPluginTable;

BOOL Plugin_func_init()
{
if (g_winputPluginTable->func_init) {
BOOL b = g_winputPluginTable->func_init();
return b;

} else {
return TRUE;
}
}

BOOL Plugin_func_exit()
{
if (g_winputPluginTable->func_exit) {
BOOL b = g_winputPluginTable->func_exit();
return b;

} else {
return TRUE;
}
}


INPUT_HANDLE Plugin_func_open(LPSTR file)
{
Expand Down
2 changes: 2 additions & 0 deletions Share/PluginWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include "..\InputPipePlugin\input.h"

BOOL Plugin_func_init();
BOOL Plugin_func_exit();
INPUT_HANDLE Plugin_func_open(LPSTR file);
BOOL Plugin_func_close(INPUT_HANDLE ih);
BOOL Plugin_func_info_get(INPUT_HANDLE ih, INPUT_INFO* iip);
Expand Down

0 comments on commit 477b4f9

Please sign in to comment.