File: mplayer.1.0pre7try2.s3d.patch

package info (click to toggle)
s3d 0.2.2-14
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,572 kB
  • ctags: 5,265
  • sloc: ansic: 20,869; python: 488; perl: 98; makefile: 38; sh: 29
file content (371 lines) | stat: -rw-r--r-- 11,924 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
diff -Naur MPlayer-1.0pre7try2/configure MPlayer-1.0pre7try2.s3d/configure
--- MPlayer-1.0pre7try2/configure	2005-04-13 13:46:35.000000000 +0200
+++ MPlayer-1.0pre7try2.s3d/configure	2006-06-10 18:37:34.000000000 +0200
@@ -234,6 +234,7 @@
   --disable-vidix        disable VIDIX [enable on x86 *nix]
   --enable-gl            build with OpenGL render support [autodetect]
   --enable-dga[=n]       build with DGA [n in {1, 2} ] support [autodetect]
+  --enable-s3d           build with s3d support [autodetect]
   --enable-vesa          build with VESA support [autodetect]
   --enable-svga          build with SVGAlib support [autodetect]
   --enable-sdl           build with SDL render support [autodetect]
@@ -1288,6 +1289,7 @@
 _mencoder=yes
 _x11=auto
 _dga=auto	# 1 2 no auto
+_s3d=auto
 _xv=auto
 _xvmc=no  #auto when complete
 _sdl=auto
@@ -1444,6 +1446,8 @@
   --disable-xvmc)       _xvmc=no        ;;
   --enable-sdl)		_sdl=yes	;;
   --disable-sdl)	_sdl=no		;;
+  --enable-s3d)		_s3d=yes	;;
+  --disable-s3d)	_s3d=no		;;
   --enable-directx)     _directx=yes    ;;
   --disable-directx)    _directx=no     ;;
   --enable-win32waveout)  _win32waveout=yes ;;
@@ -3798,6 +3802,27 @@
 fi
 echores "$_aa"
 
+echocheck "s3d"
+if test "$_s3d" = auto ; then
+  cat > $TMPC << EOF
+#include <s3d.h>
+int main(int argc, char **argv) { s3d_init( &argc, &argv, "mplayer_test"); s3d_quit(); return 0; }
+EOF
+  _s3d=no
+  cc_check -ls3d && _s3d=yes
+fi
+if test "$_s3d" = yes ; then
+  _def_s3d='#define HAVE_S3D 1'
+  _ld_s3d='-ls3d'
+  _vosrc="$_vosrc vo_s3d.c"
+  _vomodules="s3d $_vomodules"
+else
+  _def_aa='#undef HAVE_S3D'
+  _novomodules="s3d $_novomodules"
+fi
+echores "$_s3d"
+
+
 
 echocheck "CACA"
 if test "$_caca" = auto ; then
@@ -6769,6 +6794,7 @@
 SDL_LIB = $_ld_sdl
 SVGA_LIB = $_ld_svga
 AA_LIB = $_ld_aa
+S3D_LIB = $_ld_s3d
 CACA_INC = $_inc_caca
 CACA_LIB = $_ld_caca
 
@@ -7484,6 +7510,7 @@
 $_def_vesa
 $_def_xdpms
 $_def_aa
+$_def_s3d
 $_def_caca
 $_def_tga
 $_def_toolame
diff -Naur MPlayer-1.0pre7try2/libvo/video_out.c MPlayer-1.0pre7try2.s3d/libvo/video_out.c
--- MPlayer-1.0pre7try2/libvo/video_out.c	2004-12-21 21:33:51.000000000 +0100
+++ MPlayer-1.0pre7try2.s3d/libvo/video_out.c	2006-06-10 18:37:34.000000000 +0200
@@ -84,6 +84,7 @@
 extern vo_functions_t video_out_png;
 extern vo_functions_t video_out_ggi;
 extern vo_functions_t video_out_aa;
+extern vo_functions_t video_out_s3d;
 extern vo_functions_t video_out_caca;
 extern vo_functions_t video_out_mpegpes;
 extern vo_functions_t video_out_yuv4mpeg;
@@ -192,6 +193,9 @@
 #ifdef HAVE_AA
 	&video_out_aa,
 #endif
+#ifdef HAVE_S3D
+	&video_out_s3d,
+#endif
 #ifdef HAVE_CACA
 	&video_out_caca,
 #endif
