Mercurial > mplayer.hg
comparison dec_video.c @ 1422:d02e0dcaf077
libvo2 support
author | arpi |
---|---|
date | Mon, 30 Jul 2001 02:00:54 +0000 |
parents | eda16e490ae7 |
children | 8986d06b2816 |
comparison
equal
deleted
inserted
replaced
1421:ea0a0b9e6fbc | 1422:d02e0dcaf077 |
---|---|
26 #include "stheader.h" | 26 #include "stheader.h" |
27 | 27 |
28 //#include <inttypes.h> | 28 //#include <inttypes.h> |
29 //#include "libvo/img_format.h" | 29 //#include "libvo/img_format.h" |
30 | 30 |
31 #ifdef USE_LIBVO2 | |
32 #include "libvo2/libvo2.h" | |
33 #else | |
31 #include "libvo/video_out.h" | 34 #include "libvo/video_out.h" |
35 #endif | |
32 | 36 |
33 #include "libmpeg2/mpeg2.h" | 37 #include "libmpeg2/mpeg2.h" |
34 #include "libmpeg2/mpeg2_internal.h" | 38 #include "libmpeg2/mpeg2_internal.h" |
35 | 39 |
36 extern picture_t *picture; // exported from libmpeg2/decode.c | 40 extern picture_t *picture; // exported from libmpeg2/decode.c |
258 } | 262 } |
259 | 263 |
260 return 1; | 264 return 1; |
261 } | 265 } |
262 | 266 |
267 #ifdef USE_LIBVO2 | |
268 int decode_video(vo2_handle_t *video_out,sh_video_t *sh_video,unsigned char *start,int in_size,int drop_frame){ | |
269 #else | |
263 int decode_video(vo_functions_t *video_out,sh_video_t *sh_video,unsigned char *start,int in_size,int drop_frame){ | 270 int decode_video(vo_functions_t *video_out,sh_video_t *sh_video,unsigned char *start,int in_size,int drop_frame){ |
271 #endif | |
264 unsigned int out_fmt=sh_video->codec->outfmt[sh_video->outfmtidx]; | 272 unsigned int out_fmt=sh_video->codec->outfmt[sh_video->outfmtidx]; |
265 int planar=(out_fmt==IMGFMT_YV12||out_fmt==IMGFMT_IYUV||out_fmt==IMGFMT_I420); | 273 int planar=(out_fmt==IMGFMT_YV12||out_fmt==IMGFMT_IYUV||out_fmt==IMGFMT_I420); |
266 int blit_frame=0; | 274 int blit_frame=0; |
267 | 275 |
268 uint8_t* planes_[3]; | 276 uint8_t* planes_[3]; |
414 planes[2]=planes[0]+sh_video->disp_w*sh_video->disp_h; | 422 planes[2]=planes[0]+sh_video->disp_w*sh_video->disp_h; |
415 planes[1]=planes[2]+sh_video->disp_w*sh_video->disp_h/4; | 423 planes[1]=planes[2]+sh_video->disp_w*sh_video->disp_h/4; |
416 } else | 424 } else |
417 planes[0]=sh_video->our_out_buffer; | 425 planes[0]=sh_video->our_out_buffer; |
418 case 2: | 426 case 2: |
427 #ifdef USE_LIBVO2 | |
428 if(planar) | |
429 vo2_draw_slice(video_out,planes,stride,sh_video->disp_w,sh_video->disp_h,0,0); | |
430 else | |
431 vo2_draw_frame(video_out,planes[0],sh_video->disp_w,sh_video->disp_w,sh_video->disp_h); | |
432 #else | |
419 if(planar) | 433 if(planar) |
420 video_out->draw_slice(planes,stride,sh_video->disp_w,sh_video->disp_h,0,0); | 434 video_out->draw_slice(planes,stride,sh_video->disp_w,sh_video->disp_h,0,0); |
421 else | 435 else |
422 video_out->draw_frame(planes); | 436 video_out->draw_frame(planes); |
437 #endif | |
423 t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f; | 438 t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f; |
424 blit_frame=1; | 439 blit_frame=1; |
425 break; | 440 break; |
426 } | 441 } |
427 | 442 |