31 #include <X11/extensions/Xv.h>
32 #include <X11/extensions/XShm.h>
33 #include <X11/extensions/Xvlib.h>
61 unsigned int num_adaptors;
63 XvImageFormatValues *fv;
64 int num_formats = 0, j;
97 if (XvQueryAdaptors(xv->
display, DefaultRootWindow(xv->
display), &num_adaptors, &ai) != Success)
103 "Unsupported pixel format '%s', only yuv420p is currently supported\n",
111 for (j = 0; j < num_formats; j++) {
112 if (fv[j].
id ==
MKTAG(
'I',
'4',
'2',
'0')) {
118 if (j >= num_formats) {
120 "Device does not support pixel format yuv420p, aborting\n");
128 MKTAG(
'I',
'4',
'2',
'0'), 0,
147 XWindowAttributes window_attrs;
155 for (y = 0; y < img->height; y++) {
156 memcpy(&img->data[img->offsets[0] + (y * img->pitches[0])],
160 for (y = 0; y < h; ++
y) {
161 memcpy(&img->data[img->offsets[1] + (y * img->pitches[1])],
163 memcpy(&img->data[img->offsets[2] + (y * img->pitches[2])],
167 XGetWindowAttributes(xv->
display, xv->
window, &window_attrs);
170 window_attrs.width, window_attrs.height, True) != Success) {
188 #define OFFSET(x) offsetof(XVContext, x)
216 .priv_class = &xv_class,