changeset 7687:a9a19a991a70

support for VFCAP_ACCEPT_STRIDE in vo drivers
author arpi
date Wed, 09 Oct 2002 22:32:04 +0000
parents 4fa4e58587c2
children 41d242c5bee1
files libmpcodecs/vf_vo.c libmpcodecs/vfcap.h
diffstat 2 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_vo.c	Wed Oct 09 22:07:48 2002 +0000
+++ b/libmpcodecs/vf_vo.c	Wed Oct 09 22:32:04 2002 +0000
@@ -40,6 +40,9 @@
         mp_msg(MSGT_CPLAYER,MSGL_V,"VO: Comment: %s\n", info->comment);
   }
 
+    // save vo's stride capability for the wanted colorspace:
+    vf->default_caps=query_format(vf,outfmt) & VFCAP_ACCEPT_STRIDE;
+
     if(video_out->config(width,height,d_width,d_height,flags,"MPlayer",outfmt))
 	return 0;
     ++vo_config_count;
@@ -95,7 +98,8 @@
   // nope, fallback to old draw_frame/draw_slice:
   if(!(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK))){
     // blit frame:
-    if(mpi->flags&MP_IMGFLAG_PLANAR)
+//    if(mpi->flags&MP_IMGFLAG_PLANAR)
+    if(vf->default_caps&VFCAP_ACCEPT_STRIDE)
         video_out->draw_slice(mpi->planes,mpi->stride,mpi->w,mpi->h,mpi->x,mpi->y);
     else
         video_out->draw_frame(mpi->planes);
--- a/libmpcodecs/vfcap.h	Wed Oct 09 22:07:48 2002 +0000
+++ b/libmpcodecs/vfcap.h	Wed Oct 09 22:32:04 2002 +0000
@@ -19,10 +19,9 @@
 #define VFCAP_TIMER 0x100
 // driver _always_ flip image upside-down (for ve_vfw)
 #define VFCAP_FLIPPED 0x200
-// driver accept stride: (put_image/draw_frame)
+// vf filter: accepts stride (put_image)
+// vo driver: has draw_slice() support for the given csp
 #define VFCAP_ACCEPT_STRIDE 0x400
 // filter does postprocessing (so you shouldn't scale/filter image before it)
 #define VFCAP_POSTPROC 0x800
-// filter has draw_slice() support for this colorspace (assumed for planar YUV)
-#define VFCAP_DRAW_SLICE 0x1000