]> git.sesse.net Git - vlc/commitdiff
Export function to copy pixels between 2 plane_t structures.
authorAntoine Cellerier <dionoea@videolan.org>
Sun, 24 Aug 2008 13:35:09 +0000 (15:35 +0200)
committerAntoine Cellerier <dionoea@videolan.org>
Sun, 24 Aug 2008 14:02:04 +0000 (16:02 +0200)
include/vlc_vout.h
src/libvlccore.sym
src/video_output/vout_pictures.c

index 47fc3fd0a86285e1786107df69f8d6c546cef1cf..74e0db17e2f020b5625a010a6b16a5fd5779ceec 100644 (file)
@@ -176,6 +176,7 @@ static inline void picture_CopyProperties( picture_t *p_dst, const picture_t *p_
  * only the compatible(smaller) part will be copied.
  */
 VLC_EXPORT( void, picture_CopyPixels, ( picture_t *p_dst, const picture_t *p_src ) );
+VLC_EXPORT( void, plane_CopyPixels, ( plane_t *p_dst, const plane_t *p_src ) );
 
 /**
  * This function will copy both picture dynamic properties and pixels.
index 5790f974d7d71ffd76e0b9d572bf81027b0f7f63..05acc07484085f5941bed59cb366aa691dff2a6c 100644 (file)
@@ -259,6 +259,7 @@ path_sanitize
 picture_CopyPixels
 picture_Delete
 picture_New
+plane_CopyPixels
 playlist_Add
 playlist_AddExt
 playlist_AddInput
index da603e7329e54abe4a9a180dfdae47419768ce69..f49bb571b5d7cf7dda51da2b5c5f8e34f3a92bc0 100644 (file)
@@ -1053,34 +1053,37 @@ void picture_CopyPixels( picture_t *p_dst, const picture_t *p_src )
     int i;
 
     for( i = 0; i < p_src->i_planes ; i++ )
-    {
-        const unsigned i_width  = __MIN( p_dst->p[i].i_visible_pitch,
-                                         p_src->p[i].i_visible_pitch );
-        const unsigned i_height = __MIN( p_dst->p[i].i_visible_lines,
-                                         p_src->p[i].i_visible_lines );
+        plane_CopyPixels( p_dst->p+i, p_src->p+i );
+}
 
-        if( p_src->p[i].i_pitch == p_dst->p[i].i_pitch )
-        {
-            /* There are margins, but with the same width : perfect ! */
-            vlc_memcpy( p_dst->p[i].p_pixels, p_src->p[i].p_pixels,
-                        p_src->p[i].i_pitch * i_height );
-        }
-        else
-        {
-            /* We need to proceed line by line */
-            uint8_t *p_in = p_src->p[i].p_pixels;
-            uint8_t *p_out = p_dst->p[i].p_pixels;
-            int i_line;
+void plane_CopyPixels( plane_t *p_dst, const plane_t *p_src )
+{
+    const unsigned i_width  = __MIN( p_dst->i_visible_pitch,
+                                     p_src->i_visible_pitch );
+    const unsigned i_height = __MIN( p_dst->i_visible_lines,
+                                     p_src->i_visible_lines );
 
-            assert( p_in );
-            assert( p_out );
+    if( p_src->i_pitch == p_dst->i_pitch )
+    {
+        /* There are margins, but with the same width : perfect ! */
+        vlc_memcpy( p_dst->p_pixels, p_src->p_pixels,
+                    p_src->i_pitch * i_height );
+    }
+    else
+    {
+        /* We need to proceed line by line */
+        uint8_t *p_in = p_src->p_pixels;
+        uint8_t *p_out = p_dst->p_pixels;
+        int i_line;
 
-            for( i_line = i_height; i_line--; )
-            {
-                vlc_memcpy( p_out, p_in, i_width );
-                p_in += p_src->p[i].i_pitch;
-                p_out += p_dst->p[i].i_pitch;
-            }
+        assert( p_in );
+        assert( p_out );
+
+        for( i_line = i_height; i_line--; )
+        {
+            vlc_memcpy( p_out, p_in, i_width );
+            p_in += p_src->i_pitch;
+            p_out += p_dst->i_pitch;
         }
     }
 }