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.

107 lines
3.4 KiB

  1. #pragma once
  2. //==========================================================================;
  3. //
  4. // WDM Video Decoder common SRB dispatcher
  5. //
  6. // $Date: 05 Aug 1998 11:22:30 $
  7. // $Revision: 1.0 $
  8. // $Author: Tashjian $
  9. //
  10. // $Copyright: (c) 1997 - 1998 ATI Technologies Inc. All Rights Reserved. $
  11. //
  12. //==========================================================================;
  13. #include "CapStrm.h"
  14. #include "VPStrm.h"
  15. #include "CapVBI.h"
  16. #include "CapVideo.h"
  17. #include "decvport.h"
  18. #include "ddkmapi.h"
  19. typedef struct
  20. {
  21. // Please don't move srbListEntry from its first place in the structure
  22. LIST_ENTRY srbListEntry;
  23. PHW_STREAM_REQUEST_BLOCK pSrb;
  24. KEVENT bufferDoneEvent;
  25. DDCAPBUFFINFO ddCapBuffInfo;
  26. } SRB_DATA_EXTENSION, * PSRB_DATA_EXTENSION;
  27. class CWDMVideoDecoder
  28. {
  29. public:
  30. CWDMVideoDecoder( PPORT_CONFIGURATION_INFORMATION pConfigInfo,
  31. CVideoDecoderDevice* pDevice );
  32. virtual ~CWDMVideoDecoder();
  33. void * operator new(size_t size, void * pAllocation) { return(pAllocation);}
  34. void operator delete(void * pAllocation) {}
  35. void ReceivePacket (PHW_STREAM_REQUEST_BLOCK pSrb);
  36. void CancelPacket (PHW_STREAM_REQUEST_BLOCK pSrb);
  37. void TimeoutPacket (PHW_STREAM_REQUEST_BLOCK pSrb);
  38. void SetTunerInfo (PHW_STREAM_REQUEST_BLOCK pSrb);
  39. BOOL GetTunerInfo (KS_TVTUNER_CHANGE_INFO *);
  40. NTSTATUS
  41. EventProc ( IN PHW_EVENT_DESCRIPTOR pEventDescriptor);
  42. void ResetEvents() { m_preEventOccurred = m_postEventOccurred = FALSE; }
  43. void SetPreEvent() { m_preEventOccurred = TRUE; }
  44. void SetPostEvent() { m_postEventOccurred = TRUE; }
  45. BOOL PreEventOccurred() { return m_preEventOccurred; }
  46. CVideoDecoderDevice* GetDevice() { return m_pDevice; }
  47. CDecoderVideoPort* GetVideoPort() { return &m_CDecoderVPort; } // video port
  48. BOOL IsVideoPortPinConnected() { return( m_pVideoPortStream != NULL); }
  49. private:
  50. // for serializing SRB arriving into driver synchronization
  51. BOOL m_bSrbInProcess;
  52. LIST_ENTRY m_srbQueue;
  53. KSPIN_LOCK m_spinLock;
  54. CVideoDecoderDevice * m_pDevice;
  55. CDecoderVideoPort m_CDecoderVPort; // video port
  56. PDEVICE_OBJECT m_pDeviceObject;
  57. // Channel Change information
  58. KS_TVTUNER_CHANGE_INFO m_TVTunerChangeInfo;
  59. BOOL m_TVTunerChanged;
  60. PHW_STREAM_REQUEST_BLOCK m_TVTunerChangedSrb;
  61. // shared between full-screen DOS and res changes
  62. BOOL m_preEventOccurred;
  63. BOOL m_postEventOccurred;
  64. // Streams
  65. UINT m_OpenStreams;
  66. CWDMVideoPortStream * m_pVideoPortStream;
  67. CWDMVBICaptureStream * m_pVBICaptureStream;
  68. CWDMVideoCaptureStream * m_pVideoCaptureStream;
  69. UINT m_nMVDetectionEventCount;
  70. BOOL SrbInitializationComplete (PHW_STREAM_REQUEST_BLOCK pSrb);
  71. BOOL SrbChangePowerState (PHW_STREAM_REQUEST_BLOCK pSrb);
  72. BOOL SrbGetDataIntersection (PHW_STREAM_REQUEST_BLOCK pSrb);
  73. void SrbGetStreamInfo (PHW_STREAM_REQUEST_BLOCK pSrb);
  74. void SrbGetProperty (PHW_STREAM_REQUEST_BLOCK pSrb);
  75. void SrbSetProperty (PHW_STREAM_REQUEST_BLOCK pSrb);
  76. BOOL SrbOpenStream (PHW_STREAM_REQUEST_BLOCK pSrb);
  77. BOOL SrbCloseStream (PHW_STREAM_REQUEST_BLOCK pSrb);
  78. };
  79. const size_t streamDataExtensionSize =
  80. max(
  81. max(sizeof(CWDMVideoStream), sizeof(CWDMVideoPortStream)),
  82. max(sizeof(CWDMVideoCaptureStream), sizeof(CWDMVBICaptureStream))
  83. );