Commit a5d9020b authored by Felix Abecassis's avatar 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.
parent 360326db
...@@ -329,6 +329,13 @@ static void SetupPictureYV12( SurfaceInfo* p_surfaceInfo, picture_t *p_picture ) ...@@ -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->p_pixels = o->p_pixels + o->i_lines * o->i_pitch;
p->i_pitch = i_c_stride; p->i_pitch = i_c_stride;
p->i_lines = p_picture->format.i_height / 2; 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, if( vlc_fourcc_AreUVPlanesSwapped( p_picture->format.i_chroma,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment