From 6a67cccc3fd970a5b1323f0ad82744d89860019f Mon Sep 17 00:00:00 2001 From: Sanjay Singh Date: Mon, 24 Dec 2018 11:41:11 +0530 Subject: [PATCH 1/3] mm-core: Remove AIV component from registry. AIV component is not supported any more. Remove it from QCS605 OMX registry table. Change-Id: I747fa2d03dac48f699f5b2558119a31b941914e9 --- mm-core/src/qcs605/registry_table_android.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/mm-core/src/qcs605/registry_table_android.c b/mm-core/src/qcs605/registry_table_android.c index a3cda2b0..e9bb2d39 100644 --- a/mm-core/src/qcs605/registry_table_android.c +++ b/mm-core/src/qcs605/registry_table_android.c @@ -1,5 +1,5 @@ /*-------------------------------------------------------------------------- -Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. +Copyright (c) 2016-2019, 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 @@ -713,22 +713,6 @@ omx_core_cb_type core[] = "audio_decoder.aac" } }, - { - "AIV.play.generic", - NULL, // Create instance function - // Unique instance handle - { - NULL, - NULL, - NULL, - NULL - }, - NULL, // Shared object library handle - "libAivPlay.so", - { - "AIV.play.role.generic" - } - }, { "OMX.QCOM.CUST.COMP.START", NULL, //Create instance function From eadb65c1618eef70fca58f7c15daf690381fd7aa Mon Sep 17 00:00:00 2001 From: Vasantha Balla Date: Thu, 24 Jan 2019 09:30:04 +0530 Subject: [PATCH 2/3] venc: Allow vp8 encoder client to set keyframe interval. set_parameter and getparameter calls are implemented for vp8parameter OMX_IndexParamVideoAndroidVp8Encoder. Change-Id: If1c442fa6fa3205f330f7a2fd80482b2fa9c4a63 --- mm-video-v4l2/vidc/venc/inc/omx_video_base.h | 1 + .../vidc/venc/src/omx_video_base.cpp | 8 ++++++++ .../vidc/venc/src/omx_video_encoder.cpp | 20 ++++++++++++++++++- .../venc/src/video_encoder_device_v4l2.cpp | 18 +++++++++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/mm-video-v4l2/vidc/venc/inc/omx_video_base.h b/mm-video-v4l2/vidc/venc/inc/omx_video_base.h index dc805f93..6c2c0177 100644 --- a/mm-video-v4l2/vidc/venc/inc/omx_video_base.h +++ b/mm-video-v4l2/vidc/venc/inc/omx_video_base.h @@ -674,6 +674,7 @@ class omx_video: public qc_omx_component OMX_VIDEO_PARAM_H263TYPE m_sParamH263; OMX_VIDEO_PARAM_AVCTYPE m_sParamAVC; OMX_VIDEO_PARAM_VP8TYPE m_sParamVP8; + OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE m_sParamVP8Encoder; OMX_VIDEO_PARAM_HEVCTYPE m_sParamHEVC; QOMX_VIDEO_PARAM_TMETYPE m_sParamTME; OMX_U32 tme_payload_version; diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp index 4c3aa019..4de58259 100644 --- a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp +++ b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp @@ -2131,6 +2131,14 @@ OMX_ERRORTYPE omx_video::get_parameter(OMX_IN OMX_HANDLETYPE hComp, memcpy(pDownScalarParam, &m_sParamDownScalar, sizeof(m_sParamDownScalar)); break; } + case OMX_IndexParamVideoAndroidVp8Encoder: + { + VALIDATE_OMX_PARAM_DATA(paramData, OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE); + OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE *pVp8Params = + reinterpret_cast(paramData); + memcpy(pVp8Params,&m_sParamVP8Encoder,sizeof(m_sParamVP8Encoder)); + break; + } case OMX_IndexParamConsumerUsageBits: { if (paramData == NULL) { return OMX_ErrorBadParameter; } 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 0d2e8485..3a368bdd 100644 --- a/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp +++ b/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp @@ -483,6 +483,10 @@ OMX_ERRORTYPE omx_venc::component_init(OMX_STRING role) m_sParamVP8.nDCTPartitions = 0; m_sParamVP8.bErrorResilientMode = OMX_FALSE; + OMX_INIT_STRUCT(&m_sParamVP8Encoder,OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE); + m_sParamVP8Encoder.nPortIndex = (OMX_U32) PORT_INDEX_OUT; + m_sParamVP8Encoder.nKeyFrameInterval = 30; + // HEVC specific init OMX_INIT_STRUCT(&m_sParamHEVC, OMX_VIDEO_PARAM_HEVCTYPE); m_sParamHEVC.nPortIndex = (OMX_U32) PORT_INDEX_OUT; @@ -883,7 +887,21 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp, memcpy(&m_sParamVP8,pParam, sizeof(struct OMX_VIDEO_PARAM_VP8TYPE)); break; } - case (OMX_INDEXTYPE)OMX_IndexParamVideoHevc: + case (OMX_INDEXTYPE)OMX_IndexParamVideoAndroidVp8Encoder: + { + VALIDATE_OMX_PARAM_DATA(paramData, OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE); + OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE* pParam = (OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE*)paramData; + OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE vp8_param; + DEBUG_PRINT_LOW("set_parameter: OMX_IndexParamVideoAndroidVp8Encoder"); + + memcpy(&vp8_param, pParam, sizeof( struct OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE)); + if (handle->venc_set_param(&vp8_param, (OMX_INDEXTYPE)OMX_IndexParamVideoAndroidVp8Encoder) != true) { + return OMX_ErrorUnsupportedSetting; + } + memcpy(&m_sParamVP8Encoder, &vp8_param, sizeof(struct OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE)); + break; + } + case (OMX_INDEXTYPE)OMX_IndexParamVideoHevc: { VALIDATE_OMX_PARAM_DATA(paramData, OMX_VIDEO_PARAM_HEVCTYPE); OMX_VIDEO_PARAM_HEVCTYPE* pParam = (OMX_VIDEO_PARAM_HEVCTYPE*)paramData; 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 ceb6b667..3933ad03 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 @@ -2354,6 +2354,24 @@ bool venc_dev::venc_set_param(void *paramData, OMX_INDEXTYPE index) break; } + case OMX_IndexParamVideoAndroidVp8Encoder: + { + DEBUG_PRINT_LOW("venc_set_param: OMX_IndexParamVideoAndroidVp8Encoder"); + OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE *vp8EncodeParams = + (OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE *)paramData; + + if (vp8EncodeParams->nPortIndex == (OMX_U32) PORT_INDEX_OUT) { + int pFrames = vp8EncodeParams->nKeyFrameInterval - 1; + if (venc_set_intra_period(pFrames, 0) == false) { + DEBUG_PRINT_ERROR("ERROR: Request for setting intra period failed"); + return false; + } + + } else { + DEBUG_PRINT_ERROR("ERROR: Invalid Port Index for OMX_IndexParamVideoAndroidVp8Encoder"); + } + break; + } case OMX_IndexParamVideoErrorCorrection: { DEBUG_PRINT_LOW("venc_set_param:OMX_IndexParamVideoErrorCorrection"); From ca5553f270a91dfae1cb2e6432623ded24dfb4fb Mon Sep 17 00:00:00 2001 From: Paras Nagda Date: Sat, 26 Jan 2019 18:33:16 +0530 Subject: [PATCH 3/3] mm-video-v4l2: vdec: Use decode WxH for port reconfig Port setting change is based on decode resolution not the crop resolution. CRs-Fixed: 2233681 Change-Id: I10036b84641b9a804dcc145babbacdfe5aa477c3 --- mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 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 84d5b8c9..30673c88 100644 --- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp +++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp @@ -296,10 +296,18 @@ void* async_message_thread (void *input) * let's handle as Sufficient. Ex : 1080 & 1088 or 2160 & 2176. * When FBD comes, component updates the clients with actual * resolution through set_buffer_geometry. + * As the LCU size for HEVC is 32bit, we need 32 pixel alignment + * for HEVC. For others, it should be 16. */ - event_fields_changed |= (omx->drv_ctx.video_resolution.frame_height != ptr[7]); - event_fields_changed |= (omx->drv_ctx.video_resolution.frame_width != ptr[8]); + uint32_t pixel_align = (codec == V4L2_PIX_FMT_HEVC? 32:16); + + event_fields_changed |= (ALIGN(omx->drv_ctx.video_resolution.frame_height, + pixel_align) != + ALIGN(ptr[0], pixel_align)); + event_fields_changed |= (ALIGN(omx->drv_ctx.video_resolution.frame_width, + pixel_align) != + ALIGN(ptr[1], pixel_align)); if ((codec == V4L2_PIX_FMT_H264) || (codec == V4L2_PIX_FMT_HEVC)) {