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>
6 * http://www.sourceforge.net/projects/tinyptc/
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.
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.
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
28 #include <X11/Xutil.h>
34 #include <X11/extensions/XShm.h>
35 #include <X11/extensions/Xvlib.h>
40 #ifdef __TINYPTC_INCLUDED
41 #error You chose more than one target. Please make your mind and try again.
42 #endif /* __TINYPTC_INCLUDED */
44 #define __TINYPTC_INCLUDED
45 #define pragma target xvshm
49 #endif /* __cplusplus */
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);
57 void convert_yv12_mmx(void *pin, void *py, void *pu, void *pv, int stride);
60 void convert_yv12_c(void *pin, unsigned char *py, unsigned char *pu, unsigned char *pv, int stride);
61 #endif /* __PTC_MMX__ */
65 #endif /* __cplusplus */
67 #endif /* __PTC_XVSHM__ */
69 #endif /* __PTC_XVSHM_H */
71 #ifdef __PTC_FROM_SOURCE
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;
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;
85 static XShmSegmentInfo ptc_shm_segment;
87 static XvImage *ptc_xvimage;
88 static XvPortID ptc_xv_port;
91 #endif /* __PTC_FROM_SOURCE */