diff options
author | Praneeth Paladugu <ppaladug@codeaurora.org> | 2015-11-19 23:25:43 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-02-01 12:31:06 -0800 |
commit | a7f1dda4184ef2a44ae06557e6f3b7df46060e44 (patch) | |
tree | c6a0e773bdbc79f5c6d9f6f0d3ec91930701f062 | |
parent | db7937a2bfb4ddd1e1306f34f1955dcb5b69c760 (diff) | |
download | android_hardware_qcom_media-a7f1dda4184ef2a44ae06557e6f3b7df46060e44.tar.gz android_hardware_qcom_media-a7f1dda4184ef2a44ae06557e6f3b7df46060e44.tar.bz2 android_hardware_qcom_media-a7f1dda4184ef2a44ae06557e6f3b7df46060e44.zip |
mm-video-v4l2: vidc: venc: Fix rotation issue for 180 degrees
When clients sets 180 degrees rotation, this setting is not set
to driver. Hence the final encoded video doesn't have the rotation
effect. This change fixes the same.
Change-Id: I622b58332cc4e443e2b919f06e46ac5ed30cd1c3
CRs-Fixed: 933466
-rw-r--r-- | mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp index 3868326c..a55744e7 100644 --- a/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp +++ b/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp @@ -1,5 +1,5 @@ /*-------------------------------------------------------------------------- -Copyright (c) 2010-2015, The Linux Foundation. All rights reserved. +Copyright (c) 2010-2016, The Linux Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -1799,27 +1799,26 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp, nRotation = pParam->nRotation - m_sConfigFrameRotation.nRotation; if (nRotation < 0) nRotation = -nRotation; - if (nRotation == 90 || nRotation == 270) { - DEBUG_PRINT_HIGH("set_config: updating device Dims"); - if (handle->venc_set_config(configData, - OMX_IndexConfigCommonRotate) != true) { + + DEBUG_PRINT_HIGH("set_config: updating device Dims"); + + if (handle->venc_set_config(configData, + OMX_IndexConfigCommonRotate) != true) { DEBUG_PRINT_ERROR("ERROR: Set OMX_IndexConfigCommonRotate failed"); return OMX_ErrorUnsupportedSetting; - } else { - OMX_U32 nFrameWidth; - OMX_U32 nFrameHeight; - - DEBUG_PRINT_HIGH("set_config: updating port Dims"); + } + if (nRotation == 90 || nRotation == 270) { + OMX_U32 nFrameWidth; + OMX_U32 nFrameHeight; - nFrameWidth = m_sOutPortDef.format.video.nFrameWidth; - nFrameHeight = m_sOutPortDef.format.video.nFrameHeight; - m_sOutPortDef.format.video.nFrameWidth = nFrameHeight; - m_sOutPortDef.format.video.nFrameHeight = nFrameWidth; - m_sConfigFrameRotation.nRotation = pParam->nRotation; - } - } else { - m_sConfigFrameRotation.nRotation = pParam->nRotation; + DEBUG_PRINT_HIGH("set_config: updating port Dims Rotation angle = %d", + pParam->nRotation); + nFrameWidth = m_sOutPortDef.format.video.nFrameWidth; + nFrameHeight = m_sOutPortDef.format.video.nFrameHeight; + m_sOutPortDef.format.video.nFrameWidth = nFrameHeight; + m_sOutPortDef.format.video.nFrameHeight = nFrameWidth; } + m_sConfigFrameRotation.nRotation = pParam->nRotation; break; } case OMX_QcomIndexConfigVideoFramePackingArrangement: |