diff -Naur MPlayer-1.0pre7try2/libvo/vo_s3d.c MPlayer-1.0pre7try2.s3d/libvo/vo_s3d.c
--- MPlayer-1.0pre7try2/libvo/vo_s3d.c	1970-01-01 01:00:00.000000000 +0100
+++ MPlayer-1.0pre7try2.s3d/libvo/vo_s3d.c	2006-06-11 17:44:27.000000000 +0200
@@ -0,0 +1,262 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <s3d.h>
+#include <s3d_keysym.h>
+#include "config.h"
+#include "video_out.h"
+#include "video_out_internal.h"
+#include "mp_msg.h"
+#include "input/mouse.h"
+#include "input/input.h"
+
+static vo_info_t info =
+{
+	"s3d video output",
+	"s3d",
+	"<sw@simonwunderlich.de>",
+	""
+};
+
+LIBVO_EXTERN( s3d )
+
+static uint32_t image_width, image_height;
+static int int_pause;
+static uint32_t oid;
+static char *data2;
+
+//static uint32_t
+static uint32_t draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y)
+{
+//	int x2,y2;
+//	unsigned char *data;
+	// ignoring stride, as I don't know what it is O_o
+    mp_msg (MSGT_VO, MSGL_INFO, "[s3d] calling stride: %dx%d image at %dx%d\n",w,h,x,y);
+/*	data=*image;
+	for (y2=x;y2<w;y2++)
+	for (x2=y;x2<h;x2++)
+	{
+		data2[(y2*image_width+x2)*4+0]=data[(y2*image_width+x2)*3+0];
+		data2[(y2*image_width+x2)*4+1]=data[(y2*image_width+x2)*3+1];
+		data2[(y2*image_width+x2)*4+2]=data[(y2*image_width+x2)*3+2];
+		data2[(y2*image_width+x2)*4+3]=255;
+	}
+	s3d_load_texture(oid,0,x,y,w,h,data2);
+	return 0;*/
+	return 0;
+}
+
+static void draw_osd(void)
+{
+}
+
+static void
+flip_page(void)
+{
+}
+
+static uint32_t
+draw_frame(uint8_t *src[])
+{
+	uint32_t x,y;
+	unsigned char *data;
+	data=*src;
+	for (y=0;y<image_height;y++)
+		for (x=0;x<image_width;x++)
+		{
+			data2[(y*image_width+x)*4+0]=data[(y*image_width+x)*3+0];
+			data2[(y*image_width+x)*4+1]=data[(y*image_width+x)*3+1];
+			data2[(y*image_width+x)*4+2]=data[(y*image_width+x)*3+2];
+			data2[(y*image_width+x)*4+3]=255;
+		}
+	s3d_load_texture(oid,0,0,0,image_width,image_height,data2);
+	return VO_TRUE;
+}
+
+static uint32_t
+config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format)
+{
+	float aspect;
+	image_width = width;
+	image_height = height;
+	printf("config!!\n\n");
+	if (vo_config_count>0)
+	{
+	} else {
+		free(data2);
+		s3d_pop_texture(oid,1);
+		s3d_pop_vertex(oid,4);
+	}
+	aspect=((float) d_width)/((float) d_height);
+	s3d_push_vertex(oid,-3*aspect,-3,0);
+	s3d_push_vertex(oid, 3*aspect,-3,0);
+	s3d_push_vertex(oid, 3*aspect, 3,0);
+	s3d_push_vertex(oid,-3*aspect, 3,0);
+
+/*	s3d_scale(oid,(((float) d_width)/((float) d_height)),1.0,1.0);*/
+	data2=malloc(width*height*4);
+	memset(data2,128,width*height*4);
+	s3d_push_texture(oid,image_width,image_height);
+   	mp_msg (MSGT_VO, MSGL_INFO,"[s3d] requesting a %d %d texture... \n",image_width,image_height);
+   	mp_msg (MSGT_VO, MSGL_INFO,"[s3d] wanted size is %d %d... \n",d_width,d_height);
+	s3d_pep_material_texture(oid,0);	// assign texture 0 to material 0
+	return 0;
+}
+
+static void
+uninit(void)
+{
+	if (data2!=NULL)
+		free(data2);
+	s3d_quit();
+}
+
+#include "osdep/keycodes.h"
+extern void mplayer_put_key(int code);
+
+static void check_events(void)
+{
+	s3d_net_check();
+}
+#define shift_key (ki->modifier==(S3D_KMOD_LSHIFT||S3D_KMOD_RSHIFT))
+void s3dmp_key(struct s3d_evt *evt)
+{
+	struct s3d_key_event *ki=(struct s3d_key_event *)evt->buf;
+	switch (ki->keysym)
+	{
+		case S3DK_RETURN: mplayer_put_key(KEY_ENTER);break;
+        case S3DK_ESCAPE: mplayer_put_key(KEY_ESC);break;
+		case S3DK_q: mplayer_put_key('q');break;
+ 		case S3DK_F1: mplayer_put_key(KEY_F+1);break;
+ 		case S3DK_F2: mplayer_put_key(KEY_F+2);break;
+ 		case S3DK_F3: mplayer_put_key(KEY_F+3);break;
+ 		case S3DK_F4: mplayer_put_key(KEY_F+4);break;
+ 		case S3DK_F5: mplayer_put_key(KEY_F+5);break;
+ 		case S3DK_F6: mplayer_put_key(KEY_F+6);break;
+ 		case S3DK_F7: mplayer_put_key(KEY_F+7);break;
+ 		case S3DK_F8: mplayer_put_key(KEY_F+8);break;
+ 		case S3DK_F9: mplayer_put_key(KEY_F+9);break;
+ 		case S3DK_F10: mplayer_put_key(KEY_F+10);break;
+ 		case S3DK_F11: mplayer_put_key(KEY_F+11);break;
+ 		case S3DK_F12: mplayer_put_key(KEY_F+12);break;
+                                /*case S3DK_o: mplayer_put_key('o');break;
+                                case S3DK_SPACE: mplayer_put_key(' ');break;
+                                case S3DK_p: mplayer_put_key('p');break;*/
+		case S3DK_7: mplayer_put_key(shift_key?'/':'7');
+        case S3DK_PLUS: mplayer_put_key(shift_key?'*':'+');
+        case S3DK_KP_PLUS: mplayer_put_key('+');break;
+        case S3DK_MINUS:
+        case S3DK_KP_MINUS: mplayer_put_key('-');break;
+		case S3DK_TAB: mplayer_put_key('\t');break;
+		case S3DK_PAGEUP: mplayer_put_key(KEY_PAGE_UP);break;
+		case S3DK_PAGEDOWN: mplayer_put_key(KEY_PAGE_DOWN);break;
+		case S3DK_UP: mplayer_put_key(KEY_UP);break;
+        case S3DK_DOWN: mplayer_put_key(KEY_DOWN);break;
+        case S3DK_LEFT: mplayer_put_key(KEY_LEFT);break;
+        case S3DK_RIGHT: mplayer_put_key(KEY_RIGHT);break;
+        case S3DK_LESS: mplayer_put_key(shift_key?'>':'<'); break;
+        case S3DK_GREATER: mplayer_put_key('>'); break;
+        case S3DK_ASTERISK:
+		case S3DK_KP_MULTIPLY: mplayer_put_key('*'); break;
+		case S3DK_SLASH:
+		case S3DK_KP_DIVIDE: mplayer_put_key('/'); break;
+		case S3DK_KP0: mplayer_put_key(KEY_KP0); break;
+		case S3DK_KP1: mplayer_put_key(KEY_KP1); break;
+		case S3DK_KP2: mplayer_put_key(KEY_KP2); break;
+		case S3DK_KP3: mplayer_put_key(KEY_KP3); break;
+		case S3DK_KP4: mplayer_put_key(KEY_KP4); break;
+		case S3DK_KP5: mplayer_put_key(KEY_KP5); break;
+		case S3DK_KP6: mplayer_put_key(KEY_KP6); break;
+		case S3DK_KP7: mplayer_put_key(KEY_KP7); break;
+		case S3DK_KP8: mplayer_put_key(KEY_KP8); break;
+		case S3DK_KP9: mplayer_put_key(KEY_KP9); break;
+		case S3DK_KP_PERIOD: mplayer_put_key(KEY_KPDEC); break;
+		case S3DK_KP_ENTER: mplayer_put_key(KEY_KPENTER); break;
+		default:
+			mplayer_put_key(ki->keysym);
+			break;
+
+	}
+
+}
+int mbutton;
+void s3dmp_mbutton(struct s3d_evt *evt)
+{
+	struct s3d_but_info *bi=(struct s3d_but_info *)evt->buf;
+	mbutton=-1;
+	if ((bi->state==0) && (!vo_nomouse_input))
+		mbutton=bi->button;
+}
+void s3dmp_obj_click(struct s3d_evt *evt)
+{
+	uint32_t coid=*((uint32_t *)evt->buf);
+	if (coid==oid)
+	{
+		mplayer_put_key(MOUSE_BASE+mbutton-1);
+	}
+	mbutton=-1;
+}
+
+
+
+
+static uint32_t preinit(const char *arg)
+{
+	int argc=0;
+	char *arg1=NULL;
+	char **argv=&arg1;
+    mp_msg (MSGT_VO, MSGL_INFO, "[s3d] hello, i'm initing - darn it!\n");
+	mbutton=-1;
+    s3d_set_callback(S3D_EVENT_MBUTTON,s3dmp_mbutton);
+    s3d_set_callback(S3D_EVENT_OBJ_CLICK,s3dmp_obj_click);
+    s3d_set_callback(S3D_EVENT_KEY,s3dmp_key);
+
+	if (s3d_init(&argc,&argv,"mplayer"))
+	{
+    	mp_msg (MSGT_VO, MSGL_WARN, "[s3d] sorry, can't reach server.\n");
+		return ENOSYS;
+	}
+	oid=s3d_new_object();
+	s3d_push_vertex(oid,-3,-3,0);
+	s3d_push_vertex(oid, 3,-3,0);
+	s3d_push_vertex(oid, 3, 3,0);
+	s3d_push_vertex(oid,-3, 3,0);
+	s3d_push_material_a(oid,
+					0.0,	0.0,	0.8	,1.0,
+					1.0,	1.0,	1.0	,1.0,
+					0.0,	0.0,	0.8	,1.0);
+	s3d_push_polygon(oid,0,2,1,0);
+	s3d_pep_polygon_tex_coord(oid, 0.0,1.0,
+								   1.0,0.0,
+								   1.0,1.0);
+	s3d_push_polygon(oid,0,3,2,0);
+	s3d_pep_polygon_tex_coord(oid, 0.0,1.0,
+								   0.0,0.0,
+								   1.0,0.0);
+	s3d_flags_on(oid,S3D_OF_VISIBLE);
+    if(arg)
+    {
+    	mp_msg (MSGT_VO, MSGL_WARN, "[s3d] what should I do with this arg? \n");
+		return ENOSYS;
+    }
+    return 0;
+}
+
+static uint32_t
+query_format(uint32_t format)
+{
+    if (format == IMGFMT_RGB24)
+        return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
+    return 0;
+}
+static uint32_t control(uint32_t request, void *data, ...)
+{
+  switch (request) {
+  case VOCTRL_PAUSE: return (int_pause=1);
+  case VOCTRL_RESUME: return (int_pause=0);
+  case VOCTRL_QUERY_FORMAT:
+    return query_format(*((uint32_t*)data));
+  }
+  return VO_NOTIMPL;
+}
diff -Naur MPlayer-1.0pre7try2/Makefile MPlayer-1.0pre7try2.s3d/Makefile
--- MPlayer-1.0pre7try2/Makefile	2005-04-16 22:18:12.000000000 +0200
+++ MPlayer-1.0pre7try2.s3d/Makefile	2006-06-10 18:37:34.000000000 +0200
@@ -30,7 +30,7 @@
 OBJS_MENCODER = $(SRCS_MENCODER:.c=.o)
 OBJS_MPLAYER = $(SRCS_MPLAYER:.c=.o)
 
