]> git.sesse.net Git - vlc/blob - plugins/mga/vout_mga.h
Removed flooding debug info :)
[vlc] / plugins / mga / vout_mga.h
1 /*****************************************************************************
2  * vout_mga.h: MGA video output display method headers
3  *****************************************************************************
4  * Copyright (C) 1999 Aaron Holtzman
5  * Copyright (C) 2000 VideoLAN
6  *
7  * Authors:
8  *
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.
13  * 
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.
18  *
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  *****************************************************************************/
23
24 #ifndef __LINUX_MGAVID_H
25 #define __LINUX_MGAVID_H
26
27 typedef struct mga_vid_config_s
28 {
29     u32     card_type;
30     u32     ram_size;
31     u32     src_width;
32     u32     src_height;
33     u32     dest_width;
34     u32     dest_height;
35     u32     x_org;
36     u32     y_org;
37     u8      colkey_on;
38     u8      colkey_red;
39     u8      colkey_green;
40     u8      colkey_blue;
41 } mga_vid_config_t;
42
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)
46
47 #define MGA_G200 0x1234
48 #define MGA_G400 0x5678
49
50 #endif
51
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
61 {
62     /* User settings */
63     boolean_t           b_shm;               /* shared memory extension flag */
64
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) */
73
74     /* Display buffers and shared memory information */
75     XImage *            p_ximage[2];                       /* XImage pointer */
76     XShmSegmentInfo     shm_info[2];       /* shared memory zone information */
77
78     /* MGA specific variables */
79     int                 i_fd;
80     int                 i_size;
81     mga_vid_config_t *  p_mga;
82     byte_t *            p_mga_vid_base;
83     boolean_t           b_g400;
84
85 } vout_sys_t;
86
87 /*****************************************************************************
88  * Local prototypes
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 );
100