diff --git a/ProxyEdit.vcxproj b/ProxyEdit.vcxproj
index 234019d..85c054e 100644
--- a/ProxyEdit.vcxproj
+++ b/ProxyEdit.vcxproj
@@ -100,6 +100,7 @@
+
@@ -112,6 +113,7 @@
+
diff --git a/ProxyEdit.vcxproj.filters b/ProxyEdit.vcxproj.filters
index bf6c66e..5681d8c 100644
--- a/ProxyEdit.vcxproj.filters
+++ b/ProxyEdit.vcxproj.filters
@@ -43,6 +43,9 @@
ソース ファイル
+
+ ソース ファイル
+
ソース ファイル
@@ -72,6 +75,9 @@
ヘッダー ファイル
+
+ ヘッダー ファイル
+
ヘッダー ファイル
diff --git a/src/Plugin.cpp b/src/Plugin.cpp
index 8caa9d3..5f5e556 100644
--- a/src/Plugin.cpp
+++ b/src/Plugin.cpp
@@ -2,6 +2,10 @@
#include "HostContext.h"
#include "Log.h"
+#include "MediaDecoder.h"
+#include "ProxyBuilder.h"
+#include "ProxyInput.h"
+#include "Settings.h"
using namespace pe;
@@ -22,9 +26,16 @@ EXTERN_C __declspec(dllexport) bool InitializePlugin(DWORD) { return true; }
EXTERN_C __declspec(dllexport) void RegisterPlugin(HOST_APP_TABLE* host) {
SetEditHandle(host->create_edit_handle());
SetHostWindow(Edit()->get_host_app_window());
+ LoadSettings();
+ StartMediaFoundation();
+ host->register_input_plugin(ProxyInputTable());
+ StartBuilder();
}
EXTERN_C __declspec(dllexport) void UninitializePlugin() {
+ StopBuilder();
+ ShutdownProxyInput();
+ StopMediaFoundation();
}
BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID) {
diff --git a/src/ProxyBuilder.cpp b/src/ProxyBuilder.cpp
index fab15a9..5f1bc6f 100644
--- a/src/ProxyBuilder.cpp
+++ b/src/ProxyBuilder.cpp
@@ -280,6 +280,7 @@ bool RegisterSource(const std::wstring& source, std::wstring& proxy_path) {
header.chunk_frames = settings.chunk_frames;
header.source_size = key.size;
header.source_time = key.time;
+ wcsncpy_s(header.source_path, key.path.c_str(), _TRUNCATE);
probe.Close();
EnsureStoreDirectory();
@@ -287,6 +288,7 @@ bool RegisterSource(const std::wstring& source, std::wstring& proxy_path) {
if (job->writer.OpenExisting(job->proxy)) {
const ProxyHeader& existing = job->writer.Header();
if (SameSource(key, existing.source_size, existing.source_time) &&
+ _wcsicmp(existing.source_path, key.path.c_str()) == 0 &&
existing.proxy_width == header.proxy_width && existing.proxy_height == header.proxy_height &&
existing.frame_count == header.frame_count && existing.quality == header.quality &&
existing.chunk_frames == header.chunk_frames) {
diff --git a/src/ProxyFormat.h b/src/ProxyFormat.h
index 372857f..f2f3e48 100644
--- a/src/ProxyFormat.h
+++ b/src/ProxyFormat.h
@@ -26,6 +26,7 @@ struct ProxyHeader {
int64_t source_time;
int64_t data_offset;
int32_t reserved[14];
+ wchar_t source_path[1024];
};
struct ProxyIndexEntry {
diff --git a/src/ProxyInput.cpp b/src/ProxyInput.cpp
new file mode 100644
index 0000000..344a613
--- /dev/null
+++ b/src/ProxyInput.cpp
@@ -0,0 +1,259 @@
+#include "ProxyInput.h"
+
+#include
+#include
+#include
+#include
+#include