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.

208 lines
5.5 KiB

  1. #pragma once
  2. //==========================================================================;
  3. //
  4. // Device - Declaration of the Bt829 CVideoDecoderDevice
  5. //
  6. // $Date: 28 Aug 1998 14:44:36 $
  7. // $Revision: 1.2 $
  8. // $Author: Tashjian $
  9. //
  10. // $Copyright: (c) 1997 - 1998 ATI Technologies Inc. All Rights Reserved. $
  11. //
  12. //==========================================================================;
  13. #include "decoder.h"
  14. #include "scaler.h"
  15. #include "xbar.h"
  16. #include "capmain.h"
  17. #include "capdebug.h"
  18. #include "wdmvdec.h"
  19. #include "decdev.h"
  20. class Device: public CVideoDecoderDevice
  21. {
  22. private:
  23. NTSTATUS GetRegistryValue(HANDLE, PWCHAR, ULONG, PWCHAR, ULONG);
  24. VOID UseRegistryValues(PPORT_CONFIGURATION_INFORMATION);
  25. BOOL stringsEqual(PWCHAR, PWCHAR);
  26. PDEVICE_PARMS m_pDeviceParms;
  27. int hue;
  28. int saturation;
  29. int contrast;
  30. int brightness;
  31. int NTSCDecoderWidth;
  32. int NTSCDecoderHeight;
  33. int PALDecoderWidth;
  34. int PALDecoderHeight;
  35. int defaultDecoderWidth;
  36. int defaultDecoderHeight;
  37. int VBIEN;
  38. int VBIFMT;
  39. BOOL isCodeInDataStream;
  40. BOOL is16;
  41. MRect destRect;
  42. Connector source;
  43. int VBISurfaceOriginX;
  44. int VBISurfaceOriginY;
  45. int VBISurfacePitch;
  46. int VideoSurfaceOriginX;
  47. int VideoSurfaceOriginY;
  48. int VideoSurfacePitch;
  49. Decoder *decoder;
  50. Scaler *scaler;
  51. CrossBar *xbar;
  52. public:
  53. Device(PPORT_CONFIGURATION_INFORMATION,
  54. PDEVICE_PARMS,
  55. PUINT puiError);
  56. void * operator new(size_t size, void * pAllocation) { return(pAllocation);}
  57. void operator delete(void * pAllocation) {}
  58. void SaveState();
  59. void RestoreState(DWORD dwStreamsOpen = -1);
  60. void SetRect(MRect &);
  61. int GetDecoderWidth();
  62. int GetDecoderHeight();
  63. int GetDefaultDecoderWidth();
  64. int GetDefaultDecoderHeight();
  65. int GetPartID();
  66. int GetPartRev();
  67. //
  68. // --------------- decoder functions
  69. //
  70. void SoftwareReset()
  71. {decoder->SoftwareReset();}
  72. void SetOutputEnabled(BOOL b)
  73. {
  74. decoder->SetOutputEnabled( b);
  75. }
  76. BOOL IsOutputEnabled()
  77. {return decoder->IsOutputEnabled();}
  78. void GetVideoDecoderCaps(PKSPROPERTY_VIDEODECODER_CAPS_S caps)
  79. {decoder->GetVideoDecoderCaps(caps);}
  80. void GetVideoDecoderStatus(PKSPROPERTY_VIDEODECODER_STATUS_S status)
  81. {decoder->GetVideoDecoderStatus(status);}
  82. DWORD GetVideoDecoderStandard()
  83. {return decoder->GetVideoDecoderStandard();}
  84. BOOL SetVideoDecoderStandard(DWORD standard);
  85. void SetHighOdd(BOOL b)
  86. {decoder->SetHighOdd(b);}
  87. BOOL IsHighOdd()
  88. {return decoder->IsHighOdd();}
  89. ErrorCode SetVideoInput(Connector i)
  90. {source = i; return decoder->SetVideoInput(i);}
  91. Connector GetVideoInput()
  92. {return decoder->GetVideoInput();}
  93. NTSTATUS GetProcAmpProperty(ULONG, PLONG);
  94. NTSTATUS SetProcAmpProperty(ULONG, LONG);
  95. void Set16BitDataStream(BOOL b)
  96. {decoder->Set16BitDataStream(b);}
  97. BOOL Is16BitDataStream()
  98. {return decoder->Is16BitDataStream();}
  99. void SetCodeInsertionEnabled(BOOL b)
  100. {decoder->SetCodeInsertionEnabled(b);}
  101. BOOL IsCodeInsertionEnabled()
  102. {return decoder->IsCodeInsertionEnabled();}
  103. void SetOutputEnablePolarity(int i)
  104. {decoder->SetOutputEnablePolarity(i);}
  105. int GetOutputEnablePolarity()
  106. {return decoder->GetOutputEnablePolarity();}
  107. //
  108. // --------------- scaler functions
  109. //
  110. void SetVBIEN(BOOL b)
  111. {scaler->SetVBIEN(b);}
  112. BOOL IsVBIEN()
  113. {return scaler->IsVBIEN();}
  114. void SetVBIFMT(BOOL b)
  115. {scaler->SetVBIFMT(b);}
  116. BOOL IsVBIFMT()
  117. {return scaler->IsVBIFMT();}
  118. //
  119. // --------------- xbar functions
  120. //
  121. BOOL GoodPins(ULONG InPin, ULONG OutPin)
  122. {return xbar->GoodPins(InPin, OutPin);}
  123. BOOL TestRoute(ULONG InPin, ULONG OutPin)
  124. {return xbar->TestRoute(InPin, OutPin);}
  125. void Route(ULONG OutPin, ULONG InPin)
  126. {xbar->Route(OutPin, InPin);}
  127. ULONG GetNoInputs()
  128. {return xbar->GetNoInputs();}
  129. ULONG GetNoOutputs()
  130. {return xbar->GetNoOutputs();}
  131. ULONG GetPinInfo(KSPIN_DATAFLOW dir, ULONG idx, ULONG &related)
  132. {return xbar->GetPinInfo(dir, idx, related);}
  133. ULONG GetRoute(ULONG OutPin)
  134. {return xbar->GetRoute(OutPin);}
  135. KSPIN_MEDIUM * GetPinMedium(KSPIN_DATAFLOW dir, ULONG idx)
  136. {return xbar->GetPinMedium(dir, idx);}
  137. void Reset();
  138. ~Device();
  139. void GetVideoPortProperty(PHW_STREAM_REQUEST_BLOCK pSrb);
  140. void GetVideoPortVBIProperty(PHW_STREAM_REQUEST_BLOCK pSrb);
  141. void ConfigVPSurfaceParams(PKSVPSURFACEPARAMS pSurfaceParams);
  142. void ConfigVPVBISurfaceParams(PKSVPSURFACEPARAMS pSurfaceParams);
  143. void GetVideoSurfaceOrigin(int* pX, int* pY)
  144. { *pX = VideoSurfaceOriginX; *pY = VideoSurfaceOriginY; }
  145. void GetVBISurfaceOrigin(int* pX, int* pY)
  146. { *pX = VBISurfaceOriginX; *pY = VBISurfaceOriginY; }
  147. };
  148. typedef struct
  149. {
  150. CWDMVideoDecoder CWDMDecoder;
  151. Device CDevice;
  152. Decoder CDecoder;
  153. Scaler CScaler;
  154. CrossBar CXbar;
  155. CI2CScript CScript;
  156. DEVICE_PARMS deviceParms;
  157. } DEVICE_DATA_EXTENSION, * PDEVICE_DATA_EXTENSION;