]> git.sesse.net Git - ccbs/blob - bigscreen/tinyptc/xvshm.h
Import TinyPTC 0.7.3 sources, switch from OpenGL to TinyPTC for now.
[ccbs] / bigscreen / tinyptc / xvshm.h
1 /*
2  * TinyPTC x11 v0.7.3 XVideo with Shared Memory Extension target
3  * Copyright (C) 2002 Fred Howell <foohoo@shaw.ca>
4  * Copyright (C) 2002 Alessandro Gatti <a.gatti@tiscali.it>
5  *
6  * http://www.sourceforge.net/projects/tinyptc/
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21  *
22  */
23
24 #ifndef __PTC_XVSHM_H
25 #define __PTC_XVSHM_H
26
27 #include <X11/Xlib.h>
28 #include <X11/Xutil.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <limits.h>
32 #include <sys/ipc.h>
33 #include <sys/shm.h>
34 #include <X11/extensions/XShm.h>
35 #include <X11/extensions/Xvlib.h>
36 #include "tinyptc.h"
37
38 #ifdef __PTC_XVSHM__
39
40 #ifdef __TINYPTC_INCLUDED
41 #error You chose more than one target. Please make your mind and try again.
42 #endif /* __TINYPTC_INCLUDED */
43
44 #define __TINYPTC_INCLUDED
45 #define pragma target xvshm
46
47 #ifdef __cplusplus
48         extern "C" {
49 #endif /* __cplusplus */
50
51 int ptc_open (char *title, int width, int height);
52 int ptc_update (void *buffer);
53 void ptc_close (void);
54 int ptc_process_events (void);
55
56 #ifdef __PTC_MMX__
57 void convert_yv12_mmx(void *pin, void *py, void *pu, void *pv, int stride);
58 #else
59 void yuvbuf_init();
60 void convert_yv12_c(void *pin, unsigned char *py, unsigned char *pu, unsigned char *pv, int stride);
61 #endif /* __PTC_MMX__ */
62
63 #ifdef __cplusplus
64         }
65 #endif /* __cplusplus */
66
67 #endif /* __PTC_XVSHM__ */
68
69 #endif /* __PTC_XVSHM_H */
70
71 #ifdef __PTC_FROM_SOURCE
72
73 static Display *ptc_display;
74 static int ptc_screen, ptc_screen_width, ptc_screen_height,
75   ptc_viewport_width, ptc_viewport_height, ptc_depth;
76 static Window ptc_root_window;
77 static Visual *ptc_visual;
78 static char *ptc_buffer = NULL;
79
80 static Window ptc_window;
81 static int ptc_x_position, ptc_y_position;
82 static XSetWindowAttributes ptc_window_attributes;
83 static GC ptc_window_gc;
84
85 static XShmSegmentInfo ptc_shm_segment;
86 static int ptc_xv_ok;
87 static XvImage *ptc_xvimage;
88 static XvPortID ptc_xv_port;
89
90
91 #endif /* __PTC_FROM_SOURCE */