30 #include <X11/extensions/Xv.h>
31 #include <X11/extensions/XShm.h>
32 #include <X11/extensions/Xvlib.h>
81 for (i = 0; m->
tag; m = &tag_codec_map[++i]) {
106 unsigned int num_adaptors;
108 XvImageFormatValues *fv;
110 XWindowAttributes window_attrs;
111 int num_formats = 0, j,
tag,
ret;
123 "Unsupported pixel format '%s', only yuv420p, uyvy422, yuyv422 are currently supported\n",
166 if (XvQueryAdaptors(xv->
display, DefaultRootWindow(xv->
display), &num_adaptors, &ai) != Success) {
175 XvFreeAdaptorInfo(ai);
182 for (j = 0; j < num_formats; j++) {
183 if (fv[j].
id == tag) {
189 if (j >= num_formats) {
191 "Device does not support pixel format %s, aborting\n",
212 XGetWindowAttributes(xv->
display, xv->
window, &window_attrs);
213 fgcolor.red = fgcolor.green = fgcolor.blue = 0;
214 fgcolor.flags = DoRed | DoGreen | DoBlue;
215 XAllocColor(xv->
display, window_attrs.colormap, &fgcolor);
216 XSetForeground(xv->
display, xv->
gc, fgcolor.pixel);
259 XWindowAttributes window_attrs;
261 XGetWindowAttributes(xv->
display, xv->
window, &window_attrs);
264 xv->
dest_w = window_attrs.width;
265 xv->
dest_h = window_attrs.height;
268 rect[0].width = rect[1].width = xv->
dest_x;
269 rect[0].height = rect[1].height = window_attrs.height;
270 rect[0].y = rect[1].y = 0;
276 rect[0].width = rect[1].width = window_attrs.width;
277 rect[0].height = rect[1].height = xv->
dest_y;
278 rect[0].x = rect[1].x = 0;
299 img->data + img->offsets[0],
300 img->data + img->offsets[1],
301 img->data + img->offsets[2]
307 while (XPending(xv->
display)) {
308 XNextEvent(xv->
display, &event);
309 if (event.type == ClientMessage && event.xclient.data.l[0] == xv->
wm_delete_message) {
350 #define OFFSET(x) offsetof(XVContext, x)
382 .priv_class = &xv_class,