Commit 944c1c4e authored by Martin Storsjö's avatar Martin Storsjö Committed by Jean-Baptiste Kempf

omxil: Handle planes with a height larger than the frame height

The nSliceHeight parameter in OMX apparently can indicate plane
height. This shows up on Nexus One with recent CyanogenMod
with the OpenMAX driver built from source (as opposed to the
older ones with a binary-only OpenMAX driver).
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 5d0d9dec
......@@ -1079,7 +1079,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
p_pic = decoder_NewPicture( p_dec );
if( !p_pic ) break; /* No picture available */
CopyOmxPicture(p_dec, p_pic, p_header);
CopyOmxPicture(p_dec, p_pic, p_header, p_sys->out.definition.format.video.nSliceHeight);
}
p_pic->date = p_header->nTimeStamp;
......
......@@ -119,7 +119,7 @@ OMX_ERRORTYPE WaitForSpecificOmxEvent(decoder_t *p_dec,
/*****************************************************************************
* Picture utility functions
*****************************************************************************/
void CopyOmxPicture( decoder_t *, picture_t *, OMX_BUFFERHEADERTYPE * );
void CopyOmxPicture( decoder_t *, picture_t *, OMX_BUFFERHEADERTYPE *, int );
void CopyVlcPicture( decoder_t *, OMX_BUFFERHEADERTYPE *, picture_t * );
/*****************************************************************************
......
......@@ -119,7 +119,7 @@ OMX_ERRORTYPE WaitForSpecificOmxEvent(decoder_t *p_dec,
* Picture utility functions
*****************************************************************************/
void CopyOmxPicture( decoder_t *p_dec, picture_t *p_pic,
OMX_BUFFERHEADERTYPE *p_header )
OMX_BUFFERHEADERTYPE *p_header, int i_slice_height )
{
decoder_sys_t *p_sys = p_dec->p_sys;
int i_src_stride, i_dst_stride;
......@@ -142,6 +142,13 @@ void CopyOmxPicture( decoder_t *p_dec, picture_t *p_pic,
p_src += i_src_stride;
p_dst += i_dst_stride;
}
/* Handle plane height, which may be indicated via nSliceHeight in OMX.
* The handling for chroma planes currently assumes vertically
* subsampled chroma, e.g. 422 planar wouldn't work right. */
if( i_plane == 0 && i_slice_height > p_pic->p[i_plane].i_visible_lines )
p_src += i_src_stride * (i_slice_height - p_pic->p[i_plane].i_visible_lines);
else if ( i_plane > 0 && i_slice_height/2 > p_pic->p[i_plane].i_visible_lines )
p_src += i_src_stride * (i_slice_height/2 - p_pic->p[i_plane].i_visible_lines);
}
}
......
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