1 /*****************************************************************************
2 * vout_mga.h: MGA video output display method headers
3 *****************************************************************************
4 * Copyright (C) 1999 Aaron Holtzman
5 * Copyright (C) 2000 VideoLAN
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Boston, MA 02111-1307, USA.
22 *****************************************************************************/
24 #ifndef __LINUX_MGAVID_H
25 #define __LINUX_MGAVID_H
27 typedef struct mga_vid_config_s
43 #define MGA_VID_CONFIG _IOR('J', 1, mga_vid_config_t)
44 #define MGA_VID_ON _IO ('J', 2)
45 #define MGA_VID_OFF _IO ('J', 3)
47 #define MGA_G200 0x1234
48 #define MGA_G400 0x5678
52 /*****************************************************************************
53 * vout_sys_t: video output X11 method descriptor
54 *****************************************************************************
55 * This structure is part of the video output thread descriptor.
56 * It describes the X11 specific properties of an output thread. X11 video
57 * output is performed through regular resizable windows. Windows can be
58 * dynamically resized to adapt to the size of the streams.
59 *****************************************************************************/
60 typedef struct vout_sys_s
63 boolean_t b_shm; /* shared memory extension flag */
65 /* Internal settings and properties */
66 Display * p_display; /* display pointer */
67 Visual * p_visual; /* visual pointer */
68 int i_screen; /* screen number */
69 Window root_window; /* root window */
70 Window window; /* window instance handler */
71 GC gc; /* graphic context instance handler */
72 Colormap colormap; /* colormap used (8bpp only) */
74 /* Display buffers and shared memory information */
75 XImage * p_ximage[2]; /* XImage pointer */
76 XShmSegmentInfo shm_info[2]; /* shared memory zone information */
78 /* MGA specific variables */
81 mga_vid_config_t * p_mga;
82 byte_t * p_mga_vid_base;
87 /*****************************************************************************
89 *****************************************************************************/
90 static int X11OpenDisplay ( vout_thread_t *p_vout, char *psz_display, Window root_window );
91 static void X11CloseDisplay ( vout_thread_t *p_vout );
92 static int X11CreateWindow ( vout_thread_t *p_vout );
93 static void X11DestroyWindow ( vout_thread_t *p_vout );
94 static int X11CreateImage ( vout_thread_t *p_vout, XImage **pp_ximage );
95 static void X11DestroyImage ( XImage *p_ximage );
96 static int X11CreateShmImage ( vout_thread_t *p_vout, XImage **pp_ximage,
97 XShmSegmentInfo *p_shm_info );
98 static void X11DestroyShmImage ( vout_thread_t *p_vout, XImage *p_ximage,
99 XShmSegmentInfo *p_shm_info );