Mercurial > mplayer.hg
annotate dec_video.c @ 1352:5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
author | arpi |
---|---|
date | Fri, 20 Jul 2001 00:00:08 +0000 |
parents | 3db173705860 |
children | 3ab0d3f21f51 |
rev | line source |
---|---|
1294 | 1 |
2 #include <stdio.h> | |
3 #include <stdlib.h> | |
4 | |
5 #include "config.h" | |
6 | |
7 extern int verbose; // defined in mplayer.c | |
8 extern int divx_quality; | |
9 | |
10 extern double video_time_usage; | |
11 extern double vout_time_usage; | |
12 | |
1327
b12e1817bcc2
some cleanup - fixed warnings, removed old stuff, moved audio resync to dec_audio
arpi
parents:
1309
diff
changeset
|
13 #include "linux/timer.h" |
b12e1817bcc2
some cleanup - fixed warnings, removed old stuff, moved audio resync to dec_audio
arpi
parents:
1309
diff
changeset
|
14 |
1294 | 15 #include "stream.h" |
16 #include "demuxer.h" | |
17 | |
18 #include "wine/mmreg.h" | |
19 #include "wine/avifmt.h" | |
20 #include "wine/vfw.h" | |
21 | |
22 #include "codec-cfg.h" | |
23 #include "stheader.h" | |
24 | |
25 //#include <inttypes.h> | |
26 //#include "libvo/img_format.h" | |
27 | |
28 #include "libvo/video_out.h" | |
29 | |
30 #include "libmpeg2/mpeg2.h" | |
31 #include "libmpeg2/mpeg2_internal.h" | |
32 | |
33 extern picture_t *picture; // exported from libmpeg2/decode.c | |
34 | |
1297 | 35 extern int init_video_codec(sh_video_t *sh_video,int ex); |
1294 | 36 |
37 #ifdef USE_DIRECTSHOW | |
38 #include "loader/DirectShow/DS_VideoDec.h" | |
39 #endif | |
40 | |
41 #ifdef USE_LIBAVCODEC | |
42 #include "libavcodec/avcodec.h" | |
43 AVCodec *lavc_codec=NULL; | |
44 AVCodecContext lavc_context; | |
45 AVPicture lavc_picture; | |
46 #endif | |
47 | |
1349 | 48 #ifndef NEW_DECORE |
1294 | 49 #include "opendivx/decore.h" |
1349 | 50 #else |
51 #include <decore.h> | |
52 #endif | |
1294 | 53 |
54 //**************************************************************************// | |
55 // The OpenDivX stuff: | |
56 //**************************************************************************// | |
57 | |
58 #ifndef NEW_DECORE | |
59 | |
60 static unsigned char *opendivx_src[3]; | |
61 static int opendivx_stride[3]; | |
62 | |
63 // callback, the opendivx decoder calls this for each frame: | |
64 void convert_linux(unsigned char *puc_y, int stride_y, | |
65 unsigned char *puc_u, unsigned char *puc_v, int stride_uv, | |
66 unsigned char *bmp, int width_y, int height_y){ | |
67 | |
68 // printf("convert_yuv called %dx%d stride: %d,%d\n",width_y,height_y,stride_y,stride_uv); | |
69 | |
70 opendivx_src[0]=puc_y; | |
71 opendivx_src[1]=puc_u; | |
72 opendivx_src[2]=puc_v; | |
73 | |
74 opendivx_stride[0]=stride_y; | |
75 opendivx_stride[1]=stride_uv; | |
76 opendivx_stride[2]=stride_uv; | |
77 } | |
78 #endif | |
79 | |
80 | |
81 int init_video(sh_video_t *sh_video){ | |
82 unsigned int out_fmt=sh_video->codec->outfmt[sh_video->outfmtidx]; | |
83 | |
84 switch(sh_video->codec->driver){ | |
1309
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
85 #ifdef ARCH_X86 |
1294 | 86 case 2: { |
1297 | 87 if(!init_video_codec(sh_video,0)) { |
1294 | 88 // GUI_MSG( mplUnknowError ) |
89 // exit(1); | |
90 return 0; | |
91 } | |
92 if(verbose) printf("INFO: Win32 video codec init OK!\n"); | |
93 break; | |
94 } | |
1297 | 95 case 6: { |
96 if(!init_video_codec(sh_video,1)) { | |
97 // GUI_MSG( mplUnknowError ) | |
98 // exit(1); | |
99 return 0; | |
100 } | |
101 if(verbose) printf("INFO: Win32Ex video codec init OK!\n"); | |
102 break; | |
103 } | |
1294 | 104 case 4: { // Win32/DirectShow |
105 #ifndef USE_DIRECTSHOW | |
106 fprintf(stderr,"MPlayer was compiled WITHOUT directshow support!\n"); | |
107 return 0; | |
108 // GUI_MSG( mplCompileWithoutDSSupport ) | |
109 // exit(1); | |
110 #else | |
111 sh_video->our_out_buffer=NULL; | |
112 if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, &sh_video->our_out_buffer)){ | |
113 // if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, NULL)){ | |
114 printf("ERROR: Couldn't open required DirectShow codec: %s\n",sh_video->codec->dll); | |
115 printf("Maybe you forget to upgrade your win32 codecs?? It's time to download the new\n"); | |
116 printf("package from: ftp://thot.banki.hu/esp-team/linux/MPlayer/w32codec.zip !\n"); | |
117 printf("Or you should disable DShow support: make distclean;make -f Makefile.No-DS\n"); | |
118 return 0; | |
119 // #ifdef HAVE_GUI | |
120 // if ( !nogui ) | |
121 // { | |
122 // strcpy( mplShMem->items.videodata.codecdll,sh_video->codec->dll ); | |
123 // mplSendMessage( mplDSCodecNotFound ); | |
124 // usec_sleep( 10000 ); | |
125 // } | |
126 // #endif | |
127 // exit(1); | |
128 } | |
129 | |
130 switch(out_fmt){ | |
131 case IMGFMT_YUY2: | |
132 case IMGFMT_UYVY: | |
133 DS_VideoDecoder_SetDestFmt(16,out_fmt);break; // packed YUV | |
134 case IMGFMT_YV12: | |
135 case IMGFMT_I420: | |
136 case IMGFMT_IYUV: | |
137 DS_VideoDecoder_SetDestFmt(12,out_fmt);break; // planar YUV | |
138 default: | |
139 DS_VideoDecoder_SetDestFmt(out_fmt&255,0); // RGB/BGR | |
140 } | |
141 | |
142 DS_VideoDecoder_Start(); | |
143 | |
144 DS_SetAttr_DivX("Quality",divx_quality); | |
145 // printf("DivX setting result = %d\n", DS_SetAttr_DivX("Quality",divx_quality) ); | |
146 // printf("DivX setting result = %d\n", DS_SetValue_DivX("Brightness",60) ); | |
147 | |
148 if(verbose) printf("INFO: Win32/DShow video codec init OK!\n"); | |
149 break; | |
150 #endif | |
151 } | |
1309
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
152 #else /* !ARCH_X86 */ |
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
153 case 2: |
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
154 case 4: |
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
155 case 6: |
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
156 fprintf(stderr,"MPlayer does not support win32 codecs on non-x86 platforms!\n"); |
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
157 return 0; |
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
158 #endif /* !ARCH_X86 */ |
1294 | 159 case 3: { // OpenDivX |
160 if(verbose) printf("OpenDivX video codec\n"); | |
161 { DEC_PARAM dec_param; | |
162 DEC_SET dec_set; | |
1349 | 163 memset(&dec_param,0,sizeof(dec_param)); |
1294 | 164 #ifdef NEW_DECORE |
165 dec_param.output_format=DEC_USER; | |
166 #else | |
167 dec_param.color_depth = 32; | |
168 #endif | |
169 dec_param.x_dim = sh_video->bih->biWidth; | |
170 dec_param.y_dim = sh_video->bih->biHeight; | |
171 decore(0x123, DEC_OPT_INIT, &dec_param, NULL); | |
172 dec_set.postproc_level = divx_quality; | |
173 decore(0x123, DEC_OPT_SETPP, &dec_set, NULL); | |
1349 | 174 } |
175 if(verbose) printf("INFO: OpenDivX video codec init OK!\n"); | |
176 break; | |
177 } | |
178 case 7: { // DivX4Linux | |
1352
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
179 #ifndef NEW_DECORE |
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
180 fprintf(stderr,"MPlayer was compiled WITHOUT DivX4Linux (libdivxdecore.so) support!\n"); |
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
181 return 0; //exit(1); |
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
182 #else |
1349 | 183 if(verbose) printf("DivX4Linux video codec\n"); |
184 { DEC_PARAM dec_param; | |
185 DEC_SET dec_set; | |
186 int bits=16; | |
187 memset(&dec_param,0,sizeof(dec_param)); | |
188 switch(out_fmt){ | |
189 case IMGFMT_YV12: dec_param.output_format=DEC_YV12;bits=12;break; | |
190 case IMGFMT_YUY2: dec_param.output_format=DEC_YUY2;break; | |
191 case IMGFMT_UYVY: dec_param.output_format=DEC_UYVY;break; | |
192 case IMGFMT_I420: dec_param.output_format=DEC_420;bits=12;break; | |
193 case IMGFMT_BGR15: dec_param.output_format=DEC_RGB555_INV;break; | |
194 case IMGFMT_BGR16: dec_param.output_format=DEC_RGB565_INV;break; | |
195 case IMGFMT_BGR24: dec_param.output_format=DEC_RGB24_INV;bits=24;break; | |
196 case IMGFMT_BGR32: dec_param.output_format=DEC_RGB32_INV;bits=32;break; | |
197 default: | |
198 fprintf(stderr,"Unsupported out_fmt: 0x%X\n",out_fmt); | |
199 return 0; | |
200 } | |
201 dec_param.x_dim = sh_video->bih->biWidth; | |
202 dec_param.y_dim = sh_video->bih->biHeight; | |
203 decore(0x123, DEC_OPT_INIT, &dec_param, NULL); | |
204 dec_set.postproc_level = divx_quality; | |
205 decore(0x123, DEC_OPT_SETPP, &dec_set, NULL); | |
1352
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
206 sh_video->our_out_buffer = shmem_alloc(((bits*dec_param.x_dim+7)/8)*dec_param.y_dim); |
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
207 // sh_video->our_out_buffer = shmem_alloc(dec_param.x_dim*dec_param.y_dim*5); |
1294 | 208 } |
209 if(verbose) printf("INFO: OpenDivX video codec init OK!\n"); | |
210 break; | |
1352
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
211 #endif |
1294 | 212 } |
213 case 5: { // FFmpeg's libavcodec | |
214 #ifndef USE_LIBAVCODEC | |
215 fprintf(stderr,"MPlayer was compiled WITHOUT libavcodec support!\n"); | |
216 return 0; //exit(1); | |
217 #else | |
218 if(verbose) printf("FFmpeg's libavcodec video codec\n"); | |
219 avcodec_init(); | |
220 avcodec_register_all(); | |
221 lavc_codec = (AVCodec *)avcodec_find_decoder_by_name(sh_video->codec->dll); | |
222 if(!lavc_codec){ | |
223 fprintf(stderr,"Can't find codec '%s' in libavcodec...\n",sh_video->codec->dll); | |
224 return 0; //exit(1); | |
225 } | |
226 memset(&lavc_context, 0, sizeof(lavc_context)); | |
227 lavc_context.width=sh_video->disp_w; | |
228 lavc_context.height=sh_video->disp_h; | |
229 printf("libavcodec.size: %d x %d\n",lavc_context.width,lavc_context.height); | |
230 /* open it */ | |
231 if (avcodec_open(&lavc_context, lavc_codec) < 0) { | |
232 fprintf(stderr, "could not open codec\n"); | |
233 return 0; //exit(1); | |
234 } | |
235 | |
236 if(verbose) printf("INFO: libavcodec init OK!\n"); | |
237 break; | |
238 #endif | |
239 } | |
240 | |
241 case 1: { | |
242 // init libmpeg2: | |
243 #ifdef MPEG12_POSTPROC | |
244 picture->pp_options=divx_quality; | |
245 #else | |
246 if(divx_quality){ | |
247 printf("WARNING! You requested image postprocessing for an MPEG 1/2 video,\n"); | |
248 printf(" but compiled MPlayer without MPEG 1/2 postprocessing support!\n"); | |
249 printf(" #define MPEG12_POSTPROC in config.h, and recompile libmpeg2!\n"); | |
250 } | |
251 #endif | |
252 mpeg2_allocate_image_buffers (picture); | |
253 break; | |
254 } | |
255 } | |
256 | |
257 return 1; | |
258 } | |
259 | |
260 int decode_video(vo_functions_t *video_out,sh_video_t *sh_video,unsigned char *start,int in_size,int drop_frame){ | |
261 unsigned int out_fmt=sh_video->codec->outfmt[sh_video->outfmtidx]; | |
262 int blit_frame=0; | |
263 | |
264 //-------------------- Decode a frame: ----------------------- | |
265 switch(sh_video->codec->driver){ | |
266 case 3: { | |
267 // OpenDivX | |
268 unsigned int t=GetTimer(); | |
269 unsigned int t2; | |
270 DEC_FRAME dec_frame; | |
271 #ifdef NEW_DECORE | |
272 DEC_PICTURE dec_pic; | |
273 #endif | |
274 // let's decode | |
275 dec_frame.length = in_size; | |
276 dec_frame.bitstream = start; | |
1349 | 277 dec_frame.render_flag = drop_frame?0:1; |
278 | |
1294 | 279 #ifdef NEW_DECORE |
280 dec_frame.bmp=&dec_pic; | |
281 dec_pic.y=dec_pic.u=dec_pic.v=NULL; | |
1349 | 282 decore(0x123, (sh_video->format==mmioFOURCC('D','I','V','3'))?DEC_OPT_FRAME_311:DEC_OPT_FRAME, &dec_frame, NULL); |
283 #else | |
284 decore(0x123, 0, &dec_frame, NULL); | |
1294 | 285 #endif |
1349 | 286 |
1294 | 287 t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f; |
288 | |
1349 | 289 // let's display |
1294 | 290 #ifdef NEW_DECORE |
291 if(dec_pic.y){ | |
292 void* src[3]; | |
293 int stride[3]; | |
294 src[0]=dec_pic.y; | |
295 src[1]=dec_pic.u; | |
296 src[2]=dec_pic.v; | |
297 stride[0]=dec_pic.stride_y; | |
298 stride[1]=stride[2]=dec_pic.stride_uv; | |
299 video_out->draw_slice(src,stride, | |
300 sh_video->disp_w,sh_video->disp_h,0,0); | |
301 blit_frame=1; | |
302 } | |
303 #else | |
304 if(opendivx_src[0]){ | |
305 video_out->draw_slice(opendivx_src,opendivx_stride, | |
306 sh_video->disp_w,sh_video->disp_h,0,0); | |
307 opendivx_src[0]=NULL; | |
308 blit_frame=1; | |
309 } | |
310 #endif | |
311 t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f; | |
312 | |
313 break; | |
314 } | |
1352
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
315 #ifdef NEW_DECORE |
1349 | 316 case 7: { |
317 // DivX4Linux | |
318 unsigned int t=GetTimer(); | |
319 unsigned int t2; | |
320 DEC_FRAME dec_frame; | |
321 // let's decode | |
322 dec_frame.length = in_size; | |
323 dec_frame.bitstream = start; | |
324 dec_frame.render_flag = drop_frame?0:1; | |
325 dec_frame.bmp=sh_video->our_out_buffer; | |
326 dec_frame.stride=sh_video->disp_w; | |
327 // printf("Decoding DivX4 frame\n"); | |
328 decore(0x123, (sh_video->format==mmioFOURCC('D','I','V','3'))?DEC_OPT_FRAME_311:DEC_OPT_FRAME, &dec_frame, NULL); | |
329 t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f; | |
330 | |
331 if(!drop_frame && sh_video->our_out_buffer){ | |
332 // printf("Displaying DivX4 frame\n"); | |
333 if(out_fmt==IMGFMT_YV12||out_fmt==IMGFMT_IYUV||out_fmt==IMGFMT_I420){ | |
334 uint8_t* dst[3]; | |
335 int stride[3]; | |
336 stride[0]=sh_video->disp_w; | |
337 stride[1]=stride[2]=sh_video->disp_w/2; | |
338 dst[0]=sh_video->our_out_buffer; | |
339 dst[2]=dst[0]+sh_video->disp_w*sh_video->disp_h; | |
340 dst[1]=dst[2]+sh_video->disp_w*sh_video->disp_h/4; | |
341 video_out->draw_slice(dst,stride,sh_video->disp_w,sh_video->disp_h,0,0); | |
342 } else | |
343 video_out->draw_frame((uint8_t **)&sh_video->our_out_buffer); | |
344 blit_frame=1; | |
345 } | |
346 | |
347 t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f; | |
348 | |
349 break; | |
350 } | |
1352
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
351 #endif |
1294 | 352 #ifdef USE_DIRECTSHOW |
353 case 4: { // W32/DirectShow | |
354 unsigned int t=GetTimer(); | |
355 unsigned int t2; | |
356 | |
357 if(drop_frame<2) DS_VideoDecoder_DecodeFrame(start, in_size, 0, !drop_frame); | |
358 | |
359 if(!drop_frame && sh_video->our_out_buffer){ | |
360 t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f; | |
361 if(out_fmt==IMGFMT_YV12||out_fmt==IMGFMT_IYUV||out_fmt==IMGFMT_I420){ | |
362 uint8_t* dst[3]; | |
363 int stride[3]; | |
364 stride[0]=sh_video->disp_w; | |
365 stride[1]=stride[2]=sh_video->disp_w/2; | |
366 dst[0]=sh_video->our_out_buffer; | |
367 dst[2]=dst[0]+sh_video->disp_w*sh_video->disp_h; | |
368 dst[1]=dst[2]+sh_video->disp_w*sh_video->disp_h/4; | |
369 video_out->draw_slice(dst,stride,sh_video->disp_w,sh_video->disp_h,0,0); | |
370 } else | |
371 video_out->draw_frame((uint8_t **)&sh_video->our_out_buffer); | |
372 t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f; | |
373 blit_frame=1; | |
374 } | |
375 break; | |
376 } | |
377 #endif | |
378 #ifdef USE_LIBAVCODEC | |
379 case 5: { // libavcodec | |
380 unsigned int t=GetTimer(); | |
381 unsigned int t2; | |
382 int got_picture=0; | |
383 | |
384 if(drop_frame<2 && in_size>0){ | |
385 int ret = avcodec_decode_video(&lavc_context, &lavc_picture, | |
386 &got_picture, start, in_size); | |
387 if(ret<0) fprintf(stderr, "Error while decoding frame!\n"); | |
388 } | |
389 | |
390 if(!drop_frame && got_picture){ | |
391 t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f; | |
392 video_out->draw_slice(lavc_picture.data,lavc_picture.linesize,sh_video->disp_w,sh_video->disp_h,0,0); | |
393 t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f; | |
394 blit_frame=1; | |
395 } | |
396 | |
397 break; | |
398 } | |
399 #endif | |
1297 | 400 case 6: |
1309
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
401 case 2: |
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
402 #ifdef ARCH_X86 |
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
403 { |
1294 | 404 HRESULT ret; |
405 unsigned int t=GetTimer(); | |
406 unsigned int t2; | |
407 | |
408 if(in_size){ | |
409 sh_video->bih->biSizeImage = in_size; | |
410 | |
411 // sh_video->bih->biWidth = 1280; | |
412 // sh_video->o_bih.biWidth = 1280; | |
413 // ret = ICDecompress(avi_header.hic, ICDECOMPRESS_NOTKEYFRAME|(ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL), | |
1297 | 414 |
415 if(sh_video->codec->driver==6) | |
416 ret = ICDecompressEx(sh_video->hic, | |
417 ( (sh_video->ds->flags&1) ? 0 : ICDECOMPRESS_NOTKEYFRAME ) | | |
418 ( (drop_frame==2 && !(sh_video->ds->flags&1))?(ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL):0 ) , | |
419 sh_video->bih, start, | |
420 &sh_video->o_bih, | |
421 drop_frame ? 0 : sh_video->our_out_buffer); | |
422 else | |
1294 | 423 ret = ICDecompress(sh_video->hic, |
424 ( (sh_video->ds->flags&1) ? 0 : ICDECOMPRESS_NOTKEYFRAME ) | | |
425 ( (drop_frame==2 && !(sh_video->ds->flags&1))?(ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL):0 ) , | |
426 sh_video->bih, start, | |
427 &sh_video->o_bih, | |
428 drop_frame ? 0 : sh_video->our_out_buffer); | |
429 | |
430 if(ret){ printf("Error decompressing frame, err=%d\n",(int)ret);break; } | |
431 } | |
432 // current_module="draw_frame"; | |
433 if(!drop_frame){ | |
434 t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f; | |
435 // if(out_fmt==IMGFMT_YV12){ | |
436 if(out_fmt==IMGFMT_YV12||out_fmt==IMGFMT_IYUV||out_fmt==IMGFMT_I420){ | |
437 uint8_t* dst[3]; | |
438 int stride[3]; | |
439 stride[0]=sh_video->disp_w; | |
440 stride[1]=stride[2]=sh_video->disp_w/2; | |
441 dst[0]=sh_video->our_out_buffer; | |
442 dst[2]=dst[0]+sh_video->disp_w*sh_video->disp_h; | |
443 dst[1]=dst[2]+sh_video->disp_w*sh_video->disp_h/4; | |
444 video_out->draw_slice(dst,stride,sh_video->disp_w,sh_video->disp_h,0,0); | |
445 } else | |
446 video_out->draw_frame((uint8_t **)&sh_video->our_out_buffer); | |
447 t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f; | |
448 blit_frame=1; | |
449 } | |
450 break; | |
451 } | |
1309
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
452 #else |
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
453 printf("Win32 video codec unavailable on non-x86 CPU -> force nosound :(\n"); |
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
454 break; |
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
455 #endif |
1294 | 456 case 1: { |
457 int t=0; | |
458 | |
459 t-=GetTimer(); | |
460 mpeg2_decode_data(video_out, start, start+in_size,drop_frame); | |
461 t+=GetTimer(); video_time_usage+=t*0.000001; | |
462 blit_frame=1; | |
463 | |
464 break; | |
465 } | |
466 } // switch | |
467 //------------------------ frame decoded. -------------------- | |
468 | |
469 return blit_frame; | |
470 } |