-VO_LIBS = $(AA_LIB) $(X_LIB) $(SDL_LIB) $(GGI_LIB) $(MP1E_LIB) $(MLIB_LIB) $(SVGA_LIB) $(DIRECTFB_LIB) $(CACA_LIB)
+VO_LIBS = $(AA_LIB) $(X_LIB) $(SDL_LIB) $(GGI_LIB) $(MP1E_LIB) $(MLIB_LIB) $(SVGA_LIB) $(DIRECTFB_LIB) $(CACA_LIB) $(S3D_LIB)
 AO_LIBS = $(ARTS_LIB) $(ESD_LIB) $(JACK_LIB) $(NAS_LIB) $(SGIAUDIO_LIB) $(POLYP_LIB)
 CODEC_LIBS = $(AV_LIB) $(FAME_LIB) $(MAD_LIB) $(VORBIS_LIB) $(THEORA_LIB) $(FAAD_LIB) $(LIBLZO_LIB) $(DECORE_LIB) $(XVID_LIB) $(DTS_LIB) $(PNG_LIB) $(Z_LIB) $(JPEG_LIB) $(ALSA_LIB) $(XMMS_LIB) $(X264_LIB)
 COMMON_LIBS = libmpcodecs/libmpcodecs.a $(W32_LIB) $(DS_LIB) libaf/libaf.a libmpdemux/libmpdemux.a input/libinput.a postproc/libswscale.a osdep/libosdep.a $(DVDREAD_LIB) $(CODEC_LIBS) $(FREETYPE_LIB) $(TERMCAP_LIB) $(CDPARANOIA_LIB) $(MPLAYER_NETWORK_LIB) $(WIN32_LIB) $(GIF_LIB) $(MACOSX_FRAMEWORKS) $(SMBSUPPORT_LIB) $(FRIBIDI_LIB) $(FONTCONFIG_LIB) $(ENCA_LIB)