home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 275 / DPCS0111DVD.ISO / Toolkit / Audio-Visual / VirtualDub / Source / VirtualDub-1.9.10-src.7z / src / Riza / h / displaydrv.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-09-24  |  3.9 KB  |  131 lines

  1. //    VirtualDub - Video processing and capture application
  2. //    A/V interface library
  3. //    Copyright (C) 1998-2005 Avery Lee
  4. //
  5. //    This program is free software; you can redistribute it and/or modify
  6. //    it under the terms of the GNU General Public License as published by
  7. //    the Free Software Foundation; either version 2 of the License, or
  8. //    (at your option) any later version.
  9. //
  10. //    This program is distributed in the hope that it will be useful,
  11. //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. //    GNU General Public License for more details.
  14. //
  15. //    You should have received a copy of the GNU General Public License
  16. //    along with this program; if not, write to the Free Software
  17. //    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19. #ifndef f_VD2_RIZA_DISPLAYDRV_H
  20. #define f_VD2_RIZA_DISPLAYDRV_H
  21.  
  22. #include <windows.h>
  23. #include <vd2/system/vectors.h>
  24. #include <vd2/Kasumi/pixmap.h>
  25.  
  26. class VDStringA;
  27.  
  28. class IVDVideoDisplayMinidriverCallback {
  29. public:
  30.     virtual void ReleaseActiveFrame() = 0;
  31.     virtual void RequestNextFrame() = 0;
  32. };
  33.  
  34. struct VDVideoDisplaySourceInfo {
  35.     VDPixmap    pixmap;
  36.     int            bpp;
  37.     int            bpr;
  38.     void        *pSharedObject;
  39.     ptrdiff_t    sharedOffset;
  40.     bool        bAllowConversion;
  41.     bool        bPersistent;
  42.     bool        bInterlaced;
  43.     IVDVideoDisplayMinidriverCallback *mpCB;
  44. };
  45.  
  46. class VDINTERFACE IVDVideoDisplayMinidriver {
  47. public:
  48.     enum UpdateMode {
  49.         kModeNone        = 0x00000000,
  50.         kModeEvenField    = 0x00000001,
  51.         kModeOddField    = 0x00000002,
  52.         kModeAllFields    = 0x00000003,
  53.         kModeFieldMask    = 0x00000003,
  54.         kModeVSync        = 0x00000004,
  55.         kModeFirstField    = 0x00000008,
  56.         kModeBobEven    = 0x00000100,
  57.         kModeBobOdd        = 0x00000200,
  58.         kModeAll        = 0x0000030f
  59.     };
  60.  
  61.     enum FilterMode {
  62.         kFilterAnySuitable,
  63.         kFilterPoint,
  64.         kFilterBilinear,
  65.         kFilterBicubic,
  66.         kFilterModeCount
  67.     };
  68.  
  69.     virtual ~IVDVideoDisplayMinidriver() {}
  70.  
  71.     virtual bool Init(HWND hwnd, const VDVideoDisplaySourceInfo& info) = 0;
  72.     virtual void Shutdown() = 0;
  73.  
  74.     virtual bool ModifySource(const VDVideoDisplaySourceInfo& info) = 0;
  75.  
  76.     virtual bool IsValid() = 0;
  77.     virtual bool IsFramePending() = 0;
  78.     virtual void SetFilterMode(FilterMode mode) = 0;
  79.     virtual void SetFullScreen(bool fullscreen) = 0;
  80.     virtual void SetDisplayDebugInfo(bool enable) = 0;
  81.     virtual void SetColorOverride(uint32 color) = 0;
  82.     virtual void SetHighPrecision(bool enable) = 0;
  83.  
  84.     virtual bool Tick(int id) = 0;
  85.     virtual void Poll() = 0;
  86.     virtual bool Resize() = 0;
  87.     virtual bool Update(UpdateMode) = 0;
  88.     virtual void Refresh(UpdateMode) = 0;
  89.     virtual bool Paint(HDC hdc, const RECT& rClient, UpdateMode lastUpdateMode) = 0;
  90.  
  91.     virtual bool SetSubrect(const vdrect32 *r) = 0;
  92.     virtual void SetLogicalPalette(const uint8 *pLogicalPalette) = 0;
  93.  
  94.     virtual float GetSyncDelta() const = 0;
  95. };
  96.  
  97. class VDINTERFACE VDVideoDisplayMinidriver : public IVDVideoDisplayMinidriver {
  98. public:
  99.     VDVideoDisplayMinidriver();
  100.  
  101.     virtual bool IsFramePending();
  102.     virtual void SetFilterMode(FilterMode mode);
  103.     virtual void SetFullScreen(bool fullscreen);
  104.     virtual void SetDisplayDebugInfo(bool enable);
  105.     virtual void SetColorOverride(uint32 color);
  106.     virtual void SetHighPrecision(bool enable);
  107.  
  108.     virtual bool Tick(int id);
  109.     virtual void Poll();
  110.     virtual bool Resize();
  111.  
  112.     virtual bool SetSubrect(const vdrect32 *r);
  113.     virtual void SetLogicalPalette(const uint8 *pLogicalPalette);
  114.  
  115.     virtual float GetSyncDelta() const;
  116.  
  117. protected:
  118.     static void GetFormatString(const VDVideoDisplaySourceInfo& info, VDStringA& s);
  119.  
  120.     bool    mbDisplayDebugInfo;
  121.     bool    mbHighPrecision;
  122.     uint32    mColorOverride;
  123. };
  124.  
  125. IVDVideoDisplayMinidriver *VDCreateVideoDisplayMinidriverOpenGL();
  126. IVDVideoDisplayMinidriver *VDCreateVideoDisplayMinidriverDirectDraw(bool enableOverlays, bool enableSecondaryDraw);
  127. IVDVideoDisplayMinidriver *VDCreateVideoDisplayMinidriverGDI();
  128. IVDVideoDisplayMinidriver *VDCreateVideoDisplayMinidriverDX9(bool clipToMonitor);
  129.  
  130. #endif
  131.