[vlc-devel] commit: Support multiple planes in the vmem driver, courtesy of Pierre Ynard. (Sam Hocevar )

git version control git at videolan.org
Thu Oct 16 13:07:34 CEST 2008


vlc | branch: master | Sam Hocevar <sam at zoy.org> | Thu Oct 16 13:06:27 2008 +0200| [38f8e29fd03b6168a273c22eda7829144a20cd77] | committer: Sam Hocevar 

Support multiple planes in the vmem driver, courtesy of Pierre Ynard.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=38f8e29fd03b6168a273c22eda7829144a20cd77
---

 modules/video_output/vmem.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/vmem.c b/modules/video_output/vmem.c
index 5de7f09..76f7fd0 100644
--- a/modules/video_output/vmem.c
+++ b/modules/video_output/vmem.c
@@ -62,8 +62,8 @@ static int  UnlockPicture ( vout_thread_t *, picture_t * );
 
 #define T_LOCK N_( "Lock function" )
 #define LT_LOCK N_( "Address of the locking callback function. This " \
-                    "function must return a valid memory address for use " \
-                    "by the video renderer." )
+                    "function must fill in valid plane memory address " \
+                    "information for use by the video renderer." )
 
 #define T_UNLOCK N_( "Unlock function" )
 #define LT_UNLOCK N_( "Address of the unlocking callback function" )
@@ -97,7 +97,7 @@ struct vout_sys_t
 {
     int i_width, i_height, i_pitch;
 
-    void * (*pf_lock) (void *);
+    void (*pf_lock) (void *, void **);
     void (*pf_unlock) (void *);
     void *p_data;
 };
@@ -280,7 +280,15 @@ static void Destroy( vlc_object_t *p_this )
  *****************************************************************************/
 static int LockPicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
-    p_pic->p->p_pixels = p_vout->p_sys->pf_lock( p_vout->p_sys->p_data );
+    int i_index;
+    void *planes[p_pic->i_planes];
+
+    p_vout->p_sys->pf_lock( p_vout->p_sys->p_data, planes );
+
+    for( i_index = 0; i_index < p_pic->i_planes; i_index++ )
+    {
+        p_pic->p[i_index].p_pixels = planes[i_index];
+    }
 
     return VLC_SUCCESS;
 }




More information about the vlc-devel mailing list