diff options
author | Alex Hong <rurumihong@google.com> | 2020-03-23 16:04:51 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-03-23 16:04:51 +0000 |
commit | 36a2e54ac76aac12b3a81ee4ee87efe3b2f89aaf (patch) | |
tree | d4bf8d35e88b6bcf8ad129c05da0aaf4476bb744 | |
parent | 7338ce29053842d95e83136b53efe43806e5f228 (diff) | |
parent | 463d752f5b3042193354ec8c75bb73454a7dac2f (diff) | |
download | media-36a2e54ac76aac12b3a81ee4ee87efe3b2f89aaf.tar.gz |
Merge remote-tracking branch 'goog/qcom/release/LA.UM.7.8.9.C2.08.00.00.618.012' into rvc-dev am: 463d752f5bandroid-11.0.0_r16android11-d1-b-release
Change-Id: I6009f6ed9c33333091bae75893751b15843182a7
4 files changed, 19 insertions, 10 deletions
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 5908843a..4dccb1df 100644 --- a/mm-video-v4l2/vidc/venc/inc/omx_video_base.h +++ b/mm-video-v4l2/vidc/venc/inc/omx_video_base.h @@ -1,5 +1,5 @@ /*-------------------------------------------------------------------------- -Copyright (c) 2010-2018, The Linux Foundation. All rights reserved. +Copyright (c) 2010-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 @@ -152,6 +152,8 @@ static const char* MEM_DEVICE = "/dev/ion"; #define LEGACY_CAM_METADATA_TYPE encoder_media_buffer_type #endif +class omx_video; +void post_message(omx_video *omx, unsigned char id); void* message_thread_enc(void *); enum omx_venc_extradata_types { diff --git a/mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp b/mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp index ade82a41..8df3148c 100644 --- a/mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp +++ b/mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp @@ -1,5 +1,5 @@ /*-------------------------------------------------------------------------- -Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. +Copyright (c) 2014-2017, 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 met: @@ -2054,6 +2054,13 @@ OMX_ERRORTYPE omx_venc::component_deinit(OMX_IN OMX_HANDLETYPE hComp) DEBUG_PRINT_HIGH("Calling swvenc_deinit()"); swvenc_deinit(m_hSwVenc); + if (msg_thread_created) { + msg_thread_created = false; + msg_thread_stop = true; + post_message(this, OMX_COMPONENT_CLOSE_MSG); + DEBUG_PRINT_HIGH("omx_video: Waiting on Msg Thread exit"); + pthread_join(msg_thread_id,NULL); + } DEBUG_PRINT_HIGH("OMX_Venc:Component Deinit"); RETURN(OMX_ErrorNone); 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 4018164d..0327551c 100644 --- a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp +++ b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp @@ -320,13 +320,6 @@ omx_video::omx_video(): omx_video::~omx_video() { DEBUG_PRINT_HIGH("~omx_video(): Inside Destructor()"); - if (msg_thread_created) { - msg_thread_stop = true; - post_message(this, OMX_COMPONENT_CLOSE_MSG); - DEBUG_PRINT_HIGH("omx_video: Waiting on Msg Thread exit"); - pthread_join(msg_thread_id,NULL); - } - DEBUG_PRINT_HIGH("omx_video: Waiting on Async Thread exit"); /*For V4L2 based drivers, pthread_join is done in device_close * so no need to do it here*/ pthread_mutex_destroy(&m_lock); 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 6059c24f..4eaaa3d3 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 @@ -1,5 +1,5 @@ /*-------------------------------------------------------------------------- -Copyright (c) 2010-2018, The Linux Foundation. All rights reserved. +Copyright (c) 2010-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 met: @@ -1633,6 +1633,13 @@ void venc_dev::venc_close() if (async_thread_created) pthread_join(m_tid,NULL); + if (venc_handle->msg_thread_created) { + venc_handle->msg_thread_created = false; + venc_handle->msg_thread_stop = true; + post_message(venc_handle, omx_video::OMX_COMPONENT_CLOSE_MSG); + DEBUG_PRINT_HIGH("omx_video: Waiting on Msg Thread exit"); + pthread_join(venc_handle->msg_thread_id, NULL); + } DEBUG_PRINT_HIGH("venc_close X"); unsubscribe_to_events(m_nDriver_fd); close(m_poll_efd); |