summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-03-24 02:15:13 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-03-24 02:15:13 +0000
commit7a43d87ecfbd712eca3e7b1a691721dc2064524e (patch)
treed4bf8d35e88b6bcf8ad129c05da0aaf4476bb744
parent4131510401468610b95c8070ec6b1b0081b14ed4 (diff)
parent463d752f5b3042193354ec8c75bb73454a7dac2f (diff)
downloadmedia-android11-security-release.tar.gz
Snap for 6325693 from 463d752f5b3042193354ec8c75bb73454a7dac2f to rvc-releaseandroid-vts-11.0_r9android-vts-11.0_r8android-vts-11.0_r7android-vts-11.0_r6android-vts-11.0_r5android-vts-11.0_r4android-vts-11.0_r3android-vts-11.0_r2android-vts-11.0_r16android-vts-11.0_r15android-vts-11.0_r14android-vts-11.0_r13android-vts-11.0_r12android-vts-11.0_r11android-vts-11.0_r10android-vts-11.0_r1android-security-11.0.0_r76android-security-11.0.0_r75android-security-11.0.0_r74android-security-11.0.0_r73android-security-11.0.0_r72android-security-11.0.0_r71android-security-11.0.0_r70android-security-11.0.0_r69android-security-11.0.0_r68android-security-11.0.0_r67android-security-11.0.0_r66android-security-11.0.0_r65android-security-11.0.0_r64android-security-11.0.0_r63android-security-11.0.0_r62android-security-11.0.0_r61android-security-11.0.0_r60android-security-11.0.0_r59android-security-11.0.0_r58android-security-11.0.0_r57android-security-11.0.0_r56android-security-11.0.0_r55android-security-11.0.0_r54android-security-11.0.0_r53android-security-11.0.0_r52android-security-11.0.0_r51android-security-11.0.0_r50android-security-11.0.0_r49android-security-11.0.0_r1android-platform-11.0.0_r2android-platform-11.0.0_r1android-cts-11.0_r9android-cts-11.0_r8android-cts-11.0_r7android-cts-11.0_r6android-cts-11.0_r5android-cts-11.0_r4android-cts-11.0_r3android-cts-11.0_r2android-cts-11.0_r16android-cts-11.0_r15android-cts-11.0_r14android-cts-11.0_r13android-cts-11.0_r12android-cts-11.0_r11android-cts-11.0_r10android-cts-11.0_r1android-11.0.0_r6android-11.0.0_r5android-11.0.0_r4android-11.0.0_r3android-11.0.0_r25android-11.0.0_r2android-11.0.0_r17android-11.0.0_r1android11-tests-releaseandroid11-security-releaseandroid11-s1-releaseandroid11-release
Change-Id: I699f9b38f038cf0c414418110438cb35e89ea545
-rw-r--r--mm-video-v4l2/vidc/venc/inc/omx_video_base.h4
-rw-r--r--mm-video-v4l2/vidc/venc/src/omx_swvenc_mpeg4.cpp9
-rw-r--r--mm-video-v4l2/vidc/venc/src/omx_video_base.cpp7
-rw-r--r--mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp9
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);