diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2010-04-09 18:12:59 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2010-04-09 18:12:59 +0400 |
commit | efbc9d9043ff8ff92716ddd00a5f61412d535593 (patch) | |
tree | 8f3e621f756cf1f5b4d64d97964c7e7abd8aaf08 /include/vd2 | |
parent | df6b139a6d9027156f614b68687e039e3a5854db (diff) |
revert r1783
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1785 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'include/vd2')
-rw-r--r-- | include/vd2/OldFilterSDK/Filter.h | 9 | ||||
-rw-r--r-- | include/vd2/VDXFrame/Unknown.h | 114 | ||||
-rw-r--r-- | include/vd2/VDXFrame/VideoFilter.h | 255 | ||||
-rw-r--r-- | include/vd2/VDXFrame/VideoFilterDialog.h | 19 | ||||
-rw-r--r-- | include/vd2/VDXFrame/VideoFilterEntry.h | 2 | ||||
-rw-r--r-- | include/vd2/extras/FilterSDK/Filter.h | 200 | ||||
-rw-r--r-- | include/vd2/extras/FilterSDK/ScriptError.h | 74 | ||||
-rw-r--r-- | include/vd2/extras/FilterSDK/ScriptInterpreter.h | 19 | ||||
-rw-r--r-- | include/vd2/extras/FilterSDK/ScriptValue.h | 199 | ||||
-rw-r--r-- | include/vd2/extras/FilterSDK/VBitmap.h | 190 | ||||
-rw-r--r-- | include/vd2/plugin/vdaudiofilt.h | 225 | ||||
-rw-r--r-- | include/vd2/plugin/vdinputdriver.h | 348 | ||||
-rw-r--r-- | include/vd2/plugin/vdplugin.h | 266 | ||||
-rw-r--r-- | include/vd2/plugin/vdvideofilt.h | 741 | ||||
-rw-r--r-- | include/vd2/plugin/vdvideoutil.h | 178 |
15 files changed, 1282 insertions, 1557 deletions
diff --git a/include/vd2/OldFilterSDK/Filter.h b/include/vd2/OldFilterSDK/Filter.h index 7e283fcc4..40515ba7e 100644 --- a/include/vd2/OldFilterSDK/Filter.h +++ b/include/vd2/OldFilterSDK/Filter.h @@ -6,15 +6,14 @@ // This is really dumb, but necessary to support VTbls in C++.
-typedef struct VDXFilterVTbls
-{
- void *pvtblVBitmap;
+typedef struct VDXFilterVTbls {
+ void *pvtblVBitmap;
} FilterVTbls;
#ifdef VDEXT_MAIN
-VDXFilterVTbls g_vtbls;
+ VDXFilterVTbls g_vtbls;
#elif defined(VDEXT_NOTMAIN)
-extern VDXFilterVTbls g_vtbls;
+ extern VDXFilterVTbls g_vtbls;
#endif
#define INITIALIZE_VTBLS ff->InitVTables(&g_vtbls)
diff --git a/include/vd2/VDXFrame/Unknown.h b/include/vd2/VDXFrame/Unknown.h index 47878110e..34de61f46 100644 --- a/include/vd2/VDXFrame/Unknown.h +++ b/include/vd2/VDXFrame/Unknown.h @@ -30,91 +30,81 @@ extern "C" long _InterlockedExchangeAdd(volatile long *p, long v);
#pragma intrinsic(_InterlockedExchangeAdd)
-template<class T> class vdxunknown : public T
-{
+template<class T> class vdxunknown : public T {
public:
- vdxunknown() : mRefCount(0) {}
- vdxunknown(const vdxunknown<T>& src) : mRefCount(0) {} // do not copy the refcount
- virtual ~vdxunknown() {}
+ vdxunknown() : mRefCount(0) {}
+ vdxunknown(const vdxunknown<T>& src) : mRefCount(0) {} // do not copy the refcount
+ virtual ~vdxunknown() {}
- vdxunknown<T>& operator=(const vdxunknown<T>&) {} // do not copy the refcount
+ vdxunknown<T>& operator=(const vdxunknown<T>&) {} // do not copy the refcount
- virtual int VDXAPIENTRY AddRef()
- {
- return _InterlockedExchangeAdd(&mRefCount, 1) + 1;
- }
+ virtual int VDXAPIENTRY AddRef() {
+ return _InterlockedExchangeAdd(&mRefCount, 1) + 1;
+ }
- virtual int VDXAPIENTRY Release()
- {
- long rc = _InterlockedExchangeAdd(&mRefCount, -1) - 1;
- if(!mRefCount)
- {
- mRefCount = 1;
- delete this;
- return 0;
- }
+ virtual int VDXAPIENTRY Release() {
+ long rc = _InterlockedExchangeAdd(&mRefCount, -1) - 1;
+ if (!mRefCount) {
+ mRefCount = 1;
+ delete this;
+ return 0;
+ }
- return rc;
- }
+ return rc;
+ }
- virtual void *VDXAPIENTRY AsInterface(uint32 iid)
- {
- if(iid == T::kIID)
- return static_cast<T *>(this);
+ virtual void *VDXAPIENTRY AsInterface(uint32 iid) {
+ if (iid == T::kIID)
+ return static_cast<T *>(this);
- if(iid == IVDXUnknown::kIID)
- return static_cast<IVDXUnknown *>(this);
+ if (iid == IVDXUnknown::kIID)
+ return static_cast<IVDXUnknown *>(this);
- return NULL;
- }
+ return NULL;
+ }
protected:
- volatile long mRefCount;
+ volatile long mRefCount;
};
-template<class T1, class T2> class vdxunknown2 : public T1, public T2
-{
+template<class T1, class T2> class vdxunknown2 : public T1, public T2 {
public:
- vdxunknown2() : mRefCount(0) {}
- vdxunknown2(const vdxunknown2& src) : mRefCount(0) {} // do not copy the refcount
- virtual ~vdxunknown2() {}
+ vdxunknown2() : mRefCount(0) {}
+ vdxunknown2(const vdxunknown2& src) : mRefCount(0) {} // do not copy the refcount
+ virtual ~vdxunknown2() {}
- vdxunknown2& operator=(const vdxunknown2&) {} // do not copy the refcount
+ vdxunknown2& operator=(const vdxunknown2&) {} // do not copy the refcount
- virtual int VDXAPIENTRY AddRef()
- {
- return _InterlockedExchangeAdd(&mRefCount, 1) + 1;
- }
+ virtual int VDXAPIENTRY AddRef() {
+ return _InterlockedExchangeAdd(&mRefCount, 1) + 1;
+ }
- virtual int VDXAPIENTRY Release()
- {
- long rc = _InterlockedExchangeAdd(&mRefCount, -1) - 1;
- if(!mRefCount)
- {
- mRefCount = 1;
- delete this;
- return 0;
- }
+ virtual int VDXAPIENTRY Release() {
+ long rc = _InterlockedExchangeAdd(&mRefCount, -1) - 1;
+ if (!mRefCount) {
+ mRefCount = 1;
+ delete this;
+ return 0;
+ }
- return rc;
- }
+ return rc;
+ }
- virtual void *VDXAPIENTRY AsInterface(uint32 iid)
- {
- if(iid == T1::kIID)
- return static_cast<T1 *>(this);
+ virtual void *VDXAPIENTRY AsInterface(uint32 iid) {
+ if (iid == T1::kIID)
+ return static_cast<T1 *>(this);
- if(iid == T2::kIID)
- return static_cast<T2 *>(this);
+ if (iid == T2::kIID)
+ return static_cast<T2 *>(this);
- if(iid == IVDXUnknown::kIID)
- return static_cast<IVDXUnknown *>(static_cast<T1 *>(this));
+ if (iid == IVDXUnknown::kIID)
+ return static_cast<IVDXUnknown *>(static_cast<T1 *>(this));
- return NULL;
- }
+ return NULL;
+ }
protected:
- volatile long mRefCount;
+ volatile long mRefCount;
};
#endif
diff --git a/include/vd2/VDXFrame/VideoFilter.h b/include/vd2/VDXFrame/VideoFilter.h index bec645a42..78ef03bd1 100644 --- a/include/vd2/VDXFrame/VideoFilter.h +++ b/include/vd2/VDXFrame/VideoFilter.h @@ -37,55 +37,54 @@ /// This class handles most of the grimy work of creating the interface
/// between your filter and VirtualDub.
///
-class VDXVideoFilter
-{
+class VDXVideoFilter {
public:
- VDXVideoFilter();
- virtual ~VDXVideoFilter();
-
- void SetHooks(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
-
- // linkage routines
-
- virtual bool Init();
- virtual uint32 GetParams() = 0;
- virtual void Start();
- virtual void Run() = 0;
- virtual void End();
- virtual bool Configure(VDXHWND hwnd);
- virtual void GetSettingString(char *buf, int maxlen);
- virtual void GetScriptString(char *buf, int maxlen);
- virtual int Serialize(char *buf, int maxbuf);
- virtual int Deserialize(const char *buf, int maxbuf);
- virtual sint64 Prefetch(sint64 frame);
- virtual bool Prefetch2(sint64 frame, IVDXVideoPrefetcher *prefetcher);
-
- virtual bool OnEvent(uint32 event, const void *eventData);
- virtual bool OnInvalidateCaches();
-
- static void __cdecl FilterDeinit(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
- static int __cdecl FilterRun(const VDXFilterActivation *fa, const VDXFilterFunctions *ff);
- static long __cdecl FilterParam(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
- static int __cdecl FilterConfig(VDXFilterActivation *fa, const VDXFilterFunctions *ff, VDXHWND hWnd);
- static int __cdecl FilterStart(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
- static int __cdecl FilterEnd(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
- static void __cdecl FilterString(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, char *buf);
- static bool __cdecl FilterScriptStr(VDXFilterActivation *fa, const VDXFilterFunctions *, char *, int);
- static void __cdecl FilterString2(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, char *buf, int maxlen);
- static int __cdecl FilterSerialize(VDXFilterActivation *fa, const VDXFilterFunctions *ff, char *buf, int maxbuf);
- static void __cdecl FilterDeserialize(VDXFilterActivation *fa, const VDXFilterFunctions *ff, const char *buf, int maxbuf);
- static sint64 __cdecl FilterPrefetch(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, sint64 frame);
- static bool __cdecl FilterPrefetch2(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, sint64 frame, IVDXVideoPrefetcher *prefetcher);
- static bool __cdecl FilterEvent(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, uint32 event, const void *eventData);
-
- // member variables
- VDXFilterActivation *fa;
- const VDXFilterFunctions *ff;
-
- static const VDXScriptFunctionDef sScriptMethods[];
+ VDXVideoFilter();
+ virtual ~VDXVideoFilter();
+
+ void SetHooks(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
+
+ // linkage routines
+
+ virtual bool Init();
+ virtual uint32 GetParams()=0;
+ virtual void Start();
+ virtual void Run() = 0;
+ virtual void End();
+ virtual bool Configure(VDXHWND hwnd);
+ virtual void GetSettingString(char *buf, int maxlen);
+ virtual void GetScriptString(char *buf, int maxlen);
+ virtual int Serialize(char *buf, int maxbuf);
+ virtual int Deserialize(const char *buf, int maxbuf);
+ virtual sint64 Prefetch(sint64 frame);
+ virtual bool Prefetch2(sint64 frame, IVDXVideoPrefetcher *prefetcher);
+
+ virtual bool OnEvent(uint32 event, const void *eventData);
+ virtual bool OnInvalidateCaches();
+
+ static void __cdecl FilterDeinit (VDXFilterActivation *fa, const VDXFilterFunctions *ff);
+ static int __cdecl FilterRun (const VDXFilterActivation *fa, const VDXFilterFunctions *ff);
+ static long __cdecl FilterParam (VDXFilterActivation *fa, const VDXFilterFunctions *ff);
+ static int __cdecl FilterConfig (VDXFilterActivation *fa, const VDXFilterFunctions *ff, VDXHWND hWnd);
+ static int __cdecl FilterStart (VDXFilterActivation *fa, const VDXFilterFunctions *ff);
+ static int __cdecl FilterEnd (VDXFilterActivation *fa, const VDXFilterFunctions *ff);
+ static void __cdecl FilterString (const VDXFilterActivation *fa, const VDXFilterFunctions *ff, char *buf);
+ static bool __cdecl FilterScriptStr(VDXFilterActivation *fa, const VDXFilterFunctions *, char *, int);
+ static void __cdecl FilterString2 (const VDXFilterActivation *fa, const VDXFilterFunctions *ff, char *buf, int maxlen);
+ static int __cdecl FilterSerialize (VDXFilterActivation *fa, const VDXFilterFunctions *ff, char *buf, int maxbuf);
+ static void __cdecl FilterDeserialize (VDXFilterActivation *fa, const VDXFilterFunctions *ff, const char *buf, int maxbuf);
+ static sint64 __cdecl FilterPrefetch(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, sint64 frame);
+ static bool __cdecl FilterPrefetch2(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, sint64 frame, IVDXVideoPrefetcher *prefetcher);
+ static bool __cdecl FilterEvent(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, uint32 event, const void *eventData);
+
+ // member variables
+ VDXFilterActivation *fa;
+ const VDXFilterFunctions *ff;
+
+ static const VDXScriptFunctionDef sScriptMethods[];
protected:
- void SafePrintf(char *buf, int maxbuf, const char *format, ...);
+ void SafePrintf(char *buf, int maxbuf, const char *format, ...);
};
///////////////////////////////////////////////////////////////////////////
@@ -114,7 +113,7 @@ protected: extern char VDXVideoFilterConfigureOverloadTest(bool (VDXVideoFilter::*)(VDXHWND));
extern double VDXVideoFilterConfigureOverloadTest(...);
-extern char VDXVideoFilterPrefetchOverloadTest(sint64(VDXVideoFilter::*)(sint64));
+extern char VDXVideoFilterPrefetchOverloadTest(sint64 (VDXVideoFilter::*)(sint64));
extern double VDXVideoFilterPrefetchOverloadTest(...);
extern char VDXVideoFilterPrefetch2OverloadTest(bool (VDXVideoFilter::*)(sint64, IVDXVideoPrefetcher *));
extern double VDXVideoFilterPrefetch2OverloadTest(...);
@@ -123,25 +122,22 @@ template<class T, void (T::*T_Method)(IVDXScriptInterpreter *, const VDXScriptVa class VDXVideoFilterScriptAdapter
{
public:
- static void AdaptFn(IVDXScriptInterpreter *isi, void *fa0, const VDXScriptValue *argv, int argc)
- {
- VDXFilterActivation *fa = (VDXFilterActivation *)fa0;
- VDXVideoFilter *base = *(VDXVideoFilter **)fa->filter_data;
- (static_cast<T *>(base)->*T_Method)(isi, argv, argc);
- }
+ static void AdaptFn(IVDXScriptInterpreter *isi, void *fa0, const VDXScriptValue *argv, int argc) {
+ VDXFilterActivation *fa = (VDXFilterActivation *)fa0;
+ VDXVideoFilter *base = *(VDXVideoFilter **)fa->filter_data;
+ (static_cast<T *>(base)->*T_Method)(isi, argv, argc);
+ }
};
template<class T>
-class VDXVideoFilterScriptObjectAdapter
-{
+class VDXVideoFilterScriptObjectAdapter {
public:
- static const VDXScriptObject sScriptObject;
+ static const VDXScriptObject sScriptObject;
};
template<class T>
-const VDXScriptObject VDXVideoFilterScriptObjectAdapter<T>::sScriptObject =
-{
- NULL, (T::sScriptMethods == VDXVideoFilter::sScriptMethods) ? NULL : (VDXScriptFunctionDef *)static_cast<const VDXScriptFunctionDef *>(T::sScriptMethods), NULL
+const VDXScriptObject VDXVideoFilterScriptObjectAdapter<T>::sScriptObject = {
+ NULL, (T::sScriptMethods == VDXVideoFilter::sScriptMethods) ? NULL : (VDXScriptFunctionDef *)static_cast<const VDXScriptFunctionDef *>(T::sScriptMethods), NULL
};
///////////////////////////////////////////////////////////////////////////
@@ -151,84 +147,75 @@ const VDXScriptObject VDXVideoFilterScriptObjectAdapter<T>::sScriptObject = /// your filter class.
///
template<class T>
-class VDXVideoFilterDefinition : public VDXFilterDefinition
-{
+class VDXVideoFilterDefinition : public VDXFilterDefinition {
public:
- VDXVideoFilterDefinition(const char *pszAuthor, const char *pszName, const char *pszDescription)
- {
- _next = NULL;
- _prev = NULL;
- _module = NULL;
-
- name = pszName;
- desc = pszDescription;
- maker = pszAuthor;
- private_data = NULL;
- inst_data_size = sizeof(T) + sizeof(VDXVideoFilter *);
-
- initProc = FilterInit;
- deinitProc = T::FilterDeinit;
- runProc = T::FilterRun;
- paramProc = T::FilterParam;
- configProc = sizeof(VDXVideoFilterConfigureOverloadTest(&T::Configure)) > 1 ? T::FilterConfig : NULL;
- stringProc = T::FilterString;
- startProc = T::FilterStart;
- endProc = T::FilterEnd;
-
- script_obj = T::sScriptMethods ? const_cast<VDXScriptObject *>(&VDXVideoFilterScriptObjectAdapter<T>::sScriptObject) : 0;
- fssProc = T::FilterScriptStr;
-
- stringProc2 = T::FilterString2;
- serializeProc = T::FilterSerialize;
- deserializeProc = T::FilterDeserialize;
- copyProc = FilterCopy;
- copyProc2 = FilterCopy2;
-
- prefetchProc = sizeof(VDXVideoFilterPrefetchOverloadTest(&T::Prefetch)) > 1 ? T::FilterPrefetch : NULL;
- prefetchProc2 = sizeof(VDXVideoFilterPrefetch2OverloadTest(&T::Prefetch2)) > 1 || sizeof(VDXVideoFilterPrefetchOverloadTest(&T::Prefetch)) > 1 ? T::FilterPrefetch2 : NULL;
-
- eventProc = T::FilterEvent;
- }
+ VDXVideoFilterDefinition(const char *pszAuthor, const char *pszName, const char *pszDescription) {
+ _next = NULL;
+ _prev = NULL;
+ _module = NULL;
+
+ name = pszName;
+ desc = pszDescription;
+ maker = pszAuthor;
+ private_data = NULL;
+ inst_data_size = sizeof(T) + sizeof(VDXVideoFilter *);
+
+ initProc = FilterInit;
+ deinitProc = T::FilterDeinit;
+ runProc = T::FilterRun;
+ paramProc = T::FilterParam;
+ configProc = sizeof(VDXVideoFilterConfigureOverloadTest(&T::Configure)) > 1 ? T::FilterConfig : NULL;
+ stringProc = T::FilterString;
+ startProc = T::FilterStart;
+ endProc = T::FilterEnd;
+
+ script_obj = T::sScriptMethods ? const_cast<VDXScriptObject *>(&VDXVideoFilterScriptObjectAdapter<T>::sScriptObject) : 0;
+ fssProc = T::FilterScriptStr;
+
+ stringProc2 = T::FilterString2;
+ serializeProc = T::FilterSerialize;
+ deserializeProc = T::FilterDeserialize;
+ copyProc = FilterCopy;
+ copyProc2 = FilterCopy2;
+
+ prefetchProc = sizeof(VDXVideoFilterPrefetchOverloadTest(&T::Prefetch)) > 1 ? T::FilterPrefetch : NULL;
+ prefetchProc2 = sizeof(VDXVideoFilterPrefetch2OverloadTest(&T::Prefetch2)) > 1 || sizeof(VDXVideoFilterPrefetchOverloadTest(&T::Prefetch)) > 1 ? T::FilterPrefetch2 : NULL;
+
+ eventProc = T::FilterEvent;
+ }
private:
- static int __cdecl FilterInit(VDXFilterActivation *fa, const VDXFilterFunctions *ff)
- {
- T *pThis = new((char *)fa->filter_data + sizeof(VDXVideoFilter *)) T;
- *(VDXVideoFilter **)fa->filter_data = static_cast<VDXVideoFilter *>(pThis);
-
- pThis->SetHooks(fa, ff);
-
- try
- {
- if(!pThis->Init())
- {
- pThis->~T();
- return 1;
- }
-
- return 0;
- }
- catch(...)
- {
- pThis->~T();
- throw;
- }
- }
-
- static void __cdecl FilterCopy(VDXFilterActivation *fa, const VDXFilterFunctions *ff, void *dst)
- {
- T *p = new((char *)dst + sizeof(VDXVideoFilter *)) T(*static_cast<T *>(*reinterpret_cast<VDXVideoFilter **>(fa->filter_data)));
- p->ff = ff;
- *(VDXVideoFilter **)dst = p;
- }
-
- static void __cdecl FilterCopy2(VDXFilterActivation *fa, const VDXFilterFunctions *ff, void *dst, VDXFilterActivation *fanew, const VDXFilterFunctions *ffnew)
- {
- T *p = new((char *)dst + sizeof(VDXVideoFilter *)) T(*static_cast<T *>(*reinterpret_cast<VDXVideoFilter **>(fa->filter_data)));
- p->ff = ffnew;
- p->fa = fanew;
- *(VDXVideoFilter **)dst = p;
- }
+ static int __cdecl FilterInit (VDXFilterActivation *fa, const VDXFilterFunctions *ff) {
+ T *pThis = new((char *)fa->filter_data + sizeof(VDXVideoFilter *)) T;
+ *(VDXVideoFilter **)fa->filter_data = static_cast<VDXVideoFilter *>(pThis);
+
+ pThis->SetHooks(fa, ff);
+
+ try {
+ if (!pThis->Init()) {
+ pThis->~T();
+ return 1;
+ }
+
+ return 0;
+ } catch(...) {
+ pThis->~T();
+ throw;
+ }
+ }
+
+ static void __cdecl FilterCopy (VDXFilterActivation *fa, const VDXFilterFunctions *ff, void *dst) {
+ T *p = new((char *)dst + sizeof(VDXVideoFilter *)) T(*static_cast<T *>(*reinterpret_cast<VDXVideoFilter **>(fa->filter_data)));
+ p->ff = ff;
+ *(VDXVideoFilter **)dst = p;
+ }
+
+ static void __cdecl FilterCopy2 (VDXFilterActivation *fa, const VDXFilterFunctions *ff, void *dst, VDXFilterActivation *fanew, const VDXFilterFunctions *ffnew) {
+ T *p = new((char *)dst + sizeof(VDXVideoFilter *)) T(*static_cast<T *>(*reinterpret_cast<VDXVideoFilter **>(fa->filter_data)));
+ p->ff = ffnew;
+ p->fa = fanew;
+ *(VDXVideoFilter **)dst = p;
+ }
};
#endif
diff --git a/include/vd2/VDXFrame/VideoFilterDialog.h b/include/vd2/VDXFrame/VideoFilterDialog.h index 813991109..1e9aa4917 100644 --- a/include/vd2/VDXFrame/VideoFilterDialog.h +++ b/include/vd2/VDXFrame/VideoFilterDialog.h @@ -27,21 +27,20 @@ #include <windows.h>
-class VDXVideoFilterDialog
-{
+class VDXVideoFilterDialog {
public:
- VDXVideoFilterDialog();
+ VDXVideoFilterDialog();
protected:
- HWND mhdlg;
+ HWND mhdlg;
- LRESULT Show(HINSTANCE hInst, LPCSTR templName, HWND parent);
- LRESULT Show(HINSTANCE hInst, LPCWSTR templName, HWND parent);
- HWND ShowModeless(HINSTANCE hInst, LPCSTR templName, HWND parent);
- HWND ShowModeless(HINSTANCE hInst, LPCWSTR templName, HWND parent);
+ LRESULT Show(HINSTANCE hInst, LPCSTR templName, HWND parent);
+ LRESULT Show(HINSTANCE hInst, LPCWSTR templName, HWND parent);
+ HWND ShowModeless(HINSTANCE hInst, LPCSTR templName, HWND parent);
+ HWND ShowModeless(HINSTANCE hInst, LPCWSTR templName, HWND parent);
- static INT_PTR CALLBACK StaticDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam);
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
+ static INT_PTR CALLBACK StaticDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam);
+ virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
};
#endif
diff --git a/include/vd2/VDXFrame/VideoFilterEntry.h b/include/vd2/VDXFrame/VideoFilterEntry.h index 5f311e35e..112f02c3f 100644 --- a/include/vd2/VDXFrame/VideoFilterEntry.h +++ b/include/vd2/VDXFrame/VideoFilterEntry.h @@ -28,7 +28,7 @@ #include <vd2/plugin/vdvideofilt.h>
#ifdef _MSC_VER
-#pragma once
+ #pragma once
#endif
struct VDXFilterModule;
diff --git a/include/vd2/extras/FilterSDK/Filter.h b/include/vd2/extras/FilterSDK/Filter.h index c538a126f..a8747a4a6 100644 --- a/include/vd2/extras/FilterSDK/Filter.h +++ b/include/vd2/extras/FilterSDK/Filter.h @@ -44,9 +44,8 @@ // This is really dumb, but necessary to support VTbls in C++.
-struct FilterVTbls
-{
- void *pvtblVBitmap;
+struct FilterVTbls {
+ void *pvtblVBitmap;
};
#ifdef VDEXT_MAIN
@@ -65,10 +64,9 @@ struct CScriptObject; //////////////////
-enum
-{
- FILTERPARAM_SWAP_BUFFERS = 0x00000001L,
- FILTERPARAM_NEEDS_LAST = 0x00000002L,
+enum {
+ FILTERPARAM_SWAP_BUFFERS = 0x00000001L,
+ FILTERPARAM_NEEDS_LAST = 0x00000002L,
};
#define FILTERPARAM_HAS_LAG(frames) ((int)(frames) << 16)
@@ -79,19 +77,19 @@ class VFBitmap; class FilterActivation;
struct FilterFunctions;
-typedef int (*FilterInitProc)(FilterActivation *fa, const FilterFunctions *ff);
-typedef void (*FilterDeinitProc)(FilterActivation *fa, const FilterFunctions *ff);
-typedef int (*FilterRunProc)(const FilterActivation *fa, const FilterFunctions *ff);
-typedef long(*FilterParamProc)(FilterActivation *fa, const FilterFunctions *ff);
-typedef int (*FilterConfigProc)(FilterActivation *fa, const FilterFunctions *ff, HWND hWnd);
-typedef void (*FilterStringProc)(const FilterActivation *fa, const FilterFunctions *ff, char *buf);
-typedef int (*FilterStartProc)(FilterActivation *fa, const FilterFunctions *ff);
-typedef int (*FilterEndProc)(FilterActivation *fa, const FilterFunctions *ff);
+typedef int (*FilterInitProc )(FilterActivation *fa, const FilterFunctions *ff);
+typedef void (*FilterDeinitProc )(FilterActivation *fa, const FilterFunctions *ff);
+typedef int (*FilterRunProc )(const FilterActivation *fa, const FilterFunctions *ff);
+typedef long (*FilterParamProc )(FilterActivation *fa, const FilterFunctions *ff);
+typedef int (*FilterConfigProc )(FilterActivation *fa, const FilterFunctions *ff, HWND hWnd);
+typedef void (*FilterStringProc )(const FilterActivation *fa, const FilterFunctions *ff, char *buf);
+typedef int (*FilterStartProc )(FilterActivation *fa, const FilterFunctions *ff);
+typedef int (*FilterEndProc )(FilterActivation *fa, const FilterFunctions *ff);
typedef bool (*FilterScriptStrProc)(FilterActivation *fa, const FilterFunctions *, char *, int);
-typedef void (*FilterStringProc2)(const FilterActivation *fa, const FilterFunctions *ff, char *buf, int maxlen);
-typedef int (*FilterSerialize)(FilterActivation *fa, const FilterFunctions *ff, char *buf, int maxbuf);
-typedef void (*FilterDeserialize)(FilterActivation *fa, const FilterFunctions *ff, const char *buf, int maxbuf);
-typedef void (*FilterCopy)(FilterActivation *fa, const FilterFunctions *ff, void *dst);
+typedef void (*FilterStringProc2 )(const FilterActivation *fa, const FilterFunctions *ff, char *buf, int maxlen);
+typedef int (*FilterSerialize )(FilterActivation *fa, const FilterFunctions *ff, char *buf, int maxbuf);
+typedef void (*FilterDeserialize )(FilterActivation *fa, const FilterFunctions *ff, const char *buf, int maxbuf);
+typedef void (*FilterCopy )(FilterActivation *fa, const FilterFunctions *ff, void *dst);
typedef int (__cdecl *FilterModuleInitProc)(struct FilterModule *fm, const FilterFunctions *ff, int& vdfd_ver, int& vdfd_compat);
typedef void (__cdecl *FilterModuleDeinitProc)(struct FilterModule *fm, const FilterFunctions *ff);
@@ -101,22 +99,21 @@ typedef void (__cdecl *FilterModuleDeinitProc)(struct FilterModule *fm, const Fi typedef void (__cdecl *FilterPreviewButtonCallback)(bool fNewState, void *pData);
typedef void (__cdecl *FilterPreviewSampleCallback)(VFBitmap *, long lFrame, long lCount, void *pData);
-class IFilterPreview
-{
+class IFilterPreview {
public:
- virtual void SetButtonCallback(FilterPreviewButtonCallback, void *) = 0;
- virtual void SetSampleCallback(FilterPreviewSampleCallback, void *) = 0;
-
- virtual bool isPreviewEnabled() = 0;
- virtual void Toggle(HWND) = 0;
- virtual void Display(HWND, bool) = 0;
- virtual void RedoFrame() = 0;
- virtual void RedoSystem() = 0;
- virtual void UndoSystem() = 0;
- virtual void InitButton(HWND) = 0;
- virtual void Close() = 0;
- virtual bool SampleCurrentFrame() = 0;
- virtual long SampleFrames() = 0;
+ virtual void SetButtonCallback(FilterPreviewButtonCallback, void *)=0;
+ virtual void SetSampleCallback(FilterPreviewSampleCallback, void *)=0;
+
+ virtual bool isPreviewEnabled()=0;
+ virtual void Toggle(HWND)=0;
+ virtual void Display(HWND, bool)=0;
+ virtual void RedoFrame()=0;
+ virtual void RedoSystem()=0;
+ virtual void UndoSystem()=0;
+ virtual void InitButton(HWND)=0;
+ virtual void Close()=0;
+ virtual bool SampleCurrentFrame()=0;
+ virtual long SampleFrames()=0;
};
//////////
@@ -131,91 +128,85 @@ public: // v7 (1.4d): added frame lag, exception handling
// v8 (1.4.11):
-typedef struct FilterModule
-{
- struct FilterModule *next, *prev;
- HINSTANCE hInstModule;
- FilterModuleInitProc initProc;
- FilterModuleDeinitProc deinitProc;
+typedef struct FilterModule {
+ struct FilterModule *next, *prev;
+ HINSTANCE hInstModule;
+ FilterModuleInitProc initProc;
+ FilterModuleDeinitProc deinitProc;
} FilterModule;
-typedef struct FilterDefinition
-{
+typedef struct FilterDefinition {
- struct FilterDefinition *next, *prev;
- FilterModule *module;
+ struct FilterDefinition *next, *prev;
+ FilterModule *module;
- const char * name;
- const char * desc;
- const char * maker;
- void * private_data;
- int inst_data_size;
+ const char * name;
+ const char * desc;
+ const char * maker;
+ void * private_data;
+ int inst_data_size;
- FilterInitProc initProc;
- FilterDeinitProc deinitProc;
- FilterRunProc runProc;
- FilterParamProc paramProc;
- FilterConfigProc configProc;
- FilterStringProc stringProc;
- FilterStartProc startProc;
- FilterEndProc endProc;
+ FilterInitProc initProc;
+ FilterDeinitProc deinitProc;
+ FilterRunProc runProc;
+ FilterParamProc paramProc;
+ FilterConfigProc configProc;
+ FilterStringProc stringProc;
+ FilterStartProc startProc;
+ FilterEndProc endProc;
- CScriptObject *script_obj;
+ CScriptObject *script_obj;
- FilterScriptStrProc fssProc;
+ FilterScriptStrProc fssProc;
- // NEW - 1.4.11
- FilterStringProc2 stringProc2;
- FilterSerialize serializeProc;
- FilterDeserialize deserializeProc;
- FilterCopy copyProc;
+ // NEW - 1.4.11
+ FilterStringProc2 stringProc2;
+ FilterSerialize serializeProc;
+ FilterDeserialize deserializeProc;
+ FilterCopy copyProc;
} FilterDefinition;
//////////
// FilterStateInfo: contains dynamic info about file being processed
-class FilterStateInfo
-{
+class FilterStateInfo {
public:
- long lCurrentFrame; // current output frame
- long lMicrosecsPerFrame; // microseconds per output frame
- long lCurrentSourceFrame; // current source frame
- long lMicrosecsPerSrcFrame; // microseconds per source frame
- long lSourceFrameMS; // source frame timestamp
- long lDestFrameMS; // output frame timestamp
+ long lCurrentFrame; // current output frame
+ long lMicrosecsPerFrame; // microseconds per output frame
+ long lCurrentSourceFrame; // current source frame
+ long lMicrosecsPerSrcFrame; // microseconds per source frame
+ long lSourceFrameMS; // source frame timestamp
+ long lDestFrameMS; // output frame timestamp
};
// VFBitmap: VBitmap extended to hold filter-specific information
-class VFBitmap : public VBitmap
-{
+class VFBitmap : public VBitmap {
public:
- enum
- {
- NEEDS_HDC = 0x00000001L,
- };
+ enum {
+ NEEDS_HDC = 0x00000001L,
+ };
- DWORD dwFlags;
- HDC hdc;
+ DWORD dwFlags;
+ HDC hdc;
};
// FilterActivation: This is what is actually passed to filters at runtime.
-class FilterActivation
-{
+class FilterActivation {
public:
- FilterDefinition *filter;
- void *filter_data;
- VFBitmap &dst, &src;
- VFBitmap *__reserved0, *const last;
- unsigned long x1, y1, x2, y2;
+ FilterDefinition *filter;
+ void *filter_data;
+ VFBitmap &dst, &src;
+ VFBitmap *__reserved0, *const last;
+ unsigned long x1, y1, x2, y2;
- FilterStateInfo *pfsi;
- IFilterPreview *ifp;
+ FilterStateInfo *pfsi;
+ IFilterPreview *ifp;
- FilterActivation(VFBitmap& _dst, VFBitmap& _src, VFBitmap *_last) : dst(_dst), src(_src), last(_last) {}
- FilterActivation(const FilterActivation& fa, VFBitmap& _dst, VFBitmap& _src, VFBitmap *_last);
+ FilterActivation(VFBitmap& _dst, VFBitmap& _src, VFBitmap *_last) : dst(_dst), src(_src), last(_last) {}
+ FilterActivation(const FilterActivation& fa, VFBitmap& _dst, VFBitmap& _src, VFBitmap *_last);
};
// These flags must match those in cpuaccel.h!
@@ -231,24 +222,23 @@ public: #define CPUF_SUPPORTS_3DNOW_EXT (0x00000080L)
#endif
-struct FilterFunctions
-{
- FilterDefinition *(*addFilter)(FilterModule *, FilterDefinition *, int fd_len);
- void (*removeFilter)(FilterDefinition *);
- bool (*isFPUEnabled)();
- bool (*isMMXEnabled)();
- void (*InitVTables)(struct FilterVTbls *);
+struct FilterFunctions {
+ FilterDefinition *(*addFilter)(FilterModule *, FilterDefinition *, int fd_len);
+ void (*removeFilter)(FilterDefinition *);
+ bool (*isFPUEnabled)();
+ bool (*isMMXEnabled)();
+ void (*InitVTables)(struct FilterVTbls *);
- // These functions permit you to throw MyError exceptions from a filter.
- // YOU MUST ONLY CALL THESE IN runProc, initProc, and startProc.
+ // These functions permit you to throw MyError exceptions from a filter.
+ // YOU MUST ONLY CALL THESE IN runProc, initProc, and startProc.
- void (*ExceptOutOfMemory)(); // ADDED: V6 (VirtualDub 1.4)
- void (*Except)(const char *format, ...); // ADDED: V6 (VirtualDub 1.4)
+ void (*ExceptOutOfMemory)(); // ADDED: V6 (VirtualDub 1.4)
+ void (*Except)(const char *format, ...); // ADDED: V6 (VirtualDub 1.4)
- // These functions are callable at any time.
+ // These functions are callable at any time.
- long(*getCPUFlags)(); // ADDED: V6 (VirtualDub 1.4)
- long(*getHostVersionInfo)(char *buffer, int len); // ADDED: V7 (VirtualDub 1.4d)
+ long (*getCPUFlags)(); // ADDED: V6 (VirtualDub 1.4)
+ long (*getHostVersionInfo)(char *buffer, int len); // ADDED: V7 (VirtualDub 1.4d)
};
#endif
diff --git a/include/vd2/extras/FilterSDK/ScriptError.h b/include/vd2/extras/FilterSDK/ScriptError.h index db59a32f7..ceaad8bb0 100644 --- a/include/vd2/extras/FilterSDK/ScriptError.h +++ b/include/vd2/extras/FilterSDK/ScriptError.h @@ -39,61 +39,55 @@ #ifndef f_SYLIA_SCRIPTERROR_H
#define f_SYLIA_SCRIPTERROR_H
-class CScriptError
-{
+class CScriptError {
public:
- int err;
+ int err;
- enum
- {
- PARSE_ERROR = 1,
- SEMICOLON_EXPECTED,
- IDENTIFIER_EXPECTED,
+ enum {
+ PARSE_ERROR=1,
+ SEMICOLON_EXPECTED,
+ IDENTIFIER_EXPECTED,
- TYPE_INT_REQUIRED,
- TYPE_ARRAY_REQUIRED,
- TYPE_FUNCTION_REQUIRED,
- TYPE_OBJECT_REQUIRED,
+ TYPE_INT_REQUIRED,
+ TYPE_ARRAY_REQUIRED,
+ TYPE_FUNCTION_REQUIRED,
+ TYPE_OBJECT_REQUIRED,
- OBJECT_MEMBER_NAME_REQUIRED,
- FUNCCALLEND_EXPECTED,
- TOO_MANY_PARAMS,
- DIVIDE_BY_ZERO,
- VAR_NOT_FOUND,
- MEMBER_NOT_FOUND,
- OVERLOADED_FUNCTION_NOT_FOUND,
- IDENT_TOO_LONG,
- OPERATOR_EXPECTED,
- CLOSEPARENS_EXPECTED,
- CLOSEBRACKET_EXPECTED,
+ OBJECT_MEMBER_NAME_REQUIRED,
+ FUNCCALLEND_EXPECTED,
+ TOO_MANY_PARAMS,
+ DIVIDE_BY_ZERO,
+ VAR_NOT_FOUND,
+ MEMBER_NOT_FOUND,
+ OVERLOADED_FUNCTION_NOT_FOUND,
+ IDENT_TOO_LONG,
+ OPERATOR_EXPECTED,
+ CLOSEPARENS_EXPECTED,
+ CLOSEBRACKET_EXPECTED,
- VAR_UNDEFINED,
+ VAR_UNDEFINED,
- OUT_OF_STRING_SPACE,
- OUT_OF_MEMORY,
- INTERNAL_ERROR,
- EXTERNAL_ERROR,
+ OUT_OF_STRING_SPACE,
+ OUT_OF_MEMORY,
+ INTERNAL_ERROR,
+ EXTERNAL_ERROR,
- FCALL_OUT_OF_RANGE,
- FCALL_INVALID_PTYPE,
- FCALL_UNKNOWN_STR,
- };
+ FCALL_OUT_OF_RANGE,
+ FCALL_INVALID_PTYPE,
+ FCALL_UNKNOWN_STR,
+ };
- CScriptError(int err_num) : err(err_num) { }
+ CScriptError(int err_num) : err(err_num) { }
- int getErr()
- {
- return err;
- }
+ int getErr() { return err; }
};
#define SCRIPT_ERROR(x) throw CScriptError(CScriptError::##x)
extern "C" __declspec(dllexport) char * __stdcall TranslateScriptError(int);
-char inline *TranslateScriptError(CScriptError cse)
-{
- return TranslateScriptError(cse.getErr());
+char inline *TranslateScriptError(CScriptError cse) {
+ return TranslateScriptError(cse.getErr());
}
#endif
diff --git a/include/vd2/extras/FilterSDK/ScriptInterpreter.h b/include/vd2/extras/FilterSDK/ScriptInterpreter.h index 196380d82..ad0197118 100644 --- a/include/vd2/extras/FilterSDK/ScriptInterpreter.h +++ b/include/vd2/extras/FilterSDK/ScriptInterpreter.h @@ -44,22 +44,21 @@ class CScriptError; struct CScriptObject;
class IScriptInterpreter;
-typedef CScriptValue(*ScriptRootHandlerPtr)(IScriptInterpreter *, char *, void *);
+typedef CScriptValue (*ScriptRootHandlerPtr)(IScriptInterpreter *,char *,void *);
-class IScriptInterpreter
-{
+class IScriptInterpreter {
public:
- virtual void Destroy() = 0;
+ virtual void Destroy() =0;
- virtual void SetRootHandler(ScriptRootHandlerPtr, void *) = 0;
+ virtual void SetRootHandler(ScriptRootHandlerPtr, void *) =0;
- virtual void ExecuteLine(char *s) = 0;
+ virtual void ExecuteLine(char *s) =0;
- virtual void ScriptError(int e) = 0;
- virtual char* TranslateScriptError(CScriptError& cse) = 0;
- virtual char** AllocTempString(long l) = 0;
+ virtual void ScriptError(int e) =0;
+ virtual char* TranslateScriptError(CScriptError& cse) =0;
+ virtual char** AllocTempString(long l) =0;
- virtual CScriptValue LookupObjectMember(CScriptObject *obj, void *, char *szIdent) = 0;
+ virtual CScriptValue LookupObjectMember(CScriptObject *obj, void *, char *szIdent) = 0;
};
extern "C" __declspec(dllexport) IScriptInterpreter * __stdcall CreateScriptInterpreter();
diff --git a/include/vd2/extras/FilterSDK/ScriptValue.h b/include/vd2/extras/FilterSDK/ScriptValue.h index eb1cfada3..52e629a3f 100644 --- a/include/vd2/extras/FilterSDK/ScriptValue.h +++ b/include/vd2/extras/FilterSDK/ScriptValue.h @@ -45,155 +45,82 @@ class CScriptValue; class IScriptInterpreter;
class VariableTableEntry;
-typedef CScriptValue(*ScriptObjectLookupFuncPtr)(IScriptInterpreter *, CScriptObject *, void *lpVoid, char *szName);
-typedef CScriptValue(*ScriptFunctionPtr)(IScriptInterpreter *, void *, CScriptValue *, int);
+typedef CScriptValue (*ScriptObjectLookupFuncPtr)(IScriptInterpreter *, CScriptObject *, void *lpVoid, char *szName);
+typedef CScriptValue (*ScriptFunctionPtr)(IScriptInterpreter *, void *, CScriptValue *, int);
typedef void (*ScriptVoidFunctionPtr)(IScriptInterpreter *, void *, CScriptValue *, int);
typedef int (*ScriptIntFunctionPtr)(IScriptInterpreter *, void *, CScriptValue *, int);
-typedef CScriptValue(*ScriptArrayFunctionPtr)(IScriptInterpreter *, void *, int);
+typedef CScriptValue (*ScriptArrayFunctionPtr)(IScriptInterpreter *, void *, int);
-typedef struct ScriptFunctionDef
-{
- ScriptFunctionPtr func_ptr;
- char *name;
- char *arg_list;
+typedef struct ScriptFunctionDef {
+ ScriptFunctionPtr func_ptr;
+ char *name;
+ char *arg_list;
} ScriptFunctionDef;
-typedef struct ScriptObjectDef
-{
- char *name;
- CScriptObject *obj;
+typedef struct ScriptObjectDef {
+ char *name;
+ CScriptObject *obj;
} ScriptObjectDef;
-typedef struct CScriptObject
-{
- ScriptObjectLookupFuncPtr Lookup;
- ScriptFunctionDef *func_list;
- ScriptObjectDef *obj_list;
+typedef struct CScriptObject {
+ ScriptObjectLookupFuncPtr Lookup;
+ ScriptFunctionDef *func_list;
+ ScriptObjectDef *obj_list;
} CScriptObject;
-class CScriptValue
-{
+class CScriptValue {
public:
- enum { T_VOID, T_INT, T_PINT, T_STR, T_ARRAY, T_OBJECT, T_FNAME, T_FUNCTION, T_VARLV } type;
- CScriptObject *thisPtr;
- union
- {
- int i;
- int *pi;
- char **s;
- ScriptArrayFunctionPtr ary;
- CScriptObject *obj;
- ScriptFunctionPtr func;
- ScriptFunctionDef *fname;
- VariableTableEntry *vte;
- } u;
- void *lpVoid;
+ enum { T_VOID, T_INT, T_PINT, T_STR, T_ARRAY, T_OBJECT, T_FNAME, T_FUNCTION, T_VARLV } type;
+ CScriptObject *thisPtr;
+ union {
+ int i;
+ int *pi;
+ char **s;
+ ScriptArrayFunctionPtr ary;
+ CScriptObject *obj;
+ ScriptFunctionPtr func;
+ ScriptFunctionDef *fname;
+ VariableTableEntry *vte;
+ } u;
+ void *lpVoid;
- CScriptValue()
- {
- type = T_VOID;
- }
- CScriptValue(int i)
- {
- type = T_INT;
- u.i = i;
- }
- CScriptValue(int *pi)
- {
- type = T_PINT;
- u.pi = pi;
- }
- CScriptValue(char **s)
- {
- type = T_STR;
- u.s = s;
- }
- CScriptValue(CScriptObject *obj)
- {
- type = T_OBJECT;
- u.obj = obj;
- }
- CScriptValue(CScriptObject *_thisPtr, ScriptArrayFunctionPtr csa)
- {
- type = T_ARRAY;
- u.ary = csa;
- thisPtr = _thisPtr;
- }
- CScriptValue(CScriptObject *_thisPtr, ScriptFunctionDef *sfd)
- {
- type = T_FNAME;
- u.fname = sfd;
- thisPtr = _thisPtr;
- }
- CScriptValue(CScriptObject *_thisPtr, ScriptFunctionPtr fn)
- {
- type = T_FUNCTION;
- u.func = fn;
- thisPtr = _thisPtr;
- }
- CScriptValue(VariableTableEntry *vte)
- {
- type = T_VARLV;
- u.vte = vte;
- }
+ CScriptValue() { type = T_VOID; }
+ CScriptValue(int i) { type = T_INT; u.i = i; }
+ CScriptValue(int *pi) { type = T_PINT; u.pi = pi; }
+ CScriptValue(char **s) { type = T_STR; u.s = s; }
+ CScriptValue(CScriptObject *obj) { type = T_OBJECT; u.obj = obj; }
+ CScriptValue(CScriptObject *_thisPtr, ScriptArrayFunctionPtr csa) {
+ type = T_ARRAY;
+ u.ary = csa;
+ thisPtr = _thisPtr;
+ }
+ CScriptValue(CScriptObject *_thisPtr, ScriptFunctionDef *sfd) {
+ type = T_FNAME;
+ u.fname = sfd;
+ thisPtr = _thisPtr;
+ }
+ CScriptValue(CScriptObject *_thisPtr, ScriptFunctionPtr fn) {
+ type = T_FUNCTION;
+ u.func = fn;
+ thisPtr = _thisPtr;
+ }
+ CScriptValue(VariableTableEntry *vte) { type = T_VARLV; u.vte = vte; }
- bool isVoid()
- {
- return type == T_VOID;
- }
- bool isInt()
- {
- return type == T_INT;
- }
- bool isString()
- {
- return type == T_STR;
- }
- bool isArray()
- {
- return type == T_ARRAY;
- }
- bool isObject()
- {
- return type == T_OBJECT;
- }
- bool isFName()
- {
- return type == T_FNAME;
- }
- bool isFunction()
- {
- return type == T_FUNCTION;
- }
- bool isVarLV()
- {
- return type == T_VARLV;
- }
+ bool isVoid() { return type == T_VOID; }
+ bool isInt() { return type == T_INT; }
+ bool isString() { return type == T_STR; }
+ bool isArray() { return type == T_ARRAY; }
+ bool isObject() { return type == T_OBJECT; }
+ bool isFName() { return type == T_FNAME; }
+ bool isFunction() { return type == T_FUNCTION; }
+ bool isVarLV() { return type == T_VARLV; }
- int asInt()
- {
- return u.i;
- }
- char ** asString()
- {
- return u.s;
- }
- ScriptArrayFunctionPtr asArray()
- {
- return u.ary;
- }
- CScriptObject * asObject()
- {
- return u.obj;
- }
- ScriptFunctionPtr asFunction()
- {
- return u.func;
- }
- VariableTableEntry* asVarLV()
- {
- return u.vte;
- }
+ int asInt() { return u.i; }
+ char ** asString() { return u.s; }
+ ScriptArrayFunctionPtr asArray() { return u.ary; }
+ CScriptObject * asObject() { return u.obj; }
+ ScriptFunctionPtr asFunction() { return u.func; }
+ VariableTableEntry* asVarLV() { return u.vte; }
};
#endif
diff --git a/include/vd2/extras/FilterSDK/VBitmap.h b/include/vd2/extras/FilterSDK/VBitmap.h index 4ab5ba54d..0b95066fc 100644 --- a/include/vd2/extras/FilterSDK/VBitmap.h +++ b/include/vd2/extras/FilterSDK/VBitmap.h @@ -54,133 +54,117 @@ typedef long PixOffset; #define NOVTABLE
#endif
-class NOVTABLE VBitmap
-{
+class NOVTABLE VBitmap {
public:
- Pixel * data;
- Pixel * palette;
- int depth;
- PixCoord w, h;
- PixOffset pitch;
- PixOffset modulo;
- PixOffset size;
- PixOffset offset;
-
- Pixel *Address(PixCoord x, PixCoord y) const
- {
- return Addressi(x, h - y - 1);
- }
-
- Pixel *Addressi(PixCoord x, PixCoord y) const
- {
- return (Pixel *)((char *)data + y * pitch + x * (depth >> 3));
- }
-
- Pixel *Address16(PixCoord x, PixCoord y) const
- {
- return Address16i(x, h - y - 1);
- }
-
- Pixel *Address16i(PixCoord x, PixCoord y) const
- {
- return (Pixel *)((char *)data + y * pitch + x * 2);
- }
-
- Pixel *Address32(PixCoord x, PixCoord y) const
- {
- return Address32i(x, h - y - 1);
- }
-
- Pixel *Address32i(PixCoord x, PixCoord y) const
- {
- return (Pixel *)((char *)data + y * pitch + x * sizeof(Pixel));
- }
-
- PixOffset PitchAlign4()
- {
- return ((w * depth + 31) / 32) * 4;
- }
-
- PixOffset PitchAlign8()
- {
- return ((w * depth + 63) / 64) * 8;
- }
-
- PixOffset Modulo()
- {
- return pitch - (w * depth + 7) / 8;
- }
-
- PixOffset Size()
- {
- return pitch * h;
- }
-
- //////
-
- VBitmap() throw()
- {
+ Pixel * data;
+ Pixel * palette;
+ int depth;
+ PixCoord w, h;
+ PixOffset pitch;
+ PixOffset modulo;
+ PixOffset size;
+ PixOffset offset;
+
+ Pixel *Address(PixCoord x, PixCoord y) const {
+ return Addressi(x, h-y-1);
+ }
+
+ Pixel *Addressi(PixCoord x, PixCoord y) const {
+ return (Pixel *)((char *)data + y*pitch + x*(depth>>3));
+ }
+
+ Pixel *Address16(PixCoord x, PixCoord y) const {
+ return Address16i(x, h-y-1);
+ }
+
+ Pixel *Address16i(PixCoord x, PixCoord y) const {
+ return (Pixel *)((char *)data + y*pitch + x*2);
+ }
+
+ Pixel *Address32(PixCoord x, PixCoord y) const {
+ return Address32i(x, h-y-1);
+ }
+
+ Pixel *Address32i(PixCoord x, PixCoord y) const {
+ return (Pixel *)((char *)data + y*pitch + x*sizeof(Pixel));
+ }
+
+ PixOffset PitchAlign4() {
+ return ((w * depth + 31)/32)*4;
+ }
+
+ PixOffset PitchAlign8() {
+ return ((w * depth + 63)/64)*8;
+ }
+
+ PixOffset Modulo() {
+ return pitch - (w*depth+7)/8;
+ }
+
+ PixOffset Size() {
+ return pitch*h;
+ }
+
+ //////
+
+ VBitmap() throw() {
#ifdef VDEXT_VIDEO_FILTER
- init();
+ init();
#endif
- }
- VBitmap(void *data, PixDim w, PixDim h, int depth) throw();
- VBitmap(void *data, BITMAPINFOHEADER *) throw();
+ }
+ VBitmap(void *data, PixDim w, PixDim h, int depth) throw();
+ VBitmap(void *data, BITMAPINFOHEADER *) throw();
#ifdef VDEXT_VIDEO_FILTER
- void init() throw()
- {
- *(void **)this = g_vtbls.pvtblVBitmap;
- }
+ void init() throw() { *(void **)this = g_vtbls.pvtblVBitmap; }
#endif
- virtual VBitmap& init(void *data, PixDim w, PixDim h, int depth) throw();
- virtual VBitmap& init(void *data, BITMAPINFOHEADER *) throw();
+ virtual VBitmap& init(void *data, PixDim w, PixDim h, int depth) throw();
+ virtual VBitmap& init(void *data, BITMAPINFOHEADER *) throw();
- virtual void MakeBitmapHeader(BITMAPINFOHEADER *bih) const throw();
+ virtual void MakeBitmapHeader(BITMAPINFOHEADER *bih) const throw();
- virtual void AlignTo4() throw();
- virtual void AlignTo8() throw();
+ virtual void AlignTo4() throw();
+ virtual void AlignTo8() throw();
- virtual void BitBlt(PixCoord x2, PixCoord y2, const VBitmap *src, PixCoord x1, PixCoord y1, PixDim dx, PixDim dy) const throw();
- virtual void BitBltDither(PixCoord x2, PixCoord y2, const VBitmap *src, PixDim x1, PixDim y1, PixDim dx, PixDim dy, bool to565) const throw();
- virtual void BitBlt565(PixCoord x2, PixCoord y2, const VBitmap *src, PixDim x1, PixDim y1, PixDim dx, PixDim dy) const throw();
+ virtual void BitBlt(PixCoord x2, PixCoord y2, const VBitmap *src, PixCoord x1, PixCoord y1, PixDim dx, PixDim dy) const throw();
+ virtual void BitBltDither(PixCoord x2, PixCoord y2, const VBitmap *src, PixDim x1, PixDim y1, PixDim dx, PixDim dy, bool to565) const throw();
+ virtual void BitBlt565(PixCoord x2, PixCoord y2, const VBitmap *src, PixDim x1, PixDim y1, PixDim dx, PixDim dy) const throw();
- virtual bool BitBltXlat1(PixCoord x2, PixCoord y2, const VBitmap *src, PixCoord x1, PixCoord y1, PixDim dx, PixDim dy, const Pixel8 *tbl) const throw();
- virtual bool BitBltXlat3(PixCoord x2, PixCoord y2, const VBitmap *src, PixCoord x1, PixCoord y1, PixDim dx, PixDim dy, const Pixel32 *tbl) const throw();
+ virtual bool BitBltXlat1(PixCoord x2, PixCoord y2, const VBitmap *src, PixCoord x1, PixCoord y1, PixDim dx, PixDim dy, const Pixel8 *tbl) const throw();
+ virtual bool BitBltXlat3(PixCoord x2, PixCoord y2, const VBitmap *src, PixCoord x1, PixCoord y1, PixDim dx, PixDim dy, const Pixel32 *tbl) const throw();
- virtual bool StretchBltNearestFast(PixCoord x1, PixCoord y1, PixDim dx, PixDim dy, const VBitmap *src, double x2, double y2, double dx1, double dy1) const throw();
+ virtual bool StretchBltNearestFast(PixCoord x1, PixCoord y1, PixDim dx, PixDim dy, const VBitmap *src, double x2, double y2, double dx1, double dy1) const throw();
- virtual bool StretchBltBilinearFast(PixCoord x1, PixCoord y1, PixDim dx, PixDim dy, const VBitmap *src, double x2, double y2, double dx1, double dy1) const throw();
+ virtual bool StretchBltBilinearFast(PixCoord x1, PixCoord y1, PixDim dx, PixDim dy, const VBitmap *src, double x2, double y2, double dx1, double dy1) const throw();
- virtual bool RectFill(PixCoord x1, PixCoord y1, PixDim dx, PixDim dy, Pixel32 c) const throw();
+ virtual bool RectFill(PixCoord x1, PixCoord y1, PixDim dx, PixDim dy, Pixel32 c) const throw();
- enum
- {
- HISTO_LUMA,
- HISTO_GRAY,
- HISTO_RED,
- HISTO_GREEN,
- HISTO_BLUE,
- };
+ enum {
+ HISTO_LUMA,
+ HISTO_GRAY,
+ HISTO_RED,
+ HISTO_GREEN,
+ HISTO_BLUE,
+ };
- virtual bool Histogram(PixCoord x, PixCoord y, PixCoord dx, PixCoord dy, long *pHisto, int iHistoType) const throw();
+ virtual bool Histogram(PixCoord x, PixCoord y, PixCoord dx, PixCoord dy, long *pHisto, int iHistoType) const throw();
- //// NEW AS OF VIRTUALDUB V1.2B
+ //// NEW AS OF VIRTUALDUB V1.2B
- virtual bool BitBltFromYUY2(PixCoord x2, PixCoord y2, const VBitmap *src, PixCoord x1, PixCoord y1, PixDim dx, PixDim dy) const throw();
- virtual bool BitBltFromI420(PixCoord x2, PixCoord y2, const VBitmap *src, PixCoord x1, PixCoord y1, PixDim dx, PixDim dy) const throw();
+ virtual bool BitBltFromYUY2(PixCoord x2, PixCoord y2, const VBitmap *src, PixCoord x1, PixCoord y1, PixDim dx, PixDim dy) const throw();
+ virtual bool BitBltFromI420(PixCoord x2, PixCoord y2, const VBitmap *src, PixCoord x1, PixCoord y1, PixDim dx, PixDim dy) const throw();
- //// NEW AS OF VIRTUALDUB V1.4C
+ //// NEW AS OF VIRTUALDUB V1.4C
- virtual void MakeBitmapHeaderNoPadding(BITMAPINFOHEADER *bih) const throw();
+ virtual void MakeBitmapHeaderNoPadding(BITMAPINFOHEADER *bih) const throw();
- ///////////
+ ///////////
- bool BitBltFromYUY2Fullscale(PixCoord x2, PixCoord y2, const VBitmap *src, PixCoord x1, PixCoord y1, PixDim dx, PixDim dy) const throw();
+ bool BitBltFromYUY2Fullscale(PixCoord x2, PixCoord y2, const VBitmap *src, PixCoord x1, PixCoord y1, PixDim dx, PixDim dy) const throw();
private:
- bool dualrectclip(PixCoord& x2, PixCoord& y2, const VBitmap *src, PixCoord& x1, PixCoord& y1, PixDim& dx, PixDim& dy) const throw();
+ bool dualrectclip(PixCoord& x2, PixCoord& y2, const VBitmap *src, PixCoord& x1, PixCoord& y1, PixDim& dx, PixDim& dy) const throw();
};
#undef NOVTABLE
diff --git a/include/vd2/plugin/vdaudiofilt.h b/include/vd2/plugin/vdaudiofilt.h index 46f7d6ab5..2680ad794 100644 --- a/include/vd2/plugin/vdaudiofilt.h +++ b/include/vd2/plugin/vdaudiofilt.h @@ -9,151 +9,140 @@ struct VDAudioFilterDefinition; struct VDXWaveFormat;
struct VDPluginCallbacks;
-enum
-{
- kVDPlugin_AudioAPIVersion = 2
+enum {
+ kVDPlugin_AudioAPIVersion = 2
};
-struct VDAudioFilterPin
-{
- unsigned mGranularity; // Block size a filter reads/writes this pin.
- unsigned mDelay; // Delay in samples on this input.
- unsigned mBufferSize; // The size, in samples, of the buffer.
- unsigned mCurrentLevel; // The number of samples currently in the buffer.
- sint64 mLength; // Approximate length of this stream in us.
- const VDXWaveFormat *mpFormat;
- bool mbVBR;
- bool mbEnded;
- char _pad[2];
- void *mpBuffer;
- unsigned mSamplesWritten; // The number of samples just written to the buffer.
- unsigned mAvailSpace; // Available room pointed to by mpBuffer (output pins only).
-
- uint32(VDAPIENTRY *mpReadProc)(VDAudioFilterPin *pPin, void *dst, uint32 samples, bool bAllowFill, int format);
-
- // These helpers are non-virtual inlines and are compiled into filters.
- uint32 Read(void *dst, uint32 samples, bool bAllowFill, int format)
- {
- return mpReadProc(this, dst, samples, bAllowFill, format);
- }
+struct VDAudioFilterPin {
+ unsigned mGranularity; // Block size a filter reads/writes this pin.
+ unsigned mDelay; // Delay in samples on this input.
+ unsigned mBufferSize; // The size, in samples, of the buffer.
+ unsigned mCurrentLevel; // The number of samples currently in the buffer.
+ sint64 mLength; // Approximate length of this stream in us.
+ const VDXWaveFormat *mpFormat;
+ bool mbVBR;
+ bool mbEnded;
+ char _pad[2];
+ void *mpBuffer;
+ unsigned mSamplesWritten; // The number of samples just written to the buffer.
+ unsigned mAvailSpace; // Available room pointed to by mpBuffer (output pins only).
+
+ uint32 (VDAPIENTRY *mpReadProc)(VDAudioFilterPin *pPin, void *dst, uint32 samples, bool bAllowFill, int format);
+
+ // These helpers are non-virtual inlines and are compiled into filters.
+ uint32 Read(void *dst, uint32 samples, bool bAllowFill, int format) {
+ return mpReadProc(this, dst, samples, bAllowFill, format);
+ }
};
struct VDAudioFilterContext;
-struct VDAudioFilterCallbacks
-{
- VDXWaveFormat *(VDAPIENTRY *AllocPCMWaveFormat)(unsigned sampling_rate, unsigned channels, unsigned bits, bool bFloat);
- VDXWaveFormat *(VDAPIENTRY *AllocCustomWaveFormat)(unsigned extra_size);
- VDXWaveFormat *(VDAPIENTRY *CopyWaveFormat)(const VDXWaveFormat *);
- void (VDAPIENTRY *FreeWaveFormat)(const VDXWaveFormat *);
- void (VDAPIENTRY *Wake)(const VDAudioFilterContext *pContext);
+struct VDAudioFilterCallbacks {
+ VDXWaveFormat *(VDAPIENTRY *AllocPCMWaveFormat)(unsigned sampling_rate, unsigned channels, unsigned bits, bool bFloat);
+ VDXWaveFormat *(VDAPIENTRY *AllocCustomWaveFormat)(unsigned extra_size);
+ VDXWaveFormat *(VDAPIENTRY *CopyWaveFormat)(const VDXWaveFormat *);
+ void (VDAPIENTRY *FreeWaveFormat)(const VDXWaveFormat *);
+ void (VDAPIENTRY *Wake)(const VDAudioFilterContext *pContext);
};
-struct VDAudioFilterContext
-{
- void *mpFilterData;
- VDAudioFilterPin **mpInputs;
- VDAudioFilterPin **mpOutputs;
- IVDPluginCallbacks *mpServices;
- const VDAudioFilterCallbacks *mpAudioCallbacks;
- const VDAudioFilterDefinition *mpDefinition;
- uint32 mAPIVersion;
- uint32 mInputSamples; // Number of input samples available on all pins.
- uint32 mInputGranules; // Number of input granules available on all pins.
- uint32 mInputsEnded; // Number of inputs that have ended.
- uint32 mOutputSamples; // Number of output sample spaces available on all pins.
- uint32 mOutputGranules; // Number of output granule spaces available on all pins.
- uint32 mCommonSamples; // Number of input samples and output sample spaces.
- uint32 mCommonGranules; // Number of input and output granules.
+struct VDAudioFilterContext {
+ void *mpFilterData;
+ VDAudioFilterPin **mpInputs;
+ VDAudioFilterPin **mpOutputs;
+ IVDPluginCallbacks *mpServices;
+ const VDAudioFilterCallbacks *mpAudioCallbacks;
+ const VDAudioFilterDefinition *mpDefinition;
+ uint32 mAPIVersion;
+ uint32 mInputSamples; // Number of input samples available on all pins.
+ uint32 mInputGranules; // Number of input granules available on all pins.
+ uint32 mInputsEnded; // Number of inputs that have ended.
+ uint32 mOutputSamples; // Number of output sample spaces available on all pins.
+ uint32 mOutputGranules; // Number of output granule spaces available on all pins.
+ uint32 mCommonSamples; // Number of input samples and output sample spaces.
+ uint32 mCommonGranules; // Number of input and output granules.
};
// This structure is intentionally identical to WAVEFORMATEX, with one
// exception -- mExtraSize is *always* present, even for PCM.
-struct VDXWaveFormat
-{
- enum { kTagPCM = 1 };
-
- uint16 mTag;
- uint16 mChannels;
- uint32 mSamplingRate;
- uint32 mDataRate;
- uint16 mBlockSize;
- uint16 mSampleBits;
- uint16 mExtraSize;
+struct VDXWaveFormat {
+ enum { kTagPCM = 1 };
+
+ uint16 mTag;
+ uint16 mChannels;
+ uint32 mSamplingRate;
+ uint32 mDataRate;
+ uint16 mBlockSize;
+ uint16 mSampleBits;
+ uint16 mExtraSize;
};
-enum
-{
- kVFARun_OK = 0,
- kVFARun_Finished = 1,
- kVFARun_InternalWork = 2,
+enum {
+ kVFARun_OK = 0,
+ kVFARun_Finished = 1,
+ kVFARun_InternalWork = 2,
- kVFAPrepare_OK = 0,
- kVFAPrepare_BadFormat = 1
+ kVFAPrepare_OK = 0,
+ kVFAPrepare_BadFormat = 1
};
-enum
-{
- kVFARead_Native = 0,
- kVFARead_PCM8 = 1,
- kVFARead_PCM16 = 2,
- kVFARead_PCM32F = 3
+enum {
+ kVFARead_Native = 0,
+ kVFARead_PCM8 = 1,
+ kVFARead_PCM16 = 2,
+ kVFARead_PCM32F = 3
};
-typedef void *(VDAPIENTRY *VDAudioFilterExtProc)(const VDAudioFilterContext *pContext, const char *pInterfaceName);
-typedef uint32(VDAPIENTRY *VDAudioFilterRunProc)(const VDAudioFilterContext *pContext);
-typedef sint64(VDAPIENTRY *VDAudioFilterSeekProc)(const VDAudioFilterContext *pContext, sint64 microsecs);
-typedef uint32(VDAPIENTRY *VDAudioFilterPrepareProc)(const VDAudioFilterContext *pContext);
-typedef void (VDAPIENTRY *VDAudioFilterStartProc)(const VDAudioFilterContext *pContext);
-typedef void (VDAPIENTRY *VDAudioFilterStopProc)(const VDAudioFilterContext *pContext);
-typedef void (VDAPIENTRY *VDAudioFilterInitProc)(const VDAudioFilterContext *pContext);
-typedef void (VDAPIENTRY *VDAudioFilterDestroyProc)(const VDAudioFilterContext *pContext);
-typedef unsigned(VDAPIENTRY *VDAudioFilterSuspendProc)(const VDAudioFilterContext *pContext, void *dst, unsigned size);
-typedef void (VDAPIENTRY *VDAudioFilterResumeProc)(const VDAudioFilterContext *pContext, const void *src, unsigned size);
-typedef unsigned(VDAPIENTRY *VDAudioFilterGetParamProc)(const VDAudioFilterContext *pContext, unsigned idx, void *dst, unsigned size);
-typedef void (VDAPIENTRY *VDAudioFilterSetParamProc)(const VDAudioFilterContext *pContext, unsigned idx, const void *src, unsigned variant_count);
-typedef bool (VDAPIENTRY *VDAudioFilterConfigProc)(const VDAudioFilterContext *pContext, struct HWND__ *hwnd);
-
-enum
-{
- kVFAF_Zero = 0,
- kVFAF_HasConfig = 1, // Filter has a configuration dialog.
- kVFAF_SerializedIO = 2, // Filter must execute in the serialized I/O thread.
-
- kVFAF_Max = 0xFFFFFFFF,
+typedef void * (VDAPIENTRY *VDAudioFilterExtProc )(const VDAudioFilterContext *pContext, const char *pInterfaceName);
+typedef uint32 (VDAPIENTRY *VDAudioFilterRunProc )(const VDAudioFilterContext *pContext);
+typedef sint64 (VDAPIENTRY *VDAudioFilterSeekProc )(const VDAudioFilterContext *pContext, sint64 microsecs);
+typedef uint32 (VDAPIENTRY *VDAudioFilterPrepareProc )(const VDAudioFilterContext *pContext);
+typedef void (VDAPIENTRY *VDAudioFilterStartProc )(const VDAudioFilterContext *pContext);
+typedef void (VDAPIENTRY *VDAudioFilterStopProc )(const VDAudioFilterContext *pContext);
+typedef void (VDAPIENTRY *VDAudioFilterInitProc )(const VDAudioFilterContext *pContext);
+typedef void (VDAPIENTRY *VDAudioFilterDestroyProc )(const VDAudioFilterContext *pContext);
+typedef unsigned (VDAPIENTRY *VDAudioFilterSuspendProc )(const VDAudioFilterContext *pContext, void *dst, unsigned size);
+typedef void (VDAPIENTRY *VDAudioFilterResumeProc )(const VDAudioFilterContext *pContext, const void *src, unsigned size);
+typedef unsigned (VDAPIENTRY *VDAudioFilterGetParamProc )(const VDAudioFilterContext *pContext, unsigned idx, void *dst, unsigned size);
+typedef void (VDAPIENTRY *VDAudioFilterSetParamProc )(const VDAudioFilterContext *pContext, unsigned idx, const void *src, unsigned variant_count);
+typedef bool (VDAPIENTRY *VDAudioFilterConfigProc )(const VDAudioFilterContext *pContext, struct HWND__ *hwnd);
+
+enum {
+ kVFAF_Zero = 0,
+ kVFAF_HasConfig = 1, // Filter has a configuration dialog.
+ kVFAF_SerializedIO = 2, // Filter must execute in the serialized I/O thread.
+
+ kVFAF_Max = 0xFFFFFFFF,
};
-struct VDAudioFilterVtbl
-{
- uint32 mSize;
- VDAudioFilterDestroyProc mpDestroy;
- VDAudioFilterPrepareProc mpPrepare;
- VDAudioFilterStartProc mpStart;
- VDAudioFilterStopProc mpStop;
- VDAudioFilterRunProc mpRun;
- VDAudioFilterSeekProc mpSeek;
- VDAudioFilterSuspendProc mpSuspend;
- VDAudioFilterResumeProc mpResume;
- VDAudioFilterGetParamProc mpGetParam;
- VDAudioFilterSetParamProc mpSetParam;
- VDAudioFilterConfigProc mpConfig;
- VDAudioFilterExtProc mpExt;
+struct VDAudioFilterVtbl {
+ uint32 mSize;
+ VDAudioFilterDestroyProc mpDestroy;
+ VDAudioFilterPrepareProc mpPrepare;
+ VDAudioFilterStartProc mpStart;
+ VDAudioFilterStopProc mpStop;
+ VDAudioFilterRunProc mpRun;
+ VDAudioFilterSeekProc mpSeek;
+ VDAudioFilterSuspendProc mpSuspend;
+ VDAudioFilterResumeProc mpResume;
+ VDAudioFilterGetParamProc mpGetParam;
+ VDAudioFilterSetParamProc mpSetParam;
+ VDAudioFilterConfigProc mpConfig;
+ VDAudioFilterExtProc mpExt;
};
-struct VDAudioFilterDefinition
-{
- uint32 mSize; // size of this structure in bytes
- uint32 mFlags;
+struct VDAudioFilterDefinition {
+ uint32 mSize; // size of this structure in bytes
+ uint32 mFlags;
- uint32 mFilterDataSize;
- uint32 mInputPins;
- uint32 mOutputPins;
+ uint32 mFilterDataSize;
+ uint32 mInputPins;
+ uint32 mOutputPins;
- const VDXPluginConfigEntry *mpConfigInfo;
+ const VDXPluginConfigEntry *mpConfigInfo;
- VDAudioFilterInitProc mpInit;
- const VDAudioFilterVtbl *mpVtbl;
+ VDAudioFilterInitProc mpInit;
+ const VDAudioFilterVtbl *mpVtbl;
};
#endif
diff --git a/include/vd2/plugin/vdinputdriver.h b/include/vd2/plugin/vdinputdriver.h index 83c91631a..b75738c98 100644 --- a/include/vd2/plugin/vdinputdriver.h +++ b/include/vd2/plugin/vdinputdriver.h @@ -27,284 +27,258 @@ #define f_VD2_PLUGIN_VDINPUTDRIVER_H
#ifdef _MSC_VER
-#pragma once
-#pragma pack(push, 8)
+ #pragma once
+ #pragma pack(push, 8)
#endif
#include "vdplugin.h"
/// Unsigned 32-bit fraction.
-struct VDXFraction
-{
- uint32 mNumerator;
- uint32 mDenominator;
+struct VDXFraction {
+ uint32 mNumerator;
+ uint32 mDenominator;
};
typedef struct VDXHWNDStruct *VDXHWND;
-typedef struct VDXBITMAPINFOHEADERStruct
-{
- enum { kCompressionRGB = 0 };
- uint32 mSize;
- sint32 mWidth;
- sint32 mHeight;
- uint16 mPlanes;
- uint16 mBitCount;
- uint32 mCompression;
- uint32 mSizeImage;
- sint32 mXPelsPerMeter;
- sint32 mYPelsPerMeter;
- uint32 mClrUsed;
- uint32 mClrImportant;
+typedef struct VDXBITMAPINFOHEADERStruct {
+ enum { kCompressionRGB = 0 };
+ uint32 mSize;
+ sint32 mWidth;
+ sint32 mHeight;
+ uint16 mPlanes;
+ uint16 mBitCount;
+ uint32 mCompression;
+ uint32 mSizeImage;
+ sint32 mXPelsPerMeter;
+ sint32 mYPelsPerMeter;
+ uint32 mClrUsed;
+ uint32 mClrImportant;
} VDXBITMAPINFOHEADER;
-typedef struct VDXWAVEFORMATEXStruct
-{
- enum { kFormatPCM = 1 };
- uint16 mFormatTag;
- uint16 mChannels;
- uint32 mSamplesPerSec;
- uint32 mAvgBytesPerSec;
- uint16 mBlockAlign;
- uint16 mBitsPerSample;
- uint16 mExtraSize;
+typedef struct VDXWAVEFORMATEXStruct {
+ enum { kFormatPCM = 1 };
+ uint16 mFormatTag;
+ uint16 mChannels;
+ uint32 mSamplesPerSec;
+ uint32 mAvgBytesPerSec;
+ uint16 mBlockAlign;
+ uint16 mBitsPerSample;
+ uint16 mExtraSize;
} VDXWAVEFORMATEX;
-struct VDXStreamSourceInfo
-{
- VDXFraction mSampleRate;
- sint64 mSampleCount;
- VDXFraction mPixelAspectRatio;
+struct VDXStreamSourceInfo {
+ VDXFraction mSampleRate;
+ sint64 mSampleCount;
+ VDXFraction mPixelAspectRatio;
};
// V3+ (1.7.X) only
-struct VDXStreamSourceInfoV3
-{
- VDXStreamSourceInfo mInfo;
+struct VDXStreamSourceInfoV3 {
+ VDXStreamSourceInfo mInfo;
- enum
- {
- kFlagVariableSizeSamples = 0x00000001
- };
+ enum {
+ kFlagVariableSizeSamples = 0x00000001
+ };
- uint32 mFlags;
- uint32 mfccHandler; ///< If non-zero, specifies the FOURCC of a codec handler that should be preferred.
+ uint32 mFlags;
+ uint32 mfccHandler; ///< If non-zero, specifies the FOURCC of a codec handler that should be preferred.
};
-class IVDXStreamSource : public IVDXUnknown
-{
+class IVDXStreamSource : public IVDXUnknown {
public:
- enum { kIID = VDXMAKEFOURCC('X', 's', 't', 's') };
+ enum { kIID = VDXMAKEFOURCC('X', 's', 't', 's') };
- virtual void VDXAPIENTRY GetStreamSourceInfo(VDXStreamSourceInfo&) = 0;
+ virtual void VDXAPIENTRY GetStreamSourceInfo(VDXStreamSourceInfo&) = 0;
- virtual bool VDXAPIENTRY Read(sint64 lStart, uint32 lCount, void *lpBuffer, uint32 cbBuffer, uint32 *lBytesRead, uint32 *lSamplesRead) = 0;
+ virtual bool VDXAPIENTRY Read(sint64 lStart, uint32 lCount, void *lpBuffer, uint32 cbBuffer, uint32 *lBytesRead, uint32 *lSamplesRead) = 0;
- virtual const void * VDXAPIENTRY GetDirectFormat() = 0;
- virtual int VDXAPIENTRY GetDirectFormatLen() = 0;
+ virtual const void * VDXAPIENTRY GetDirectFormat() = 0;
+ virtual int VDXAPIENTRY GetDirectFormatLen() = 0;
- enum ErrorMode
- {
- kErrorModeReportAll = 0,
- kErrorModeConceal,
- kErrorModeDecodeAnyway,
- kErrorModeCount
- };
+ enum ErrorMode {
+ kErrorModeReportAll = 0,
+ kErrorModeConceal,
+ kErrorModeDecodeAnyway,
+ kErrorModeCount
+ };
- virtual ErrorMode VDXAPIENTRY GetDecodeErrorMode() = 0;
- virtual void VDXAPIENTRY SetDecodeErrorMode(ErrorMode mode) = 0;
- virtual bool VDXAPIENTRY IsDecodeErrorModeSupported(ErrorMode mode) = 0;
+ virtual ErrorMode VDXAPIENTRY GetDecodeErrorMode() = 0;
+ virtual void VDXAPIENTRY SetDecodeErrorMode(ErrorMode mode) = 0;
+ virtual bool VDXAPIENTRY IsDecodeErrorModeSupported(ErrorMode mode) = 0;
- virtual bool VDXAPIENTRY IsVBR() = 0;
- virtual sint64 VDXAPIENTRY TimeToPositionVBR(sint64 us) = 0;
- virtual sint64 VDXAPIENTRY PositionToTimeVBR(sint64 samples) = 0;
+ virtual bool VDXAPIENTRY IsVBR() = 0;
+ virtual sint64 VDXAPIENTRY TimeToPositionVBR(sint64 us) = 0;
+ virtual sint64 VDXAPIENTRY PositionToTimeVBR(sint64 samples) = 0;
};
// V3+ (1.7.X)
-class IVDXStreamSourceV3 : public IVDXUnknown
-{
+class IVDXStreamSourceV3 : public IVDXUnknown {
public:
- enum { kIID = VDXMAKEFOURCC('X', 's', 't', '2') };
+ enum { kIID = VDXMAKEFOURCC('X', 's', 't', '2') };
- virtual void VDXAPIENTRY GetStreamSourceInfoV3(VDXStreamSourceInfoV3&) = 0;
+ virtual void VDXAPIENTRY GetStreamSourceInfoV3(VDXStreamSourceInfoV3&) = 0;
};
-class IVDXVideoDecoderModel : public IVDXUnknown
-{
+class IVDXVideoDecoderModel : public IVDXUnknown {
public:
- enum { kIID = VDXMAKEFOURCC('X', 'v', 'd', 'm') };
+ enum { kIID = VDXMAKEFOURCC('X', 'v', 'd', 'm') };
- virtual void VDXAPIENTRY Reset() = 0;
- virtual void VDXAPIENTRY SetDesiredFrame(sint64 frame_num) = 0;
- virtual sint64 VDXAPIENTRY GetNextRequiredSample(bool& is_preroll) = 0;
- virtual int VDXAPIENTRY GetRequiredCount() = 0;
+ virtual void VDXAPIENTRY Reset() = 0;
+ virtual void VDXAPIENTRY SetDesiredFrame(sint64 frame_num) = 0;
+ virtual sint64 VDXAPIENTRY GetNextRequiredSample(bool& is_preroll) = 0;
+ virtual int VDXAPIENTRY GetRequiredCount() = 0;
};
-class IVDXVideoDecoder : public IVDXUnknown
-{
+class IVDXVideoDecoder : public IVDXUnknown {
public:
- enum { kIID = VDXMAKEFOURCC('X', 'v', 'd', 'e') };
-
- virtual const void * VDXAPIENTRY DecodeFrame(const void *inputBuffer, uint32 data_len, bool is_preroll, sint64 sampleNumber, sint64 targetFrame) = 0;
- virtual uint32 VDXAPIENTRY GetDecodePadding() = 0;
- virtual void VDXAPIENTRY Reset() = 0;
- virtual bool VDXAPIENTRY IsFrameBufferValid() = 0;
- virtual const VDXPixmap& VDXAPIENTRY GetFrameBuffer() = 0;
- virtual bool VDXAPIENTRY SetTargetFormat(int format, bool useDIBAlignment) = 0;
- virtual bool VDXAPIENTRY SetDecompressedFormat(const VDXBITMAPINFOHEADER *pbih) = 0;
-
- virtual bool VDXAPIENTRY IsDecodable(sint64 sample_num) = 0;
- virtual const void * VDXAPIENTRY GetFrameBufferBase() = 0;
+ enum { kIID = VDXMAKEFOURCC('X', 'v', 'd', 'e') };
+
+ virtual const void * VDXAPIENTRY DecodeFrame(const void *inputBuffer, uint32 data_len, bool is_preroll, sint64 sampleNumber, sint64 targetFrame) = 0;
+ virtual uint32 VDXAPIENTRY GetDecodePadding() = 0;
+ virtual void VDXAPIENTRY Reset() = 0;
+ virtual bool VDXAPIENTRY IsFrameBufferValid() = 0;
+ virtual const VDXPixmap& VDXAPIENTRY GetFrameBuffer() = 0;
+ virtual bool VDXAPIENTRY SetTargetFormat(int format, bool useDIBAlignment) = 0;
+ virtual bool VDXAPIENTRY SetDecompressedFormat(const VDXBITMAPINFOHEADER *pbih) = 0;
+
+ virtual bool VDXAPIENTRY IsDecodable(sint64 sample_num) = 0;
+ virtual const void * VDXAPIENTRY GetFrameBufferBase() = 0;
};
-enum VDXVideoFrameType
-{
- kVDXVFT_Independent,
- kVDXVFT_Predicted,
- kVDXVFT_Bidirectional,
- kVDXVFT_Null,
+enum VDXVideoFrameType {
+ kVDXVFT_Independent,
+ kVDXVFT_Predicted,
+ kVDXVFT_Bidirectional,
+ kVDXVFT_Null,
};
-struct VDXVideoFrameInfo
-{
- char mTypeChar;
- uint8 mFrameType;
- sint64 mBytePosition;
+struct VDXVideoFrameInfo {
+ char mTypeChar;
+ uint8 mFrameType;
+ sint64 mBytePosition;
};
-struct VDXVideoSourceInfo
-{
- enum DecoderModel
- {
- kDecoderModelCustom, ///< A custom decoder model is provided.
- kDecoderModelDefaultIP ///< Use the default I/P decoder model.
- };
-
- enum Flags
- {
- kFlagNone = 0,
- kFlagKeyframeOnly = 0x00000001,
- kFlagAll = 0xFFFFFFFF
- };
+struct VDXVideoSourceInfo {
+ enum DecoderModel {
+ kDecoderModelCustom, ///< A custom decoder model is provided.
+ kDecoderModelDefaultIP ///< Use the default I/P decoder model.
+ };
+
+ enum Flags {
+ kFlagNone = 0,
+ kFlagKeyframeOnly = 0x00000001,
+ kFlagAll = 0xFFFFFFFF
+ };
public:
- uint32 mFlags;
- uint32 mWidth;
- uint32 mHeight;
- uint8 mDecoderModel;
- uint8 unused[3];
+ uint32 mFlags;
+ uint32 mWidth;
+ uint32 mHeight;
+ uint8 mDecoderModel;
+ uint8 unused[3];
};
-class IVDXVideoSource : public IVDXUnknown
-{
+class IVDXVideoSource : public IVDXUnknown {
public:
- enum { kIID = VDXMAKEFOURCC('X', 'v', 'd', 's') };
+ enum { kIID = VDXMAKEFOURCC('X', 'v', 'd', 's') };
- virtual void VDXAPIENTRY GetVideoSourceInfo(VDXVideoSourceInfo& info) = 0;
+ virtual void VDXAPIENTRY GetVideoSourceInfo(VDXVideoSourceInfo& info) = 0;
- virtual bool VDXAPIENTRY CreateVideoDecoderModel(IVDXVideoDecoderModel **) = 0;
- virtual bool VDXAPIENTRY CreateVideoDecoder(IVDXVideoDecoder **) = 0;
+ virtual bool VDXAPIENTRY CreateVideoDecoderModel(IVDXVideoDecoderModel **) = 0;
+ virtual bool VDXAPIENTRY CreateVideoDecoder(IVDXVideoDecoder **) = 0;
- virtual void VDXAPIENTRY GetSampleInfo(sint64 sample_num, VDXVideoFrameInfo& frameInfo) = 0;
+ virtual void VDXAPIENTRY GetSampleInfo(sint64 sample_num, VDXVideoFrameInfo& frameInfo) = 0;
- virtual bool VDXAPIENTRY IsKey(sint64 sample_num) = 0;
+ virtual bool VDXAPIENTRY IsKey(sint64 sample_num) = 0;
- virtual sint64 VDXAPIENTRY GetFrameNumberForSample(sint64 sample_num) = 0;
- virtual sint64 VDXAPIENTRY GetSampleNumberForFrame(sint64 frame_num) = 0;
- virtual sint64 VDXAPIENTRY GetRealFrame(sint64 frame_num) = 0;
+ virtual sint64 VDXAPIENTRY GetFrameNumberForSample(sint64 sample_num) = 0;
+ virtual sint64 VDXAPIENTRY GetSampleNumberForFrame(sint64 frame_num) = 0;
+ virtual sint64 VDXAPIENTRY GetRealFrame(sint64 frame_num) = 0;
- virtual sint64 VDXAPIENTRY GetSampleBytePosition(sint64 sample_num) = 0;
+ virtual sint64 VDXAPIENTRY GetSampleBytePosition(sint64 sample_num) = 0;
};
-struct VDXAudioSourceInfo
-{
+struct VDXAudioSourceInfo {
public:
- uint32 mFlags;
+ uint32 mFlags;
};
-class IVDXAudioSource : public IVDXUnknown
-{
+class IVDXAudioSource : public IVDXUnknown {
public:
- enum { kIID = VDXMAKEFOURCC('X', 'a', 'd', 's') };
+ enum { kIID = VDXMAKEFOURCC('X', 'a', 'd', 's') };
- virtual void VDXAPIENTRY GetAudioSourceInfo(VDXAudioSourceInfo& info) = 0;
+ virtual void VDXAPIENTRY GetAudioSourceInfo(VDXAudioSourceInfo& info) = 0;
};
-class IVDXInputOptions : public IVDXUnknown
-{
+class IVDXInputOptions : public IVDXUnknown {
public:
- enum { kIID = VDXMAKEFOURCC('X', 'i', 'o', 'p') };
+ enum { kIID = VDXMAKEFOURCC('X', 'i', 'o', 'p') };
- virtual uint32 VDXAPIENTRY Write(void *buf, uint32 buflen) = 0;
+ virtual uint32 VDXAPIENTRY Write(void *buf, uint32 buflen) = 0;
};
-class IVDXInputFile : public IVDXUnknown
-{
+class IVDXInputFile : public IVDXUnknown {
public:
- enum { kIID = VDXMAKEFOURCC('X', 'i', 'f', 'l') };
+ enum { kIID = VDXMAKEFOURCC('X', 'i', 'f', 'l') };
- virtual bool VDXAPIENTRY PromptForOptions(VDXHWND, IVDXInputOptions **ppOptions) = 0;
- virtual bool VDXAPIENTRY CreateOptions(const void *buf, uint32 len, IVDXInputOptions **ppOptions) = 0;
+ virtual bool VDXAPIENTRY PromptForOptions(VDXHWND, IVDXInputOptions **ppOptions) = 0;
+ virtual bool VDXAPIENTRY CreateOptions(const void *buf, uint32 len, IVDXInputOptions **ppOptions) = 0;
- virtual void VDXAPIENTRY Init(const wchar_t *path, IVDXInputOptions *options) = 0;
- virtual bool VDXAPIENTRY Append(const wchar_t *path) = 0;
+ virtual void VDXAPIENTRY Init(const wchar_t *path, IVDXInputOptions *options) = 0;
+ virtual bool VDXAPIENTRY Append(const wchar_t *path) = 0;
- virtual void VDXAPIENTRY DisplayInfo(VDXHWND hwndParent) = 0;
+ virtual void VDXAPIENTRY DisplayInfo(VDXHWND hwndParent) = 0;
- virtual bool VDXAPIENTRY GetVideoSource(int index, IVDXVideoSource **ppVS) = 0;
- virtual bool VDXAPIENTRY GetAudioSource(int index, IVDXAudioSource **ppAS) = 0;
+ virtual bool VDXAPIENTRY GetVideoSource(int index, IVDXVideoSource **ppVS) = 0;
+ virtual bool VDXAPIENTRY GetAudioSource(int index, IVDXAudioSource **ppAS) = 0;
};
///////////////////////////////////////////////////////////////////////////////
// IVDXInputFileDriver
//
-class IVDXInputFileDriver : public IVDXUnknown
-{
+class IVDXInputFileDriver : public IVDXUnknown {
public:
- enum { kIID = VDXMAKEFOURCC('X', 'i', 'f', 'd') };
+ enum { kIID = VDXMAKEFOURCC('X', 'i', 'f', 'd') };
- virtual int VDXAPIENTRY DetectBySignature(const void *pHeader, sint32 nHeaderSize, const void *pFooter, sint32 nFooterSize, sint64 nFileSize) = 0;
- virtual bool VDXAPIENTRY CreateInputFile(uint32 flags, IVDXInputFile **ppFile) = 0;
+ virtual int VDXAPIENTRY DetectBySignature(const void *pHeader, sint32 nHeaderSize, const void *pFooter, sint32 nFooterSize, sint64 nFileSize) = 0;
+ virtual bool VDXAPIENTRY CreateInputFile(uint32 flags, IVDXInputFile **ppFile) = 0;
};
-struct VDXInputDriverContext
-{
- uint32 mAPIVersion;
- IVDPluginCallbacks *mpCallbacks;
+struct VDXInputDriverContext {
+ uint32 mAPIVersion;
+ IVDPluginCallbacks *mpCallbacks;
};
typedef bool (VDXAPIENTRY *VDXInputDriverCreateProc)(const VDXInputDriverContext *pContext, IVDXInputFileDriver **);
-struct VDXInputDriverDefinition
-{
- enum
- {
- kFlagNone = 0x00000000,
- kFlagSupportsVideo = 0x00000001,
- kFlagSupportsAudio = 0x00000002,
- kFlagCustomSignature = 0x00010000,
- kFlagAll = 0xFFFFFFFF
- };
- uint32 mSize; // size of this structure in bytes
- uint32 mFlags;
- sint32 mPriority;
- uint32 mSignatureLength;
- const void *mpSignature;
- const wchar_t *mpFilenameDetectPattern;
- const wchar_t *mpFilenamePattern;
- const wchar_t *mpDriverTagName;
-
- VDXInputDriverCreateProc mpCreate;
+struct VDXInputDriverDefinition {
+ enum {
+ kFlagNone = 0x00000000,
+ kFlagSupportsVideo = 0x00000001,
+ kFlagSupportsAudio = 0x00000002,
+ kFlagCustomSignature = 0x00010000,
+ kFlagAll = 0xFFFFFFFF
+ };
+ uint32 mSize; // size of this structure in bytes
+ uint32 mFlags;
+ sint32 mPriority;
+ uint32 mSignatureLength;
+ const void *mpSignature;
+ const wchar_t *mpFilenameDetectPattern;
+ const wchar_t *mpFilenamePattern;
+ const wchar_t *mpDriverTagName;
+
+ VDXInputDriverCreateProc mpCreate;
};
-enum
-{
- // V1 (1.7.4.28204): Initial version
- // V2 (1.7.5): Default I/P frame model fixed.
- kVDXPlugin_InputDriverAPIVersion = 2
+enum {
+ // V1 (1.7.4.28204): Initial version
+ // V2 (1.7.5): Default I/P frame model fixed.
+ kVDXPlugin_InputDriverAPIVersion = 2
};
#ifdef _MSC_VER
-#pragma pack(pop)
+ #pragma pack(pop)
#endif
#endif
diff --git a/include/vd2/plugin/vdplugin.h b/include/vd2/plugin/vdplugin.h index 08a6c0c11..cec344d37 100644 --- a/include/vd2/plugin/vdplugin.h +++ b/include/vd2/plugin/vdplugin.h @@ -27,85 +27,81 @@ #define f_VD2_PLUGIN_VDPLUGIN_H
#ifdef _MSC_VER
-#pragma once
-#pragma pack(push, 8)
+ #pragma once
+ #pragma pack(push, 8)
#endif
#include <stddef.h>
// Copied from <vd2/system/vdtypes.h>. Must be in sync.
#ifndef VD_STANDARD_TYPES_DECLARED
-#if defined(_MSC_VER)
-typedef signed __int64 sint64;
-typedef unsigned __int64 uint64;
-#elif defined(__GNUC__)
-typedef signed long long sint64;
-typedef unsigned long long uint64;
-#endif
-typedef signed int sint32;
-typedef unsigned int uint32;
-typedef signed short sint16;
-typedef unsigned short uint16;
-typedef signed char sint8;
-typedef unsigned char uint8;
-
-typedef sint64 int64;
-typedef sint32 int32;
-typedef sint16 int16;
-typedef sint8 int8;
-
-typedef ptrdiff_t sintptr;
-typedef size_t uintptr;
+ #if defined(_MSC_VER)
+ typedef signed __int64 sint64;
+ typedef unsigned __int64 uint64;
+ #elif defined(__GNUC__)
+ typedef signed long long sint64;
+ typedef unsigned long long uint64;
+ #endif
+ typedef signed int sint32;
+ typedef unsigned int uint32;
+ typedef signed short sint16;
+ typedef unsigned short uint16;
+ typedef signed char sint8;
+ typedef unsigned char uint8;
+
+ typedef sint64 int64;
+ typedef sint32 int32;
+ typedef sint16 int16;
+ typedef sint8 int8;
+
+ typedef ptrdiff_t sintptr;
+ typedef size_t uintptr;
#endif
#ifndef VDXAPIENTRY
-#define VDXAPIENTRY __stdcall
+ #define VDXAPIENTRY __stdcall
#endif
#ifndef VDXAPIENTRYV
-#define VDXAPIENTRYV __cdecl
+ #define VDXAPIENTRYV __cdecl
#endif
-enum VDXCPUFeatureFlags
-{
- kVDXCPUF_CPUID = 0x00000001,
- kVDXCPUF_MMX = 0x00000004,
- kVDXCPUF_ISSE = 0x00000008,
- kVDXCPUF_SSE = 0x00000010,
- kVDXCPUF_SSE2 = 0x00000020,
- kVDXCPUF_3DNOW = 0x00000040,
- kVDXCPUF_3DNOW_EXT = 0x00000080,
- kVDXCPUF_SSE3 = 0x00000100,
- kVDXCPUF_SSSE3 = 0x00000200
+enum VDXCPUFeatureFlags {
+ kVDXCPUF_CPUID = 0x00000001,
+ kVDXCPUF_MMX = 0x00000004,
+ kVDXCPUF_ISSE = 0x00000008,
+ kVDXCPUF_SSE = 0x00000010,
+ kVDXCPUF_SSE2 = 0x00000020,
+ kVDXCPUF_3DNOW = 0x00000040,
+ kVDXCPUF_3DNOW_EXT = 0x00000080,
+ kVDXCPUF_SSE3 = 0x00000100,
+ kVDXCPUF_SSSE3 = 0x00000200
};
-enum
-{
- kVDXPlugin_APIVersion = 10
+enum {
+ kVDXPlugin_APIVersion = 10
};
-enum
-{
- kVDXPluginType_Video, // Updated video filter API is not yet complete.
- kVDXPluginType_Audio,
- kVDXPluginType_Input
+enum {
+ kVDXPluginType_Video, // Updated video filter API is not yet complete.
+ kVDXPluginType_Audio,
+ kVDXPluginType_Input
};
-struct VDXPluginInfo
-{
- uint32 mSize; // size of this structure in bytes
- const wchar_t *mpName;
- const wchar_t *mpAuthor;
- const wchar_t *mpDescription;
- uint32 mVersion; // (major<<24) + (minor<<16) + build. 1.4.1000 would be 0x010403E8.
- uint32 mType;
- uint32 mFlags;
- uint32 mAPIVersionRequired;
- uint32 mAPIVersionUsed;
- uint32 mTypeAPIVersionRequired;
- uint32 mTypeAPIVersionUsed;
- const void * mpTypeSpecificInfo;
+struct VDXPluginInfo {
+ uint32 mSize; // size of this structure in bytes
+ const wchar_t *mpName;
+ const wchar_t *mpAuthor;
+ const wchar_t *mpDescription;
+ uint32 mVersion; // (major<<24) + (minor<<16) + build. 1.4.1000 would be 0x010403E8.
+ uint32 mType;
+ uint32 mFlags;
+ uint32 mAPIVersionRequired;
+ uint32 mAPIVersionUsed;
+ uint32 mTypeAPIVersionRequired;
+ uint32 mTypeAPIVersionUsed;
+ const void * mpTypeSpecificInfo;
};
typedef const VDXPluginInfo *const *(VDXAPIENTRY *tpVDXGetPluginInfo)();
@@ -113,106 +109,98 @@ typedef const VDXPluginInfo *const *(VDXAPIENTRY *tpVDXGetPluginInfo)(); typedef VDXPluginInfo VDPluginInfo;
typedef tpVDXGetPluginInfo tpVDPluginInfo;
-class IVDXPluginCallbacks
-{
+class IVDXPluginCallbacks {
public:
- virtual void * VDXAPIENTRY GetExtendedAPI(const char *pExtendedAPIName) = 0;
- virtual void VDXAPIENTRYV SetError(const char *format, ...) = 0;
- virtual void VDXAPIENTRY SetErrorOutOfMemory() = 0;
- virtual uint32 VDXAPIENTRY GetCPUFeatureFlags() = 0;
+ virtual void * VDXAPIENTRY GetExtendedAPI(const char *pExtendedAPIName) = 0;
+ virtual void VDXAPIENTRYV SetError(const char *format, ...) = 0;
+ virtual void VDXAPIENTRY SetErrorOutOfMemory() = 0;
+ virtual uint32 VDXAPIENTRY GetCPUFeatureFlags() = 0;
};
typedef IVDXPluginCallbacks IVDPluginCallbacks;
-struct VDXPluginConfigEntry
-{
- enum Type
- {
- kTypeInvalid = 0,
- kTypeU32 = 1,
- kTypeS32,
- kTypeU64,
- kTypeS64,
- kTypeDouble,
- kTypeAStr,
- kTypeWStr,
- kTypeBlock
- };
-
- const VDXPluginConfigEntry *next;
-
- unsigned idx;
- uint32 type;
- const wchar_t *name;
- const wchar_t *label;
- const wchar_t *desc;
+struct VDXPluginConfigEntry {
+ enum Type {
+ kTypeInvalid = 0,
+ kTypeU32 = 1,
+ kTypeS32,
+ kTypeU64,
+ kTypeS64,
+ kTypeDouble,
+ kTypeAStr,
+ kTypeWStr,
+ kTypeBlock
+ };
+
+ const VDXPluginConfigEntry *next;
+
+ unsigned idx;
+ uint32 type;
+ const wchar_t *name;
+ const wchar_t *label;
+ const wchar_t *desc;
};
-struct VDXPixmap
-{
- void *data;
- const uint32 *palette;
- sint32 w;
- sint32 h;
- ptrdiff_t pitch;
- sint32 format;
-
- // Auxiliary planes are always byte-per-pixel.
- void *data2; // Cb (U) for YCbCr
- ptrdiff_t pitch2;
- void *data3; // Cr (V) for YCbCr
- ptrdiff_t pitch3;
+struct VDXPixmap {
+ void *data;
+ const uint32 *palette;
+ sint32 w;
+ sint32 h;
+ ptrdiff_t pitch;
+ sint32 format;
+
+ // Auxiliary planes are always byte-per-pixel.
+ void *data2; // Cb (U) for YCbCr
+ ptrdiff_t pitch2;
+ void *data3; // Cr (V) for YCbCr
+ ptrdiff_t pitch3;
};
-struct VDXPixmapLayout
-{
- ptrdiff_t data;
- const uint32 *palette;
- sint32 w;
- sint32 h;
- ptrdiff_t pitch;
- sint32 format;
-
- // Auxiliary planes are always byte-per-pixel.
- ptrdiff_t data2; // Cb (U) for YCbCr
- ptrdiff_t pitch2;
- ptrdiff_t data3; // Cr (V) for YCbCr
- ptrdiff_t pitch3;
+struct VDXPixmapLayout {
+ ptrdiff_t data;
+ const uint32 *palette;
+ sint32 w;
+ sint32 h;
+ ptrdiff_t pitch;
+ sint32 format;
+
+ // Auxiliary planes are always byte-per-pixel.
+ ptrdiff_t data2; // Cb (U) for YCbCr
+ ptrdiff_t pitch2;
+ ptrdiff_t data3; // Cr (V) for YCbCr
+ ptrdiff_t pitch3;
};
-namespace nsVDXPixmap
-{
-enum VDXPixmapFormat
-{
- kPixFormat_Null = 0,
- kPixFormat_XRGB1555 = 5,
- kPixFormat_RGB565 = 6,
- kPixFormat_RGB888 = 7,
- kPixFormat_XRGB8888 = 8,
- kPixFormat_Y8 = 9,
- kPixFormat_YUV422_UYVY = 10,
- kPixFormat_YUV422_YUYV = 11,
- kPixFormat_YUV444_Planar = 13,
- kPixFormat_YUV422_Planar = 14,
- kPixFormat_YUV420_Planar = 15,
- kPixFormat_YUV411_Planar = 16,
- kPixFormat_YUV410_Planar = 17
-};
+namespace nsVDXPixmap {
+ enum VDXPixmapFormat {
+ kPixFormat_Null = 0,
+ kPixFormat_XRGB1555 = 5,
+ kPixFormat_RGB565 = 6,
+ kPixFormat_RGB888 = 7,
+ kPixFormat_XRGB8888 = 8,
+ kPixFormat_Y8 = 9,
+ kPixFormat_YUV422_UYVY = 10,
+ kPixFormat_YUV422_YUYV = 11,
+ kPixFormat_YUV444_Planar = 13,
+ kPixFormat_YUV422_Planar = 14,
+ kPixFormat_YUV420_Planar = 15,
+ kPixFormat_YUV411_Planar = 16,
+ kPixFormat_YUV410_Planar = 17
+ };
};
#define VDXMAKEFOURCC(a, b, c, d) ((uint32)(uint8)(d) + ((uint32)(uint8)(c) << 8) + ((uint32)(uint8)(b) << 16) + ((uint32)(uint8)(a) << 24))
-class IVDXUnknown
-{
+class IVDXUnknown {
public:
- enum { kIID = VDXMAKEFOURCC('X', 'u', 'n', 'k') };
- virtual int VDXAPIENTRY AddRef() = 0;
- virtual int VDXAPIENTRY Release() = 0;
- virtual void *VDXAPIENTRY AsInterface(uint32 iid) = 0;
+ enum { kIID = VDXMAKEFOURCC('X', 'u', 'n', 'k') };
+ virtual int VDXAPIENTRY AddRef() = 0;
+ virtual int VDXAPIENTRY Release() = 0;
+ virtual void *VDXAPIENTRY AsInterface(uint32 iid) = 0;
};
#ifdef _MSC_VER
-#pragma pack(pop)
+ #pragma pack(pop)
#endif
#endif
diff --git a/include/vd2/plugin/vdvideofilt.h b/include/vd2/plugin/vdvideofilt.h index 694d34642..aab8e023f 100644 --- a/include/vd2/plugin/vdvideofilt.h +++ b/include/vd2/plugin/vdvideofilt.h @@ -27,8 +27,8 @@ #define f_VD2_PLUGIN_VDVIDEOFILT_H
#ifdef _MSC_VER
-#pragma once
-#pragma pack(push, 8)
+ #pragma once
+ #pragma pack(push, 8)
#endif
#include <stddef.h>
@@ -46,48 +46,47 @@ struct VDXFilterVTbls; //////////////////
-enum
-{
- /// Request distinct source and destination buffers. Otherwise, the source and destination buffers
- /// alias (in-place mode).
- FILTERPARAM_SWAP_BUFFERS = 0x00000001L,
-
- /// Request an extra buffer for the previous source frame.
- FILTERPARAM_NEEDS_LAST = 0x00000002L,
-
- /// Filter supports image formats other than RGB32. Filters that support format negotiation must
- /// set this flag for all calls to paramProc.
- FILTERPARAM_SUPPORTS_ALTFORMATS = 0x00000004L,
-
- /// Filter requests 16 byte alignment for source and destination buffers. This guarantees that:
- ///
- /// - data and pitch fields are multiples of 16 bytes (aligned)
- /// - an integral number of 16 byte vectors may be read, even if the last vector includes
- /// some bytes beyond the end of the scanline (their values are undefined)
- /// - an integral number of 16 byte vectors may be written, even if the last vector includes
- /// some bytes beyong the end of the scanline (their values are ignored)
- ///
- FILTERPARAM_ALIGN_SCANLINES = 0x00000008L,
-
- /// Filter's output is purely a function of configuration parameters and source image data, and not
- /// source or output frame numbers. In other words, two output frames produced by a filter instance
- /// can be assumed to be identical images if:
- ///
- /// - the same number of source frames are prefetched
- /// - the same type of prefetches are performed (direct vs. non-direct)
- /// - the frame numbers for the two prefetch lists, taken in order, correspond to identical
- /// source frames
- /// - the prefetch cookies match
- ///
- /// Enabling this flag improves the ability of the host to identify identical frames and drop them
- /// in preview or in the output file.
- ///
- FILTERPARAM_PURE_TRANSFORM = 0x00000010L,
-
- /// Filter cannot support the requested source format. Note that this sets all bits, so the meaning
- /// of other bits is ignored. The one exception is that FILTERPARAM_SUPPORTS_ALTFORMATS is assumed
- /// to be implicitly set.
- FILTERPARAM_NOT_SUPPORTED = (long)0xFFFFFFFF
+enum {
+ /// Request distinct source and destination buffers. Otherwise, the source and destination buffers
+ /// alias (in-place mode).
+ FILTERPARAM_SWAP_BUFFERS = 0x00000001L,
+
+ /// Request an extra buffer for the previous source frame.
+ FILTERPARAM_NEEDS_LAST = 0x00000002L,
+
+ /// Filter supports image formats other than RGB32. Filters that support format negotiation must
+ /// set this flag for all calls to paramProc.
+ FILTERPARAM_SUPPORTS_ALTFORMATS = 0x00000004L,
+
+ /// Filter requests 16 byte alignment for source and destination buffers. This guarantees that:
+ ///
+ /// - data and pitch fields are multiples of 16 bytes (aligned)
+ /// - an integral number of 16 byte vectors may be read, even if the last vector includes
+ /// some bytes beyond the end of the scanline (their values are undefined)
+ /// - an integral number of 16 byte vectors may be written, even if the last vector includes
+ /// some bytes beyong the end of the scanline (their values are ignored)
+ ///
+ FILTERPARAM_ALIGN_SCANLINES = 0x00000008L,
+
+ /// Filter's output is purely a function of configuration parameters and source image data, and not
+ /// source or output frame numbers. In other words, two output frames produced by a filter instance
+ /// can be assumed to be identical images if:
+ ///
+ /// - the same number of source frames are prefetched
+ /// - the same type of prefetches are performed (direct vs. non-direct)
+ /// - the frame numbers for the two prefetch lists, taken in order, correspond to identical
+ /// source frames
+ /// - the prefetch cookies match
+ ///
+ /// Enabling this flag improves the ability of the host to identify identical frames and drop them
+ /// in preview or in the output file.
+ ///
+ FILTERPARAM_PURE_TRANSFORM = 0x00000010L,
+
+ /// Filter cannot support the requested source format. Note that this sets all bits, so the meaning
+ /// of other bits is ignored. The one exception is that FILTERPARAM_SUPPORTS_ALTFORMATS is assumed
+ /// to be implicitly set.
+ FILTERPARAM_NOT_SUPPORTED = (long)0xFFFFFFFF
};
/// The filter has a delay from source to output. For instance, a lag of 3 indicates that the
@@ -107,29 +106,28 @@ struct VDXFilterFunctions; struct VDXFilterModule;
class IVDXVideoPrefetcher;
-enum
-{
- kVDXVFEvent_None = 0,
- kVDXVFEvent_InvalidateCaches = 1
+enum {
+ kVDXVFEvent_None = 0,
+ kVDXVFEvent_InvalidateCaches = 1
};
-typedef int (__cdecl *VDXFilterInitProc)(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
-typedef void (__cdecl *VDXFilterDeinitProc)(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
-typedef int (__cdecl *VDXFilterRunProc)(const VDXFilterActivation *fa, const VDXFilterFunctions *ff);
-typedef long(__cdecl *VDXFilterParamProc)(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
-typedef int (__cdecl *VDXFilterConfigProc)(VDXFilterActivation *fa, const VDXFilterFunctions *ff, VDXHWND hWnd);
-typedef void (__cdecl *VDXFilterStringProc)(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, char *buf);
-typedef int (__cdecl *VDXFilterStartProc)(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
-typedef int (__cdecl *VDXFilterEndProc)(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
+typedef int (__cdecl *VDXFilterInitProc )(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
+typedef void (__cdecl *VDXFilterDeinitProc )(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
+typedef int (__cdecl *VDXFilterRunProc )(const VDXFilterActivation *fa, const VDXFilterFunctions *ff);
+typedef long (__cdecl *VDXFilterParamProc )(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
+typedef int (__cdecl *VDXFilterConfigProc )(VDXFilterActivation *fa, const VDXFilterFunctions *ff, VDXHWND hWnd);
+typedef void (__cdecl *VDXFilterStringProc )(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, char *buf);
+typedef int (__cdecl *VDXFilterStartProc )(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
+typedef int (__cdecl *VDXFilterEndProc )(VDXFilterActivation *fa, const VDXFilterFunctions *ff);
typedef bool (__cdecl *VDXFilterScriptStrProc)(VDXFilterActivation *fa, const VDXFilterFunctions *, char *, int);
-typedef void (__cdecl *VDXFilterStringProc2)(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, char *buf, int maxlen);
-typedef int (__cdecl *VDXFilterSerialize)(VDXFilterActivation *fa, const VDXFilterFunctions *ff, char *buf, int maxbuf);
-typedef void (__cdecl *VDXFilterDeserialize)(VDXFilterActivation *fa, const VDXFilterFunctions *ff, const char *buf, int maxbuf);
-typedef void (__cdecl *VDXFilterCopy)(VDXFilterActivation *fa, const VDXFilterFunctions *ff, void *dst);
-typedef sint64(__cdecl *VDXFilterPrefetch)(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, sint64 frame);
-typedef void (__cdecl *VDXFilterCopy2Proc)(VDXFilterActivation *fa, const VDXFilterFunctions *ff, void *dst, VDXFilterActivation *fa2, const VDXFilterFunctions *ff2);
+typedef void (__cdecl *VDXFilterStringProc2 )(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, char *buf, int maxlen);
+typedef int (__cdecl *VDXFilterSerialize )(VDXFilterActivation *fa, const VDXFilterFunctions *ff, char *buf, int maxbuf);
+typedef void (__cdecl *VDXFilterDeserialize )(VDXFilterActivation *fa, const VDXFilterFunctions *ff, const char *buf, int maxbuf);
+typedef void (__cdecl *VDXFilterCopy )(VDXFilterActivation *fa, const VDXFilterFunctions *ff, void *dst);
+typedef sint64 (__cdecl *VDXFilterPrefetch )(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, sint64 frame);
+typedef void (__cdecl *VDXFilterCopy2Proc )(VDXFilterActivation *fa, const VDXFilterFunctions *ff, void *dst, VDXFilterActivation *fa2, const VDXFilterFunctions *ff2);
typedef bool (__cdecl *VDXFilterPrefetch2Proc)(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, sint64 frame, IVDXVideoPrefetcher *prefetcher);
-typedef bool (__cdecl *VDXFilterEventProc)(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, uint32 event, const void *eventData);
+typedef bool (__cdecl *VDXFilterEventProc )(const VDXFilterActivation *fa, const VDXFilterFunctions *ff, uint32 event, const void *eventData);
typedef int (__cdecl *VDXFilterModuleInitProc)(VDXFilterModule *fm, const VDXFilterFunctions *ff, int& vdfd_ver, int& vdfd_compat);
typedef void (__cdecl *VDXFilterModuleDeinitProc)(VDXFilterModule *fm, const VDXFilterFunctions *ff);
@@ -139,72 +137,68 @@ typedef void (__cdecl *VDXFilterModuleDeinitProc)(VDXFilterModule *fm, const VDX typedef void (__cdecl *VDXFilterPreviewButtonCallback)(bool fNewState, void *pData);
typedef void (__cdecl *VDXFilterPreviewSampleCallback)(VDXFBitmap *, long lFrame, long lCount, void *pData);
-class IVDXFilterPreview
-{
+class IVDXFilterPreview {
public:
- virtual void SetButtonCallback(VDXFilterPreviewButtonCallback, void *) = 0;
- virtual void SetSampleCallback(VDXFilterPreviewSampleCallback, void *) = 0;
-
- virtual bool isPreviewEnabled() = 0;
- virtual void Toggle(VDXHWND) = 0;
- virtual void Display(VDXHWND, bool) = 0;
- virtual void RedoFrame() = 0;
- virtual void RedoSystem() = 0;
- virtual void UndoSystem() = 0;
- virtual void InitButton(VDXHWND) = 0;
- virtual void Close() = 0;
- virtual bool SampleCurrentFrame() = 0;
- virtual long SampleFrames() = 0;
+ virtual void SetButtonCallback(VDXFilterPreviewButtonCallback, void *)=0;
+ virtual void SetSampleCallback(VDXFilterPreviewSampleCallback, void *)=0;
+
+ virtual bool isPreviewEnabled()=0;
+ virtual void Toggle(VDXHWND)=0;
+ virtual void Display(VDXHWND, bool)=0;
+ virtual void RedoFrame()=0;
+ virtual void RedoSystem()=0;
+ virtual void UndoSystem()=0;
+ virtual void InitButton(VDXHWND)=0;
+ virtual void Close()=0;
+ virtual bool SampleCurrentFrame()=0;
+ virtual long SampleFrames()=0;
};
-class IVDXFilterPreview2 : public IVDXFilterPreview
-{
+class IVDXFilterPreview2 : public IVDXFilterPreview {
public:
- virtual bool IsPreviewDisplayed() = 0;
+ virtual bool IsPreviewDisplayed() = 0;
};
-class IVDXVideoPrefetcher : public IVDXUnknown
-{
+class IVDXVideoPrefetcher : public IVDXUnknown {
public:
- enum { kIID = VDXMAKEFOURCC('X', 'v', 'p', 'f') };
-
- /// Request a video frame fetch from an upstream source.
- virtual void VDXAPIENTRY PrefetchFrame(sint32 srcIndex, sint64 frame, uint64 cookie) = 0;
-
- /// Request a video frame fetch from an upstream source in direct mode.
- /// This specifies that the output frame is the same as the input frame.
- /// There cannot be more than one direct fetch and there must be no standard
- /// fetches at the same time. There can, however, be symbolic fetches.
- virtual void VDXAPIENTRY PrefetchFrameDirect(sint32 srcIndex, sint64 frame) = 0;
-
- /// Request a symbolic fetch from a source. This does not actually fetch
- /// any frames, but marks an association from source to output. This is
- /// useful for indicating the approximate center of where an output derives
- /// in a source, even if those frames aren't fetched (perhaps due to caching).
- /// There may be either zero or one symbolic fetch per source.
- ///
- /// If no symbolic fetches are performed, the symbolic frame is assumed to
- /// be the rounded mean of the fetched source frames.
- virtual void VDXAPIENTRY PrefetchFrameSymbolic(sint32 srcIndex, sint64 frame) = 0;
+ enum { kIID = VDXMAKEFOURCC('X', 'v', 'p', 'f') };
+
+ /// Request a video frame fetch from an upstream source.
+ virtual void VDXAPIENTRY PrefetchFrame(sint32 srcIndex, sint64 frame, uint64 cookie) = 0;
+
+ /// Request a video frame fetch from an upstream source in direct mode.
+ /// This specifies that the output frame is the same as the input frame.
+ /// There cannot be more than one direct fetch and there must be no standard
+ /// fetches at the same time. There can, however, be symbolic fetches.
+ virtual void VDXAPIENTRY PrefetchFrameDirect(sint32 srcIndex, sint64 frame) = 0;
+
+ /// Request a symbolic fetch from a source. This does not actually fetch
+ /// any frames, but marks an association from source to output. This is
+ /// useful for indicating the approximate center of where an output derives
+ /// in a source, even if those frames aren't fetched (perhaps due to caching).
+ /// There may be either zero or one symbolic fetch per source.
+ ///
+ /// If no symbolic fetches are performed, the symbolic frame is assumed to
+ /// be the rounded mean of the fetched source frames.
+ virtual void VDXAPIENTRY PrefetchFrameSymbolic(sint32 srcIndex, sint64 frame) = 0;
};
//////////
-enum
-{
- // This is the highest API version supported by this header file.
- VIRTUALDUB_FILTERDEF_VERSION = 14,
+enum {
+ // This is the highest API version supported by this header file.
+ VIRTUALDUB_FILTERDEF_VERSION = 14,
- // This is the absolute lowest API version supported by this header file.
- // Note that V4 is rather old, corresponding to VirtualDub 1.2.
- // Chances are you will need to declare a higher version.
- VIRTUALDUB_FILTERDEF_COMPATIBLE = 4,
+ // This is the absolute lowest API version supported by this header file.
+ // Note that V4 is rather old, corresponding to VirtualDub 1.2.
+ // Chances are you will need to declare a higher version.
+ VIRTUALDUB_FILTERDEF_COMPATIBLE = 4,
- // API V9 is a slightly saner baseline, since it is the first API
- // version that has copy constructor support. You may still need to
- // declare a higher vdfd_compat version in your module init if you
- // need features beyond V9 (VirtualDub 1.4.12).
- VIRTUALDUB_FILTERDEF_COMPATIBLE_COPYCTOR = 9
+ // API V9 is a slightly saner baseline, since it is the first API
+ // version that has copy constructor support. You may still need to
+ // declare a higher vdfd_compat version in your module init if you
+ // need features beyond V9 (VirtualDub 1.4.12).
+ VIRTUALDUB_FILTERDEF_COMPATIBLE_COPYCTOR = 9
};
@@ -221,161 +215,150 @@ enum // v13 (1.8.2): added mOutputFrame field to VDXFilterStateInfo
// v14 (1.9.1): added copyProc2, prefetchProc2, input/output frame arrays
-struct VDXFilterDefinition
-{
- void *_next; // deprecated - set to NULL
- void *_prev; // deprecated - set to NULL
- void *_module; // deprecated - set to NULL
-
- const char * name;
- const char * desc;
- const char * maker;
- void * private_data;
- int inst_data_size;
-
- VDXFilterInitProc initProc;
- VDXFilterDeinitProc deinitProc;
- VDXFilterRunProc runProc;
- VDXFilterParamProc paramProc;
- VDXFilterConfigProc configProc;
- VDXFilterStringProc stringProc;
- VDXFilterStartProc startProc;
- VDXFilterEndProc endProc;
-
- VDXScriptObject *script_obj;
-
- VDXFilterScriptStrProc fssProc;
-
- // NEW - 1.4.11
- VDXFilterStringProc2 stringProc2;
- VDXFilterSerialize serializeProc;
- VDXFilterDeserialize deserializeProc;
- VDXFilterCopy copyProc;
-
- VDXFilterPrefetch prefetchProc; // (V12/V1.7.4+)
-
- // NEW - V14 / 1.9.1
- VDXFilterCopy2Proc copyProc2;
- VDXFilterPrefetch2Proc prefetchProc2;
- VDXFilterEventProc eventProc;
+struct VDXFilterDefinition {
+ void *_next; // deprecated - set to NULL
+ void *_prev; // deprecated - set to NULL
+ void *_module; // deprecated - set to NULL
+
+ const char * name;
+ const char * desc;
+ const char * maker;
+ void * private_data;
+ int inst_data_size;
+
+ VDXFilterInitProc initProc;
+ VDXFilterDeinitProc deinitProc;
+ VDXFilterRunProc runProc;
+ VDXFilterParamProc paramProc;
+ VDXFilterConfigProc configProc;
+ VDXFilterStringProc stringProc;
+ VDXFilterStartProc startProc;
+ VDXFilterEndProc endProc;
+
+ VDXScriptObject *script_obj;
+
+ VDXFilterScriptStrProc fssProc;
+
+ // NEW - 1.4.11
+ VDXFilterStringProc2 stringProc2;
+ VDXFilterSerialize serializeProc;
+ VDXFilterDeserialize deserializeProc;
+ VDXFilterCopy copyProc;
+
+ VDXFilterPrefetch prefetchProc; // (V12/V1.7.4+)
+
+ // NEW - V14 / 1.9.1
+ VDXFilterCopy2Proc copyProc2;
+ VDXFilterPrefetch2Proc prefetchProc2;
+ VDXFilterEventProc eventProc;
};
//////////
// FilterStateInfo: contains dynamic info about file being processed
-class VDXFilterStateInfo
-{
+class VDXFilterStateInfo {
public:
- sint32 lCurrentFrame; // current sequence frame (previously called output frame)
- sint32 lMicrosecsPerFrame; // microseconds per sequence frame
- sint32 lCurrentSourceFrame; // current source frame
- sint32 lMicrosecsPerSrcFrame; // microseconds per source frame
- sint32 lSourceFrameMS; // source frame timestamp
- sint32 lDestFrameMS; // output frame timestamp
-
- enum
- {
- kStateNone = 0x00000000,
- kStatePreview = 0x00000001, // (V1.5.10+) Job output is not being saved to disk.
- kStateRealTime = 0x00000002, // (V1.5.10+) Operation is running in real-time (capture, playback).
- kStateMax = 0xFFFFFFFF
- };
-
- uint32 flags; // (V10 / 1.5.10+ only)
-
- sint32 mOutputFrame; // (V13/V1.8.2+) current output frame
+ sint32 lCurrentFrame; // current sequence frame (previously called output frame)
+ sint32 lMicrosecsPerFrame; // microseconds per sequence frame
+ sint32 lCurrentSourceFrame; // current source frame
+ sint32 lMicrosecsPerSrcFrame; // microseconds per source frame
+ sint32 lSourceFrameMS; // source frame timestamp
+ sint32 lDestFrameMS; // output frame timestamp
+
+ enum {
+ kStateNone = 0x00000000,
+ kStatePreview = 0x00000001, // (V1.5.10+) Job output is not being saved to disk.
+ kStateRealTime = 0x00000002, // (V1.5.10+) Operation is running in real-time (capture, playback).
+ kStateMax = 0xFFFFFFFF
+ };
+
+ uint32 flags; // (V10 / 1.5.10+ only)
+
+ sint32 mOutputFrame; // (V13/V1.8.2+) current output frame
};
// VDXFBitmap: VBitmap extended to hold filter-specific information
-class VDXBitmap
-{
+class VDXBitmap {
public:
- void * _vtable; // Reserved - do not use.
- uint32 * data; // Pointer to start of _bottom-most_ scanline of plane 0.
- uint32 * palette; // Pointer to palette (reserved - set to NULL).
- sint32 depth; // Bit depth, in bits. Set to zero if mpPixmap/mpPixmapLayout are active.
- sint32 w; // Width of bitmap, in pixels.
- sint32 h; // Height of bitmap, in pixels.
- ptrdiff_t pitch; // Distance, in bytes, from the start of one scanline in plane 0 to the next.
- ptrdiff_t modulo; // Distance, in bytes, from the end of one scanline in plane 0 to the start of the next.
- ptrdiff_t size; // Size of plane 0, including padding.
- ptrdiff_t offset; // Offset from beginning of buffer to beginning of plane 0.
-
- uint32 *Address32(int x, int y) const
- {
- return Address32i(x, h - y - 1);
- }
-
- uint32 *Address32i(int x, int y) const
- {
- return (uint32 *)((char *)data + y * pitch + x * 4);
- }
-
- void AlignTo4()
- {
- pitch = w << 2;
- }
-
- void AlignTo8()
- {
- pitch = ((w + 1)&~1) << 2;
- }
+ void * _vtable; // Reserved - do not use.
+ uint32 * data; // Pointer to start of _bottom-most_ scanline of plane 0.
+ uint32 * palette; // Pointer to palette (reserved - set to NULL).
+ sint32 depth; // Bit depth, in bits. Set to zero if mpPixmap/mpPixmapLayout are active.
+ sint32 w; // Width of bitmap, in pixels.
+ sint32 h; // Height of bitmap, in pixels.
+ ptrdiff_t pitch; // Distance, in bytes, from the start of one scanline in plane 0 to the next.
+ ptrdiff_t modulo; // Distance, in bytes, from the end of one scanline in plane 0 to the start of the next.
+ ptrdiff_t size; // Size of plane 0, including padding.
+ ptrdiff_t offset; // Offset from beginning of buffer to beginning of plane 0.
+
+ uint32 *Address32(int x, int y) const {
+ return Address32i(x, h-y-1);
+ }
+
+ uint32 *Address32i(int x, int y) const {
+ return (uint32 *)((char *)data + y*pitch + x*4);
+ }
+
+ void AlignTo4() {
+ pitch = w << 2;
+ }
+
+ void AlignTo8() {
+ pitch = ((w+1)&~1) << 2;
+ }
};
-class VDXFBitmap : public VDXBitmap
-{
+class VDXFBitmap : public VDXBitmap {
public:
- enum
- {
- /// Set in paramProc if the filter requires a Win32 GDI display context
- /// for a bitmap. (Deprecated as of API V12 - do not use)
- NEEDS_HDC = 0x00000001L,
- };
-
- uint32 dwFlags;
- VDXHDC hdc;
-
- uint32 mFrameRateHi; // Frame rate numerator (V1.7.4+)
- uint32 mFrameRateLo; // Frame rate denominator (V1.7.4+)
- sint64 mFrameCount; // Frame count; -1 if unlimited or indeterminate (V1.7.4+)
-
- VDXPixmapLayout *mpPixmapLayout;
- const VDXPixmap *mpPixmap;
-
- uint32 mAspectRatioHi; ///< Pixel aspect ratio fraction (numerator). 0/0 = unknown
- uint32 mAspectRatioLo; ///< Pixel aspect ratio fraction (denominator).
-
- sint64 mFrameNumber; ///< Current frame number (zero based).
- sint64 mFrameTimestampStart; ///< Starting timestamp of frame, in 100ns units.
- sint64 mFrameTimestampEnd; ///< Ending timestamp of frame, in 100ns units.
- sint64 mCookie; ///< Cookie supplied when frame was requested.
+ enum {
+ /// Set in paramProc if the filter requires a Win32 GDI display context
+ /// for a bitmap. (Deprecated as of API V12 - do not use)
+ NEEDS_HDC = 0x00000001L,
+ };
+
+ uint32 dwFlags;
+ VDXHDC hdc;
+
+ uint32 mFrameRateHi; // Frame rate numerator (V1.7.4+)
+ uint32 mFrameRateLo; // Frame rate denominator (V1.7.4+)
+ sint64 mFrameCount; // Frame count; -1 if unlimited or indeterminate (V1.7.4+)
+
+ VDXPixmapLayout *mpPixmapLayout;
+ const VDXPixmap *mpPixmap;
+
+ uint32 mAspectRatioHi; ///< Pixel aspect ratio fraction (numerator). 0/0 = unknown
+ uint32 mAspectRatioLo; ///< Pixel aspect ratio fraction (denominator).
+
+ sint64 mFrameNumber; ///< Current frame number (zero based).
+ sint64 mFrameTimestampStart; ///< Starting timestamp of frame, in 100ns units.
+ sint64 mFrameTimestampEnd; ///< Ending timestamp of frame, in 100ns units.
+ sint64 mCookie; ///< Cookie supplied when frame was requested.
};
// VDXFilterActivation: This is what is actually passed to filters at runtime.
-class VDXFilterActivation
-{
+class VDXFilterActivation {
public:
- const VDXFilterDefinition *filter; //
- void *filter_data;
- VDXFBitmap& dst;
- VDXFBitmap& src;
- VDXFBitmap *_reserved0;
- VDXFBitmap *const last;
- uint32 x1;
- uint32 y1;
- uint32 x2;
- uint32 y2;
-
- VDXFilterStateInfo *pfsi;
- IVDXFilterPreview *ifp;
- IVDXFilterPreview2 *ifp2; // (V11+)
-
- uint32 mSourceFrameCount; // (V14+)
- VDXFBitmap *const *mpSourceFrames; // (V14+)
- VDXFBitmap *const *mpOutputFrames; // (V14+)
+ const VDXFilterDefinition *filter; //
+ void *filter_data;
+ VDXFBitmap& dst;
+ VDXFBitmap& src;
+ VDXFBitmap *_reserved0;
+ VDXFBitmap *const last;
+ uint32 x1;
+ uint32 y1;
+ uint32 x2;
+ uint32 y2;
+
+ VDXFilterStateInfo *pfsi;
+ IVDXFilterPreview *ifp;
+ IVDXFilterPreview2 *ifp2; // (V11+)
+
+ uint32 mSourceFrameCount; // (V14+)
+ VDXFBitmap *const *mpSourceFrames; // (V14+)
+ VDXFBitmap *const *mpOutputFrames; // (V14+)
};
// These flags must match those in cpuaccel.h!
@@ -391,24 +374,23 @@ public: #define CPUF_SUPPORTS_3DNOW_EXT (0x00000080L)
#endif
-struct VDXFilterFunctions
-{
- VDXFilterDefinition *(__cdecl *addFilter)(VDXFilterModule *, VDXFilterDefinition *, int fd_len);
- void (__cdecl *removeFilter)(VDXFilterDefinition *);
- bool (__cdecl *isFPUEnabled)();
- bool (__cdecl *isMMXEnabled)();
- void (__cdecl *InitVTables)(VDXFilterVTbls *);
+struct VDXFilterFunctions {
+ VDXFilterDefinition *(__cdecl *addFilter)(VDXFilterModule *, VDXFilterDefinition *, int fd_len);
+ void (__cdecl *removeFilter)(VDXFilterDefinition *);
+ bool (__cdecl *isFPUEnabled)();
+ bool (__cdecl *isMMXEnabled)();
+ void (__cdecl *InitVTables)(VDXFilterVTbls *);
- // These functions permit you to throw MyError exceptions from a filter.
- // YOU MUST ONLY CALL THESE IN runProc, initProc, and startProc.
+ // These functions permit you to throw MyError exceptions from a filter.
+ // YOU MUST ONLY CALL THESE IN runProc, initProc, and startProc.
- void (__cdecl *ExceptOutOfMemory)(); // ADDED: V6 (VirtualDub 1.4)
- void (__cdecl *Except)(const char *format, ...); // ADDED: V6 (VirtualDub 1.4)
+ void (__cdecl *ExceptOutOfMemory)(); // ADDED: V6 (VirtualDub 1.4)
+ void (__cdecl *Except)(const char *format, ...); // ADDED: V6 (VirtualDub 1.4)
- // These functions are callable at any time.
+ // These functions are callable at any time.
- long(__cdecl *getCPUFlags)(); // ADDED: V6 (VirtualDub 1.4)
- long(__cdecl *getHostVersionInfo)(char *buffer, int len); // ADDED: V7 (VirtualDub 1.4d)
+ long (__cdecl *getCPUFlags)(); // ADDED: V6 (VirtualDub 1.4)
+ long (__cdecl *getHostVersionInfo)(char *buffer, int len); // ADDED: V7 (VirtualDub 1.4d)
};
@@ -421,168 +403,115 @@ class VDXScriptValue; class VDXScriptError;
struct VDXScriptObject;
-class VDXScriptError
-{
+class VDXScriptError {
public:
- enum
- {
- PARSE_ERROR = 1,
- SEMICOLON_EXPECTED,
- IDENTIFIER_EXPECTED,
-
- TYPE_INT_REQUIRED,
- TYPE_ARRAY_REQUIRED,
- TYPE_FUNCTION_REQUIRED,
- TYPE_OBJECT_REQUIRED,
-
- OBJECT_MEMBER_NAME_REQUIRED,
- FUNCCALLEND_EXPECTED,
- TOO_MANY_PARAMS,
- DIVIDE_BY_ZERO,
- VAR_NOT_FOUND,
- MEMBER_NOT_FOUND,
- OVERLOADED_FUNCTION_NOT_FOUND,
- IDENT_TOO_LONG,
- OPERATOR_EXPECTED,
- CLOSEPARENS_EXPECTED,
- CLOSEBRACKET_EXPECTED,
-
- VAR_UNDEFINED,
-
- OUT_OF_STRING_SPACE,
- OUT_OF_MEMORY,
- INTERNAL_ERROR,
- EXTERNAL_ERROR,
-
- FCALL_OUT_OF_RANGE,
- FCALL_INVALID_PTYPE,
- FCALL_UNKNOWN_STR,
-
- ARRAY_INDEX_OUT_OF_BOUNDS,
-
- NUMERIC_OVERFLOW,
- STRING_NOT_AN_INTEGER_VALUE,
- STRING_NOT_A_REAL_VALUE,
-
- ASSERTION_FAILED,
- AMBIGUOUS_CALL,
- CANNOT_CAST
- };
+ enum {
+ PARSE_ERROR=1,
+ SEMICOLON_EXPECTED,
+ IDENTIFIER_EXPECTED,
+
+ TYPE_INT_REQUIRED,
+ TYPE_ARRAY_REQUIRED,
+ TYPE_FUNCTION_REQUIRED,
+ TYPE_OBJECT_REQUIRED,
+
+ OBJECT_MEMBER_NAME_REQUIRED,
+ FUNCCALLEND_EXPECTED,
+ TOO_MANY_PARAMS,
+ DIVIDE_BY_ZERO,
+ VAR_NOT_FOUND,
+ MEMBER_NOT_FOUND,
+ OVERLOADED_FUNCTION_NOT_FOUND,
+ IDENT_TOO_LONG,
+ OPERATOR_EXPECTED,
+ CLOSEPARENS_EXPECTED,
+ CLOSEBRACKET_EXPECTED,
+
+ VAR_UNDEFINED,
+
+ OUT_OF_STRING_SPACE,
+ OUT_OF_MEMORY,
+ INTERNAL_ERROR,
+ EXTERNAL_ERROR,
+
+ FCALL_OUT_OF_RANGE,
+ FCALL_INVALID_PTYPE,
+ FCALL_UNKNOWN_STR,
+
+ ARRAY_INDEX_OUT_OF_BOUNDS,
+
+ NUMERIC_OVERFLOW,
+ STRING_NOT_AN_INTEGER_VALUE,
+ STRING_NOT_A_REAL_VALUE,
+
+ ASSERTION_FAILED,
+ AMBIGUOUS_CALL,
+ CANNOT_CAST
+ };
};
-class IVDXScriptInterpreter
-{
+class IVDXScriptInterpreter {
public:
- virtual void _placeholder1() {}
- virtual void _placeholder2(void *, void *) {}
- virtual void _placeholder3(char *s) {}
+ virtual void _placeholder1() {}
+ virtual void _placeholder2(void *, void *) {}
+ virtual void _placeholder3(char *s) {}
- virtual void ScriptError(int e) = 0;
- virtual void _placeholder4(VDXScriptError& cse) {}
- virtual char** AllocTempString(long l) = 0;
+ virtual void ScriptError(int e)=0;
+ virtual void _placeholder4(VDXScriptError& cse) {}
+ virtual char** AllocTempString(long l)=0;
- virtual void _placeholder5() {}
+ virtual void _placeholder5() {}
};
#define EXT_SCRIPT_ERROR(x) (isi->ScriptError((VDXScriptError::x)))
-typedef VDXScriptValue(*VDXScriptFunctionPtr)(IVDXScriptInterpreter *, void *, const VDXScriptValue *, int);
+typedef VDXScriptValue (*VDXScriptFunctionPtr)(IVDXScriptInterpreter *, void *, const VDXScriptValue *, int);
typedef void (*VDXScriptVoidFunctionPtr)(IVDXScriptInterpreter *, void *, const VDXScriptValue *, int);
typedef int (*VDXScriptIntFunctionPtr)(IVDXScriptInterpreter *, void *, const VDXScriptValue *, int);
-struct VDXScriptFunctionDef
-{
- VDXScriptFunctionPtr func_ptr;
- char *name;
- char *arg_list;
+struct VDXScriptFunctionDef {
+ VDXScriptFunctionPtr func_ptr;
+ char *name;
+ char *arg_list;
};
-struct VDXScriptObject
-{
- void *_lookup; // reserved - set to NULL
- VDXScriptFunctionDef *func_list;
- void *_obj_list; // reserved - set to NULL
+struct VDXScriptObject {
+ void *_lookup; // reserved - set to NULL
+ VDXScriptFunctionDef *func_list;
+ void *_obj_list; // reserved - set to NULL
};
-class VDXScriptValue
-{
+class VDXScriptValue {
public:
- enum { T_VOID, T_INT, T_PINT, T_STR, T_ARRAY, T_OBJECT, T_FNAME, T_FUNCTION, T_VARLV, T_LONG, T_DOUBLE } type;
- VDXScriptObject *thisPtr;
- union
- {
- int i;
- char **s;
- sint64 l;
- double d;
- } u;
-
- VDXScriptValue()
- {
- type = T_VOID;
- }
- VDXScriptValue(int i)
- {
- type = T_INT;
- u.i = i;
- }
- VDXScriptValue(sint64 l)
- {
- type = T_LONG;
- u.l = l;
- }
- VDXScriptValue(double d)
- {
- type = T_DOUBLE;
- u.d = d;
- }
- VDXScriptValue(char **s)
- {
- type = T_STR;
- u.s = s;
- }
-
- bool isVoid() const
- {
- return type == T_VOID;
- }
- bool isInt() const
- {
- return type == T_INT;
- }
- bool isString() const
- {
- return type == T_STR;
- }
- bool isLong() const
- {
- return type == T_LONG;
- }
- bool isDouble() const
- {
- return type == T_DOUBLE;
- }
-
- int asInt() const
- {
- return u.i;
- }
- sint64 asLong() const
- {
- return u.l;
- }
- double asDouble() const
- {
- return u.d;
- }
- char ** asString() const
- {
- return u.s;
- }
+ enum { T_VOID, T_INT, T_PINT, T_STR, T_ARRAY, T_OBJECT, T_FNAME, T_FUNCTION, T_VARLV, T_LONG, T_DOUBLE } type;
+ VDXScriptObject *thisPtr;
+ union {
+ int i;
+ char **s;
+ sint64 l;
+ double d;
+ } u;
+
+ VDXScriptValue() { type = T_VOID; }
+ VDXScriptValue(int i) { type = T_INT; u.i = i; }
+ VDXScriptValue(sint64 l) { type = T_LONG; u.l = l; }
+ VDXScriptValue(double d) { type = T_DOUBLE; u.d = d; }
+ VDXScriptValue(char **s) { type = T_STR; u.s = s; }
+
+ bool isVoid() const { return type == T_VOID; }
+ bool isInt() const { return type == T_INT; }
+ bool isString() const { return type == T_STR; }
+ bool isLong() const { return type == T_LONG; }
+ bool isDouble() const { return type == T_DOUBLE; }
+
+ int asInt() const { return u.i; }
+ sint64 asLong() const { return u.l; }
+ double asDouble() const { return u.d; }
+ char ** asString() const { return u.s; }
};
#ifdef _MSC_VER
-#pragma pack(pop)
+ #pragma pack(pop)
#endif
#endif
diff --git a/include/vd2/plugin/vdvideoutil.h b/include/vd2/plugin/vdvideoutil.h index 7ba59b3d1..8379e4f7d 100644 --- a/include/vd2/plugin/vdvideoutil.h +++ b/include/vd2/plugin/vdvideoutil.h @@ -2,127 +2,103 @@ #define f_VD2_PLUGIN_VDVIDEOUTIL_H
template<class T>
-T *vd_ptroffset(T *p, ptrdiff_t diff)
-{
- return (T *)((char *)p + diff);
+T *vd_ptroffset(T *p, ptrdiff_t diff) {
+ return (T *)((char *)p + diff);
}
template<class T>
-class vd_row_iter
-{
+class vd_row_iter {
public:
- vd_row_iter() {}
- vd_row_iter(T *p, ptrdiff_t pitch) : mp(p), mpitch(pitch) {}
- vd_row_iter(T *p, ptrdiff_t pitch, int y) : mp(vd_ptroffset(p, pitch*y)), mpitch(pitch) {}
-
- vd_row_iter(const VFBitmap& bm, int x = 0, int y = 0) : mp(vd_ptroffset((T*)bm.data, bm.pitch*(bm.h - 1 - y)) + x), mpitch(-bm.pitch) {}
-
- operator T*() const
- {
- return mp;
- }
- T& operator[](int x) const
- {
- return mp[x];
- }
-
- void mulstep(int x)
- {
- mpitch *= x;
- }
-
- const vd_row_iter<T>& operator+=(int y)
- {
- mp = vd_ptroffset(mp, mpitch * y);
- return *this;
- }
-
- const vd_row_iter<T>& operator-=(int y)
- {
- mp = vd_ptroffset(mp, -(mpitch * y));
- return *this;
- }
-
- const vd_row_iter<T>& operator++()
- {
- mp = vd_ptroffset(mp, mpitch);
- return *this;
- }
-
- const vd_row_iter<T> operator++(int)
- {
- const vd_row_iter<T> temp(*this);
- mp = vd_ptroffset(mp, mpitch);
- return temp;
- }
-
- const vd_row_iter<T>& operator--()
- {
- mp = vd_ptroffset(mp, -mpitch);
- return *this;
- }
-
- const vd_row_iter<T> operator--(int)
- {
- const vd_row_iter<T> temp(*this);
- mp = vd_ptroffset(mp, -mpitch);
- return temp;
- }
+ vd_row_iter() {}
+ vd_row_iter(T *p, ptrdiff_t pitch) : mp(p), mpitch(pitch) {}
+ vd_row_iter(T *p, ptrdiff_t pitch, int y) : mp(vd_ptroffset(p, pitch*y)), mpitch(pitch) {}
+
+ vd_row_iter(const VFBitmap& bm, int x = 0, int y = 0) : mp(vd_ptroffset((T*)bm.data, bm.pitch*(bm.h - 1 - y))+x), mpitch(-bm.pitch) {}
+
+ operator T*() const { return mp; }
+ T& operator[](int x) const { return mp[x]; }
+
+ void mulstep(int x) {
+ mpitch *= x;
+ }
+
+ const vd_row_iter<T>& operator+=(int y) {
+ mp = vd_ptroffset(mp, mpitch * y);
+ return *this;
+ }
+
+ const vd_row_iter<T>& operator-=(int y) {
+ mp = vd_ptroffset(mp, -(mpitch * y));
+ return *this;
+ }
+
+ const vd_row_iter<T>& operator++() {
+ mp = vd_ptroffset(mp, mpitch);
+ return *this;
+ }
+
+ const vd_row_iter<T> operator++(int) {
+ const vd_row_iter<T> temp(*this);
+ mp = vd_ptroffset(mp, mpitch);
+ return temp;
+ }
+
+ const vd_row_iter<T>& operator--() {
+ mp = vd_ptroffset(mp, -mpitch);
+ return *this;
+ }
+
+ const vd_row_iter<T> operator--(int) {
+ const vd_row_iter<T> temp(*this);
+ mp = vd_ptroffset(mp, -mpitch);
+ return temp;
+ }
protected:
- T *mp;
- ptrdiff_t mpitch;
+ T *mp;
+ ptrdiff_t mpitch;
};
typedef vd_row_iter<uint32> vd_pixrow_iter;
-inline uint32 vd_pixavg_down(uint32 x, uint32 y)
-{
- return (x & y) + (((x ^ y) & 0xfefefefe) >> 1);
+inline uint32 vd_pixavg_down(uint32 x, uint32 y) {
+ return (x&y) + (((x^y)&0xfefefefe)>>1);
}
-inline uint32 vd_pixavg_up(uint32 x, uint32 y)
-{
- return (x | y) - (((x ^ y) & 0xfefefefe) >> 1);
+inline uint32 vd_pixavg_up(uint32 x, uint32 y) {
+ return (x|y) - (((x^y)&0xfefefefe)>>1);
}
-inline void vd_pixunpack(uint32 px, int& r, int& g, int& b)
-{
- r = (px >> 16) & 255;
- g = (px >> 8) & 255;
- b = (px) & 255;
+inline void vd_pixunpack(uint32 px, int& r, int& g, int& b) {
+ r = (px>>16)&255;
+ g = (px>> 8)&255;
+ b = (px )&255;
}
-inline uint32 vd_pixpack(int r, int g, int b)
-{
- if((unsigned)r >= 256) r = ~(r >> 31) & 255;
- if((unsigned)g >= 256) g = ~(g >> 31) & 255;
- if((unsigned)b >= 256) b = ~(b >> 31) & 255;
+inline uint32 vd_pixpack(int r, int g, int b) {
+ if ((unsigned)r >= 256) r = ~(r>>31) & 255;
+ if ((unsigned)g >= 256) g = ~(g>>31) & 255;
+ if ((unsigned)b >= 256) b = ~(b>>31) & 255;
- return (r << 16) + (g << 8) + b;
+ return (r<<16) + (g<<8) + b;
}
-inline uint32 vd_pixpackfast(int r, int g, int b)
-{
- return (r << 16) + (g << 8) + b;
+inline uint32 vd_pixpackfast(int r, int g, int b) {
+ return (r<<16) + (g<<8) + b;
}
-struct vd_transform_pixmap_helper
-{
- vd_transform_pixmap_helper(const VFBitmap& dst)
- : p((uint32 *)dst.data)
- , pitch(dst.pitch)
- , w(dst.w)
- , h(dst.h) {}
-
- operator bool() const
- {
- return false;
- }
-
- uint32 *p;
- const ptrdiff_t pitch;
- const int w, h;
+struct vd_transform_pixmap_helper {
+ vd_transform_pixmap_helper(const VFBitmap& dst)
+ : p((uint32 *)dst.data)
+ , pitch(dst.pitch)
+ , w(dst.w)
+ , h(dst.h) {}
+
+ operator bool() const { return false; }
+
+ uint32 *p;
+ const ptrdiff_t pitch;
+ const int w, h;
};
#define vd_transform_pixmap_blt(dst, src) \
@@ -138,7 +114,7 @@ struct vd_transform_pixmap_helper for(int y = 0, h = dstinfo.h, w = dstinfo.w; y < h; ++y, dstinfo.p=vd_ptroffset(dstinfo.p, dstinfo.pitch)) \
for(int x = 0; x < dstinfo.w; ++x) \
switch(unsigned& px = dstinfo.p[x]) case 0: default: \
-
+
#define vd_maketable256_16(x) formula((x+0)),formula((x+1)),formula((x+2)),formula((x+3)),formula((x+4)),formula((x+5)),formula((x+6)),formula((x+7)),formula((x+8)),formula((x+9)),formula((x+10)),formula((x+11)),formula((x+12)),formula((x+13)),formula((x+14)),formula((x+15))
#define vd_maketable256 vd_maketable256_16(0x00),vd_maketable256_16(0x10),vd_maketable256_16(0x20),vd_maketable256_16(0x30),vd_maketable256_16(0x40),vd_maketable256_16(0x50),vd_maketable256_16(0x60),vd_maketable256_16(0x70),vd_maketable256_16(0x80),vd_maketable256_16(0x90),vd_maketable256_16(0xA0),vd_maketable256_16(0xB0),vd_maketable256_16(0xC0),vd_maketable256_16(0xD0),vd_maketable256_16(0xE0),vd_maketable256_16(0xF0),
|