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.

134 lines
4.2 KiB

  1. /*
  2. * msyuv.h Microsoft YUV Codec
  3. *
  4. * Copyright (c) Microsoft 1993.
  5. */
  6. #include <msviddrv.h>
  7. #include <vfw.h>
  8. #include "vcstruct.h"
  9. #include "vcuser.h"
  10. #include "debug.h"
  11. #ifndef FOURCC_UYVY
  12. #define FOURCC_UYVY mmioFOURCC('U', 'Y', 'V', 'Y') // UYVY
  13. #endif
  14. #ifndef FOURCC_YUY2
  15. #define FOURCC_YUY2 mmioFOURCC('Y', 'U', 'Y', '2') // YUYV
  16. #endif
  17. #ifndef FOURCC_YVYU
  18. #define FOURCC_YVYU mmioFOURCC('Y', 'V', 'Y', 'U') // YUYV
  19. #endif
  20. typedef struct {
  21. DWORD dwFlags; // flags from ICOPEN
  22. DWORD dwFormat; // format that pXlate is built for (FOURCC)
  23. PVOID pXlate; // xlate table (for decompress)
  24. BOOL bRGB565; // true if 5-6-5 format output (otherwise 555)
  25. /* support for drawing */
  26. VCUSER_HANDLE vh;
  27. HWND hwnd;
  28. RECT rcSource;
  29. RECT rcDest;
  30. HBRUSH hKeyBrush;
  31. } INSTINFO, *PINSTINFO;
  32. /*
  33. * message processing functions in msyuv.c
  34. */
  35. INSTINFO * NEAR PASCAL Open(ICOPEN FAR * icinfo);
  36. DWORD NEAR PASCAL Close(INSTINFO * pinst);
  37. BOOL NEAR PASCAL QueryAbout(INSTINFO * pinst);
  38. DWORD NEAR PASCAL About(INSTINFO * pinst, HWND hwnd);
  39. BOOL NEAR PASCAL QueryConfigure(INSTINFO * pinst);
  40. DWORD NEAR PASCAL Configure(INSTINFO * pinst, HWND hwnd);
  41. DWORD NEAR PASCAL GetState(INSTINFO * pinst, LPVOID pv, DWORD dwSize);
  42. DWORD NEAR PASCAL SetState(INSTINFO * pinst, LPVOID pv, DWORD dwSize);
  43. DWORD NEAR PASCAL GetInfo(INSTINFO * pinst, ICINFO FAR *icinfo, DWORD dwSize);
  44. DWORD FAR PASCAL CompressQuery(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  45. DWORD FAR PASCAL CompressGetFormat(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  46. DWORD FAR PASCAL CompressBegin(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  47. DWORD FAR PASCAL CompressGetSize(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  48. DWORD FAR PASCAL Compress(INSTINFO * pinst, ICCOMPRESS FAR *icinfo, DWORD dwSize);
  49. DWORD FAR PASCAL CompressEnd(INSTINFO * pinst);
  50. DWORD NEAR PASCAL DecompressQuery(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  51. DWORD NEAR PASCAL DecompressGetFormat(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  52. DWORD NEAR PASCAL DecompressBegin(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  53. DWORD NEAR PASCAL Decompress(INSTINFO * pinst, ICDECOMPRESS FAR *icinfo, DWORD dwSize);
  54. DWORD NEAR PASCAL DecompressGetPalette(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  55. DWORD NEAR PASCAL DecompressEnd(INSTINFO * pinst);
  56. DWORD NEAR PASCAL DecompressExQuery(INSTINFO * pinst, ICDECOMPRESSEX * pICD, DWORD dwICDSize);
  57. DWORD NEAR PASCAL DecompressEx(INSTINFO * pinst, ICDECOMPRESSEX * pICD, DWORD dwICDSize);
  58. DWORD NEAR PASCAL DecompressExBegin(INSTINFO * pinst, ICDECOMPRESSEX * pICD, DWORD dwICDSize);
  59. DWORD NEAR PASCAL DecompressExEnd(INSTINFO * pinst);
  60. DWORD DrawQuery(INSTINFO * pinst, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
  61. DWORD DrawBegin(INSTINFO * pinst,ICDRAWBEGIN FAR *icinfo, DWORD dwSize);
  62. DWORD Draw(INSTINFO * pinst, ICDRAW FAR *icinfo, DWORD dwSize);
  63. DWORD DrawEnd(INSTINFO * pinst);
  64. DWORD DrawWindow(PINSTINFO pinst, PRECT prc);
  65. /*
  66. * build UYVY -> RGB555 xlate table
  67. */
  68. LPVOID BuildUYVYToRGB555(PINSTINFO pinst);
  69. // build UYVY -> RGB32 xlate table
  70. LPVOID BuildUYVYToRGB32(PINSTINFO pinst);
  71. // build UYVY -> RGB565
  72. LPVOID BuildUYVYToRGB565(PINSTINFO pinst);
  73. // build UYVY -> RGB8
  74. LPVOID BuildUYVYToRGB8(PINSTINFO pinst);
  75. VOID UYVYToRGB32(PINSTINFO pinst,
  76. LPBITMAPINFOHEADER lpbiInput,
  77. LPVOID lpInput,
  78. LPBITMAPINFOHEADER lpbiOutput,
  79. LPVOID lpOutput);
  80. VOID UYVYToRGB24(PINSTINFO pinst,
  81. LPBITMAPINFOHEADER lpbiInput,
  82. LPVOID lpInput,
  83. LPBITMAPINFOHEADER lpbiOutput,
  84. LPVOID lpOutput);
  85. /*
  86. * translate one frame from uyvy to rgb 555 or 565
  87. */
  88. VOID UYVYToRGB16(PINSTINFO pinst,
  89. LPBITMAPINFOHEADER lpbiInput,
  90. LPVOID lpInput,
  91. LPBITMAPINFOHEADER lpbiOutput,
  92. LPVOID lpOutput);
  93. /*
  94. * translate one frame from uyvy to RGB8
  95. */
  96. VOID UYVYToRGB8(PINSTINFO pinst,
  97. LPBITMAPINFOHEADER lpbiInput,
  98. LPVOID lpInput,
  99. LPBITMAPINFOHEADER lpbiOutput,
  100. LPVOID lpOutput);
  101. VOID FreeXlate(PINSTINFO pinst);