[MPlayer-dev-eng] [PATCH] move vo_directrendering hack from vo_xvmc to vf_vo

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Feb 14 09:46:05 CET 2009


Hello,
currently vo_xvmc sets the vo_directrendering global variable to 1.
I think it is less ugly to instead special-case the hardware-accelerated
formats in vf_vo, so vo_directrendering is only changed by the
option-parsing code (well, and our horrible Gui ;-) ).
The disadvantage is that it may be harder to find for the next person
implementing such a vo...

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libmpcodecs/vf_vo.c
===================================================================
--- libmpcodecs/vf_vo.c	(revision 28546)
+++ libmpcodecs/vf_vo.c	(working copy)
@@ -165,7 +165,11 @@
 
 static void get_image(struct vf_instance_s* vf,
         mp_image_t *mpi){
-    if(vo_directrendering && vo_config_count)
+    if (!vo_config_count)
+        return;
+    // GET_IMAGE is required for hardware-accelerated formats
+    if(vo_directrendering ||
+       IMGFMT_IS_XVMC(mpi->imgfmt) || IMGFMT_IS_VDPAU(mpi->imgfmt))
 	video_out->control(VOCTRL_GET_IMAGE,mpi);
 }
 
Index: libvo/vo_xvmc.c
===================================================================
--- libvo/vo_xvmc.c	(revision 28546)
+++ libvo/vo_xvmc.c	(working copy)
@@ -685,7 +685,6 @@
    free_element = 0;
    first_frame = 1;
 
-   vo_directrendering = 1;//ugly hack, coz xvmc works only with direct rendering
    image_format=format;
    return 0;		
 }


More information about the MPlayer-dev-eng mailing list