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.

227 lines
5.1 KiB

  1. /*++
  2. Module Name:
  3. MsdvAvc.h
  4. Abstract:
  5. Header file for MsdvAvc.c.
  6. Author:
  7. Yee J. Wu 27-July-99
  8. Environment:
  9. Kernel mode only
  10. Revision History:
  11. --*/
  12. #ifndef _MSDVAVC_INC
  13. #define _MSDVAVC_INC
  14. #include "XPrtDefs.h" // WdmCap directory; derived from DShow's edevdefs.h
  15. #include "EDevCtrl.h" // External Device COM interface structures
  16. //
  17. // The index MUST match DVcrAVCCmdTable[]
  18. //
  19. typedef enum {
  20. DV_UNIT_INFO = 0
  21. ,DV_SUBUNIT_INFO
  22. ,DV_CONNECT_AV_MODE
  23. ,DV_VEN_DEP_CANON_MODE // Vendor denpendent mode of operation for Canon DV that does not support ConnectDV
  24. ,DV_VEN_DEP_DVCPRO // Vendor depend cmd to detect DVC PRO tape format
  25. ,DV_IN_PLUG_SIGNAL_FMT
  26. ,DV_OUT_PLUG_SIGNAL_FMT // to determine if it is a PAL or NTSC
  27. ,VCR_TIMECODE_SEARCH
  28. ,VCR_TIMECODE_READ
  29. ,VCR_ATN_SEARCH
  30. ,VCR_ATN_READ
  31. ,VCR_RTC_SEARCH
  32. ,VCR_RTC_READ
  33. ,VCR_OPEN_MIC_CLOSE
  34. ,VCR_OPEN_MIC_READ
  35. ,VCR_OPEN_MIC_WRITE
  36. ,VCR_OPEN_MIC_STATUS
  37. ,VCR_READ_MIC
  38. ,VCR_WRITE_MIC
  39. ,VCR_OUTPUT_SIGNAL_MODE
  40. ,VCR_INPUT_SIGNAL_MODE
  41. ,VCR_LOAD_MEDIUM_EJECT
  42. ,VCR_RECORD
  43. ,VCR_RECORD_PAUSE
  44. ,VCR_PLAY_FORWARD_STEP
  45. ,VCR_PLAY_FORWARD_SLOWEST
  46. ,VCR_PLAY_FORWARD_SLOWEST2
  47. ,VCR_PLAY_FORWARD_FASTEST
  48. ,VCR_PLAY_REVERSE_STEP
  49. ,VCR_PLAY_REVERSE_SLOWEST
  50. ,VCR_PLAY_REVERSE_SLOWEST2
  51. ,VCR_PLAY_REVERSE_FASTEST
  52. ,VCR_PLAY_FORWARD
  53. ,VCR_PLAY_FORWARD_PAUSE
  54. ,VCR_WIND_STOP
  55. ,VCR_WIND_REWIND
  56. ,VCR_WIND_FAST_FORWARD
  57. ,VCR_TRANSPORT_STATE
  58. ,VCR_TRANSPORT_STATE_NOTIFY
  59. ,VCR_MEDIUM_INFO
  60. ,VCR_RAW_AVC
  61. } DVCR_AVC_COMMAND, *PDVCR_AVC_COMMAND;
  62. #define MAX_FCP_PAYLOAD_SIZE 512
  63. //
  64. // CTYPE definitions (in bit-map form... should correlate with AvcCommandType from avc.h)
  65. //
  66. typedef enum {
  67. CMD_CONTROL = 0x01
  68. ,CMD_STATUS = 0x02
  69. ,CMD_SPEC_INQ = 0x04
  70. ,CMD_NOTIFY = 0x08
  71. ,CMD_GEN_INQ = 0x10
  72. } BITMAP_CTYPE;
  73. typedef enum {
  74. CMD_STATE_UNDEFINED
  75. ,CMD_STATE_ISSUED
  76. ,CMD_STATE_RESP_ACCEPTED
  77. ,CMD_STATE_RESP_REJECTED
  78. ,CMD_STATE_RESP_NOT_IMPL
  79. ,CMD_STATE_RESP_INTERIM
  80. ,CMD_STATE_ABORTED
  81. } AVC_CMD_STATE, *PAVC_CMD_STATE;
  82. // An AVC command entry
  83. typedef struct _AVC_CMD_ENTRY {
  84. LIST_ENTRY ListEntry;
  85. PDVCR_EXTENSION pDevExt;
  86. PIRP pIrp; // The Irp associated with this command
  87. PAVC_COMMAND_IRB pAvcIrb; // points to the AVC command information
  88. PVOID pProperty; // Data from/to COM interface
  89. DVCR_AVC_COMMAND idxDVCRCmd; // Used to check for RAW AVC command, which requires special processing
  90. AVC_CMD_STATE cmdState; // Issuing, interim, completed
  91. NTSTATUS Status; // To save the results of response parsing
  92. AvcCommandType cmdType; // Type of command: Control, Status. Notify, Gen or Spec Inquery
  93. BYTE OpCode; // Since the opcode in response frame of TRANSITION and STABLE can be different from the COMMAND frame
  94. BYTE Reserved[3]; // Pack to DWORD
  95. } AVCCmdEntry, *PAVCCmdEntry;
  96. #define CMD_IMPLEMENTED 1
  97. #define CMD_NOT_IMPLEMENTED 0
  98. #define CMD_UNDETERMINED 0xffffffff // -1
  99. typedef struct {
  100. DVCR_AVC_COMMAND command; // VCR_PLAY_FORWARD
  101. LONG lCmdImplemented; // 1:Implemented, 0:NotImpelemnted; -1:UnDetermined
  102. ULONG ulRespFlags; // DVCR_AVC_SEND
  103. ULONG ulCmdSupported; // one or more of constants defined in BITMAP_CTYPE
  104. LONG OperandLength; // -1 = variable length
  105. BYTE CType;
  106. BYTE SubunitAddr;
  107. BYTE Opcode;
  108. BYTE Operands[MAX_AVC_OPERAND_BYTES];
  109. } KSFCP_PACKET, *PKSFCP_PACKET;
  110. #define OPC_TIMECODE 0x51
  111. #define OPC_OPEN_MIC 0x60
  112. #define OPC_READ_MIC 0x61
  113. #define OPC_WRITE_MIC 0x62
  114. #define OPC_INPUT_SIGNAL_MODE 0x79
  115. #define OPC_LOAD_MEDIUM 0xc1
  116. #define OPC_RECORD 0xc2
  117. #define OPC_PLAY 0xc3
  118. #define OPC_WIND 0xc4
  119. #define OPC_TRANSPORT_STATE 0xd0
  120. #define OPC_MEDIUM_INFO 0xda
  121. #define UNIT_TYPE_ID_VCR 0x20 // VCR 00100:000; 00100 == 4 == VCR, 000 == instancve number
  122. #define UNIT_TYPE_ID_CAMERA 0x38 // Camera 00111:000; 00111 == 7 == Camera, 000 == instancve number
  123. #define UNIT_TYPE_ID_DV 0xff // DV UNIT as a whole
  124. // Vendor IDs that require special treatments
  125. #define VENDOR_ID_MASK 0x00ffffff
  126. #define VENDORID_CANON 0x85 // VEN_85 : Vendor Dependent command for ModeOfOperation
  127. #define VENDORID_PANASONIC 0x8045 // VEN_8045 : DVCPRO?
  128. #define VENDORID_SAMSUNG 0xf0 // VEN_f0 : exception for AVC Command Retries
  129. #endif
  130. NTSTATUS
  131. DVIssueAVCCommand (
  132. IN PDVCR_EXTENSION pDevExt,
  133. IN AvcCommandType cType,
  134. IN DVCR_AVC_COMMAND idxAVCCmd,
  135. IN PVOID pProperty
  136. );
  137. void
  138. DVAVCCmdResetAfterBusReset(
  139. PDVCR_EXTENSION pDevExt
  140. );
  141. NTSTATUS
  142. DVGetDeviceProperty(
  143. IN PDVCR_EXTENSION pDevExt,
  144. IN PSTREAM_PROPERTY_DESCRIPTOR pSPDesc,
  145. OUT PULONG pulActualBytetransferred
  146. );
  147. NTSTATUS
  148. DVSetDeviceProperty(
  149. IN PDVCR_EXTENSION pDevExt,
  150. IN PSTREAM_PROPERTY_DESCRIPTOR pSPD,
  151. IN PULONG pulActualBytetransferred
  152. );