diff options
author | Jerry Huang <huangjerry@google.com> | 2019-09-12 15:32:58 +0800 |
---|---|---|
committer | wenchangliu <wenchangliu@google.com> | 2019-10-14 14:55:58 +0800 |
commit | 5c3f5e0a919a1dade53a3b00e8ef79d8719d58bf (patch) | |
tree | 497418be2cc11aca720f99df66839abf47d7a6dc /msm8998 | |
parent | 585eaee8b0f299727df8006d5e4de3e9b52bc62a (diff) | |
download | media-5c3f5e0a919a1dade53a3b00e8ef79d8719d58bf.tar.gz |
mm-video-v4l2: venc: Check private handle->flags changed in empty_this_buffer_opaque
private handle flags was updated only once in C2DColorConvert.
C2D_FORMAT_UBWC_COMPRESSED should be aligned if private_handle_t::PRIV_FLAGS_UBWC_ALIGNED is SET.
Bug: 134527014
Test: Daydream cast to sink, screenrecord, camera recording
Change-Id: I7f04bea4eb89e5e90309c26723361f2e956fd63b
Diffstat (limited to 'msm8998')
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/venc/inc/omx_video_base.h | 2 | ||||
-rw-r--r-- | msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/msm8998/mm-video-v4l2/vidc/venc/inc/omx_video_base.h b/msm8998/mm-video-v4l2/vidc/venc/inc/omx_video_base.h index 7ea8fd7..c15a1b1 100644 --- a/msm8998/mm-video-v4l2/vidc/venc/inc/omx_video_base.h +++ b/msm8998/mm-video-v4l2/vidc/venc/inc/omx_video_base.h @@ -195,6 +195,7 @@ class omx_video: public qc_omx_component bool get_buffer_size(int port,unsigned int &buf_size); int get_src_format(); void close(); + bool isUBWCChanged(unsigned int flags); private: C2DColorConverterBase *c2dcc; pthread_mutex_t c_lock; @@ -202,6 +203,7 @@ class omx_video: public qc_omx_component ColorConvertFormat src_format; createC2DColorConverter_t *mConvertOpen; destroyC2DColorConverter_t *mConvertClose; + unsigned int mFlags = 0; }; omx_c2d_conv c2d_conv; #endif diff --git a/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp index d1c8d97..8756c09 100644 --- a/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp +++ b/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp @@ -5069,6 +5069,7 @@ bool omx_video::omx_c2d_conv::open(unsigned int height,unsigned int width, if (c2dcc) { src_format = src; status = true; + mFlags = flags; } else DEBUG_PRINT_ERROR("mConvertOpen failed"); } @@ -5131,6 +5132,11 @@ bool omx_video::omx_c2d_conv::get_buffer_size(int port,unsigned int &buf_size) } return ret; } +bool omx_video::omx_c2d_conv::isUBWCChanged(unsigned int flags) +{ + return (mFlags & private_handle_t::PRIV_FLAGS_UBWC_ALIGNED) != + (flags & private_handle_t::PRIV_FLAGS_UBWC_ALIGNED); +} bool omx_video::is_conv_needed(int hal_fmt, int hal_flags) { @@ -5212,7 +5218,8 @@ OMX_ERRORTYPE omx_video::empty_this_buffer_opaque(OMX_IN OMX_HANDLETYPE hComp, updated correctly*/ if (buffer->nFilledLen > 0 && handle) { - if (c2d_opened && handle->format != c2d_conv.get_src_format()) { + if (c2d_opened && (handle->format != c2d_conv.get_src_format() || + c2d_conv.isUBWCChanged(handle->flags))) { c2d_conv.close(); c2d_opened = false; } |