PageRenderTime 68ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/libXv-1.0.7/include/X11/extensions/Xvlib.h

#
C++ Header | 382 lines | 287 code | 43 blank | 52 comment | 0 complexity | c3a69357c022a51a16742e8a3cdf0b61 MD5 | raw file
  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. #ifndef XVLIB_H
  21. #define XVLIB_H
  22. /*
  23. ** File:
  24. **
  25. ** Xvlib.h --- Xv library public header file
  26. **
  27. ** Author:
  28. **
  29. ** David Carver (Digital Workstation Engineering/Project Athena)
  30. **
  31. ** Revisions:
  32. **
  33. ** 26.06.91 Carver
  34. ** - changed XvFreeAdaptors to XvFreeAdaptorInfo
  35. ** - changed XvFreeEncodings to XvFreeEncodingInfo
  36. **
  37. ** 11.06.91 Carver
  38. ** - changed SetPortControl to SetPortAttribute
  39. ** - changed GetPortControl to GetPortAttribute
  40. ** - changed QueryBestSize
  41. **
  42. ** 05.15.91 Carver
  43. ** - version 2.0 upgrade
  44. **
  45. ** 01.24.91 Carver
  46. ** - version 1.4 upgrade
  47. **
  48. */
  49. #include <X11/Xfuncproto.h>
  50. #include <X11/extensions/Xv.h>
  51. #include <X11/extensions/XShm.h>
  52. typedef struct {
  53. int numerator;
  54. int denominator;
  55. } XvRational;
  56. typedef struct {
  57. int flags; /* XvGettable, XvSettable */
  58. int min_value;
  59. int max_value;
  60. char *name;
  61. } XvAttribute;
  62. typedef struct {
  63. XvEncodingID encoding_id;
  64. char *name;
  65. unsigned long width;
  66. unsigned long height;
  67. XvRational rate;
  68. unsigned long num_encodings;
  69. } XvEncodingInfo;
  70. typedef struct {
  71. char depth;
  72. unsigned long visual_id;
  73. } XvFormat;
  74. typedef struct {
  75. XvPortID base_id;
  76. unsigned long num_ports;
  77. char type;
  78. char *name;
  79. unsigned long num_formats;
  80. XvFormat *formats;
  81. unsigned long num_adaptors;
  82. } XvAdaptorInfo;
  83. typedef struct {
  84. int type;
  85. unsigned long serial; /* # of last request processed by server */
  86. Bool send_event; /* true if this came from a SendEvent request */
  87. Display *display; /* Display the event was read from */
  88. Drawable drawable; /* drawable */
  89. unsigned long reason; /* what generated this event */
  90. XvPortID port_id; /* what port */
  91. Time time; /* milliseconds */
  92. } XvVideoNotifyEvent;
  93. typedef struct {
  94. int type;
  95. unsigned long serial; /* # of last request processed by server */
  96. Bool send_event; /* true if this came from a SendEvent request */
  97. Display *display; /* Display the event was read from */
  98. XvPortID port_id; /* what port */
  99. Time time; /* milliseconds */
  100. Atom attribute; /* atom that identifies attribute */
  101. long value; /* value of attribute */
  102. } XvPortNotifyEvent;
  103. typedef union {
  104. int type;
  105. XvVideoNotifyEvent xvvideo;
  106. XvPortNotifyEvent xvport;
  107. long pad[24];
  108. } XvEvent;
  109. typedef struct {
  110. int id; /* Unique descriptor for the format */
  111. int type; /* XvRGB, XvYUV */
  112. int byte_order; /* LSBFirst, MSBFirst */
  113. char guid[16]; /* Globally Unique IDentifier */
  114. int bits_per_pixel;
  115. int format; /* XvPacked, XvPlanar */
  116. int num_planes;
  117. /* for RGB formats only */
  118. int depth;
  119. unsigned int red_mask;
  120. unsigned int green_mask;
  121. unsigned int blue_mask;
  122. /* for YUV formats only */
  123. unsigned int y_sample_bits;
  124. unsigned int u_sample_bits;
  125. unsigned int v_sample_bits;
  126. unsigned int horz_y_period;
  127. unsigned int horz_u_period;
  128. unsigned int horz_v_period;
  129. unsigned int vert_y_period;
  130. unsigned int vert_u_period;
  131. unsigned int vert_v_period;
  132. char component_order[32]; /* eg. UYVY */
  133. int scanline_order; /* XvTopToBottom, XvBottomToTop */
  134. } XvImageFormatValues;
  135. typedef struct {
  136. int id;
  137. int width, height;
  138. int data_size; /* bytes */
  139. int num_planes;
  140. int *pitches; /* bytes */
  141. int *offsets; /* bytes */
  142. char *data;
  143. XPointer obdata;
  144. } XvImage;
  145. _XFUNCPROTOBEGIN
  146. extern int XvQueryExtension(
  147. Display* /* display */,
  148. unsigned int* /* p_version */,
  149. unsigned int* /* p_revision */,
  150. unsigned int* /* p_requestBase */,
  151. unsigned int* /* p_eventBase */,
  152. unsigned int* /* p_errorBase */
  153. );
  154. extern int XvQueryAdaptors(
  155. Display* /* display */,
  156. Window /* window */,
  157. unsigned int* /* p_nAdaptors */,
  158. XvAdaptorInfo** /* p_pAdaptors */
  159. );
  160. extern int XvQueryEncodings(
  161. Display* /* display */,
  162. XvPortID /* port */,
  163. unsigned int* /* p_nEncoding */,
  164. XvEncodingInfo** /* p_pEncoding */
  165. );
  166. extern int XvPutVideo(
  167. Display* /* display */,
  168. XvPortID /* port */,
  169. Drawable /* d */,
  170. GC /* gc */,
  171. int /* vx */,
  172. int /* vy */,
  173. unsigned int /* vw */,
  174. unsigned int /* vh */,
  175. int /* dx */,
  176. int /* dy */,
  177. unsigned int /* dw */,
  178. unsigned int /* dh */
  179. );
  180. extern int XvPutStill(
  181. Display* /* display */,
  182. XvPortID /* port */,
  183. Drawable /* d */,
  184. GC /* gc */,
  185. int /* vx */,
  186. int /* vy */,
  187. unsigned int /* vw */,
  188. unsigned int /* vh */,
  189. int /* dx */,
  190. int /* dy */,
  191. unsigned int /* dw */,
  192. unsigned int /* dh */
  193. );
  194. extern int XvGetVideo(
  195. Display* /* display */,
  196. XvPortID /* port */,
  197. Drawable /* d */,
  198. GC /* gc */,
  199. int /* vx */,
  200. int /* vy */,
  201. unsigned int /* vw */,
  202. unsigned int /* vh */,
  203. int /* dx */,
  204. int /* dy */,
  205. unsigned int /* dw */,
  206. unsigned int /* dh */
  207. );
  208. extern int XvGetStill(
  209. Display* /* display */,
  210. XvPortID /* port */,
  211. Drawable /* d */,
  212. GC /* gc */,
  213. int /* vx */,
  214. int /* vy */,
  215. unsigned int /* vw */,
  216. unsigned int /* vh */,
  217. int /* dx */,
  218. int /* dy */,
  219. unsigned int /* dw */,
  220. unsigned int /* dh */
  221. );
  222. extern int XvStopVideo(
  223. Display* /* display */,
  224. XvPortID /* port */,
  225. Drawable /* drawable */
  226. );
  227. extern int XvGrabPort(
  228. Display* /* display */,
  229. XvPortID /* port */,
  230. Time /* time */
  231. );
  232. extern int XvUngrabPort(
  233. Display* /* display */,
  234. XvPortID /* port */,
  235. Time /* time */
  236. );
  237. extern int XvSelectVideoNotify(
  238. Display* /* display */,
  239. Drawable /* drawable */,
  240. Bool /* onoff */
  241. );
  242. extern int XvSelectPortNotify(
  243. Display* /* display */,
  244. XvPortID /* port */,
  245. Bool /* onoff */
  246. );
  247. extern int XvSetPortAttribute(
  248. Display* /* display */,
  249. XvPortID /* port */,
  250. Atom /* attribute */,
  251. int /* value */
  252. );
  253. extern int XvGetPortAttribute(
  254. Display* /* display */,
  255. XvPortID /* port */,
  256. Atom /* attribute */,
  257. int* /* p_value */
  258. );
  259. extern int XvQueryBestSize(
  260. Display* /* display */,
  261. XvPortID /* port */,
  262. Bool /* motion */,
  263. unsigned int /* vid_w */,
  264. unsigned int /* vid_h */,
  265. unsigned int /* drw_w */,
  266. unsigned int /* drw_h */,
  267. unsigned int* /* p_actual_width */,
  268. unsigned int* /* p_actual_width */
  269. );
  270. extern XvAttribute* XvQueryPortAttributes(
  271. Display* /* display */,
  272. XvPortID /* port */,
  273. int* /* number */
  274. );
  275. extern void XvFreeAdaptorInfo(
  276. XvAdaptorInfo* /* adaptors */
  277. );
  278. extern void XvFreeEncodingInfo(
  279. XvEncodingInfo* /* encodings */
  280. );
  281. extern XvImageFormatValues * XvListImageFormats (
  282. Display *display,
  283. XvPortID port_id,
  284. int *count_return
  285. );
  286. extern XvImage * XvCreateImage (
  287. Display *display,
  288. XvPortID port,
  289. int id,
  290. char *data,
  291. int width,
  292. int height
  293. );
  294. extern int XvPutImage (
  295. Display *display,
  296. XvPortID id,
  297. Drawable d,
  298. GC gc,
  299. XvImage *image,
  300. int src_x,
  301. int src_y,
  302. unsigned int src_w,
  303. unsigned int src_h,
  304. int dest_x,
  305. int dest_y,
  306. unsigned int dest_w,
  307. unsigned int dest_h
  308. );
  309. extern int XvShmPutImage (
  310. Display *display,
  311. XvPortID id,
  312. Drawable d,
  313. GC gc,
  314. XvImage *image,
  315. int src_x,
  316. int src_y,
  317. unsigned int src_w,
  318. unsigned int src_h,
  319. int dest_x,
  320. int dest_y,
  321. unsigned int dest_w,
  322. unsigned int dest_h,
  323. Bool send_event
  324. );
  325. extern XvImage * XvShmCreateImage (
  326. Display *display,
  327. XvPortID port,
  328. int id,
  329. char* data,
  330. int width,
  331. int height,
  332. XShmSegmentInfo *shminfo
  333. );
  334. _XFUNCPROTOEND
  335. #endif /* XVLIB_H */