xvlib.pp 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. {***********************************************************
  2. Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
  3. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  4. All Rights Reserved
  5. Permission to use, copy, modify, and distribute this software and its
  6. documentation for any purpose and without fee is hereby granted,
  7. provided that the above copyright notice appear in all copies and that
  8. both that copyright notice and this permission notice appear in
  9. supporting documentation, and that the names of Digital or MIT not be
  10. used in advertising or publicity pertaining to distribution of the
  11. software without specific, written prior permission.
  12. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  13. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  14. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  15. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  16. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  17. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  18. SOFTWARE.
  19. ******************************************************************}
  20. { $XFree86: xc/include/extensions/Xvlib.h,v 1.3 1999/12/11 19:28:48 mvojkovi Exp $ }
  21. {*
  22. ** File:
  23. **
  24. ** Xvlib.h --- Xv library public header file
  25. **
  26. ** Author:
  27. **
  28. ** David Carver (Digital Workstation Engineering/Project Athena)
  29. **
  30. ** Revisions:
  31. **
  32. ** 26.06.91 Carver
  33. ** - changed XvFreeAdaptors to XvFreeAdaptorInfo
  34. ** - changed XvFreeEncodings to XvFreeEncodingInfo
  35. **
  36. ** 11.06.91 Carver
  37. ** - changed SetPortControl to SetPortAttribute
  38. ** - changed GetPortControl to GetPortAttribute
  39. ** - changed QueryBestSize
  40. **
  41. ** 05.15.91 Carver
  42. ** - version 2.0 upgrade
  43. **
  44. ** 01.24.91 Carver
  45. ** - version 1.4 upgrade
  46. **
  47. *}
  48. unit xvlib;
  49. interface
  50. uses
  51. ctypes, x, xlib, xshm, xv;
  52. {$PACKRECORDS c}
  53. const
  54. libXv='Xv';
  55. type
  56. PXvRational = ^TXvRational;
  57. TXvRational = record
  58. numerator : cint;
  59. denominator : cint;
  60. end;
  61. PXvAttribute = ^TXvAttribute;
  62. TXvAttribute = record
  63. flags : cint; { XvGettable, XvSettable }
  64. min_value : cint;
  65. max_value : cint;
  66. name : pchar;
  67. end;
  68. PPXvEncodingInfo = ^PXvEncodingInfo;
  69. PXvEncodingInfo = ^TXvEncodingInfo;
  70. TXvEncodingInfo = record
  71. encoding_id : TXvEncodingID;
  72. name : pchar;
  73. width : culong;
  74. height : culong;
  75. rate : TXvRational;
  76. num_encodings : culong;
  77. end;
  78. PXvFormat = ^TXvFormat;
  79. TXvFormat = record
  80. depth : cchar;
  81. visual_id : culong;
  82. end;
  83. PPXvAdaptorInfo = ^PXvAdaptorInfo;
  84. PXvAdaptorInfo = ^TXvAdaptorInfo;
  85. TXvAdaptorInfo = record
  86. base_id : TXvPortID;
  87. num_ports : culong;
  88. _type : cchar;
  89. name : pchar;
  90. num_formats : culong;
  91. formats : PXvFormat;
  92. num_adaptors : culong;
  93. end;
  94. PXvVideoNotifyEvent = ^TXvVideoNotifyEvent;
  95. TXvVideoNotifyEvent = record
  96. _type : cint;
  97. serial : culong; { # of last request processed by server }
  98. send_event : TBool; { true if this came from a SendEvent request }
  99. display : PDisplay; { Display the event was read from }
  100. drawable : TDrawable; { drawable }
  101. reason : culong; { what generated this event }
  102. port_id : TXvPortID; { what port }
  103. time : TTime; { milliseconds }
  104. end;
  105. PXvPortNotifyEvent = ^TXvPortNotifyEvent;
  106. TXvPortNotifyEvent = record
  107. _type : cint;
  108. serial : culong; { # of last request processed by server }
  109. send_event : TBool; { true if this came from a SendEvent request }
  110. display : PDisplay; { Display the event was read from }
  111. port_id : TXvPortID; { what port }
  112. time : TTime; { milliseconds }
  113. attribute : TAtom; { atom that identifies attribute }
  114. value : clong; { value of attribute }
  115. end;
  116. PXvEvent = ^TXvEvent;
  117. TXvEvent = record
  118. case longint of
  119. 0 : (
  120. _type : cint;
  121. );
  122. 1 : (
  123. xvvideo : TXvVideoNotifyEvent;
  124. );
  125. 2 : (
  126. xvport : TXvPortNotifyEvent;
  127. );
  128. 3 : (
  129. pad : array[0..23] of clong;
  130. );
  131. end;
  132. PXvImageFormatValues = ^TXvImageFormatValues;
  133. TXvImageFormatValues = record
  134. id : cint; { Unique descriptor for the format }
  135. _type : cint; { XvRGB, XvYUV }
  136. byte_order : cint; { LSBFirst, MSBFirst }
  137. guid : array[0..15] of cchar; { Globally Unique IDentifier }
  138. bits_per_pixel : cint;
  139. format : cint; { XvPacked, XvPlanar }
  140. num_planes : cint;
  141. { for RGB formats only }
  142. depth : cint;
  143. red_mask : cuint;
  144. green_mask : cuint;
  145. blue_mask : cuint;
  146. { for YUV formats only }
  147. y_sample_bits : cuint;
  148. u_sample_bits : cuint;
  149. v_sample_bits : cuint;
  150. horz_y_period : cuint;
  151. horz_u_period : cuint;
  152. horz_v_period : cuint;
  153. vert_y_period : cuint;
  154. vert_u_period : cuint;
  155. vert_v_period : cuint;
  156. component_order : array[0..31] of char; { eg. UYVY }
  157. scanline_order : cint; { XvTopToBottom, XvBottomToTop }
  158. end;
  159. PXvImage = ^TXvImage;
  160. TXvImage = record
  161. id : cint;
  162. width, height : cint;
  163. data_size : cint; { bytes }
  164. num_planes : cint;
  165. pitches : pcint; { bytes }
  166. offsets : pcint; { bytes }
  167. data : pcchar;
  168. obdata : TXPointer;
  169. end;
  170. function XvQueryExtension(
  171. display : PDisplay;
  172. p_version,
  173. p_revision,
  174. p_requestBase,
  175. p_eventBase,
  176. p_errorBase : pcuint
  177. ) : cint; cdecl; external libXv;
  178. function XvQueryAdaptors(
  179. display : PDisplay;
  180. window : TWindow;
  181. p_nAdaptors : pcuint;
  182. p_pAdaptors : PPXvAdaptorInfo
  183. ) : cint; cdecl; external libXv;
  184. function XvQueryEncodings(
  185. display : PDisplay;
  186. port : TXvPortID;
  187. p_nEncoding : pcuint;
  188. p_pEncoding : PPXvEncodingInfo
  189. ) : cint; cdecl; external libXv;
  190. function XvPutVideo(
  191. display : PDisplay;
  192. port : TXvPortID;
  193. d : TDrawable;
  194. gc : TGC;
  195. vx,
  196. vy : cint;
  197. vw,
  198. vh : cuint;
  199. dx,
  200. dy : cint;
  201. dw,
  202. dh : cuint
  203. ) : cint; cdecl; external libXv;
  204. function XvPutStill(
  205. display : PDisplay;
  206. port : TXvPortID;
  207. d : TDrawable;
  208. gc : TGC;
  209. vx,
  210. vy : cint;
  211. vw,
  212. vh : cuint;
  213. dx,
  214. dy : cint;
  215. dw,
  216. dh : cuint
  217. ) : cint; cdecl; external libXv;
  218. function XvGetVideo(
  219. display : PDisplay;
  220. port : TXvPortID;
  221. d : TDrawable;
  222. gc : TGC;
  223. vx,
  224. vy : cint;
  225. vw,
  226. vh : cuint;
  227. dx,
  228. dy : cint;
  229. dw,
  230. dh : cuint
  231. ) : cint; cdecl; external libXv;
  232. function XvGetStill(
  233. display : PDisplay;
  234. port : TXvPortID;
  235. d : TDrawable;
  236. gc : TGC;
  237. vx,
  238. vy : cint;
  239. vw,
  240. vh : cuint;
  241. dx,
  242. dy : cint;
  243. dw,
  244. dh : cuint
  245. ) : cint; cdecl; external libXv;
  246. function XvStopVideo(
  247. display : PDisplay;
  248. port : TXvPortID;
  249. drawable : TDrawable
  250. ) : cint; cdecl; external libXv;
  251. function XvGrabPort(
  252. display : PDisplay;
  253. port : TXvPortID;
  254. time : TTime
  255. ) : cint; cdecl; external libXv;
  256. function XvUngrabPort(
  257. display : PDisplay;
  258. port : TXvPortID;
  259. time : TTime
  260. ) : cint; cdecl; external libXv;
  261. function XvSelectVideoNotify(
  262. display : PDisplay;
  263. drawable : TDrawable;
  264. onoff : TBool
  265. ) : cint; cdecl; external libXv;
  266. function XvSelectPortNotify(
  267. display : PDisplay;
  268. port : TXvPortID;
  269. onoff : TBool
  270. ) : cint; cdecl; external libXv;
  271. function XvSetPortAttribute(
  272. display : PDisplay;
  273. port : TXvPortID;
  274. attribute : TAtom;
  275. value : cint
  276. ) : cint; cdecl; external libXv;
  277. function XvGetPortAttribute(
  278. display : PDisplay;
  279. port : TXvPortID;
  280. attribute : TAtom;
  281. p_value : pcint
  282. ) : cint; cdecl; external libXv;
  283. function XvQueryBestSize(
  284. display : PDisplay;
  285. port : TXvPortID;
  286. motion : TBool;
  287. vid_w,
  288. vid_h,
  289. drw_w,
  290. drw_h : cuint;
  291. p_actual_width,
  292. p_actual_height : pcuint
  293. ) : cint; cdecl; external libXv;
  294. function XvQueryPortAttributes(
  295. display : PDisplay;
  296. port : TXvPortID;
  297. number : pcint
  298. ) : PXvAttribute; cdecl; external libXv;
  299. procedure XvFreeAdaptorInfo(
  300. adaptors : PXvAdaptorInfo
  301. ); cdecl; external libXv;
  302. procedure XvFreeEncodingInfo(
  303. encodings : PXvEncodingInfo
  304. ); cdecl; external libXv;
  305. function XvListImageFormats (
  306. display : PDisplay;
  307. port_id : TXvPortID;
  308. count_return : pcint
  309. ) : PXvImageFormatValues; cdecl; external libXv;
  310. function XvCreateImage (
  311. display : PDisplay;
  312. port : TXvPortID;
  313. id : cint;
  314. data : pcchar;
  315. width,
  316. height : cint
  317. ) : PXvImage; cdecl; external libXv;
  318. function XvPutImage (
  319. display : PDisplay;
  320. id : TXvPortID;
  321. d : TDrawable;
  322. gc : TGC;
  323. image : PXvImage;
  324. src_x,
  325. src_y : cint;
  326. src_w,
  327. src_h : cuint;
  328. dest_x,
  329. dest_y : cint;
  330. dest_w,
  331. dest_h : cuint
  332. ) : cint; cdecl; external libXv;
  333. function XvShmPutImage (
  334. display : PDisplay;
  335. id : TXvPortID;
  336. d : TDrawable;
  337. gc : TGC;
  338. image : PXvImage;
  339. src_x,
  340. src_y : cint;
  341. src_w,
  342. src_h : cuint;
  343. dest_x,
  344. dest_y : cint;
  345. dest_w,
  346. dest_h : cuint;
  347. send_event : TBool
  348. ) : cint; cdecl; external libXv;
  349. function XvShmCreateImage(
  350. display : PDisplay;
  351. port : TXvPortID;
  352. id : cint;
  353. data : pcchar;
  354. width,
  355. height : cint;
  356. shminfo : PXShmSegmentInfo
  357. ) : PXvImage; cdecl; external libXv;
  358. implementation
  359. end.