• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/minidlna/ffmpeg-2.3.4/libavdevice/

Lines Matching defs:xv

90     XVContext *xv = s->priv_data;
91 if (xv->display) {
92 XShmDetach(xv->display, &xv->yuv_shminfo);
93 if (xv->yuv_image)
94 shmdt(xv->yuv_image->data);
95 XFree(xv->yuv_image);
96 if (xv->gc)
97 XFreeGC(xv->display, xv->gc);
98 XCloseDisplay(xv->display);
105 XVContext *xv = s->priv_data;
127 xv->image_format = encctx->pix_fmt;
129 xv->display = XOpenDisplay(xv->display_name);
130 if (!xv->display) {
131 av_log(s, AV_LOG_ERROR, "Could not open the X11 display '%s'\n", xv->display_name);
135 xv->image_width = encctx->width;
136 xv->image_height = encctx->height;
137 if (!xv->window_width && !xv->window_height) {
139 xv->window_width = encctx->width;
140 xv->window_height = encctx->height;
143 xv->window_width = av_rescale(xv->window_width, sar.num, sar.den);
145 xv->window_height = av_rescale(xv->window_height, sar.den, sar.num);
148 if (!xv->window_id) {
149 xv->window = XCreateSimpleWindow(xv->display, DefaultRootWindow(xv->display),
150 xv->window_x, xv->window_y,
151 xv->window_width, xv->window_height,
153 if (!xv->window_title) {
154 if (!(xv->window_title = av_strdup(s->filename))) {
159 XStoreName(xv->display, xv->window, xv->window_title);
160 xv->wm_delete_message = XInternAtom(xv->display, "WM_DELETE_WINDOW", False);
161 XSetWMProtocols(xv->display, xv->window, &xv->wm_delete_message, 1);
162 XMapWindow(xv->display, xv->window);
164 xv->window = xv->window_id;
166 if (XvQueryAdaptors(xv->display, DefaultRootWindow(xv->display), &num_adaptors, &ai) != Success) {
174 xv->xv_port = ai[0].base_id;
177 fv = XvListImageFormats(xv->display, xv->xv_port, &num_formats);
197 xv->gc = XCreateGC(xv->display, xv->window, 0, 0);
198 xv->image_width = encctx->width;
199 xv->image_height = encctx->height;
200 xv->yuv_image = XvShmCreateImage(xv->display, xv->xv_port, tag, 0,
201 xv->image_width, xv->image_height, &xv->yuv_shminfo);
202 xv->yuv_shminfo.shmid = shmget(IPC_PRIVATE, xv->yuv_image->data_size,
204 xv->yuv_shminfo.shmaddr = (char *)shmat(xv->yuv_shminfo.shmid, 0, 0);
205 xv->yuv_image->data = xv->yuv_shminfo.shmaddr;
206 xv->yuv_shminfo.readOnly = False;
208 XShmAttach(xv->display, &xv->yuv_shminfo);
209 XSync(xv->display, False);
210 shmctl(xv->yuv_shminfo.shmid, IPC_RMID, 0);
212 XGetWindowAttributes(xv->display, xv->window, &window_attrs);
215 XAllocColor(xv->display, window_attrs.colormap, &fgcolor);
216 XSetForeground(xv->display, xv->gc, fgcolor.pixel);
218 xv->window_width = xv->window_height = 0;
228 XVContext *xv = s->priv_data;
239 if (av_cmp_q(dar, (AVRational){ xv->dest_w, xv->dest_h }) > 0) {
241 xv->dest_y = xv->dest_h;
242 xv->dest_x = 0;
243 xv->dest_h = av_rescale(xv->dest_w, dar.den, dar.num);
244 xv->dest_y -= xv->dest_h;
245 xv->dest_y /= 2;
248 xv->dest_x = xv->dest_w;
249 xv->dest_y = 0;
250 xv->dest_w = av_rescale(xv->dest_h, dar.num, dar.den);
251 xv->dest_x -= xv->dest_w;
252 xv->dest_x /= 2;
258 XVContext *xv = s->priv_data;
261 XGetWindowAttributes(xv->display, xv->window, &window_attrs);
262 if (window_attrs.width != xv->window_width || window_attrs.height != xv->window_height) {
264 xv->dest_w = window_attrs.width;
265 xv->dest_h = window_attrs.height;
267 if (xv->dest_x) {
268 rect[0].width = rect[1].width = xv->dest_x;
272 rect[1].x = xv->dest_w + xv->dest_x;
273 XFillRectangles(xv->display, xv->window, xv->gc, rect, 2);
275 if (xv->dest_y) {
277 rect[0].height = rect[1].height = xv->dest_y;
280 rect[1].y = xv->dest_h + xv->dest_y;
281 XFillRectangles(xv->display, xv->window, xv->gc, rect, 2);
285 if (XvShmPutImage(xv->display, xv->xv_port, xv->window, xv->gc,
286 xv->yuv_image, 0, 0, xv->image_width, xv->image_height,
287 xv->dest_x, xv->dest_y, xv->dest_w, xv->dest_h, True) != Success) {
296 XVContext *xv = s->priv_data;
297 XvImage *img = xv->yuv_image;
305 if (!xv->window_id) {
307 while (XPending(xv->display)) {
308 XNextEvent(xv->display, &event);
309 if (event.type == ClientMessage && event.xclient.data.l[0] == xv->wm_delete_message) {
310 av_log(xv, AV_LOG_DEBUG, "Window close event.\n");
317 xv->image_format, img->width, img->height);
371 .name = "xv",