Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
2.9 KiB

  1. #include <windows.h>
  2. #include <vfw.h>
  3. #include <dcap.h>
  4. #include "vidpool.h"
  5. #include "effect.h"
  6. #ifndef _FRAMEOP_H
  7. #define _FRAMEOP_H
  8. class CFrameOp
  9. {
  10. private:
  11. LONG m_cRef;
  12. public:
  13. CFrameOp *m_next;
  14. CVidPool *m_pool;
  15. CFrameOp() {m_cRef = 0; m_next = NULL; m_pool = NULL; }
  16. virtual ~CFrameOp() {};
  17. virtual STDMETHODIMP_(ULONG) AddRef(void);
  18. virtual STDMETHODIMP_(ULONG) Release(void);
  19. virtual STDMETHODIMP DoOp(IBitmapSurface** ppbs) = 0;
  20. };
  21. class CCaptureFrame :
  22. public CFrameOp
  23. {
  24. private:
  25. HCAPDEV m_hcapdev;
  26. HFRAMEBUF m_hbuf1;
  27. HFRAMEBUF m_hbuf2;
  28. public:
  29. CCaptureFrame() { m_hcapdev = NULL; m_hbuf1 = NULL; m_hbuf2 = NULL; }
  30. ~CCaptureFrame();
  31. STDMETHODIMP DoOp(IBitmapSurface** ppbs);
  32. BOOL InitCapture(HCAPDEV hcapdev, LPBITMAPINFOHEADER lpbmh);
  33. };
  34. class CStreamCaptureFrame :
  35. public CFrameOp
  36. {
  37. private:
  38. HCAPDEV m_hcapdev;
  39. public:
  40. CStreamCaptureFrame() { m_hcapdev = NULL; }
  41. ~CStreamCaptureFrame();
  42. STDMETHODIMP DoOp(IBitmapSurface** ppbs);
  43. BOOL InitCapture(HCAPDEV hcapdev, LPBITMAPINFOHEADER lpbmh);
  44. };
  45. class CICMcvtFrame :
  46. public CFrameOp
  47. {
  48. private:
  49. HIC m_hic;
  50. LPBITMAPINFOHEADER m_inlpbmh;
  51. LPBITMAPINFOHEADER m_outlpbmh;
  52. public:
  53. CICMcvtFrame() { m_hic = NULL; m_inlpbmh = NULL; m_outlpbmh = NULL; }
  54. ~CICMcvtFrame();
  55. STDMETHODIMP DoOp(IBitmapSurface** ppbs);
  56. BOOL InitCvt(LPBITMAPINFOHEADER lpbmh, DWORD bmhLen,
  57. LPBITMAPINFOHEADER *plpbmhdsp);
  58. // if TRUE, then plpbmhdsp will point to allocated memory that the caller will
  59. // be responsible for deallocating
  60. // if FALSE, then plpbmhdsp will point to a copy lpbmh, if no conversion necessary,
  61. // else it will be NULL to indicate that converion is not possible
  62. };
  63. class CFilterFrame :
  64. public CFrameOp
  65. {
  66. private:
  67. IBitmapEffect *m_effect;
  68. BOOL m_inplace;
  69. public:
  70. CLSID m_clsid;
  71. HANDLE m_tag;
  72. BOOL m_enabled;
  73. CFilterFrame() { m_effect = NULL; m_inplace = TRUE; m_enabled = TRUE; m_tag = 0; }
  74. ~CFilterFrame();
  75. STDMETHODIMP DoOp(IBitmapSurface** ppbs);
  76. BOOL InitFilter(IBitmapEffect *effect, LPBITMAPINFOHEADER lpbmhIn, CVidPool *pool);
  77. };
  78. class CFilterChain :
  79. public CFrameOp
  80. {
  81. private:
  82. public:
  83. CFilterFrame *m_head;
  84. CFilterChain() { m_head = NULL; }
  85. ~CFilterChain();
  86. STDMETHODIMP DoOp(IBitmapSurface** ppbs);
  87. };
  88. typedef BOOL (FRAMECONVERTPROC) (IBitmapSurface*, IBitmapSurface*, LPVOID);
  89. class CConvertFrame :
  90. public CFrameOp
  91. {
  92. private:
  93. FRAMECONVERTPROC *m_convert;
  94. LPVOID m_refdata;
  95. public:
  96. CConvertFrame() { m_convert = NULL; m_refdata = NULL; }
  97. ~CConvertFrame();
  98. STDMETHODIMP DoOp(IBitmapSurface** ppbs);
  99. BOOL InitConverter(LPBITMAPINFOHEADER lpbmh, FRAMECONVERTPROC *convertproc, LPVOID refdata);
  100. };
  101. #endif // #ifndef _FRAMEOP_H