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

omxil: Make CopyOmxPicture not use the omxil decoder's internals

This allows using this function for copying data in a given
OMX pixel format, to be used by the MediaCodec decoder (that
uses OMX pixel format definitions).
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent c62eab3d
...@@ -1290,7 +1290,11 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) ...@@ -1290,7 +1290,11 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
p_pic = decoder_NewPicture( p_dec ); p_pic = decoder_NewPicture( p_dec );
if (p_pic) if (p_pic)
CopyOmxPicture(p_dec, p_pic, p_header, p_sys->out.definition.format.video.nSliceHeight); CopyOmxPicture(p_sys->out.definition.format.video.eColorFormat,
p_pic, p_sys->out.definition.format.video.nSliceHeight,
p_sys->out.i_frame_stride,
p_header->pBuffer + p_header->nOffset,
p_sys->out.i_frame_stride_chroma_div);
} }
if (p_pic) if (p_pic)
......
...@@ -131,7 +131,10 @@ OMX_ERRORTYPE WaitForSpecificOmxEvent(decoder_t *p_dec, ...@@ -131,7 +131,10 @@ OMX_ERRORTYPE WaitForSpecificOmxEvent(decoder_t *p_dec,
/***************************************************************************** /*****************************************************************************
* Picture utility functions * Picture utility functions
*****************************************************************************/ *****************************************************************************/
void CopyOmxPicture( decoder_t *, picture_t *, OMX_BUFFERHEADERTYPE *, int ); void CopyOmxPicture( int i_color_format, picture_t *p_pic,
int i_slice_height,
int i_src_stride, uint8_t *p_src, int i_chroma_div );
void CopyVlcPicture( decoder_t *, OMX_BUFFERHEADERTYPE *, picture_t * ); void CopyVlcPicture( decoder_t *, OMX_BUFFERHEADERTYPE *, picture_t * );
/***************************************************************************** /*****************************************************************************
......
...@@ -119,18 +119,14 @@ OMX_ERRORTYPE WaitForSpecificOmxEvent(decoder_t *p_dec, ...@@ -119,18 +119,14 @@ OMX_ERRORTYPE WaitForSpecificOmxEvent(decoder_t *p_dec,
/***************************************************************************** /*****************************************************************************
* Picture utility functions * Picture utility functions
*****************************************************************************/ *****************************************************************************/
void CopyOmxPicture( decoder_t *p_dec, picture_t *p_pic, void CopyOmxPicture( int i_color_format, picture_t *p_pic,
OMX_BUFFERHEADERTYPE *p_header, int i_slice_height ) int i_slice_height,
int i_src_stride, uint8_t *p_src, int i_chroma_div )
{ {
decoder_sys_t *p_sys = p_dec->p_sys; uint8_t *p_dst;
int i_src_stride, i_dst_stride; int i_dst_stride;
int i_plane, i_width, i_line; int i_plane, i_width, i_line;
uint8_t *p_dst, *p_src; if( i_color_format == QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka )
i_src_stride = p_sys->out.i_frame_stride;
p_src = p_header->pBuffer + p_header->nOffset;
if( p_dec->p_sys->out.definition.format.video.eColorFormat == QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka )
{ {
qcom_convert(p_src, p_pic); qcom_convert(p_src, p_pic);
return; return;
...@@ -138,7 +134,7 @@ void CopyOmxPicture( decoder_t *p_dec, picture_t *p_pic, ...@@ -138,7 +134,7 @@ void CopyOmxPicture( decoder_t *p_dec, picture_t *p_pic,
for( i_plane = 0; i_plane < p_pic->i_planes; i_plane++ ) for( i_plane = 0; i_plane < p_pic->i_planes; i_plane++ )
{ {
if(i_plane == 1) i_src_stride /= p_sys->out.i_frame_stride_chroma_div; if(i_plane == 1) i_src_stride /= i_chroma_div;
p_dst = p_pic->p[i_plane].p_pixels; p_dst = p_pic->p[i_plane].p_pixels;
i_dst_stride = p_pic->p[i_plane].i_pitch; i_dst_stride = p_pic->p[i_plane].i_pitch;
i_width = p_pic->p[i_plane].i_visible_pitch; i_width = p_pic->p[i_plane].i_visible_pitch;
......
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