Lines Matching refs:xcontext
207 XSetForeground (ximagesink->xcontext->disp, xwindow->gc, in gst_x_image_sink_xwindow_draw_borders()
208 ximagesink->xcontext->black); in gst_x_image_sink_xwindow_draw_borders()
212 XFillRectangle (ximagesink->xcontext->disp, xwindow->win, xwindow->gc, in gst_x_image_sink_xwindow_draw_borders()
218 XFillRectangle (ximagesink->xcontext->disp, xwindow->win, xwindow->gc, in gst_x_image_sink_xwindow_draw_borders()
224 XFillRectangle (ximagesink->xcontext->disp, xwindow->win, xwindow->gc, in gst_x_image_sink_xwindow_draw_borders()
230 XFillRectangle (ximagesink->xcontext->disp, xwindow->win, xwindow->gc, in gst_x_image_sink_xwindow_draw_borders()
311 if (ximagesink->xcontext->use_xshm) { in gst_x_image_sink_ximage_put()
316 XShmPutImage (ximagesink->xcontext->disp, ximagesink->xwindow->win, in gst_x_image_sink_ximage_put()
326 XPutImage (ximagesink->xcontext->disp, ximagesink->xwindow->win, in gst_x_image_sink_ximage_put()
331 XSync (ximagesink->xcontext->disp, FALSE); in gst_x_image_sink_ximage_put()
352 hints_atom = XInternAtom (ximagesink->xcontext->disp, "_MOTIF_WM_HINTS", in gst_x_image_sink_xwindow_decorate()
364 XChangeProperty (ximagesink->xcontext->disp, window->win, in gst_x_image_sink_xwindow_decorate()
368 XSync (ximagesink->xcontext->disp, FALSE); in gst_x_image_sink_xwindow_decorate()
410 XInternAtom (ximagesink->xcontext->disp, "_NET_WM_NAME", 0); in gst_x_image_sink_xwindow_set_title()
412 XInternAtom (ximagesink->xcontext->disp, "UTF8_STRING", 0); in gst_x_image_sink_xwindow_set_title()
413 XChangeProperty (ximagesink->xcontext->disp, xwindow->win, in gst_x_image_sink_xwindow_set_title()
416 XSync (ximagesink->xcontext->disp, False); in gst_x_image_sink_xwindow_set_title()
418 XSetWMName (ximagesink->xcontext->disp, xwindow->win, &xproperty); in gst_x_image_sink_xwindow_set_title()
428 XSetClassHint (ximagesink->xcontext->disp, xwindow->win, hint); in gst_x_image_sink_xwindow_set_title()
453 xwindow->win = XCreateSimpleWindow (ximagesink->xcontext->disp, in gst_x_image_sink_xwindow_new()
454 ximagesink->xcontext->root, in gst_x_image_sink_xwindow_new()
455 0, 0, width, height, 0, 0, ximagesink->xcontext->black); in gst_x_image_sink_xwindow_new()
459 XSetWindowBackgroundPixmap (ximagesink->xcontext->disp, xwindow->win, None); in gst_x_image_sink_xwindow_new()
467 XSelectInput (ximagesink->xcontext->disp, xwindow->win, ExposureMask | in gst_x_image_sink_xwindow_new()
473 wm_delete = XInternAtom (ximagesink->xcontext->disp, in gst_x_image_sink_xwindow_new()
475 (void) XSetWMProtocols (ximagesink->xcontext->disp, xwindow->win, in gst_x_image_sink_xwindow_new()
479 xwindow->gc = XCreateGC (ximagesink->xcontext->disp, xwindow->win, in gst_x_image_sink_xwindow_new()
482 XMapRaised (ximagesink->xcontext->disp, xwindow->win); in gst_x_image_sink_xwindow_new()
484 XSync (ximagesink->xcontext->disp, FALSE); in gst_x_image_sink_xwindow_new()
508 XDestroyWindow (ximagesink->xcontext->disp, xwindow->win); in gst_x_image_sink_xwindow_destroy()
510 XSelectInput (ximagesink->xcontext->disp, xwindow->win, 0); in gst_x_image_sink_xwindow_destroy()
512 XFreeGC (ximagesink->xcontext->disp, xwindow->gc); in gst_x_image_sink_xwindow_destroy()
514 XSync (ximagesink->xcontext->disp, FALSE); in gst_x_image_sink_xwindow_destroy()
536 XGetWindowAttributes (ximagesink->xcontext->disp, in gst_x_image_sink_xwindow_update_geometry()
561 XSetForeground (ximagesink->xcontext->disp, xwindow->gc, in gst_x_image_sink_xwindow_clear()
562 ximagesink->xcontext->black); in gst_x_image_sink_xwindow_clear()
564 XFillRectangle (ximagesink->xcontext->disp, xwindow->win, xwindow->gc, in gst_x_image_sink_xwindow_clear()
567 XSync (ximagesink->xcontext->disp, FALSE); in gst_x_image_sink_xwindow_clear()
589 while (XCheckWindowEvent (ximagesink->xcontext->disp, in gst_x_image_sink_handle_xevents()
621 while (XCheckWindowEvent (ximagesink->xcontext->disp, in gst_x_image_sink_handle_xevents()
652 if (ximagesink->xcontext->use_xkb) { in gst_x_image_sink_handle_xevents()
653 keysym = XkbKeycodeToKeysym (ximagesink->xcontext->disp, in gst_x_image_sink_handle_xevents()
656 keysym = XKeycodeToKeysym (ximagesink->xcontext->disp, in gst_x_image_sink_handle_xevents()
680 while (XCheckWindowEvent (ximagesink->xcontext->disp, in gst_x_image_sink_handle_xevents()
708 while (XPending (ximagesink->xcontext->disp)) { in gst_x_image_sink_handle_xevents()
709 XNextEvent (ximagesink->xcontext->disp, &e); in gst_x_image_sink_handle_xevents()
715 wm_delete = XInternAtom (ximagesink->xcontext->disp, in gst_x_image_sink_handle_xevents()
766 if (ximagesink->xcontext == NULL) { in gst_x_image_sink_manage_event_thread()
802 gst_x_image_sink_calculate_pixel_aspect_ratio (GstXContext * xcontext) in gst_x_image_sink_calculate_pixel_aspect_ratio() argument
822 ratio = (gdouble) (xcontext->widthmm * xcontext->height) in gst_x_image_sink_calculate_pixel_aspect_ratio()
823 / (xcontext->heightmm * xcontext->width); in gst_x_image_sink_calculate_pixel_aspect_ratio()
827 if (xcontext->width == 720 && xcontext->height == 576) { in gst_x_image_sink_calculate_pixel_aspect_ratio()
848 g_free (xcontext->par); in gst_x_image_sink_calculate_pixel_aspect_ratio()
849 xcontext->par = g_new0 (GValue, 1); in gst_x_image_sink_calculate_pixel_aspect_ratio()
850 g_value_init (xcontext->par, GST_TYPE_FRACTION); in gst_x_image_sink_calculate_pixel_aspect_ratio()
851 gst_value_set_fraction (xcontext->par, par[index][0], par[index][1]); in gst_x_image_sink_calculate_pixel_aspect_ratio()
853 gst_value_get_fraction_numerator (xcontext->par), in gst_x_image_sink_calculate_pixel_aspect_ratio()
854 gst_value_get_fraction_denominator (xcontext->par)); in gst_x_image_sink_calculate_pixel_aspect_ratio()
864 GstXContext *xcontext = NULL; in gst_x_image_sink_xcontext_get() local
876 xcontext = g_new0 (GstXContext, 1); in gst_x_image_sink_xcontext_get()
880 xcontext->disp = XOpenDisplay (ximagesink->display_name); in gst_x_image_sink_xcontext_get()
882 if (!xcontext->disp) { in gst_x_image_sink_xcontext_get()
884 g_free (xcontext); in gst_x_image_sink_xcontext_get()
890 xcontext->screen = DefaultScreenOfDisplay (xcontext->disp); in gst_x_image_sink_xcontext_get()
891 xcontext->screen_num = DefaultScreen (xcontext->disp); in gst_x_image_sink_xcontext_get()
892 xcontext->visual = DefaultVisual (xcontext->disp, xcontext->screen_num); in gst_x_image_sink_xcontext_get()
893 xcontext->root = DefaultRootWindow (xcontext->disp); in gst_x_image_sink_xcontext_get()
894 xcontext->white = XWhitePixel (xcontext->disp, xcontext->screen_num); in gst_x_image_sink_xcontext_get()
895 xcontext->black = XBlackPixel (xcontext->disp, xcontext->screen_num); in gst_x_image_sink_xcontext_get()
896 xcontext->depth = DefaultDepthOfScreen (xcontext->screen); in gst_x_image_sink_xcontext_get()
898 xcontext->width = DisplayWidth (xcontext->disp, xcontext->screen_num); in gst_x_image_sink_xcontext_get()
899 xcontext->height = DisplayHeight (xcontext->disp, xcontext->screen_num); in gst_x_image_sink_xcontext_get()
900 xcontext->widthmm = DisplayWidthMM (xcontext->disp, xcontext->screen_num); in gst_x_image_sink_xcontext_get()
901 xcontext->heightmm = DisplayHeightMM (xcontext->disp, xcontext->screen_num); in gst_x_image_sink_xcontext_get()
904 xcontext->width, xcontext->height, xcontext->widthmm, xcontext->heightmm); in gst_x_image_sink_xcontext_get()
906 gst_x_image_sink_calculate_pixel_aspect_ratio (xcontext); in gst_x_image_sink_xcontext_get()
909 px_formats = XListPixmapFormats (xcontext->disp, &nb_formats); in gst_x_image_sink_xcontext_get()
912 XCloseDisplay (xcontext->disp); in gst_x_image_sink_xcontext_get()
914 g_free (xcontext->par); in gst_x_image_sink_xcontext_get()
915 g_free (xcontext); in gst_x_image_sink_xcontext_get()
923 if (px_formats[i].depth == xcontext->depth) in gst_x_image_sink_xcontext_get()
924 xcontext->bpp = px_formats[i].bits_per_pixel; in gst_x_image_sink_xcontext_get()
929 endianness = (ImageByteOrder (xcontext->disp) == in gst_x_image_sink_xcontext_get()
934 if (XShmQueryExtension (xcontext->disp) && in gst_x_image_sink_xcontext_get()
935 gst_x_image_sink_check_xshm_calls (ximagesink, xcontext)) { in gst_x_image_sink_xcontext_get()
936 xcontext->use_xshm = TRUE; in gst_x_image_sink_xcontext_get()
941 xcontext->use_xshm = FALSE; in gst_x_image_sink_xcontext_get()
944 if (XkbQueryExtension (xcontext->disp, &opcode, &event, &err, &major, &minor)) { in gst_x_image_sink_xcontext_get()
945 xcontext->use_xkb = TRUE; in gst_x_image_sink_xcontext_get()
948 xcontext->use_xkb = FALSE; in gst_x_image_sink_xcontext_get()
953 if (xcontext->depth == 32) { in gst_x_image_sink_xcontext_get()
954 alpha_mask = ~(xcontext->visual->red_mask in gst_x_image_sink_xcontext_get()
955 | xcontext->visual->green_mask | xcontext->visual->blue_mask); in gst_x_image_sink_xcontext_get()
961 gst_video_format_from_masks (xcontext->depth, xcontext->bpp, endianness, in gst_x_image_sink_xcontext_get()
962 xcontext->visual->red_mask, xcontext->visual->green_mask, in gst_x_image_sink_xcontext_get()
963 xcontext->visual->blue_mask, alpha_mask); in gst_x_image_sink_xcontext_get()
971 gst_value_init_and_copy (ximagesink->par, xcontext->par); in gst_x_image_sink_xcontext_get()
974 xcontext->caps = gst_caps_new_simple ("video/x-raw", in gst_x_image_sink_xcontext_get()
984 gst_caps_set_simple (xcontext->caps, "pixel-aspect-ratio", in gst_x_image_sink_xcontext_get()
990 return xcontext; in gst_x_image_sink_xcontext_get()
1005 GstXContext *xcontext; in gst_x_image_sink_xcontext_clear() local
1010 if (ximagesink->xcontext == NULL) { in gst_x_image_sink_xcontext_clear()
1018 xcontext = ximagesink->xcontext; in gst_x_image_sink_xcontext_clear()
1019 ximagesink->xcontext = NULL; in gst_x_image_sink_xcontext_clear()
1023 gst_caps_unref (xcontext->caps); in gst_x_image_sink_xcontext_clear()
1024 g_free (xcontext->par); in gst_x_image_sink_xcontext_clear()
1028 if (xcontext->last_caps) in gst_x_image_sink_xcontext_clear()
1029 gst_caps_replace (&xcontext->last_caps, NULL); in gst_x_image_sink_xcontext_clear()
1033 XCloseDisplay (xcontext->disp); in gst_x_image_sink_xcontext_clear()
1037 g_free (xcontext); in gst_x_image_sink_xcontext_clear()
1052 if (ximagesink->xcontext) { in gst_x_image_sink_getcaps()
1055 caps = gst_caps_ref (ximagesink->xcontext->caps); in gst_x_image_sink_getcaps()
1169 if (!ximagesink->xcontext) in gst_x_image_sink_setcaps()
1174 GST_PTR_FORMAT, ximagesink->xcontext->caps, caps); in gst_x_image_sink_setcaps()
1177 if (!gst_caps_can_intersect (ximagesink->xcontext->caps, caps)) in gst_x_image_sink_setcaps()
1192 } else if (ximagesink->xcontext->par) { in gst_x_image_sink_setcaps()
1193 if (gst_value_compare (par, ximagesink->xcontext->par) != GST_VALUE_EQUAL) { in gst_x_image_sink_setcaps()
1274 GstXContext *xcontext = NULL; in gst_x_image_sink_change_state() local
1281 if (ximagesink->xcontext == NULL) { in gst_x_image_sink_change_state()
1282 xcontext = gst_x_image_sink_xcontext_get (ximagesink); in gst_x_image_sink_change_state()
1283 if (xcontext == NULL) { in gst_x_image_sink_change_state()
1288 if (xcontext) in gst_x_image_sink_change_state()
1289 ximagesink->xcontext = xcontext; in gst_x_image_sink_change_state()
1297 XSynchronize (ximagesink->xcontext->disp, ximagesink->synchronous); in gst_x_image_sink_change_state()
1629 if (!ximagesink->xcontext && in gst_x_image_sink_set_window_handle()
1630 !(ximagesink->xcontext = gst_x_image_sink_xcontext_get (ximagesink))) { in gst_x_image_sink_set_window_handle()
1660 XSelectInput (ximagesink->xcontext->disp, xwindow->win, ExposureMask | in gst_x_image_sink_set_window_handle()
1665 xwindow->gc = XCreateGC (ximagesink->xcontext->disp, xwindow->win, 0, NULL); in gst_x_image_sink_set_window_handle()
1706 XSelectInput (ximagesink->xcontext->disp, ximagesink->xwindow->win, in gst_x_image_sink_set_event_handling()
1710 XSelectInput (ximagesink->xcontext->disp, ximagesink->xwindow->win, in gst_x_image_sink_set_event_handling()
1715 XSelectInput (ximagesink->xcontext->disp, ximagesink->xwindow->win, 0); in gst_x_image_sink_set_event_handling()
1753 if (ximagesink->xcontext) { in gst_x_image_sink_set_property()
1757 XSynchronize (ximagesink->xcontext->disp, ximagesink->synchronous); in gst_x_image_sink_set_property()
1914 ximagesink->xcontext = NULL; in gst_x_image_sink_init()