mirror of
https://github.com/staxrip/staxrip.git
synced 2026-10-18 14:40:32 +08:00
52 lines
1.0 KiB
C++
52 lines
1.0 KiB
C++
|
|
#pragma once
|
|
|
|
#include "Common.h"
|
|
#include "FrameServer.h"
|
|
#include "avisynth.h"
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
|
|
#include <atomic>
|
|
|
|
const AVS_Linkage* AVS_linkage = NULL;
|
|
|
|
|
|
class AviSynthServer : IFrameServer
|
|
{
|
|
|
|
private:
|
|
|
|
std::atomic<int> m_References = 0;
|
|
std::wstring m_Error;
|
|
ServerInfo m_Info = {};
|
|
|
|
IScriptEnvironment* m_ScriptEnvironment = NULL;
|
|
PClip m_Clip;
|
|
AVSValue m_AVSValue;
|
|
PVideoFrame m_Frame;
|
|
const AVS_Linkage* m_Linkage = NULL;
|
|
|
|
void Free();
|
|
|
|
public:
|
|
|
|
~AviSynthServer();
|
|
|
|
// IUnknown
|
|
|
|
HRESULT __stdcall QueryInterface(const IID& iid, void** ppv);
|
|
ULONG __stdcall AddRef();
|
|
ULONG __stdcall Release();
|
|
|
|
// IFrameServer
|
|
|
|
HRESULT __stdcall OpenFile(WCHAR* file);
|
|
HRESULT __stdcall GetFrame(int position, void** data, int& pitch);
|
|
ServerInfo* __stdcall GetInfo();
|
|
WCHAR* __stdcall GetError();
|
|
};
|
|
|
|
|
|
extern "C" __declspec(dllexport) AviSynthServer* __stdcall CreateAviSynthServer();
|