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.

216 lines
4.7 KiB

  1. /*++
  2. Copyright (c) 1994 - 1995 Microsoft Corporation. All Rights Reserved.
  3. Module Name:
  4. imp.h
  5. Abstract:
  6. This file defines all the implementation-dependent structures and
  7. declares internal functions for the MPEG API DLL.
  8. Author:
  9. Yi SUN (t-yisun) 08-22-1994
  10. Environment:
  11. Revision History:
  12. --*/
  13. #ifndef _IMP_H
  14. #define _IMP_H
  15. /**************************************************************************
  16. * types, vars and constants definition
  17. **************************************************************************/
  18. #define MAX_CHANNELS 8
  19. extern int nMpegAdapters;
  20. typedef enum _ATTRIBUTE_VALUE_STATUS
  21. {
  22. AttrValueUnset,
  23. AttrValueUpdated,
  24. AttrValueUnwritten
  25. } ATTRIBUTE_VALUE_STATUS, *PATTRIBUTE_VALUE_STATUS;
  26. // MPEG attribute range struct
  27. typedef struct _MPEG_ATTRIBUTE_INFO {
  28. MPEG_ATTRIBUTE eAttribute;
  29. LONG lMinimum;
  30. LONG lMaximum;
  31. LONG lStep; // 0 indicates not supported
  32. LONG lCurrentValue[MAX_CHANNELS];
  33. ATTRIBUTE_VALUE_STATUS eValueStatus[MAX_CHANNELS];
  34. } MPEG_ATTRIBUTE_INFO, *PMPEG_ATTRIBUTE_INFO;
  35. // abstract device control block contains info identifying each abstract
  36. // device
  37. typedef struct _ABSTRACT_DEVICE_CONTROL_BLOCK {
  38. BOOL bIsAvailable; // indicate if the abstract device exists
  39. int nCurrentChannel;
  40. TCHAR szId[80];
  41. HMPEG_DEVICE hAD; // handle to the abstract device; hidden from apps
  42. } ABSTRACT_DEVICE_CONTROL_BLOCK, *PABSTRACT_DEVICE_CONTROL_BLOCK;
  43. // NOTE: the following info should be obtained from the registry or by
  44. // querying the device. For now, it's hard coded.
  45. // define the max number of abstract devices for each physical MPEG device
  46. #define MAX_ABSTRACT_DEVICES 4
  47. // define the max number of attributes for each MPEG device
  48. #define NUMBER_OF_ATTRIBUTES 32
  49. // MPEG device control block
  50. typedef struct _MPEG_DEVICE_CONTROL_BLOCK {
  51. int nDevice;
  52. TCHAR szDescription[256];
  53. ULONG ulCapabilities;
  54. USHORT usSequenceNumber;
  55. int nAttributes;
  56. BOOL bAttributesLocked;
  57. ABSTRACT_DEVICE_CONTROL_BLOCK eAbstractDevices[MAX_ABSTRACT_DEVICES];
  58. MPEG_ATTRIBUTE_INFO Attributes[NUMBER_OF_ATTRIBUTES];
  59. } MPEG_DEVICE_CONTROL_BLOCK, *PMPEG_DEVICE_CONTROL_BLOCK;
  60. // define the number of the MPEG devices in the system
  61. typedef enum _MPEG_ABSTRACT_DEVICE_INDEX {
  62. MpegCombined,
  63. MpegAudio,
  64. MpegVideo,
  65. MpegOverlay
  66. } MPEG_ABSTRACT_DEVICE_INDEX, *PMPEG_ABSTRACT_DEVICE_INDEX;
  67. #define NONE -1
  68. /**************************************************************************
  69. * internal function prototypes
  70. **************************************************************************/
  71. int
  72. ReadRegistry();
  73. HMPEG_DEVICE
  74. MpegADHandle(
  75. IN USHORT usIndex,
  76. IN MPEG_ABSTRACT_DEVICE_INDEX eIndex
  77. );
  78. LPTSTR
  79. MpegDeviceDescription(
  80. IN USHORT usIndex
  81. );
  82. MPEG_STATUS
  83. CreateMpegHandle(
  84. IN USHORT usIndex,
  85. OUT PHMPEG_DEVICE phDevice
  86. );
  87. MPEG_STATUS
  88. CreateMpegPseudoHandle(
  89. IN USHORT usIndex,
  90. OUT PHMPEG_DEVICE phDevice
  91. );
  92. BOOL
  93. HandleIsValid(
  94. IN HMPEG_DEVICE hDevice,
  95. OUT PUSHORT pusIndex
  96. );
  97. BOOL
  98. PseudoHandleIsValid(
  99. IN HMPEG_DEVICE hDevice,
  100. OUT PUSHORT pusIndex
  101. );
  102. MPEG_STATUS
  103. CloseMpegHandle(
  104. IN USHORT usIndex
  105. );
  106. BOOL
  107. DeviceSupportCap(
  108. IN USHORT usIndex,
  109. IN MPEG_CAPABILITY eCapability
  110. );
  111. BOOL
  112. DeviceSupportStream(
  113. IN USHORT usIndex,
  114. IN MPEG_STREAM_TYPE eStreamType
  115. );
  116. BOOL
  117. DeviceSupportDevice(
  118. IN USHORT usIndex,
  119. IN MPEG_DEVICE_TYPE eDeviceType
  120. );
  121. MPEG_STATUS
  122. GetAttributeRange(
  123. IN USHORT usIndex,
  124. IN MPEG_ATTRIBUTE eAttribute,
  125. OUT PLONG plMinimum,
  126. OUT PLONG plMaximum,
  127. OUT PLONG plStep
  128. );
  129. BOOL
  130. DeviceIoControlSync(
  131. HMPEG_DEVICE hDevice,
  132. DWORD dwIoControlCode,
  133. LPVOID lpInBuffer,
  134. DWORD nInBufferSize,
  135. LPVOID lpOutBuffer,
  136. DWORD nOutBufferSize,
  137. LPDWORD lpBytesReturned
  138. );
  139. MPEG_STATUS
  140. MpegTranslateWin32Error(
  141. DWORD dwWin32Error
  142. );
  143. MPEG_STATUS
  144. SetCurrentChannel(
  145. IN USHORT usIndex,
  146. IN MPEG_DEVICE_TYPE eDeviceType,
  147. IN INT nChannel
  148. );
  149. MPEG_STATUS
  150. GetCurrentChannel(
  151. IN USHORT usIndex,
  152. IN MPEG_DEVICE_TYPE eDeviceType,
  153. OUT LPINT nChannel
  154. );
  155. MPEG_STATUS
  156. SetCurrentAttributeValue(
  157. IN USHORT usIndex,
  158. IN MPEG_DEVICE_TYPE eDeviceType,
  159. IN MPEG_ATTRIBUTE eAttribute,
  160. IN LONG lValue
  161. );
  162. MPEG_STATUS
  163. UpdateAttributes(
  164. IN USHORT usIndex,
  165. IN MPEG_DEVICE_TYPE eDeviceType
  166. );
  167. #endif