mm-video-v4l2: venc: Handle rotation in port definition update

When CAPTURE port definitions are updated during OUTPUT port
definition update, the resolutions must be swapped if Rotation is
enabled. Otherwise kernel may reject the setting in capability
or scaling checks.

Change-Id: I8c6a0f7f759eab17e4bbfd122a82c546859e28e1
diff --git a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
index 50f0e3a..02bb836 100644
--- a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
+++ b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
@@ -1972,8 +1972,13 @@
                             input_extradata_info.count = m_sInput_buff_property.actualcount + 1;
 
                         if (!downscalar_enabled) {
-                            m_sVenc_cfg.dvs_height = portDefn->format.video.nFrameHeight;
-                            m_sVenc_cfg.dvs_width = portDefn->format.video.nFrameWidth;
+                            if (m_rotation.rotation == 90 || m_rotation.rotation == 270) {
+                                m_sVenc_cfg.dvs_height = portDefn->format.video.nFrameWidth;
+                                m_sVenc_cfg.dvs_width = portDefn->format.video.nFrameHeight;
+                            } else {
+                                m_sVenc_cfg.dvs_height = portDefn->format.video.nFrameHeight;
+                                m_sVenc_cfg.dvs_width = portDefn->format.video.nFrameWidth;
+                            }
                         }
                         memset(&fmt, 0, sizeof(fmt));
                         fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;