diff options
author | Alex Hong <rurumihong@google.com> | 2020-02-26 18:21:08 +0800 |
---|---|---|
committer | Alex Hong <rurumihong@google.com> | 2020-02-26 18:21:08 +0800 |
commit | 463d752f5b3042193354ec8c75bb73454a7dac2f (patch) | |
tree | d4bf8d35e88b6bcf8ad129c05da0aaf4476bb744 | |
parent | 7338ce29053842d95e83136b53efe43806e5f228 (diff) | |
parent | ad4c185b37b48c75c15e9753ce0fe40866006899 (diff) | |
download | media-463d752f5b3042193354ec8c75bb73454a7dac2f.tar.gz |
Merge remote-tracking branch 'goog/qcom/release/LA.UM.7.8.9.C2.08.00.00.618.012' into rvc-devandroid-mainline-12.0.0_r112android-mainline-11.0.0_r44android-mainline-11.0.0_r43android-mainline-11.0.0_r42android-mainline-11.0.0_r41android-mainline-11.0.0_r40android-mainline-11.0.0_r39android-mainline-11.0.0_r38android-mainline-11.0.0_r37android-mainline-11.0.0_r36android-mainline-11.0.0_r35android-mainline-11.0.0_r34android-mainline-11.0.0_r32android-mainline-11.0.0_r31android-mainline-11.0.0_r30android-mainline-11.0.0_r28android-mainline-11.0.0_r27android-mainline-11.0.0_r26android-mainline-11.0.0_r25android-mainline-11.0.0_r24android-mainline-11.0.0_r23android-mainline-11.0.0_r22android-mainline-11.0.0_r21android-mainline-11.0.0_r20android-mainline-11.0.0_r18android-mainline-11.0.0_r17android-mainline-11.0.0_r16android-mainline-11.0.0_r15android-mainline-11.0.0_r14android-mainline-11.0.0_r13android-mainline-11.0.0_r12aml_tz2_305400500aml_tz2_305400300aml_tz2_305400100aml_tz2_304500300aml_tz2_303900110aml_tz2_303900102aml_tz2_303800002aml_tz2_303800001aml_tz2_303200001android12-mainline-tzdata2-releaseandroid11-mainline-tethering-releaseandroid11-mainline-permission-releaseandroid11-mainline-os-statsd-releaseandroid11-mainline-networkstack-releaseandroid11-mainline-media-swcodec-releaseandroid11-mainline-media-releaseandroid11-mainline-extservices-releaseandroid11-mainline-documentsui-releaseandroid11-mainline-conscrypt-releaseandroid11-mainline-cellbroadcast-releaseandroid11-mainline-captiveportallogin-releaseandroid11-devaml_tz2_305400100
Conflicts:
mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
Bug: 149539244
Change-Id: I1f76b1a162e331bad8e6af6b259aca271a212460
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); |