Mercurial > mplayer.hg
annotate libvo/vo_dxr3.c @ 3193:53a6d2fc1498
cosmetical change of driver summary - do not print always enabled stuff
author | arpi |
---|---|
date | Thu, 29 Nov 2001 01:18:05 +0000 |
parents | 1d4fb4d9aab5 |
children | 039a973b3dda |
rev | line source |
---|---|
2645 | 1 #define PES_MAX_SIZE 2048 |
2 /* | |
3 * vo_dxr3.c - DXR3/H+ video out | |
4 * | |
5 * Copyright (C) 2001 David Holm <dholm@iname.com> | |
6 * | |
7 * libav - MPEG-PS multiplexer, part of ffmpeg | |
8 * Copyright Gerard Lantau (see http://ffmpeg.sf.net) | |
9 * | |
10 */ | |
11 | |
12 #include "fastmemcpy.h" | |
13 #include <stdio.h> | |
14 #include <stdlib.h> | |
15 #include <string.h> | |
2921 | 16 #include <unistd.h> |
17 #include <linux/em8300.h> | |
18 #include <sys/ioctl.h> | |
19 #include <sys/stat.h> | |
20 #include <sys/types.h> | |
21 #include <fcntl.h> | |
2645 | 22 #include <stdio.h> |
23 #include <time.h> | |
24 | |
25 #include "config.h" | |
26 #include "video_out.h" | |
27 #include "video_out_internal.h" | |
28 | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
29 #include "../postproc/rgb2rgb.h" |
2645 | 30 #ifdef HAVE_MMX |
31 #include "mmx.h" | |
32 #endif | |
33 | |
34 LIBVO_EXTERN (dxr3) | |
35 | |
36 #ifdef USE_LIBAVCODEC | |
37 | |
38 #ifdef USE_LIBAVCODEC_SO | |
39 #include <libffmpeg/avcodec.h> | |
40 #else | |
41 #include "../libavcodec/avcodec.h" | |
42 #endif | |
43 static AVPicture picture; | |
44 static AVCodec *codec=NULL; | |
45 static AVCodecContext codec_context; | |
46 extern int avcodec_inited; | |
47 #endif | |
48 | |
49 static unsigned char *picture_buf=NULL; | |
50 static unsigned char *outbuf=NULL; | |
2770 | 51 static unsigned char *spubuf=NULL; |
52 static int outbuf_size = 0; | |
53 static int v_width,v_height; | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
54 static int s_width,s_height; |
2645 | 55 static int s_pos_x,s_pos_y; |
56 static int d_pos_x,d_pos_y; | |
57 static int osd_w,osd_h; | |
2770 | 58 static int img_format = 0; |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
59 static int palette[] = { 0x000000, 0x494949, 0xb5b5b5, 0xffffff }; |
2921 | 60 static int fd_control = -1; |
61 static int fd_video = -1; | |
62 static int fd_spu = -1; | |
63 static int ioval = 0; | |
2645 | 64 |
65 static vo_info_t vo_info = | |
66 { | |
67 "DXR3/H+ video out", | |
68 "dxr3", | |
69 "David Holm <dholm@iname.com>", | |
70 "" | |
71 }; | |
72 | |
73 static uint32_t | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
74 init(uint32_t scr_width, uint32_t scr_height, uint32_t width, uint32_t height, uint32_t fullscreen, char *title, uint32_t format) |
2645 | 75 { |
2921 | 76 int i; |
77 char tmp; | |
78 | |
79 fd_control = open( "/dev/em8300", O_WRONLY ); | |
80 if( fd_control < 1 ) | |
2645 | 81 { |
2921 | 82 printf( "VO: [dxr3] Error opening /dev/em8300 for writing!\n" ); |
83 return -1; | |
84 } | |
85 fd_video = open( "/dev/em8300_mv", O_WRONLY ); | |
86 if( fd_video < 0 ) | |
87 { | |
88 printf( "VO: [dxr3] Error opening /dev/em8300_mv for writing!\n" ); | |
89 return -1; | |
90 } | |
91 else printf( "VO: [dxr3] Opened /dev/em8300_mv\n" ); | |
92 fd_spu = open( "/dev/em8300_sp", O_WRONLY ); | |
93 if( fd_spu < 0 ) | |
94 { | |
95 printf( "VO: [dxr3] Error opening /dev/em8300_sp for writing!\n" ); | |
96 return -1; | |
2645 | 97 } |
98 | |
2770 | 99 /* Subpic code isn't working yet, don't set to ON |
100 unless you are really sure what you are doing */ | |
2921 | 101 ioval = EM8300_SPUMODE_OFF; |
102 if( ioctl( fd_control, EM8300_IOCTL_SET_SPUMODE, &ioval ) < 0 ) | |
103 { | |
104 printf( "VO: [dxr3] Unable to set subpicture mode!\n" ); | |
105 return -1; | |
106 } | |
2770 | 107 |
2921 | 108 if( ioctl( fd_spu, EM8300_IOCTL_SPU_SETPALETTE, palette ) < 0 ) |
109 { | |
110 printf( "VO: [dxr3] Unable to set subpicture palette!\n" ); | |
111 return -1; | |
112 } | |
113 | |
114 ioval = EM8300_PLAYMODE_PLAY; | |
2968 | 115 if( ioctl( fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval ) < 0 ) |
2921 | 116 printf( "VO: [dxr3] Unable to set playmode!\n" ); |
117 | |
118 close( fd_control ); | |
2645 | 119 |
120 img_format = format; | |
2770 | 121 v_width = width; |
122 v_height = height; | |
2921 | 123 spubuf = malloc(53220); /* 53220 bytes is the standardized max size of a subpic */ |
2645 | 124 picture_buf=NULL; |
2921 | 125 |
2645 | 126 if( format == IMGFMT_YV12 ) |
127 { | |
128 #ifdef USE_LIBAVCODEC | |
129 | |
130 int size; | |
131 | |
2968 | 132 printf("VO: [dxr3] Format: YV12\n"); |
2645 | 133 |
134 if(!avcodec_inited){ | |
135 avcodec_init(); | |
136 avcodec_register_all(); | |
137 avcodec_inited=1; | |
138 } | |
139 | |
140 /* find the mpeg1 video encoder */ | |
141 codec = avcodec_find_encoder(CODEC_ID_MPEG1VIDEO); | |
2968 | 142 if (!codec) |
143 { | |
144 printf( "VO: [dxr3] mpeg1 codec not found! Read DOCS/DXR3!\n"); | |
2645 | 145 return -1; |
146 } | |
147 | |
148 memset(&codec_context,0,sizeof(codec_context)); | |
149 codec_context.bit_rate=100000; // not used | |
2770 | 150 codec_context.frame_rate=25*FRAME_RATE_BASE; |
151 codec_context.gop_size=0; | |
2645 | 152 codec_context.flags=CODEC_FLAG_QSCALE; |
2770 | 153 codec_context.quality=1; |
154 codec_context.pix_fmt = PIX_FMT_YUV420P; | |
2645 | 155 if(width<=352 && height<=288){ |
156 codec_context.width=352; | |
157 codec_context.height=288; | |
158 } else | |
159 if(width<=352 && height<=576){ | |
160 codec_context.width=352; | |
161 codec_context.height=576; | |
162 } else | |
163 if(width<=480 && height<=576){ | |
164 codec_context.width=480; | |
165 codec_context.height=576; | |
166 } else | |
167 if(width<=544 && height<=576){ | |
168 codec_context.width=544; | |
169 codec_context.height=576; | |
170 } else { | |
171 codec_context.width=704; | |
172 codec_context.height=576; | |
173 } | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
174 s_width = codec_context.width; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
175 s_height = codec_context.height;; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
176 |
2645 | 177 |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
178 osd_w=scr_width; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
179 d_pos_x=(codec_context.width-(int)scr_width)/2; |
2645 | 180 if(d_pos_x<0){ |
181 s_pos_x=-d_pos_x;d_pos_x=0; | |
182 osd_w=codec_context.width; | |
183 } else s_pos_x=0; | |
184 | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
185 osd_h=scr_height; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
186 d_pos_y=(codec_context.height-(int)scr_height)/2; |
2645 | 187 if(d_pos_y<0){ |
188 s_pos_y=-d_pos_y;d_pos_y=0; | |
189 osd_h=codec_context.height; | |
190 } else s_pos_y=0; | |
191 | |
2968 | 192 printf("VO: [dxr3] position mapping: %d;%d => %d;%d\n",s_pos_x,s_pos_y,d_pos_x,d_pos_y); |
2645 | 193 |
194 /* open it */ | |
2968 | 195 if (avcodec_open(&codec_context, codec) < 0) |
196 { | |
197 printf( "VO: [dxr3] Could not open codec\n"); | |
2645 | 198 return -1; |
199 } | |
200 | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
201 outbuf_size=10000+width*height; |
2645 | 202 outbuf = malloc(outbuf_size); |
203 | |
204 size = codec_context.width*codec_context.height; | |
2770 | 205 picture_buf = malloc((size * 3)/2); /* size for YUV 420 */ |
206 | |
207 picture.data[0] = picture_buf; | |
208 picture.data[1] = picture.data[0] + size; | |
209 picture.data[2] = picture.data[1] + size / 4; | |
210 picture.linesize[0] = codec_context.width; | |
211 picture.linesize[1] = codec_context.width / 2; | |
212 picture.linesize[2] = codec_context.width / 2; | |
213 | |
214 return 0; | |
215 #endif | |
216 return -1; | |
217 } | |
218 else if(format==IMGFMT_BGR24) | |
219 { | |
220 #ifdef USE_LIBAVCODEC | |
221 int size = 0; | |
2968 | 222 printf("VO: [dxr3] Format: BGR24\n"); |
2770 | 223 |
224 if(!avcodec_inited) | |
225 { | |
226 avcodec_init(); | |
227 avcodec_register_all(); | |
228 avcodec_inited=1; | |
229 } | |
230 | |
231 /* find the mpeg1 video encoder */ | |
232 codec = avcodec_find_encoder(CODEC_ID_MPEG1VIDEO); | |
233 if (!codec) | |
234 { | |
2968 | 235 printf( "VO: [dxr3] mpeg1 codec not found! Read DOCS/DXR3!\n"); |
2770 | 236 return -1; |
237 } | |
238 | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
239 outbuf_size=10000+width*height; |
2770 | 240 outbuf = malloc(outbuf_size); |
241 | |
242 memset(&codec_context,0,sizeof(codec_context)); | |
243 codec_context.bit_rate=100000; | |
244 codec_context.frame_rate=25*FRAME_RATE_BASE; | |
245 codec_context.gop_size=0; | |
246 codec_context.flags=CODEC_FLAG_QSCALE; | |
247 codec_context.quality=1; | |
248 codec_context.pix_fmt = PIX_FMT_YUV420P; | |
249 | |
2968 | 250 if(width<=352 && height<=288){ |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
251 codec_context.width=352; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
252 codec_context.height=288; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
253 } else |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
254 if(width<=352 && height<=576){ |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
255 codec_context.width=352; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
256 codec_context.height=576; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
257 } else |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
258 if(width<=480 && height<=576){ |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
259 codec_context.width=480; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
260 codec_context.height=576; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
261 } else |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
262 if(width<=544 && height<=576){ |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
263 codec_context.width=544; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
264 codec_context.height=576; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
265 } else { |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
266 codec_context.width=704; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
267 codec_context.height=576; |
2968 | 268 } |
269 /* s_width = codec_context.width = width; | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
270 s_height = codec_context.height = height; |
2968 | 271 */ |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
272 osd_w=scr_width; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
273 d_pos_x=(codec_context.width-(int)scr_width)/2; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
274 if(d_pos_x<0){ |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
275 s_pos_x=-d_pos_x;d_pos_x=0; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
276 osd_w=codec_context.width; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
277 } else s_pos_x=0; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
278 |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
279 osd_h=scr_height; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
280 d_pos_y=(codec_context.height-(int)scr_height)/2; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
281 if(d_pos_y<0){ |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
282 s_pos_y=-d_pos_y;d_pos_y=0; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
283 osd_h=codec_context.height; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
284 } else s_pos_y=0; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
285 |
2968 | 286 printf("VO: [dxr3] position mapping: %d;%d => %d;%d\n",s_pos_x,s_pos_y,d_pos_x,d_pos_y); |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
287 |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
288 /* open it */ |
2968 | 289 if (avcodec_open(&codec_context, codec) < 0) |
290 { | |
291 printf( "VO: [dxr3] could not open codec\n"); | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
292 return -1; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
293 } |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
294 |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
295 size = 10000+codec_context.width*codec_context.height; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
296 picture_buf = malloc((size * 3)/2); |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
297 |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
298 picture.data[0] = picture_buf; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
299 picture.data[1] = picture.data[0] + size; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
300 picture.data[2] = picture.data[1] + size / 4; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
301 picture.linesize[0] = codec_context.width; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
302 picture.linesize[1] = codec_context.width / 2; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
303 picture.linesize[2] = codec_context.width / 2; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
304 return 0; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
305 #endif |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
306 return -1; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
307 } |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
308 else if(format==IMGFMT_YUY2) |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
309 { |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
310 #ifdef USE_LIBAVCODEC |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
311 int size = 0; |
2968 | 312 printf("VO: [dxr3] Format: YUY2\n"); |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
313 |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
314 if(!avcodec_inited) |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
315 { |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
316 avcodec_init(); |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
317 avcodec_register_all(); |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
318 avcodec_inited=1; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
319 } |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
320 |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
321 /* find the mpeg1 video encoder */ |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
322 codec = avcodec_find_encoder(CODEC_ID_MPEG1VIDEO); |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
323 if (!codec) |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
324 { |
2968 | 325 printf( "VO: [dxr3] mpeg1 codec not found! Read DOCS/DXR3!\n"); |
2921 | 326 return -1; |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
327 } |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
328 |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
329 outbuf_size=10000+width*height; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
330 outbuf = malloc(outbuf_size); |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
331 |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
332 memset(&codec_context,0,sizeof(codec_context)); |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
333 codec_context.bit_rate=100000; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
334 codec_context.frame_rate=25*FRAME_RATE_BASE; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
335 codec_context.gop_size=0; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
336 codec_context.flags=CODEC_FLAG_QSCALE; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
337 codec_context.quality=1; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
338 codec_context.pix_fmt = PIX_FMT_YUV420P; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
339 |
2770 | 340 if(width<=352 && height<=288){ |
341 codec_context.width=352; | |
342 codec_context.height=288; | |
343 } else | |
344 if(width<=352 && height<=576){ | |
345 codec_context.width=352; | |
346 codec_context.height=576; | |
347 } else | |
348 if(width<=480 && height<=576){ | |
349 codec_context.width=480; | |
350 codec_context.height=576; | |
351 } else | |
352 if(width<=544 && height<=576){ | |
353 codec_context.width=544; | |
354 codec_context.height=576; | |
355 } else { | |
356 codec_context.width=704; | |
357 codec_context.height=576; | |
358 } | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
359 s_width = codec_context.width; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
360 s_height = codec_context.height;; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
361 /* FOR DEBUGGING ONLY!! */ |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
362 codec_context.width = width; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
363 codec_context.height = height; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
364 |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
365 osd_w=scr_width; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
366 d_pos_x=(codec_context.width-(int)scr_width)/2; |
2770 | 367 if(d_pos_x<0){ |
368 s_pos_x=-d_pos_x;d_pos_x=0; | |
369 osd_w=codec_context.width; | |
370 } else s_pos_x=0; | |
371 | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
372 osd_h=scr_height; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
373 d_pos_y=(codec_context.height-(int)scr_height)/2; |
2770 | 374 if(d_pos_y<0){ |
375 s_pos_y=-d_pos_y;d_pos_y=0; | |
376 osd_h=codec_context.height; | |
377 } else s_pos_y=0; | |
378 | |
2921 | 379 printf("VO: [dxr3] position mapping: %d;%d => %d;%d\n",s_pos_x,s_pos_y,d_pos_x,d_pos_y); |
2770 | 380 |
381 /* open it */ | |
2968 | 382 if (avcodec_open(&codec_context, codec) < 0) |
383 { | |
3186 | 384 printf( "VO: [dxr3] Could not open codec\n" ); |
2770 | 385 return -1; |
386 } | |
387 | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
388 size = 10000+codec_context.width*codec_context.height; |
2770 | 389 picture_buf = malloc((size * 3)/2); |
2645 | 390 |
391 picture.data[0] = picture_buf; | |
392 picture.data[1] = picture.data[0] + size; | |
393 picture.data[2] = picture.data[1] + size / 4; | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
394 picture.linesize[0] = codec_context.width; |
2645 | 395 picture.linesize[1] = codec_context.width / 2; |
396 picture.linesize[2] = codec_context.width / 2; | |
397 return 0; | |
398 #endif | |
2770 | 399 return -1; |
2645 | 400 } |
401 else if(format==IMGFMT_MPEGPES) | |
402 { | |
2921 | 403 printf( "VO: [dxr3] Format: MPEG-PES (no conversion needed)\n" ); |
2645 | 404 return 0; |
405 } | |
406 | |
2968 | 407 printf( "VO: [dxr3] Format: Unsupported\n" ); |
2645 | 408 return -1; |
409 } | |
410 | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
411 static const vo_info_t* get_info(void) |
2645 | 412 { |
413 return &vo_info; | |
414 } | |
415 | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
416 static void draw_alpha(int x0, int y0, int w, int h, unsigned char* src, unsigned char *srca, int srcstride) |
2645 | 417 { |
418 } | |
419 | |
420 static void draw_osd(void) | |
421 { | |
2968 | 422 // vo_draw_text(osd_w,osd_h,draw_alpha); |
2645 | 423 } |
424 | |
425 static uint32_t draw_frame(uint8_t * src[]) | |
426 { | |
427 if( img_format == IMGFMT_MPEGPES ) | |
428 { | |
2770 | 429 int data_left; |
2645 | 430 vo_mpegpes_t *p=(vo_mpegpes_t *)src[0]; |
2968 | 431 unsigned char *data = p->data; |
432 | |
2645 | 433 data_left = p->size; |
3186 | 434 if( ioctl( fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts ) < 0 ) |
2968 | 435 printf( "VO: [dxr3] Unable to set PTS in draw_frame\n" ); |
2645 | 436 while( data_left ) |
2921 | 437 data_left -= write( fd_video, &((unsigned char*)p->data)[p->size-data_left], data_left ); |
438 | |
2645 | 439 return 0; |
440 } | |
441 #ifdef USE_LIBAVCODEC | |
442 else if( img_format == IMGFMT_YV12 ) | |
443 { | |
2968 | 444 printf("VO: [dxr3] ERROR: Uninplemented\n"); |
2645 | 445 } |
2770 | 446 else if( img_format == IMGFMT_BGR24 ) |
447 { | |
448 int tmp_size, out_size; | |
449 int wrap, wrap3, x, y; | |
450 int r, g, b, R, G, B, h = v_height, w = v_width; | |
451 unsigned char *s, *Y, *U, *V; | |
452 | |
453 if(d_pos_x+w>picture.linesize[0]) w=picture.linesize[0]-d_pos_x; | |
454 if(d_pos_y+h>codec_context.height) h=codec_context.height-d_pos_y; | |
455 | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
456 Y = picture.data[0]+d_pos_x+(d_pos_y*picture.linesize[0]); |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
457 U = picture.data[1]+(d_pos_x/2)+((d_pos_y/2)*picture.linesize[1]); |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
458 V = picture.data[2]+(d_pos_x/2)+((d_pos_y/2)*picture.linesize[2]); |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
459 |
2770 | 460 //BGR24->YUV420P from ffmpeg, see ffmpeg.sourceforge.net for terms of license |
461 #define SCALEBITS 8 | |
462 #define ONE_HALF (1 << (SCALEBITS - 1)) | |
463 #define FIX(x) ((int) ((x) * (1L<<SCALEBITS) + 0.5)) | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
464 wrap = s_width; |
2770 | 465 wrap3 = w * 3; |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
466 s = src[0]+s_pos_x+(s_pos_y*wrap3); |
2770 | 467 for( y = 0; y < h; y+=2 ) |
468 { | |
469 for( x = 0; x < w; x+=2 ) | |
470 { | |
471 b = s[0]; | |
472 g = s[1]; | |
473 r = s[2]; | |
474 R = r; | |
475 G = g; | |
476 B = b; | |
477 Y[0] = (FIX(0.29900) * r + FIX(0.58700) * g + FIX(0.11400) * b + ONE_HALF) >> SCALEBITS; | |
478 b = s[3]; | |
479 g = s[4]; | |
480 r = s[5]; | |
481 R += r; | |
482 G += g; | |
483 B += b; | |
484 Y[1] = (FIX(0.29900) * r + FIX(0.58700) * g + FIX(0.11400) * b + ONE_HALF) >> SCALEBITS; | |
485 s += wrap3; | |
486 Y += wrap; | |
487 | |
488 b = s[0]; | |
489 g = s[1]; | |
490 r = s[2]; | |
491 R += r; | |
492 G += g; | |
493 B += b; | |
494 Y[0] = (FIX(0.29900) * r + FIX(0.58700) * g + FIX(0.11400) * b + ONE_HALF) >> SCALEBITS; | |
495 b = s[3]; | |
496 g = s[4]; | |
497 r = s[5]; | |
498 R += r; | |
499 G += g; | |
500 B += b; | |
501 Y[1] = (FIX(0.29900) * r + FIX(0.58700) * g + FIX(0.11400) * b + ONE_HALF) >> SCALEBITS; | |
502 U[0] = ((- FIX(0.16874) * R - FIX(0.33126) * G - FIX(0.50000) * B + 4 * ONE_HALF - 1) >> (SCALEBITS + 2)) + 128; | |
503 V[0] = ((FIX(0.50000) * R - FIX(0.41869) * G - FIX(0.08131) * B + 4 * ONE_HALF - 1) >> (SCALEBITS + 2)) + 128; | |
504 | |
505 U++; | |
506 V++; | |
507 s -= (wrap3-6); | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
508 Y -= (wrap-(3/2)); |
2770 | 509 } |
510 s += wrap3; | |
511 Y += wrap; | |
512 } | |
513 #undef SCALEBITS | |
514 #undef ONE_HALF | |
515 #undef FIX(x) | |
516 //End of ffmpeg code, see ffmpeg.sourceforge.net for terms of license | |
3186 | 517 if( ioctl( fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts ) < 0 ) |
2968 | 518 printf( "VO: [dxr3] Unable to set PTS in draw_frame\n" ); |
2770 | 519 tmp_size = out_size = avcodec_encode_video(&codec_context, outbuf, outbuf_size, &picture); |
520 while( out_size ) | |
2921 | 521 out_size -= write( fd_video, &outbuf[tmp_size-out_size], out_size ); |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
522 return 0; |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
523 } |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
524 else if( img_format == IMGFMT_YUY2 ) |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
525 { |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
526 int tmp_size, out_size; |
2921 | 527 int x, y, w = v_width, h = v_height; |
528 | |
529 for( y = 0; y < h; y++ ) | |
530 { | |
531 for( x = 0; x < w; x++ ) | |
532 { | |
533 } | |
534 } | |
3186 | 535 |
536 if( ioctl( fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts ) < 0 ) | |
2968 | 537 printf( "VO: [dxr3] Unable to set PTS in draw_frame\n" ); |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
538 tmp_size = out_size = avcodec_encode_video(&codec_context, outbuf, outbuf_size, &picture); |
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
539 while( out_size ) |
2921 | 540 out_size -= write( fd_video, &outbuf[tmp_size-out_size], out_size ); |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
541 |
2770 | 542 return 0; |
543 } | |
2645 | 544 #endif |
545 | |
2968 | 546 printf( "VO: [dxr3] Error in draw_frame(...)\n" ); |
2645 | 547 return -1; |
548 } | |
549 | |
550 static void flip_page (void) | |
551 { | |
552 } | |
553 | |
554 static uint32_t draw_slice( uint8_t *srcimg[], int stride[], int w, int h, int x0, int y0 ) | |
555 { | |
2968 | 556 int y, pts; |
2645 | 557 unsigned char* s; |
558 unsigned char* d; | |
559 int data_left; | |
560 vo_mpegpes_t *p = (vo_mpegpes_t *)srcimg[0]; | |
561 | |
562 if( img_format == IMGFMT_YV12 ) | |
563 { | |
564 #ifdef USE_LIBAVCODEC | |
2770 | 565 int out_size, tmp_size; |
2645 | 566 x0+=d_pos_x; |
567 y0+=d_pos_y; | |
568 if(x0+w>picture.linesize[0]) w=picture.linesize[0]-x0; // !! | |
569 if(y0+h>codec_context.height) h=codec_context.height-y0; | |
570 | |
571 // Y | |
572 s=srcimg[0]+s_pos_x+s_pos_y*stride[0]; | |
573 d=picture.data[0]+x0+y0*picture.linesize[0]; | |
574 for( y = 0; y < h; y++) | |
575 { | |
576 memcpy(d,s,w); | |
577 s+=stride[0]; | |
578 d+=picture.linesize[0]; | |
579 } | |
580 | |
581 w/=2;h/=2;x0/=2;y0/=2; | |
582 | |
583 // U | |
584 s=srcimg[1]+(s_pos_x/2)+(s_pos_y/2)*stride[1]; | |
585 d=picture.data[1]+x0+y0*picture.linesize[1]; | |
586 for( y = 0; y < h; y++) | |
587 { | |
588 memcpy(d,s,w); | |
589 s+=stride[1]; | |
590 d+=picture.linesize[1]; | |
591 } | |
592 | |
593 // V | |
594 s=srcimg[2]+(s_pos_x/2)+(s_pos_y/2)*stride[2]; | |
595 d=picture.data[2]+x0+y0*picture.linesize[2]; | |
596 for(y=0;y<h;y++) | |
597 { | |
598 memcpy(d,s,w); | |
599 s+=stride[2]; | |
600 d+=picture.linesize[2]; | |
601 } | |
2968 | 602 pts = vo_pts; |
2770 | 603 |
2968 | 604 if( ioctl( fd_video, EM8300_IOCTL_VIDEO_SETPTS, &pts ) < 0 ) |
605 printf( "VO: [dxr3] Unable to set PTS in draw_slice\n" ); | |
2770 | 606 tmp_size = out_size = avcodec_encode_video(&codec_context, outbuf, outbuf_size, &picture); |
607 while( out_size ) | |
2921 | 608 out_size -= write( fd_video, &outbuf[tmp_size-out_size], out_size ); |
2645 | 609 |
610 return 0; | |
611 #endif | |
2968 | 612 printf( "VO: [dxr3] You need to install ffmpeg.so or libavcodec, read DOCS/DXR3\n" ); |
2645 | 613 return -1; |
614 } | |
615 | |
616 return -1; | |
617 } | |
618 | |
619 | |
620 static uint32_t | |
621 query_format(uint32_t format) | |
622 { | |
2968 | 623 if(format==IMGFMT_MPEGPES) return 1; |
2645 | 624 #ifdef USE_LIBAVCODEC |
2968 | 625 if(format==IMGFMT_YV12) return 1; |
2921 | 626 // if(format==IMGFMT_YUY2) return 0x1|0x4; |
2968 | 627 if(format==IMGFMT_BGR24) return 1; |
2770 | 628 #else |
2968 | 629 if(format==IMGFMT_YV12) {printf("VO: [dxr3] You need to compile with libavcodec or ffmpeg.so to play this file!\n" ); return 0;} |
630 if(format==IMGFMT_YUY2) {printf("VO: [dxr3] You need to compile with libavcodec or ffmpeg.so to play this file!\n" ); return 0;} | |
631 if(format==IMGFMT_BGR24) {printf("VO: [dxr3] You need to compile with libavcodec or ffmpeg.so to play this file!\n" ); return 0;} | |
2770 | 632 #endif |
2645 | 633 return 0; |
634 } | |
635 | |
636 static void | |
637 uninit(void) | |
638 { | |
2968 | 639 printf( "VO: [dxr3] Uninitializing\n" ); |
2770 | 640 free(outbuf); |
641 free(picture_buf); | |
642 free(spubuf); | |
2921 | 643 close(fd_video); |
644 close(fd_spu); | |
2645 | 645 } |
646 | |
647 | |
648 static void check_events(void) | |
649 { | |
650 } | |
651 |