Source code of Windows XP (NT5)
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.

73 lines
2.0 KiB

  1. //***************************************************************************
  2. // Queue header
  3. //
  4. //***************************************************************************
  5. #ifndef __QUE_H__
  6. #define __QUE_H__
  7. #define SRBIndex(srb) (((PSRB_EXTENSION)(srb->SRBExtension))->Index)
  8. #define SRBpfnEndSrb(srb) (((PSRB_EXTENSION)(srb->SRBExtension))->pfnEndSrb)
  9. #define SRBparamSrb(srb) (((PSRB_EXTENSION)(srb->SRBExtension))->parmSrb)
  10. #define BLOCK_SIZE 2048
  11. typedef enum
  12. {
  13. Video,
  14. Audio,
  15. SubPicture
  16. } StreamType;
  17. class DeviceQueue
  18. {
  19. private:
  20. ULONG count; // srb count in this queue
  21. PHW_STREAM_REQUEST_BLOCK top;
  22. PHW_STREAM_REQUEST_BLOCK bottom;
  23. PHW_STREAM_REQUEST_BLOCK video;
  24. PHW_STREAM_REQUEST_BLOCK audio;
  25. PHW_STREAM_REQUEST_BLOCK subpic;
  26. PVOID top_addr; // buffer address of the first srb
  27. PVOID bottom_addr; // buffer address of the bottom srb
  28. BOOLEAN v_first, a_first, s_first;
  29. ULONG v_count, a_count, s_count;
  30. // ULONG check;
  31. // KSTIME kt[100];
  32. void put( PHW_STREAM_REQUEST_BLOCK pOrigin, PHW_STREAM_REQUEST_BLOCK pSrb );
  33. void put_from_bottom( PHW_STREAM_REQUEST_BLOCK pSrb );
  34. void put_first( PHW_STREAM_REQUEST_BLOCK pSrb );
  35. public:
  36. void init( void );
  37. void put_video( PHW_STREAM_REQUEST_BLOCK pSrb );
  38. void put_audio( PHW_STREAM_REQUEST_BLOCK pSrb );
  39. void put_subpic( PHW_STREAM_REQUEST_BLOCK pSrb );
  40. PHW_STREAM_REQUEST_BLOCK get( PULONG index, PBOOLEAN last );
  41. PHW_STREAM_REQUEST_BLOCK refer1st( PULONG index, PBOOLEAN last );
  42. PHW_STREAM_REQUEST_BLOCK refer2nd( PULONG index, PBOOLEAN last );
  43. void remove( PHW_STREAM_REQUEST_BLOCK pSrb );
  44. BOOL setEndAddress( PHW_TIMER_ROUTINE pfn, PHW_STREAM_REQUEST_BLOCK pSrb );
  45. //--- 97.09.14 K.Chujo
  46. BOOL isEmpty( void );
  47. ULONG getCount( void );
  48. //--- End.
  49. };
  50. class CCQueue
  51. {
  52. private:
  53. ULONG count; // srb count in this queue
  54. PHW_STREAM_REQUEST_BLOCK top;
  55. PHW_STREAM_REQUEST_BLOCK bottom;
  56. public:
  57. void init( void );
  58. void put( PHW_STREAM_REQUEST_BLOCK pSrb );
  59. PHW_STREAM_REQUEST_BLOCK get( void );
  60. void remove( PHW_STREAM_REQUEST_BLOCK pSrb );
  61. BOOL isEmpty( void );
  62. };
  63. #endif // __QUE_H__