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

omxil: Use OMX_IndexConfigCommonOutputCrop to set video width/height

As a side effect, this also makes the output correct on Samsung
Galaxy S II on ICS.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent e9207f4a
......@@ -427,6 +427,7 @@ static OMX_ERRORTYPE GetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
decoder_sys_t *p_sys = p_dec->p_sys;
OMX_PARAM_PORTDEFINITIONTYPE *def = &p_port->definition;
OMX_ERRORTYPE omx_error;
OMX_CONFIG_RECTTYPE crop_rect;
omx_error = OMX_GetParameter(p_port->omx_handle,
OMX_IndexParamPortDefinition, def);
......@@ -443,6 +444,22 @@ static OMX_ERRORTYPE GetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
p_fmt->video.i_frame_rate = p_dec->fmt_in.video.i_frame_rate;
p_fmt->video.i_frame_rate_base = p_dec->fmt_in.video.i_frame_rate_base;
OMX_INIT_STRUCTURE(crop_rect);
crop_rect.nPortIndex = def->nPortIndex;
omx_error = OMX_GetConfig(p_port->omx_handle, OMX_IndexConfigCommonOutputCrop, &crop_rect);
if (omx_error == OMX_ErrorNone)
{
p_fmt->video.i_width = crop_rect.nWidth;
p_fmt->video.i_visible_width = crop_rect.nWidth;
p_fmt->video.i_height = crop_rect.nHeight;
p_fmt->video.i_visible_height = crop_rect.nHeight;
}
else
{
/* Don't pass the error back to the caller, this isn't mandatory */
omx_error = OMX_ErrorNone;
}
/* Hack: Nexus One (stock firmware with binary OMX driver blob)
* claims to output 420Planar even though it in in practice is
* NV21. */
......
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