vlc | branch: master | Felix Abecassis <[email protected]> | Thu Apr  3 
19:33:57 2014 +0200| [a5d9020b282d107e76259748f428ba93e34eca4f] | committer: 
Felix Abecassis

android: fix green line issue when using an YUV surface in SW mode.

The padding lines introduced by avcodec for direct rendering are set
to black since they might be used by Android during rescaling.

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

 modules/video_output/android/surface.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/video_output/android/surface.c 
b/modules/video_output/android/surface.c
index 8325fe5..bc51913 100644
--- a/modules/video_output/android/surface.c
+++ b/modules/video_output/android/surface.c
@@ -329,6 +329,13 @@ static void SetupPictureYV12( SurfaceInfo* p_surfaceInfo, 
picture_t *p_picture )
         p->p_pixels = o->p_pixels + o->i_lines * o->i_pitch;
         p->i_pitch  = i_c_stride;
         p->i_lines  = p_picture->format.i_height / 2;
+        /*
+          Explicitly set the padding lines of the picture to black (127 for 
YUV)
+          since they might be used by Android during rescaling.
+        */
+        int visible_lines = p_picture->format.i_visible_height / 2;
+        if (visible_lines < p->i_lines)
+            memset(&p->p_pixels[visible_lines * p->i_pitch], 127, (p->i_lines 
- visible_lines) * p->i_pitch);
     }
 
     if( vlc_fourcc_AreUVPlanesSwapped( p_picture->format.i_chroma,

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to