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.

346 lines
10 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1998 - 1999
  3. Module Name:
  4. EDevCtrl.h
  5. Abstract:
  6. This header contain structures and peroperty sets for
  7. interfacing to an external device, like a DV.
  8. The code is modeled after DirectShow's Vcrctrl Sample
  9. (VCR Control Filter). It contain IAMExtDevice,
  10. IAMExtTransport, and IAMTimecodeReader interfaces, and
  11. a new interface IAMAdvancedAVControl() is added
  12. for additional advanced device controls.
  13. Note: (From DShow DDK)
  14. The VCR control sample filter, Vcrctrl, is a simple
  15. implementation of the external device control interfaces
  16. that DirectShow provides. Vcrctrl provides basic transport
  17. control and SMPTE timecode-reading capabilities for certain
  18. Betacam and SVHS videocassette recorders with RS-422 or RS-232
  19. serial interfaces (see source code for specific machine types
  20. supported).
  21. Note: some methods in IAM* interfaces may not be
  22. used and will return not implemented.
  23. Created:
  24. September 23, 1998
  25. Yee J. Wu
  26. Revision:
  27. 0.6
  28. --*/
  29. #ifndef __EDevCtrl__
  30. #define __EDevCtrl__
  31. #ifndef TIMECODE_DEFINED
  32. #define TIMECODE_DEFINED
  33. typedef union _timecode {
  34. struct {
  35. WORD wFrameRate;
  36. WORD wFrameFract;
  37. DWORD dwFrames;
  38. };
  39. DWORDLONG qw;
  40. } TIMECODE;
  41. typedef TIMECODE *PTIMECODE;
  42. typedef struct tagTIMECODE_SAMPLE
  43. {
  44. LONGLONG qwTick;
  45. TIMECODE timecode;
  46. DWORD dwUser;
  47. DWORD dwFlags;
  48. } TIMECODE_SAMPLE;
  49. typedef TIMECODE_SAMPLE *PTIMECODE_SAMPLE;
  50. #endif /* TIMECODE_DEFINED */
  51. // Device Capabilities
  52. typedef struct tagDEVCAPS{
  53. long CanRecord;
  54. long CanRecordStrobe;
  55. long HasAudio;
  56. long HasVideo;
  57. long UsesFiles;
  58. long CanSave;
  59. long DeviceType;
  60. long TCRead;
  61. long TCWrite;
  62. long CTLRead;
  63. long IndexRead;
  64. long Preroll;
  65. long Postroll;
  66. long SyncAcc;
  67. long NormRate;
  68. long CanPreview;
  69. long CanMonitorSrc;
  70. long CanTest;
  71. long VideoIn;
  72. long AudioIn;
  73. long Calibrate;
  74. long SeekType;
  75. long SimulatedHardware; // private
  76. } DEVCAPS, *PDEVCAPS;
  77. // transport status
  78. typedef struct tagTRANSPORTSTATUS{
  79. long Mode;
  80. long LastError;
  81. long RecordInhibit;
  82. long ServoLock;
  83. long MediaPresent;
  84. long MediaLength;
  85. long MediaSize;
  86. long MediaTrackCount;
  87. long MediaTrackLength;
  88. long MediaTrackSide;
  89. long MediaType;
  90. long LinkMode;
  91. long NotifyOn;
  92. } TRANSPORTSTATUS, *PTRANSPORTSTATUS;
  93. // transport basic parameters
  94. typedef struct tagTRANSPORTBASICPARMS{
  95. long TimeFormat;
  96. long TimeReference;
  97. long Superimpose;
  98. long EndStopAction;
  99. long RecordFormat;
  100. long StepFrames;
  101. long SetpField;
  102. long Preroll;
  103. long RecPreroll;
  104. long Postroll;
  105. long EditDelay;
  106. long PlayTCDelay;
  107. long RecTCDelay;
  108. long EditField;
  109. long FrameServo;
  110. long ColorFrameServo;
  111. long ServoRef;
  112. long WarnGenlock;
  113. long SetTracking;
  114. TCHAR VolumeName[40];
  115. long Ballistic[20];
  116. long Speed;
  117. long CounterFormat;
  118. long TunerChannel;
  119. long TunerNumber;
  120. long TimerEvent;
  121. long TimerStartDay;
  122. long TimerStartTime;
  123. long TimerStopDay;
  124. long TimerStopTime;
  125. } TRANSPORTBASICPARMS, *PTRANSPORTBASICPARMS;
  126. // transport video parameters
  127. typedef struct tagTRANSPORTVIDEOPARMS{
  128. long OutputMode;
  129. long Input;
  130. } TRANSPORTVIDEOPARMS, *PTRANSPORTVIDEOPARMS;
  131. // transport audio parameters
  132. typedef struct tagTRANSPORTAUDIOPARMS{
  133. long EnableOutput;
  134. long EnableRecord;
  135. long EnableSelsync;
  136. long Input;
  137. long MonitorSource;
  138. } TRANSPORTAUDIOPARMS, *PTRANSPORTAUDIOPARMS;
  139. // low level machine status structure filled in after
  140. // REQUEST_STATUS command from above. This structure would
  141. // grow in a full implementation
  142. typedef struct tagVCRSTATUS{
  143. BOOL bCassetteOut; // OATRUE means no cassette
  144. BOOL bLocal; // OATRUE means front panel switch in local
  145. } VCRSTATUS;
  146. typedef VCRSTATUS far *PVCRSTATUS;
  147. //---------------------------------------------------------
  148. // STATIC_PROPSETID_VIDCAP_EXT_DEVICE
  149. //---------------------------------------------------------
  150. // This guid and interface is defined in strmif.h
  151. #define STATIC_PROPSETID_EXT_DEVICE\
  152. 0xB5730A90L, 0x1A2C, 0x11cf, 0x8c, 0x23, 0x00, 0xAA, 0x00, 0x6B, 0x68, 0x14
  153. DEFINE_GUIDSTRUCT("B5730A90-1A2C-11cf-8C23-00AA006B6814", PROPSETID_EXT_DEVICE);
  154. #define PROPSETID_EXT_DEVICE DEFINE_GUIDNAMED(PROPSETID_EXT_DEVICE)
  155. // KS properties and structure for this interface
  156. typedef enum {
  157. KSPROPERTY_EXTDEVICE_ID, // ID (such as Symbolic Lin) that can uniquely idenfy this device
  158. KSPROPERTY_EXTDEVICE_VERSION, // Device model number and version (such AV/C VCR Subunit Spec. 2.01)
  159. KSPROPERTY_EXTDEVICE_POWER_STATE, // Return current device power state.
  160. KSPROPERTY_EXTDEVICE_PORT, // Can use this to return DEV_PORT_1394
  161. KSPROPERTY_EXTDEVICE_CAPABILITIES, // Device specific capabilities
  162. } KSPROPERTY_EXTDEVICE;
  163. typedef struct {
  164. KSPROPERTY Property;
  165. union {
  166. // Client is responsible for allocating this.
  167. DEVCAPS Capabilities; // May need to expand on the existing structure
  168. ULONG DevPort; //
  169. ULONG PowerState; // On, off standby
  170. WCHAR pawchString[MAX_PATH]; // ID and version
  171. DWORD NodeUniqueID[2]; // Unique NodeID
  172. } u;
  173. } KSPROPERTY_EXTDEVICE_S, *PKSPROPERTY_EXTDEVICE_S;
  174. //---------------------------------------------------------
  175. // STATIC_PROPSETID_VIDCAP_EXT_TRANSPORT
  176. //---------------------------------------------------------
  177. // This guid and interface is defined in strmif.h
  178. #define STATIC_PROPSETID_EXT_TRANSPORT\
  179. 0xA03CD5F0L, 0x3045, 0x11cf, 0x8c, 0x44, 0x00, 0xAA, 0x00, 0x6B, 0x68, 0x14
  180. DEFINE_GUIDSTRUCT("A03CD5F0-3045-11cf-8C44-00AA006B6814", PROPSETID_EXT_TRANSPORT);
  181. #define PROPSETID_EXT_TRANSPORT DEFINE_GUIDNAMED(PROPSETID_EXT_TRANSPORT)
  182. // KS properties and structure for this interface
  183. typedef enum {
  184. KSPROPERTY_EXTXPORT_CAPABILITIES, // Transport specific capability
  185. KSPROPERTY_EXTXPORT_INPUT_SIGNAL_MODE, // MPEG, D-VHS, Analog VHS etc.
  186. KSPROPERTY_EXTXPORT_OUTPUT_SIGNAL_MODE, // MPEG, D-VHS, Analog VHS etc.
  187. KSPROPERTY_EXTXPORT_LOAD_MEDIUM, // Eject, open tray, close tray
  188. KSPROPERTY_EXTXPORT_MEDIUM_INFO, // cassettte_type and tape_grade_and_write_protect
  189. KSPROPERTY_EXTXPORT_STATE, // Get/Set transport mode and state
  190. KSPROPERTY_EXTXPORT_STATE_NOTIFY, // NOTIFY: Mode + State (Table 4-8)
  191. KSPROPERTY_EXTXPORT_TIMECODE_SEARCH, // Request VCR subunit to search for a specific timecode on the medium
  192. KSPROPERTY_EXTXPORT_ATN_SEARCH, // Request VCR subunit to search for a specific ATN on the medium
  193. KSPROPERTY_EXTXPORT_RTC_SEARCH, // Request VCR subunit to search for a specific RelativeTimeCounter on the medium
  194. //
  195. // Implemented for testing purpose
  196. // Will remove this later...
  197. //
  198. KSPROPERTY_RAW_AVC_CMD, // Send/Rcv raw AVC commnad with a FCP packet.
  199. } KSPROPERTY_EXTXPORT;
  200. typedef struct {
  201. BOOL MediaPresent; // TRUE/FALSE
  202. ULONG MediaType; // DVCR standard, small, medium; VHS; VHS-C; unknown
  203. BOOL RecordInhibit; // TRUE/FALSE
  204. } MEDIUM_INFO, *PMEDIUM_INFO;
  205. typedef struct {
  206. ULONG Mode; // LOAD MEDIUM, RECORD, PLAY or WIND
  207. ULONG State; // Vary depend on mode (Table 4-8)
  208. } TRANSPORT_STATE, *PTRANSPORT_STATE;
  209. typedef struct {
  210. KSPROPERTY Property;
  211. union {
  212. ULONG Capabilities; // May need to expand on the existing structure
  213. ULONG SignalMode; // MPEG, D-VHS, Analog VHS etc.
  214. ULONG LoadMedium; // Eject, open tray, close tray
  215. MEDIUM_INFO MediumInfo;
  216. TRANSPORT_STATE XPrtState;
  217. struct {
  218. BYTE frame;
  219. BYTE second;
  220. BYTE minute;
  221. BYTE hour;
  222. } Timecode;
  223. DWORD dwTimecode; // hour:minute:second:frame
  224. DWORD dwAbsTrackNumber; // absolute track number
  225. //
  226. // Implemented for testing purpose
  227. // Will remove this later or will keep this for
  228. // packet specific command.
  229. //
  230. struct {
  231. ULONG PayloadSize;
  232. BYTE Payload[512]; // This is only for testing sending AVC command from User mode.
  233. } RawAVC;
  234. } u;
  235. } KSPROPERTY_EXTXPORT_S, *PKSPROPERTY_EXTXPORT_S;
  236. //---------------------------------------------------------
  237. // PROPSETID_TIMECODE
  238. //---------------------------------------------------------
  239. // This guid and interface is defined in strmif.h
  240. #define STATIC_PROPSETID_TIMECODE_READER\
  241. 0x9B496CE1L, 0x811B, 0x11cf, 0x8C, 0x77, 0x00, 0xAA, 0x00, 0x6B, 0x68, 0x14
  242. DEFINE_GUIDSTRUCT("9B496CE1-811B-11cf-8C77-00AA006B6814", PROPSETID_TIMECODE_READER);
  243. #define PROPSETID_TIMECODE_READER DEFINE_GUIDNAMED(PROPSETID_TIMECODE_READER)
  244. // KS properties and structure for this interface
  245. typedef enum {
  246. KSPROPERTY_TIMECODE_READER, // Timecode for the current medium position
  247. KSPROPERTY_ATN_READER, // Absolute track number the current medium position
  248. KSPROPERTY_RTC_READER, // Relative time counter for the current medium position
  249. } KSPROPERTY_TIMECODE;
  250. typedef struct {
  251. KSPROPERTY Property;
  252. TIMECODE_SAMPLE TimecodeSamp;
  253. } KSPROPERTY_TIMECODE_S, *PKSPROPERTY_TIMECODE_S;
  254. //---------------------------------------------------------
  255. // External Device Command event notification
  256. //---------------------------------------------------------
  257. #define STATIC_KSEVENTSETID_EXTDEV_Command\
  258. 0x109c7988L, 0xb3cb, 0x11d2, 0xb4, 0x8e, 0x00, 0x60, 0x97, 0xb3, 0x39, 0x1b
  259. DEFINE_GUIDSTRUCT("109c7988-b3cb-11d2-b48e-006097b3391b", KSEVENTSETID_EXTDEV_Command);
  260. #define KSEVENTSETID_EXTDEV_Command DEFINE_GUIDNAMED(KSEVENTSETID_EXTDEV_Command)
  261. typedef enum {
  262. KSEVENT_EXTDEV_COMMAND_NOTIFY_INTERIM_READY,
  263. KSEVENT_EXTDEV_COMMAND_CONTROL_INTERIM_READY,
  264. KSEVENT_EXTDEV_COMMAND_BUSRESET,
  265. KSEVENT_EXTDEV_TIMECODE_UPDATE,
  266. KSEVENT_EXTDEV_OPERATION_MODE_UPDATE, // Notify mode of operation change (VCR,OFF,Camera)
  267. KSEVENT_EXTDEV_TRANSPORT_STATE_UPDATE, // XPrt state change
  268. KSEVENT_EXTDEV_NOTIFY_REMOVAL, // Notify device removal
  269. KSEVENT_EXTDEV_NOTIFY_MEDIUM_CHANGE, // Notify medium (tape) is removed or added
  270. } KSEVENT_DEVCMD;
  271. #endif // __EDevCTrl__