home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 275 / DPCS0111DVD.ISO / Toolkit / Audio-Visual / VirtualDub / Source / VirtualDub-1.9.10-src.7z / src / h / vd2 / plugin / vdplugin.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-09-14  |  5.4 KB  |  208 lines

  1. //    VirtualDub - Video processing and capture application
  2. //    Plugin headers
  3. //    Copyright (C) 1998-2007 Avery Lee, All Rights Reserved.
  4. //
  5. //    The plugin headers in the VirtualDub plugin SDK are licensed differently
  6. //    differently than VirtualDub and the Plugin SDK themselves.  This
  7. //    particular file is thus licensed as follows (the "zlib" license):
  8. //
  9. //    This software is provided 'as-is', without any express or implied
  10. //    warranty.  In no event will the authors be held liable for any
  11. //    damages arising from the use of this software.
  12. //
  13. //    Permission is granted to anyone to use this software for any purpose,
  14. //    including commercial applications, and to alter it and redistribute it
  15. //    freely, subject to the following restrictions:
  16. //
  17. //    1.    The origin of this software must not be misrepresented; you must
  18. //        not claim that you wrote the original software. If you use this
  19. //        software in a product, an acknowledgment in the product
  20. //        documentation would be appreciated but is not required.
  21. //    2.    Altered source versions must be plainly marked as such, and must
  22. //        not be misrepresented as being the original software.
  23. //    3.    This notice may not be removed or altered from any source
  24. //        distribution.
  25.  
  26. #ifndef f_VD2_PLUGIN_VDPLUGIN_H
  27. #define f_VD2_PLUGIN_VDPLUGIN_H
  28.  
  29. #include <stddef.h>
  30.  
  31. // Copied from <vd2/system/vdtypes.h>.  Must be in sync.
  32. #ifndef VD_STANDARD_TYPES_DECLARED
  33.     #if defined(_MSC_VER)
  34.         typedef signed __int64        sint64;
  35.         typedef unsigned __int64    uint64;
  36.     #elif defined(__GNUC__)
  37.         typedef signed long long    sint64;
  38.         typedef unsigned long long    uint64;
  39.     #endif
  40.     typedef signed int            sint32;
  41.     typedef unsigned int        uint32;
  42.     typedef signed short        sint16;
  43.     typedef unsigned short        uint16;
  44.     typedef signed char            sint8;
  45.     typedef unsigned char        uint8;
  46.  
  47.     typedef sint64                int64;
  48.     typedef sint32                int32;
  49.     typedef sint16                int16;
  50.     typedef sint8                int8;
  51.  
  52.     typedef ptrdiff_t            sintptr;
  53.     typedef size_t                uintptr;
  54. #endif
  55.  
  56. #ifndef VDXAPIENTRY
  57.     #define VDXAPIENTRY __stdcall
  58. #endif
  59.  
  60. #ifndef VDXAPIENTRYV
  61.     #define VDXAPIENTRYV __cdecl
  62. #endif
  63.  
  64. enum VDXCPUFeatureFlags {
  65.     kVDXCPUF_CPUID        = 0x00000001,
  66.     kVDXCPUF_MMX        = 0x00000004,
  67.     kVDXCPUF_ISSE        = 0x00000008,
  68.     kVDXCPUF_SSE        = 0x00000010,
  69.     kVDXCPUF_SSE2        = 0x00000020,
  70.     kVDXCPUF_3DNOW        = 0x00000040,
  71.     kVDXCPUF_3DNOW_EXT    = 0x00000080,
  72.     kVDXCPUF_SSE3        = 0x00000100,
  73.     kVDXCPUF_SSSE3        = 0x00000200
  74. };
  75.  
  76. enum {
  77.     kVDXPlugin_APIVersion        = 10
  78. };
  79.  
  80.  
  81. enum {
  82.     kVDXPluginType_Video,        // Updated video filter API is not yet complete.
  83.     kVDXPluginType_Audio,
  84.     kVDXPluginType_Input
  85. };
  86.  
  87. struct VDXPluginInfo {
  88.     uint32            mSize;                // size of this structure in bytes
  89.     const wchar_t    *mpName;
  90.     const wchar_t    *mpAuthor;
  91.     const wchar_t    *mpDescription;
  92.     uint32            mVersion;            // (major<<24) + (minor<<16) + build.  1.4.1000 would be 0x010403E8.
  93.     uint32            mType;
  94.     uint32            mFlags;
  95.     uint32            mAPIVersionRequired;
  96.     uint32            mAPIVersionUsed;
  97.     uint32            mTypeAPIVersionRequired;
  98.     uint32            mTypeAPIVersionUsed;
  99.     const void *    mpTypeSpecificInfo;
  100. };
  101.  
  102. typedef const VDXPluginInfo *const *(VDXAPIENTRY *tpVDXGetPluginInfo)();
  103.  
  104. typedef VDXPluginInfo VDPluginInfo;
  105. typedef tpVDXGetPluginInfo tpVDPluginInfo;
  106.  
  107. class IVDXPluginCallbacks {
  108. public:
  109.     virtual void * VDXAPIENTRY GetExtendedAPI(const char *pExtendedAPIName) = 0;
  110.     virtual void VDXAPIENTRYV SetError(const char *format, ...) = 0;
  111.     virtual void VDXAPIENTRY SetErrorOutOfMemory() = 0;
  112.     virtual uint32 VDXAPIENTRY GetCPUFeatureFlags() = 0;
  113. };
  114.  
  115. typedef IVDXPluginCallbacks IVDPluginCallbacks;
  116.  
  117. struct VDXPluginConfigEntry {
  118.     enum Type {
  119.         kTypeInvalid    = 0,
  120.         kTypeU32        = 1,
  121.         kTypeS32,
  122.         kTypeU64,
  123.         kTypeS64,
  124.         kTypeDouble,
  125.         kTypeAStr,
  126.         kTypeWStr,
  127.         kTypeBlock
  128.     };
  129.  
  130.     const VDXPluginConfigEntry *next;
  131.  
  132.     unsigned    idx;
  133.     uint32        type;
  134.     const wchar_t *name;
  135.     const wchar_t *label;
  136.     const wchar_t *desc;    
  137. };
  138.  
  139. struct VDXRect {
  140.     sint32    left;
  141.     sint32    top;
  142.     sint32    right;
  143.     sint32    bottom;
  144. };
  145.  
  146. struct VDXPixmap {
  147.     void            *data;
  148.     const uint32    *palette;
  149.     sint32            w;
  150.     sint32            h;
  151.     ptrdiff_t        pitch;
  152.     sint32            format;
  153.  
  154.     // Auxiliary planes are always byte-per-pixel.
  155.     void            *data2;        // Cb (U) for YCbCr
  156.     ptrdiff_t        pitch2;
  157.     void            *data3;        // Cr (V) for YCbCr
  158.     ptrdiff_t        pitch3;
  159. };
  160.  
  161. struct VDXPixmapLayout {
  162.     ptrdiff_t        data;
  163.     const uint32    *palette;
  164.     sint32            w;
  165.     sint32            h;
  166.     ptrdiff_t        pitch;
  167.     sint32            format;
  168.  
  169.     // Auxiliary planes are always byte-per-pixel.
  170.     ptrdiff_t        data2;        // Cb (U) for YCbCr
  171.     ptrdiff_t        pitch2;
  172.     ptrdiff_t        data3;        // Cr (V) for YCbCr
  173.     ptrdiff_t        pitch3;
  174. };
  175.  
  176. namespace nsVDXPixmap {
  177.     enum VDXPixmapFormat {
  178.         kPixFormat_Null                = 0,
  179.         kPixFormat_XRGB1555            = 5,
  180.         kPixFormat_RGB565            = 6,
  181.         kPixFormat_RGB888            = 7,
  182.         kPixFormat_XRGB8888            = 8,
  183.         kPixFormat_Y8                = 9,
  184.         kPixFormat_YUV422_UYVY        = 10,
  185.         kPixFormat_YUV422_YUYV        = 11,
  186.         kPixFormat_YUV444_Planar    = 13,
  187.         kPixFormat_YUV422_Planar    = 14,
  188.         kPixFormat_YUV420_Planar    = 15,
  189.         kPixFormat_YUV411_Planar    = 16,
  190.         kPixFormat_YUV410_Planar    = 17,
  191.  
  192.         kPixFormat_VDXA_RGB            = 0x10001,
  193.         kPixFormat_VDXA_YUV            = 0x10002
  194.     };
  195. };
  196.  
  197. #define VDXMAKEFOURCC(a, b, c, d) ((uint32)(uint8)(d) + ((uint32)(uint8)(c) << 8) + ((uint32)(uint8)(b) << 16) + ((uint32)(uint8)(a) << 24))
  198.  
  199. class IVDXUnknown {
  200. public:
  201.     enum { kIID = VDXMAKEFOURCC('X', 'u', 'n', 'k') };
  202.     virtual int VDXAPIENTRY AddRef() = 0;
  203.     virtual int VDXAPIENTRY Release() = 0;
  204.     virtual void *VDXAPIENTRY AsInterface(uint32 iid) = 0;
  205. };
  206.  
  207. #endif
  208.