Mercurial > mplayer.hg
comparison dec_video.c @ 4931:6c518133c3b8
DR on multibuffering
author | nick |
---|---|
date | Sun, 03 Mar 2002 18:29:05 +0000 |
parents | a41e0440edfb |
children | 026329111b09 |
comparison
equal
deleted
inserted
replaced
4930:a71ef1642a8a | 4931:6c518133c3b8 |
---|---|
785 | 785 |
786 extern int vaa_use_dr; | 786 extern int vaa_use_dr; |
787 | 787 |
788 static int use_dr=0,use_dr_422=0; | 788 static int use_dr=0,use_dr_422=0; |
789 static bes_da_t bda; | 789 static bes_da_t bda; |
790 static int multi_buff_num = 0; | |
790 void init_video_vaa( unsigned width ) | 791 void init_video_vaa( unsigned width ) |
791 { | 792 { |
792 unsigned adp; | 793 unsigned adp; |
793 memset(&bda,0,sizeof(bes_da_t)); | 794 memset(&bda,0,sizeof(bes_da_t)); |
794 if(vo_vaa.query_bes_da) | 795 if(vo_vaa.query_bes_da) |
814 unsigned int out_fmt=mpi->imgfmt; //sh_video->codec->outfmt[sh_video->outfmtidx]; | 815 unsigned int out_fmt=mpi->imgfmt; //sh_video->codec->outfmt[sh_video->outfmtidx]; |
815 int planar=(mpi->flags&MP_IMGFLAG_PLANAR)!=0; //(out_fmt==IMGFMT_YV12||out_fmt==IMGFMT_IYUV||out_fmt==IMGFMT_I420); | 816 int planar=(mpi->flags&MP_IMGFLAG_PLANAR)!=0; //(out_fmt==IMGFMT_YV12||out_fmt==IMGFMT_IYUV||out_fmt==IMGFMT_I420); |
816 int blit_frame=0; | 817 int blit_frame=0; |
817 void *vmem; | 818 void *vmem; |
818 int painted; | 819 int painted; |
819 static int double_buff_num = 0; | |
820 | 820 |
821 //uint8_t* planes_[3]; | 821 //uint8_t* planes_[3]; |
822 //uint8_t** planes=planes_; | 822 //uint8_t** planes=planes_; |
823 //int stride_[3]; | 823 //int stride_[3]; |
824 //int* stride=stride_; | 824 //int* stride=stride_; |
957 if(use_dr_422) | 957 if(use_dr_422) |
958 { | 958 { |
959 vmem = bda.dga_addr + bda.offsets[0] + bda.offset.y; | 959 vmem = bda.dga_addr + bda.offsets[0] + bda.offset.y; |
960 if(vo_doublebuffering && bda.num_frames>1) | 960 if(vo_doublebuffering && bda.num_frames>1) |
961 { | 961 { |
962 if(double_buff_num) vmem = bda.dga_addr + bda.offsets[1] + bda.offset.y; | 962 vmem = bda.dga_addr + bda.offsets[multi_buff_num] + bda.offset.y; |
963 else vmem = bda.dga_addr + bda.offsets[0] + bda.offset.y; | 963 multi_buff_num=(multi_buff_num+1)%bda.num_frames; |
964 double_buff_num = double_buff_num ? 0 : 1; | |
965 } | 964 } |
966 } | 965 } |
967 DS_VideoDecoder_DecodeInternal(ds_vdec, start, in_size, 0, drop_frame ? 0 : vmem ? vmem : sh_video->our_out_buffer); | 966 DS_VideoDecoder_DecodeInternal(ds_vdec, start, in_size, 0, drop_frame ? 0 : vmem ? vmem : sh_video->our_out_buffer); |
968 if(vmem) painted = 1; | 967 if(vmem) painted = 1; |
969 } | 968 } |
970 if(!drop_frame && sh_video->our_out_buffer) blit_frame=3; | 969 if(!drop_frame && sh_video->our_out_buffer) blit_frame=3; |
971 break; | 970 break; |
972 } | 971 } |
973 #endif | 972 #endif |
1076 if(use_dr_422) | 1075 if(use_dr_422) |
1077 { | 1076 { |
1078 vmem = bda.dga_addr + bda.offsets[0] + bda.offset.y; | 1077 vmem = bda.dga_addr + bda.offsets[0] + bda.offset.y; |
1079 if(vo_doublebuffering && bda.num_frames>1) | 1078 if(vo_doublebuffering && bda.num_frames>1) |
1080 { | 1079 { |
1081 if(double_buff_num) vmem = bda.dga_addr + bda.offsets[1] + bda.offset.y; | 1080 vmem = bda.dga_addr + bda.offsets[multi_buff_num] + bda.offset.y; |
1082 else vmem = bda.dga_addr + bda.offsets[0] + bda.offset.y; | 1081 multi_buff_num=(multi_buff_num+1)%bda.num_frames; |
1083 double_buff_num = double_buff_num ? 0 : 1; | |
1084 } | 1082 } |
1085 sh_video->our_out_buffer = vmem; | 1083 sh_video->our_out_buffer = vmem; |
1086 } | 1084 } |
1087 if((ret=vfw_decode_video(sh_video,start,in_size,drop_frame,(sh_video->codec->driver==VFM_VFWEX) ))){ | 1085 if((ret=vfw_decode_video(sh_video,start,in_size,drop_frame,(sh_video->codec->driver==VFM_VFWEX) ))){ |
1088 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error decompressing frame, err=%d\n",ret); | 1086 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error decompressing frame, err=%d\n",ret); |