comparison libvo/vo_xv.c @ 1186:beb0ee0f3a25

Xv port locking patch by Artur Zaprzala <artur.zaprzala@talex.com.pl>
author arpi_esp
date Thu, 21 Jun 2001 22:36:02 +0000
parents 4c7b219e126c
children f1f35276f635
comparison
equal deleted inserted replaced
1185:e21c96e28062 1186:beb0ee0f3a25
99 char *hello = (title == NULL) ? "Xv render" : title; 99 char *hello = (title == NULL) ? "Xv render" : title;
100 // char *name = ":0.0"; 100 // char *name = ":0.0";
101 XSizeHints hint; 101 XSizeHints hint;
102 XVisualInfo vinfo; 102 XVisualInfo vinfo;
103 XEvent xev; 103 XEvent xev;
104 XvPortID xv_p;
104 105
105 XGCValues xgcv; 106 XGCValues xgcv;
106 XSetWindowAttributes xswa; 107 XSetWindowAttributes xswa;
107 unsigned long xswamask; 108 unsigned long xswamask;
108 109
175 { 176 {
176 printf("Xv: XvQueryAdaptors failed"); 177 printf("Xv: XvQueryAdaptors failed");
177 return -1; 178 return -1;
178 } 179 }
179 /* check adaptors */ 180 /* check adaptors */
180 for (i = 0; i < adaptors; i++) 181 for (i = 0; i < adaptors && xv_port == 0; i++)
181 { 182 {
182 if ((ai[i].type & XvInputMask) && (ai[i].type & XvImageMask) && (xv_port == 0)) xv_port = ai[i].base_id; 183 if ((ai[i].type & XvInputMask) && (ai[i].type & XvImageMask))
184 for (xv_p = ai[i].base_id; xv_p < ai[i].base_id+ai[i].num_ports; ++xv_p)
185 if (!XvGrabPort(mDisplay, xv_p, CurrentTime)) {
186 xv_port = xv_p;
187 break;
188 } else {
189 printf("Xv: could not grab port %i\n", (int)xv_p);
190 }
183 } 191 }
184 /* check image formats */ 192 /* check image formats */
185 if (xv_port != 0) 193 if (xv_port != 0)
186 { 194 {
187 fo = XvListImageFormats(mDisplay, xv_port, (int*)&formats); 195 fo = XvListImageFormats(mDisplay, xv_port, (int*)&formats);