summaryrefslogtreecommitdiffstats
path: root/dec_video.c
diff options
context:
space:
mode:
authornick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-01 10:59:06 +0000
committernick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-01 10:59:06 +0000
commit1c4d86d2b4b5aba80a821e6e037facdb8de3c399 (patch)
treea0aad4ead2511867db2bd27fa1a21c373c732f20 /dec_video.c
parent68daf88d48a7d66a92db8cd7a3d1ccbc66bf35c1 (diff)
downloadmpv-1c4d86d2b4b5aba80a821e6e037facdb8de3c399.tar.bz2
mpv-1c4d86d2b4b5aba80a821e6e037facdb8de3c399.tar.xz
Use DIRECT RENDERING WITH DSHOW codecs
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4461 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'dec_video.c')
-rw-r--r--dec_video.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/dec_video.c b/dec_video.c
index d310adfe39..ad32cbb8d7 100644
--- a/dec_video.c
+++ b/dec_video.c
@@ -733,6 +733,11 @@ mp_image_t *mpi=sh_video->image;
unsigned int out_fmt=mpi->imgfmt; //sh_video->codec->outfmt[sh_video->outfmtidx];
int planar=(mpi->flags&MP_IMGFLAG_PLANAR)!=0; //(out_fmt==IMGFMT_YV12||out_fmt==IMGFMT_IYUV||out_fmt==IMGFMT_I420);
int blit_frame=0;
+bes_da_t bda;
+void *vmem;
+int use_dr;
+int painted;
+static int double_buff_num = 0;
//uint8_t* planes_[3];
//uint8_t** planes=planes_;
@@ -742,6 +747,10 @@ int blit_frame=0;
unsigned int t=GetTimer();
unsigned int t2;
+memset(&bda,0,sizeof(bes_da_t));
+painted = 0;
+ if(vo_vaa.query_bes_da)
+ use_dr = vo_vaa.query_bes_da(&bda) ? 0 : 1;
#ifdef USE_MP_IMAGE
if(mpi->type!=MP_IMGTYPE_EXPORT)
if( !(mpi->flags&MP_IMGFLAG_ALLOCATED) && !(mpi->flags&MP_IMGFLAG_DIRECT) ){
@@ -859,7 +868,22 @@ switch(sh_video->codec->driver){
#ifdef USE_DIRECTSHOW
case VFM_DSHOW: { // W32/DirectShow
if(drop_frame<2)
- DS_VideoDecoder_DecodeInternal(ds_vdec, start, in_size, 0, drop_frame ? 0 : sh_video->our_out_buffer);
+ {
+ /* FIXME: WILL WORK ONLY FOR PACKED FOURCC. BUT WHAT ABOUT PLANAR? */
+ vmem = 0;
+ if(use_dr && bda.dest.pitch.y == 16)
+ {
+ vmem = bda.dga_addr + bda.offsets[0] + bda.offset.y;
+ if(vo_doublebuffering && bda.num_frames>1)
+ {
+ if(double_buff_num) vmem = bda.dga_addr + bda.offsets[1] + bda.offset.y;
+ else vmem = bda.dga_addr + bda.offsets[0] + bda.offset.y;
+ double_buff_num = double_buff_num ? 0 : 1;
+ }
+ }
+ DS_VideoDecoder_DecodeInternal(ds_vdec, start, in_size, 0, drop_frame ? 0 : vmem ? vmem : sh_video->our_out_buffer);
+ if(vmem) painted = 1;
+ }
if(!drop_frame && sh_video->our_out_buffer) blit_frame=3;
break;
}
@@ -1070,7 +1094,7 @@ else if(gCpuCaps.hasMMX){
#endif
t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f;
-
+if(painted) return 1;
switch(blit_frame){
case 3:
if(planar){