[vlc-devel] [PATCH] picture_t: add the possibility to copy pixels another way than through planes

Steve Lhomme robux4 at videolabs.io
Mon Apr 20 15:27:54 CEST 2015


--
in the case of D3D9 surfaces, we copy pixels between the internal GPU surfaces
---
 include/vlc_picture.h | 1 +
 src/misc/picture.c    | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/include/vlc_picture.h b/include/vlc_picture.h
index d3e3b99..393f17f 100644
--- a/include/vlc_picture.h
+++ b/include/vlc_picture.h
@@ -98,6 +98,7 @@ struct picture_t
     /** Private data - the video output plugin might want to put stuff here to
      * keep track of the picture */
     picture_sys_t * p_sys;
+    void (*pf_copy_private)( picture_t *p_dst, picture_t *p_src );
 
     /** This way the picture_Release can be overloaded */
     struct
diff --git a/src/misc/picture.c b/src/misc/picture.c
index 1785d3d..8064346 100644
--- a/src/misc/picture.c
+++ b/src/misc/picture.c
@@ -360,6 +360,7 @@ void picture_CopyProperties( picture_t *p_dst, const picture_t *p_src )
     p_dst->b_progressive = p_src->b_progressive;
     p_dst->i_nb_fields = p_src->i_nb_fields;
     p_dst->b_top_field_first = p_src->b_top_field_first;
+    p_dst->pf_copy_private = p_src->pf_copy_private;
 }
 
 void picture_CopyPixels( picture_t *p_dst, const picture_t *p_src )
@@ -368,6 +369,8 @@ void picture_CopyPixels( picture_t *p_dst, const picture_t *p_src )
 
     for( i = 0; i < p_src->i_planes ; i++ )
         plane_CopyPixels( p_dst->p+i, p_src->p+i );
+    if ( p_src->pf_copy_private )
+        p_src->pf_copy_private( p_dst, p_src );
 }
 
 void picture_Copy( picture_t *p_dst, const picture_t *p_src )
-- 
2.3.0




More information about the vlc-devel mailing list