Mercurial > mplayer.hg
annotate libvo/vo_dxr3.c @ 3110:742615956148
typo noted by JAF
author | gabucino |
---|---|
date | Sun, 25 Nov 2001 15:48:36 +0000 |
parents | 9989497ab31e |
children | 1d4fb4d9aab5 |
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 { | |
384 printf(stderr, "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 { | |
2968 | 427 int pts = 0; |
2645 | 428 if( img_format == IMGFMT_MPEGPES ) |
429 { | |
2770 | 430 int data_left; |
2645 | 431 vo_mpegpes_t *p=(vo_mpegpes_t *)src[0]; |
2968 | 432 unsigned char *data = p->data; |
433 | |
2645 | 434 data_left = p->size; |
2968 | 435 pts = p->timestamp; |
436 if( ioctl( fd_video, EM8300_IOCTL_VIDEO_SETPTS, &pts ) < 0 ) | |
437 printf( "VO: [dxr3] Unable to set PTS in draw_frame\n" ); | |
2645 | 438 while( data_left ) |
2921 | 439 data_left -= write( fd_video, &((unsigned char*)p->data)[p->size-data_left], data_left ); |
440 | |
2645 | 441 return 0; |
442 } | |
443 #ifdef USE_LIBAVCODEC | |
444 else if( img_format == IMGFMT_YV12 ) | |
445 { | |
2968 | 446 printf("VO: [dxr3] ERROR: Uninplemented\n"); |
2645 | 447 } |
2770 | 448 else if( img_format == IMGFMT_BGR24 ) |
449 { | |
450 int tmp_size, out_size; | |
451 int wrap, wrap3, x, y; | |
452 int r, g, b, R, G, B, h = v_height, w = v_width; | |
453 unsigned char *s, *Y, *U, *V; | |
454 | |
455 if(d_pos_x+w>picture.linesize[0]) w=picture.linesize[0]-d_pos_x; | |
456 if(d_pos_y+h>codec_context.height) h=codec_context.height-d_pos_y; | |
457 | |
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
|
458 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
|
459 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
|
460 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
|
461 |
2770 | 462 //BGR24->YUV420P from ffmpeg, see ffmpeg.sourceforge.net for terms of license |
463 #define SCALEBITS 8 | |
464 #define ONE_HALF (1 << (SCALEBITS - 1)) | |
465 #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
|
466 wrap = s_width; |
2770 | 467 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
|
468 s = src[0]+s_pos_x+(s_pos_y*wrap3); |
2770 | 469 for( y = 0; y < h; y+=2 ) |
470 { | |
471 for( x = 0; x < w; x+=2 ) | |
472 { | |
473 b = s[0]; | |
474 g = s[1]; | |
475 r = s[2]; | |
476 R = r; | |
477 G = g; | |
478 B = b; | |
479 Y[0] = (FIX(0.29900) * r + FIX(0.58700) * g + FIX(0.11400) * b + ONE_HALF) >> SCALEBITS; | |
480 b = s[3]; | |
481 g = s[4]; | |
482 r = s[5]; | |
483 R += r; | |
484 G += g; | |
485 B += b; | |
486 Y[1] = (FIX(0.29900) * r + FIX(0.58700) * g + FIX(0.11400) * b + ONE_HALF) >> SCALEBITS; | |
487 s += wrap3; | |
488 Y += wrap; | |
489 | |
490 b = s[0]; | |
491 g = s[1]; | |
492 r = s[2]; | |
493 R += r; | |
494 G += g; | |
495 B += b; | |
496 Y[0] = (FIX(0.29900) * r + FIX(0.58700) * g + FIX(0.11400) * b + ONE_HALF) >> SCALEBITS; | |
497 b = s[3]; | |
498 g = s[4]; | |
499 r = s[5]; | |
500 R += r; | |
501 G += g; | |
502 B += b; | |
503 Y[1] = (FIX(0.29900) * r + FIX(0.58700) * g + FIX(0.11400) * b + ONE_HALF) >> SCALEBITS; | |
504 U[0] = ((- FIX(0.16874) * R - FIX(0.33126) * G - FIX(0.50000) * B + 4 * ONE_HALF - 1) >> (SCALEBITS + 2)) + 128; | |
505 V[0] = ((FIX(0.50000) * R - FIX(0.41869) * G - FIX(0.08131) * B + 4 * ONE_HALF - 1) >> (SCALEBITS + 2)) + 128; | |
506 | |
507 U++; | |
508 V++; | |
509 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
|
510 Y -= (wrap-(3/2)); |
2770 | 511 } |
512 s += wrap3; | |
513 Y += wrap; | |
514 } | |
515 #undef SCALEBITS | |
516 #undef ONE_HALF | |
517 #undef FIX(x) | |
518 //End of ffmpeg code, see ffmpeg.sourceforge.net for terms of license | |
2968 | 519 pts = vo_pts; |
520 if( ioctl( fd_video, EM8300_IOCTL_VIDEO_SETPTS, &pts ) < 0 ) | |
521 printf( "VO: [dxr3] Unable to set PTS in draw_frame\n" ); | |
2770 | 522 tmp_size = out_size = avcodec_encode_video(&codec_context, outbuf, outbuf_size, &picture); |
523 while( out_size ) | |
2921 | 524 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
|
525 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
|
526 } |
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
|
527 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
|
528 { |
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
|
529 int tmp_size, out_size; |
2921 | 530 int x, y, w = v_width, h = v_height; |
531 | |
532 for( y = 0; y < h; y++ ) | |
533 { | |
534 for( x = 0; x < w; x++ ) | |
535 { | |
536 } | |
537 } | |
2968 | 538 pts = vo_pts; |
539 if( ioctl( fd_video, EM8300_IOCTL_VIDEO_SETPTS, &pts ) < 0 ) | |
540 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
|
541 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
|
542 while( out_size ) |
2921 | 543 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
|
544 |
2770 | 545 return 0; |
546 } | |
2645 | 547 #endif |
548 | |
2968 | 549 printf( "VO: [dxr3] Error in draw_frame(...)\n" ); |
2645 | 550 return -1; |
551 } | |
552 | |
553 static void flip_page (void) | |
554 { | |
555 } | |
556 | |
557 static uint32_t draw_slice( uint8_t *srcimg[], int stride[], int w, int h, int x0, int y0 ) | |
558 { | |
2968 | 559 int y, pts; |
2645 | 560 unsigned char* s; |
561 unsigned char* d; | |
562 int data_left; | |
563 vo_mpegpes_t *p = (vo_mpegpes_t *)srcimg[0]; | |
564 | |
565 if( img_format == IMGFMT_YV12 ) | |
566 { | |
567 #ifdef USE_LIBAVCODEC | |
2770 | 568 int out_size, tmp_size; |
2645 | 569 x0+=d_pos_x; |
570 y0+=d_pos_y; | |
571 if(x0+w>picture.linesize[0]) w=picture.linesize[0]-x0; // !! | |
572 if(y0+h>codec_context.height) h=codec_context.height-y0; | |
573 | |
574 // Y | |
575 s=srcimg[0]+s_pos_x+s_pos_y*stride[0]; | |
576 d=picture.data[0]+x0+y0*picture.linesize[0]; | |
577 for( y = 0; y < h; y++) | |
578 { | |
579 memcpy(d,s,w); | |
580 s+=stride[0]; | |
581 d+=picture.linesize[0]; | |
582 } | |
583 | |
584 w/=2;h/=2;x0/=2;y0/=2; | |
585 | |
586 // U | |
587 s=srcimg[1]+(s_pos_x/2)+(s_pos_y/2)*stride[1]; | |
588 d=picture.data[1]+x0+y0*picture.linesize[1]; | |
589 for( y = 0; y < h; y++) | |
590 { | |
591 memcpy(d,s,w); | |
592 s+=stride[1]; | |
593 d+=picture.linesize[1]; | |
594 } | |
595 | |
596 // V | |
597 s=srcimg[2]+(s_pos_x/2)+(s_pos_y/2)*stride[2]; | |
598 d=picture.data[2]+x0+y0*picture.linesize[2]; | |
599 for(y=0;y<h;y++) | |
600 { | |
601 memcpy(d,s,w); | |
602 s+=stride[2]; | |
603 d+=picture.linesize[2]; | |
604 } | |
2968 | 605 pts = vo_pts; |
2770 | 606 |
2968 | 607 if( ioctl( fd_video, EM8300_IOCTL_VIDEO_SETPTS, &pts ) < 0 ) |
608 printf( "VO: [dxr3] Unable to set PTS in draw_slice\n" ); | |
2770 | 609 tmp_size = out_size = avcodec_encode_video(&codec_context, outbuf, outbuf_size, &picture); |
610 while( out_size ) | |
2921 | 611 out_size -= write( fd_video, &outbuf[tmp_size-out_size], out_size ); |
2645 | 612 |
613 return 0; | |
614 #endif | |
2968 | 615 printf( "VO: [dxr3] You need to install ffmpeg.so or libavcodec, read DOCS/DXR3\n" ); |
2645 | 616 return -1; |
617 } | |
618 | |
619 return -1; | |
620 } | |
621 | |
622 | |
623 static uint32_t | |
624 query_format(uint32_t format) | |
625 { | |
2968 | 626 if(format==IMGFMT_MPEGPES) return 1; |
2645 | 627 #ifdef USE_LIBAVCODEC |
2968 | 628 if(format==IMGFMT_YV12) return 1; |
2921 | 629 // if(format==IMGFMT_YUY2) return 0x1|0x4; |
2968 | 630 if(format==IMGFMT_BGR24) return 1; |
2770 | 631 #else |
2968 | 632 if(format==IMGFMT_YV12) {printf("VO: [dxr3] You need to compile with libavcodec or ffmpeg.so to play this file!\n" ); return 0;} |
633 if(format==IMGFMT_YUY2) {printf("VO: [dxr3] You need to compile with libavcodec or ffmpeg.so to play this file!\n" ); return 0;} | |
634 if(format==IMGFMT_BGR24) {printf("VO: [dxr3] You need to compile with libavcodec or ffmpeg.so to play this file!\n" ); return 0;} | |
2770 | 635 #endif |
2645 | 636 return 0; |
637 } | |
638 | |
639 static void | |
640 uninit(void) | |
641 { | |
2968 | 642 printf( "VO: [dxr3] Uninitializing\n" ); |
2770 | 643 free(outbuf); |
644 free(picture_buf); | |
645 free(spubuf); | |
2921 | 646 close(fd_video); |
647 close(fd_spu); | |
2645 | 648 } |
649 | |
650 | |
651 static void check_events(void) | |
652 { | |
653 } | |
654 |