diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2016-04-29 00:57:45 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-04-29 00:57:45 -0700 |
commit | fdfb471f8864911cf10635e9fd919c66b61aebcb (patch) | |
tree | 8030d9fad7240fd82d3785d8b8e75174ab03dfbe | |
parent | 73699c1931234002157fb99169694a43ce61924a (diff) | |
parent | d39458f689fa6e7fd5a236afc231a87272affbbd (diff) | |
download | android_hardware_qcom_media-fdfb471f8864911cf10635e9fd919c66b61aebcb.tar.gz android_hardware_qcom_media-fdfb471f8864911cf10635e9fd919c66b61aebcb.tar.bz2 android_hardware_qcom_media-fdfb471f8864911cf10635e9fd919c66b61aebcb.zip |
Merge "mm-video-v4l2: vidc: Restore pixel format on capture plane"
-rw-r--r-- | mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp index 2e94ff76..d04b3740 100644 --- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp +++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp @@ -970,13 +970,15 @@ OMX_ERRORTYPE omx_vdec::set_dpb(bool is_split_mode, int dpb_color_format) OMX_ERRORTYPE omx_vdec::decide_dpb_buffer_mode(bool force_split_mode) { OMX_ERRORTYPE eRet = OMX_ErrorNone; + struct v4l2_format fmt; + int rc = 0; bool cpu_access = capture_capability != V4L2_PIX_FMT_NV12_UBWC; bool is_res_above_1080p = (drv_ctx.video_resolution.frame_width > 1920 && drv_ctx.video_resolution.frame_height > 1088) || - (drv_ctx.video_resolution.frame_height > 1088 && - drv_ctx.video_resolution.frame_width > 1920); + (drv_ctx.video_resolution.frame_width > 1088 && + drv_ctx.video_resolution.frame_height > 1920); if (cpu_access) { if (dpb_bit_depth == MSM_VIDC_BIT_DEPTH_8) { @@ -1016,6 +1018,21 @@ OMX_ERRORTYPE omx_vdec::decide_dpb_buffer_mode(bool force_split_mode) if (eRet) { DEBUG_PRINT_HIGH("Failed to set DPB buffer mode: %d", eRet); } + + //Restore the capture format again here, because + //in switching between different DPB-OPB modes, the pixelformat + //on capture port may be changed. + memset(&fmt, 0x0, sizeof(struct v4l2_format)); + fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + fmt.fmt.pix_mp.height = drv_ctx.video_resolution.frame_height; + fmt.fmt.pix_mp.width = drv_ctx.video_resolution.frame_width; + fmt.fmt.pix_mp.pixelformat = capture_capability; + rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_FMT, &fmt); + if (rc) { + DEBUG_PRINT_ERROR("%s: Failed set format on capture mplane", __func__); + return OMX_ErrorUnsupportedSetting; + } + return eRet; } @@ -9451,8 +9468,8 @@ OMX_ERRORTYPE omx_vdec::get_buffer_req(vdec_allocatorproperty *buffer_prop) } else { bool is_res_1080p_or_below = (drv_ctx.video_resolution.frame_width <= 1920 && drv_ctx.video_resolution.frame_height <= 1088) || - (drv_ctx.video_resolution.frame_height <= 1088 && - drv_ctx.video_resolution.frame_width <= 1920); + (drv_ctx.video_resolution.frame_width <= 1088 && + drv_ctx.video_resolution.frame_height <= 1920); int fps = drv_ctx.frame_rate.fps_numerator / (float)drv_ctx.frame_rate.fps_denominator; bool fps_above_180 = (fps >= 180 || operating_frame_rate >= 180) ? true : false; |