summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-05-20 06:17:02 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-05-20 06:17:01 -0700
commitd38f3fb05ce3bd952f988ee533407a70e3d4d32c (patch)
treeeff829d27e62efd2b9e93b0e42ce8127502de9d6
parentdf11816dcba66c9f3ce469aa0c3315bc3dec6ab0 (diff)
parent5d06efdcec1e2f7508ddf6ea6faa9ee4797a80da (diff)
downloadandroid_hardware_qcom_media-d38f3fb05ce3bd952f988ee533407a70e3d4d32c.tar.gz
android_hardware_qcom_media-d38f3fb05ce3bd952f988ee533407a70e3d4d32c.tar.bz2
android_hardware_qcom_media-d38f3fb05ce3bd952f988ee533407a70e3d4d32c.zip
Merge "mm-video-v4l2: vidc: Restore pixel format on capture plane"
-rw-r--r--mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp25
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 eeddc78b..c4c7aeed 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
@@ -991,13 +991,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) {
@@ -1037,6 +1039,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;
}
@@ -9478,8 +9495,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;