From 90031b5b20aa0cf3187040b76b711e604fa6355f Mon Sep 17 00:00:00 2001 From: preeja33 Date: Wed, 20 Aug 2025 18:20:37 +0530 Subject: [PATCH 01/53] add sleep in destructor of test --- Tests/L1Tests/tests/test_MiracastService.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Tests/L1Tests/tests/test_MiracastService.cpp b/Tests/L1Tests/tests/test_MiracastService.cpp index 322559e3..cd53901a 100755 --- a/Tests/L1Tests/tests/test_MiracastService.cpp +++ b/Tests/L1Tests/tests/test_MiracastService.cpp @@ -44,7 +44,7 @@ namespace #define TEST_LOG(FMT, ...) log(__func__, __FILE__, __LINE__, syscall(__NR_gettid),FMT,##__VA_ARGS__) //Commented out the functions below because some test cases that use them have also been commented out. Since those test cases are disabled, these functions are now unused. - #if 0 + #if 1 static void removeFile(const char* fileName) { if (std::remove(fileName) != 0) @@ -252,6 +252,11 @@ class MiracastServiceEventTest : public MiracastServiceTest { dispatcher->Release(); PluginHost::IFactories::Assign(nullptr); + TEST_LOG("predebug Before destructor sleep "); + //Wait for all the previous destructor process to complete + std::this_thread::sleep_for(std::chrono::milliseconds(3000)); + TEST_LOG("predebug After destructor sleep "); + } }; @@ -259,7 +264,7 @@ TEST_F(MiracastServiceTest, GetInformation) { EXPECT_EQ("This MiracastService Plugin Facilitates Peer-to-Peer Control and WFD Source Device Discovery", plugin->Information()); } -#if 0 +#if 1 TEST_F(MiracastServiceTest, P2PCtrlInterfaceNameNotFound) { removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); From 0c277fd7368bfe8992689b9fe8c5a4baa4817d86 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Wed, 20 Aug 2025 18:23:16 +0530 Subject: [PATCH 02/53] Update MiracastServiceImplementation.cpp --- Miracast/MiracastService/MiracastServiceImplementation.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Miracast/MiracastService/MiracastServiceImplementation.cpp b/Miracast/MiracastService/MiracastServiceImplementation.cpp index cab5df0f..22dc914c 100644 --- a/Miracast/MiracastService/MiracastServiceImplementation.cpp +++ b/Miracast/MiracastService/MiracastServiceImplementation.cpp @@ -96,7 +96,7 @@ namespace WPEFramework m_SystemPluginObj = nullptr; } - MIRACASTLOG_INFO("Disconnect from the COM-RPC socket"); + MIRACASTLOG_INFO("predebug Disconnect from the COM-RPC socket"); if (m_isServiceInitialized) { @@ -114,6 +114,7 @@ namespace WPEFramework } MIRACAST::logger_deinit(); MiracastServiceImplementation::_instance = nullptr; + MIRACASTLOG_INFO("predebug destruction done"); } /** @@ -1233,4 +1234,4 @@ namespace WPEFramework /* Internal Timer Callback and methods End */ /* ------------------------------------------------------------------------------------------------------- */ } // namespace Plugin -} // namespace WPEFramework \ No newline at end of file +} // namespace WPEFramework From c361e04b434849ab961b591aec9be8b898d81eb5 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Wed, 20 Aug 2025 18:34:30 +0530 Subject: [PATCH 03/53] Update L1-tests.yml --- .github/workflows/L1-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/L1-tests.yml b/.github/workflows/L1-tests.yml index de9bec4d..fd7ed63e 100755 --- a/.github/workflows/L1-tests.yml +++ b/.github/workflows/L1-tests.yml @@ -138,7 +138,7 @@ jobs: with: repository: rdkcentral/entservices-casting path: entservices-casting - ref: develop + ref: test_malloc - name: Checkout googletest if: steps.cache.outputs.cache-hit != 'true' From ed8950a3134d138505adbe3522bf89a98818d994 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Wed, 20 Aug 2025 21:09:55 +0530 Subject: [PATCH 04/53] Update MiracastController.cpp --- .../MiracastService/MiracastController.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index 2c7fae38..4ba22c90 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -71,7 +71,7 @@ MiracastController::MiracastController(void) MiracastController::~MiracastController() { - MIRACASTLOG_TRACE("Entering..."); + MIRACASTLOG_INFO("Entering..."); while (!m_deviceInfoList.empty()) { @@ -85,7 +85,7 @@ MiracastController::~MiracastController() m_groupInfo = nullptr; } - MIRACASTLOG_TRACE("Exiting..."); + MIRACASTLOG_INFO("Exiting..."); } MiracastError MiracastController::create_ControllerFramework(std::string p2p_ctrl_iface) @@ -642,7 +642,7 @@ bool MiracastController::get_connection_status() void MiracastController::create_DeviceCacheData(std::string deviceMAC,std::string authType,std::string modelName,std::string deviceType, bool force_overwrite) { bool new_device_entry = false; - MIRACASTLOG_TRACE("Entering..."); + MIRACASTLOG_INFO("Entering..."); DeviceInfo *cur_device_info_ptr = MiracastController::get_device_details(deviceMAC); // Allocate memory and update the device cache info @@ -651,7 +651,7 @@ void MiracastController::create_DeviceCacheData(std::string deviceMAC,std::strin cur_device_info_ptr = new DeviceInfo; new_device_entry = true; force_overwrite = true; - MIRACASTLOG_VERBOSE("#### Creating Device Cache ####"); + MIRACASTLOG_INFO("#### Creating Device Cache ####"); } if (( nullptr != cur_device_info_ptr ) && (force_overwrite)) @@ -673,16 +673,17 @@ void MiracastController::create_DeviceCacheData(std::string deviceMAC,std::strin { m_deviceInfoList.push_back(cur_device_info_ptr); } - MIRACASTLOG_TRACE("Exiting..."); + MIRACASTLOG_INFO("Exiting..."); } DeviceInfo *MiracastController::get_device_details(std::string MAC) { DeviceInfo *deviceInfo = nullptr; std::size_t found; - MIRACASTLOG_TRACE("Entering..."); + MIRACASTLOG_INFO("Entering..."); for (auto device : m_deviceInfoList) { + MIRACASTLOG_INFO("Entering device info list"); found = device->deviceMAC.find(MAC); if (found != std::string::npos) { @@ -690,7 +691,7 @@ DeviceInfo *MiracastController::get_device_details(std::string MAC) break; } } - MIRACASTLOG_TRACE("Exiting..."); + MIRACASTLOG_INFO("Exiting..."); return deviceInfo; } @@ -1099,6 +1100,7 @@ void MiracastController::Controller_Thread(void *args) else { error_code = WPEFramework::Exchange::IMiracastService::REASON_CODE_GENERIC_FAILURE; + MIRACASTLOG_INFO("predebug session restart"); session_restart_required = true; MIRACASTLOG_ERROR("!!!! Unable to get the Source Device IP and Terminating Group Here !!!!"); remove_P2PGroupInstance(); @@ -1247,6 +1249,7 @@ void MiracastController::Controller_Thread(void *args) } new_thunder_req_client_connection_sent = false; another_thunder_req_client_connection_sent = false; + MIRACASTLOG_INFO("predebug session_restart_required\n"); session_restart_required = true; p2p_group_instance_alive = false; m_connect_req_notified = false; @@ -1611,4 +1614,4 @@ void ControllerThreadCallback(void *args) miracast_ctrler_obj->Controller_Thread(nullptr); } MIRACASTLOG_TRACE("Exiting..."); -} \ No newline at end of file +} From 6d1817de93f9445943712668572daf9f90d6b6da Mon Sep 17 00:00:00 2001 From: preeja33 Date: Wed, 20 Aug 2025 21:31:19 +0530 Subject: [PATCH 05/53] Update MiracastController.cpp --- Miracast/MiracastService/MiracastController.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index 4ba22c90..0e4babe6 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -785,19 +785,19 @@ void MiracastController::Controller_Thread(void *args) session_restart_required = false, p2p_group_instance_alive = false; - MIRACASTLOG_TRACE("Entering..."); + MIRACASTLOG_INFO("Entering..."); while (nullptr != m_controller_thread) { std::string event_buffer; event_buffer.clear(); - MIRACASTLOG_TRACE("!!! Waiting for Event !!!\n"); + MIRACASTLOG_INFO("!!! Waiting for Event !!!\n"); m_controller_thread->receive_message(&controller_msgq_data, CONTROLLER_MSGQ_SIZE, THREAD_RECV_MSG_INDEFINITE_WAIT); event_buffer = controller_msgq_data.msg_buffer; - MIRACASTLOG_TRACE("!!! Received Action[%#08X]Data[%s] !!!\n", controller_msgq_data.state, event_buffer.c_str()); + MIRACASTLOG_INFO("!!! Received Action[%#08X]Data[%s] !!!\n", controller_msgq_data.state, event_buffer.c_str()); if (CONTROLLER_SELF_ABORT == controller_msgq_data.state) { From d7c93e9e968b1163eb1b3625dcaece8c0e8213d4 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Wed, 20 Aug 2025 22:28:40 +0530 Subject: [PATCH 06/53] Update MiracastController.cpp --- Miracast/MiracastService/MiracastController.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index 0e4babe6..b84f2003 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -46,14 +46,14 @@ MiracastController *MiracastController::getInstance(MiracastError &error_code, M void MiracastController::destroyInstance() { - MIRACASTLOG_TRACE("Entering..."); + MIRACASTLOG_INFO("Entering..."); if (nullptr != m_miracast_ctrl_obj) { m_miracast_ctrl_obj->destroy_ControllerFramework(); delete m_miracast_ctrl_obj; m_miracast_ctrl_obj = nullptr; } - MIRACASTLOG_TRACE("Exiting..."); + MIRACASTLOG_INFO("Exiting..."); } MiracastController::MiracastController(void) @@ -84,14 +84,14 @@ MiracastController::~MiracastController() delete m_groupInfo; m_groupInfo = nullptr; } - + destroy_ControllerFramework(); MIRACASTLOG_INFO("Exiting..."); } MiracastError MiracastController::create_ControllerFramework(std::string p2p_ctrl_iface) { MiracastError ret_code = MIRACAST_OK; - MIRACASTLOG_TRACE("Entering..."); + MIRACASTLOG_INFO("Entering...start controller thread"); m_controller_thread = new MiracastThread(CONTROLLER_THREAD_NAME, CONTROLLER_THREAD_STACK, From b96074099d41ec7392e2b66b92bfee52a06f5257 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 14:13:30 +0530 Subject: [PATCH 07/53] Update MiracastP2P.cpp --- Miracast/MiracastService/P2P/MiracastP2P.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Miracast/MiracastService/P2P/MiracastP2P.cpp b/Miracast/MiracastService/P2P/MiracastP2P.cpp index 2a87a470..6f4ac9af 100644 --- a/Miracast/MiracastService/P2P/MiracastP2P.cpp +++ b/Miracast/MiracastService/P2P/MiracastP2P.cpp @@ -361,16 +361,20 @@ int MiracastP2P::p2pExecute(char *cmd, enum INTERFACE iface, char *ret_buf, size MiracastError MiracastP2P::executeCommand(std::string command, int interface, std::string &retBuffer) { - MIRACASTLOG_TRACE("Entering.."); - - MIRACASTLOG_INFO("Executing P2P command %s", command.c_str()); + MIRACASTLOG_INFO("Entering.."); + std::thread t([] { + MIRACASTLOG_INFO("Executing P2P command %s", command.c_str()); { char ret_buffer[2048] = {0}; p2pExecute((char *)command.c_str(), static_cast(interface), ret_buffer,sizeof(ret_buffer)); retBuffer = ret_buffer; MIRACASTLOG_INFO("command return buffer is - %s", retBuffer.c_str()); } - MIRACASTLOG_TRACE("Exiting.."); + }); + + + t.detach(); + MIRACASTLOG_INFO("Exiting.."); return MIRACAST_OK; } From 256de6d90c15996bc4ec8f4ea6026861716868c4 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 14:14:06 +0530 Subject: [PATCH 08/53] Update MiracastController.cpp --- Miracast/MiracastService/MiracastController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index b84f2003..aa8ad759 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -84,7 +84,7 @@ MiracastController::~MiracastController() delete m_groupInfo; m_groupInfo = nullptr; } - destroy_ControllerFramework(); + //destroy_ControllerFramework(); MIRACASTLOG_INFO("Exiting..."); } From b6616ae833bc10a1f4d7ef5be11c9f2421e98530 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 14:30:09 +0530 Subject: [PATCH 09/53] Update MiracastP2P.cpp --- Miracast/MiracastService/P2P/MiracastP2P.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Miracast/MiracastService/P2P/MiracastP2P.cpp b/Miracast/MiracastService/P2P/MiracastP2P.cpp index 6f4ac9af..fa6e4eb1 100644 --- a/Miracast/MiracastService/P2P/MiracastP2P.cpp +++ b/Miracast/MiracastService/P2P/MiracastP2P.cpp @@ -362,7 +362,7 @@ int MiracastP2P::p2pExecute(char *cmd, enum INTERFACE iface, char *ret_buf, size MiracastError MiracastP2P::executeCommand(std::string command, int interface, std::string &retBuffer) { MIRACASTLOG_INFO("Entering.."); - std::thread t([] { + std::thread t([this]() { MIRACASTLOG_INFO("Executing P2P command %s", command.c_str()); { char ret_buffer[2048] = {0}; From 18377be26308ac6ae8c66e91b54b6b08922d6bb3 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 14:50:37 +0530 Subject: [PATCH 10/53] Update MiracastCommon.cpp --- Miracast/common/MiracastCommon.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Miracast/common/MiracastCommon.cpp b/Miracast/common/MiracastCommon.cpp index 0625fde1..5dfa3ce5 100644 --- a/Miracast/common/MiracastCommon.cpp +++ b/Miracast/common/MiracastCommon.cpp @@ -48,11 +48,12 @@ MiracastThread::MiracastThread(std::string thread_name, size_t stack_size, size_ MiracastThread::~MiracastThread() { - MIRACASTLOG_TRACE("Entering..."); + MIRACASTLOG_INFO("Entering..."); if ( 0 != m_pthread_id ){ // Join thread pthread_join(m_pthread_id, nullptr); + MIRACASTLOG_INFO("Exit from joining..."); m_pthread_id = 0; pthread_attr_destroy(&m_pthread_attr); } @@ -63,7 +64,7 @@ MiracastThread::~MiracastThread() sem_destroy(&m_empty_msgq_sem_obj); m_g_queue = nullptr; } - MIRACASTLOG_TRACE("Exiting..."); + MIRACASTLOG_INFO("Exiting..."); } MiracastError MiracastThread::start(void) @@ -398,4 +399,4 @@ void MessageQueue::detachQueue(void) m_condNotFull.notify_all(); MIRACASTLOG_TRACE("Exiting..."); -} \ No newline at end of file +} From 97bf9d1a644b5f9d40a512fa72bc97b0355ccfdc Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 14:51:02 +0530 Subject: [PATCH 11/53] Update MiracastLogger.cpp --- Miracast/common/MiracastLogger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Miracast/common/MiracastLogger.cpp b/Miracast/common/MiracastLogger.cpp index b5f22529..bbe05608 100644 --- a/Miracast/common/MiracastLogger.cpp +++ b/Miracast/common/MiracastLogger.cpp @@ -33,7 +33,7 @@ namespace MIRACAST setvbuf(stdout, NULL, _IOLBF, 0); } - static int gDefaultLogLevel = INFO_LEVEL; + static int gDefaultLogLevel = TRACE_LEVEL; static std::string service_name = "NOT-DEFINED"; void logger_init(const char* module_name) From 5b72bc0b24f88d607a87545561517dd47d6cf7b1 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 15:04:19 +0530 Subject: [PATCH 12/53] Update MiracastP2P.cpp --- Miracast/MiracastService/P2P/MiracastP2P.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Miracast/MiracastService/P2P/MiracastP2P.cpp b/Miracast/MiracastService/P2P/MiracastP2P.cpp index fa6e4eb1..b087b015 100644 --- a/Miracast/MiracastService/P2P/MiracastP2P.cpp +++ b/Miracast/MiracastService/P2P/MiracastP2P.cpp @@ -362,7 +362,7 @@ int MiracastP2P::p2pExecute(char *cmd, enum INTERFACE iface, char *ret_buf, size MiracastError MiracastP2P::executeCommand(std::string command, int interface, std::string &retBuffer) { MIRACASTLOG_INFO("Entering.."); - std::thread t([this]() { + MIRACASTLOG_INFO("Executing P2P command %s", command.c_str()); { char ret_buffer[2048] = {0}; @@ -370,10 +370,7 @@ MiracastError MiracastP2P::executeCommand(std::string command, int interface, st retBuffer = ret_buffer; MIRACASTLOG_INFO("command return buffer is - %s", retBuffer.c_str()); } - }); - - - t.detach(); + MIRACASTLOG_INFO("Exiting.."); return MIRACAST_OK; } From 4834db8f9901108d58ba63906785437768593230 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 16:25:10 +0530 Subject: [PATCH 13/53] Update MiracastController.cpp --- Miracast/MiracastService/MiracastController.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index aa8ad759..ac6a62ed 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -84,6 +84,7 @@ MiracastController::~MiracastController() delete m_groupInfo; m_groupInfo = nullptr; } + ControllerThreadCallback(this); //destroy_ControllerFramework(); MIRACASTLOG_INFO("Exiting..."); } From c431142c0bcb6deeab9cf1d4c9a89d6171e1bb3a Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 16:48:49 +0530 Subject: [PATCH 14/53] Update MiracastController.cpp --- Miracast/MiracastService/MiracastController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index ac6a62ed..68471aa4 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -1609,7 +1609,7 @@ void ControllerThreadCallback(void *args) { MiracastController *miracast_ctrler_obj = (MiracastController *)args; MIRACASTLOG_TRACE("Entering..."); - sleep(1); + // sleep(1); if ( nullptr != miracast_ctrler_obj ) { miracast_ctrler_obj->Controller_Thread(nullptr); From 2cfd0c03f9518fe0c6e2aaeac31733b01457a57f Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 17:23:02 +0530 Subject: [PATCH 15/53] Update MiracastCommon.cpp --- Miracast/common/MiracastCommon.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Miracast/common/MiracastCommon.cpp b/Miracast/common/MiracastCommon.cpp index 5dfa3ce5..e001f912 100644 --- a/Miracast/common/MiracastCommon.cpp +++ b/Miracast/common/MiracastCommon.cpp @@ -85,7 +85,12 @@ MiracastError MiracastThread::start(void) void MiracastThread::send_message(void *message, size_t msg_size) { MIRACASTLOG_TRACE("Entering..."); + if (nullptr != m_g_queue){ + + + MIRACASTLOG_WARN("Queue size", g_async_queue_length(m_g_queue)); + void *buffer = malloc(msg_size); if (nullptr == buffer) { @@ -95,7 +100,7 @@ void MiracastThread::send_message(void *message, size_t msg_size) } memset(buffer, 0x00, msg_size); // Send message to queue - + MIRACASTLOG_TRACE(""); memcpy(buffer, message, msg_size); g_async_queue_push(m_g_queue, buffer); sem_post(&m_empty_msgq_sem_obj); @@ -139,6 +144,7 @@ int8_t MiracastThread::receive_message(void *message, size_t msg_size, int sem_w void *data_ptr = static_cast(g_async_queue_pop(m_g_queue)); if ((nullptr != message) && (nullptr != data_ptr)) { + MIRACASTLOG_TRACE("dequeue..."); memcpy(message, data_ptr, msg_size); free(data_ptr); } From e4b52b9f9a6ae66bf86cbaad6d7cc277513812c3 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 17:23:45 +0530 Subject: [PATCH 16/53] Update MiracastController.cpp --- Miracast/MiracastService/MiracastController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index 68471aa4..7dbe2750 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -84,7 +84,7 @@ MiracastController::~MiracastController() delete m_groupInfo; m_groupInfo = nullptr; } - ControllerThreadCallback(this); + // ControllerThreadCallback(this); //destroy_ControllerFramework(); MIRACASTLOG_INFO("Exiting..."); } From d07c74319ba42278e081885d922dbb5ba1d66af0 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 17:37:40 +0530 Subject: [PATCH 17/53] Update MiracastCommon.cpp --- Miracast/common/MiracastCommon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Miracast/common/MiracastCommon.cpp b/Miracast/common/MiracastCommon.cpp index e001f912..885aaab3 100644 --- a/Miracast/common/MiracastCommon.cpp +++ b/Miracast/common/MiracastCommon.cpp @@ -89,7 +89,7 @@ void MiracastThread::send_message(void *message, size_t msg_size) if (nullptr != m_g_queue){ - MIRACASTLOG_WARN("Queue size", g_async_queue_length(m_g_queue)); + MIRACASTLOG_TRACE("Queue size", g_async_queue_length(m_g_queue)); void *buffer = malloc(msg_size); if (nullptr == buffer) From 052b64c3fd8ea53939e78dba72478f3a461ea6bd Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 18:04:25 +0530 Subject: [PATCH 18/53] Update MiracastCommon.cpp --- Miracast/common/MiracastCommon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Miracast/common/MiracastCommon.cpp b/Miracast/common/MiracastCommon.cpp index 885aaab3..78ba15c1 100644 --- a/Miracast/common/MiracastCommon.cpp +++ b/Miracast/common/MiracastCommon.cpp @@ -89,7 +89,7 @@ void MiracastThread::send_message(void *message, size_t msg_size) if (nullptr != m_g_queue){ - MIRACASTLOG_TRACE("Queue size", g_async_queue_length(m_g_queue)); + MIRACASTLOG_TRACE("Queue size %d", g_async_queue_length(m_g_queue)); void *buffer = malloc(msg_size); if (nullptr == buffer) From a6c22d82ccb7a4e295a844e5fc4009d14009e0f9 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 18:28:01 +0530 Subject: [PATCH 19/53] Update MiracastCommon.cpp --- Miracast/common/MiracastCommon.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Miracast/common/MiracastCommon.cpp b/Miracast/common/MiracastCommon.cpp index 78ba15c1..57b6265c 100644 --- a/Miracast/common/MiracastCommon.cpp +++ b/Miracast/common/MiracastCommon.cpp @@ -91,7 +91,9 @@ void MiracastThread::send_message(void *message, size_t msg_size) MIRACASTLOG_TRACE("Queue size %d", g_async_queue_length(m_g_queue)); - void *buffer = malloc(msg_size); + // void *buffer = malloc(msg_size); + void* buffer = calloc(1, msg_size); + if (nullptr == buffer) { MIRACASTLOG_ERROR("Memory Allocation Failed for %u\n", msg_size); From 32d79922841139e75f1d60d0cc28228e1fafa817 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 18:31:32 +0530 Subject: [PATCH 20/53] Update MiracastCommon.cpp --- Miracast/common/MiracastCommon.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Miracast/common/MiracastCommon.cpp b/Miracast/common/MiracastCommon.cpp index 57b6265c..0875f40f 100644 --- a/Miracast/common/MiracastCommon.cpp +++ b/Miracast/common/MiracastCommon.cpp @@ -104,8 +104,11 @@ void MiracastThread::send_message(void *message, size_t msg_size) // Send message to queue MIRACASTLOG_TRACE(""); memcpy(buffer, message, msg_size); + MIRACASTLOG_TRACE("copied"); g_async_queue_push(m_g_queue, buffer); + MIRACASTLOG_TRACE("pushed"); sem_post(&m_empty_msgq_sem_obj); + MIRACASTLOG_TRACE("sempost"); } MIRACASTLOG_TRACE("Exiting..."); } From cd4411689c81eb2300f64900dd3b4e105fb34ef6 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 19:04:37 +0530 Subject: [PATCH 21/53] Update MiracastCommon.cpp --- Miracast/common/MiracastCommon.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Miracast/common/MiracastCommon.cpp b/Miracast/common/MiracastCommon.cpp index 0875f40f..8dd7f3cf 100644 --- a/Miracast/common/MiracastCommon.cpp +++ b/Miracast/common/MiracastCommon.cpp @@ -52,7 +52,10 @@ MiracastThread::~MiracastThread() if ( 0 != m_pthread_id ){ // Join thread - pthread_join(m_pthread_id, nullptr); + int ret = pthread_join(m_pthread_id, nullptr); + if (ret !=0) { + MIRACASTLOG_INFO("pthread join failed"); + } MIRACASTLOG_INFO("Exit from joining..."); m_pthread_id = 0; pthread_attr_destroy(&m_pthread_attr); @@ -89,12 +92,10 @@ void MiracastThread::send_message(void *message, size_t msg_size) if (nullptr != m_g_queue){ - MIRACASTLOG_TRACE("Queue size %d", g_async_queue_length(m_g_queue)); + MIRACASTLOG_TRACE("msg size %d", msg_size); - // void *buffer = malloc(msg_size); - void* buffer = calloc(1, msg_size); - - if (nullptr == buffer) + void *buffer = malloc(msg_size); + if (nullptr == buffer) { MIRACASTLOG_ERROR("Memory Allocation Failed for %u\n", msg_size); MIRACASTLOG_TRACE("Exiting..."); From 7eaab09bcd85e740b53faff85a6203d846d353f9 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 19:44:46 +0530 Subject: [PATCH 22/53] Update MiracastController.cpp --- Miracast/MiracastService/MiracastController.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index 7dbe2750..d5ca8ce3 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -53,6 +53,7 @@ void MiracastController::destroyInstance() delete m_miracast_ctrl_obj; m_miracast_ctrl_obj = nullptr; } + MIRACASTLOG_INFO("Exiting..."); } @@ -84,6 +85,12 @@ MiracastController::~MiracastController() delete m_groupInfo; m_groupInfo = nullptr; } + + + if (m_controller_thread !=NULL) { + delete m_controller_thread; + m_controller_thread = NULL: + } // ControllerThreadCallback(this); //destroy_ControllerFramework(); MIRACASTLOG_INFO("Exiting..."); @@ -519,8 +526,8 @@ void MiracastController::event_handler(P2P_EVENTS eventId, void *data, size_t le controller_msgq_data.state = convertP2PtoSessionActions(eventId); strncpy(controller_msgq_data.msg_buffer, event_buffer.c_str(), sizeof(controller_msgq_data.msg_buffer)); controller_msgq_data.msg_buffer[sizeof(controller_msgq_data.msg_buffer) - 1] = '\0'; - - MIRACASTLOG_INFO("event_handler to Controller Action[%#08X] buffer:%s ", controller_msgq_data.state, event_buffer.c_str()); + + MIRACASTLOG_INFO("event_handler to Controller Action[%#08X] buffer:%s size%d", controller_msgq_data.state, event_buffer.c_str(), strlen(event_buffer)); m_controller_thread->send_message(&controller_msgq_data, sizeof(controller_msgq_data)); MIRACASTLOG_VERBOSE("event received : %d buffer:%s ", eventId, event_buffer.c_str()); } From 82774d17701c9af4627287e7c7a47a49ba6d78af Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 20:15:48 +0530 Subject: [PATCH 23/53] Update MiracastController.cpp --- Miracast/MiracastService/MiracastController.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index d5ca8ce3..cf329259 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -511,7 +511,7 @@ void MiracastController::event_handler(P2P_EVENTS eventId, void *data, size_t le std::string event_buffer; MIRACASTLOG_TRACE("Entering..."); - event_buffer = (char *)data; + event_buffer = static_cast(data); free(data); if ( false == m_start_discovering_enabled ) @@ -527,7 +527,7 @@ void MiracastController::event_handler(P2P_EVENTS eventId, void *data, size_t le strncpy(controller_msgq_data.msg_buffer, event_buffer.c_str(), sizeof(controller_msgq_data.msg_buffer)); controller_msgq_data.msg_buffer[sizeof(controller_msgq_data.msg_buffer) - 1] = '\0'; - MIRACASTLOG_INFO("event_handler to Controller Action[%#08X] buffer:%s size%d", controller_msgq_data.state, event_buffer.c_str(), strlen(event_buffer)); + MIRACASTLOG_INFO("event_handler to Controller Action[%#08X] buffer:%s ", controller_msgq_data.state, event_buffer.c_str()); m_controller_thread->send_message(&controller_msgq_data, sizeof(controller_msgq_data)); MIRACASTLOG_VERBOSE("event received : %d buffer:%s ", eventId, event_buffer.c_str()); } From b64725b90ee693314e09723b0f4d871d0c78daf5 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 20:31:47 +0530 Subject: [PATCH 24/53] Update MiracastController.cpp --- Miracast/MiracastService/MiracastController.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index cf329259..704d504b 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -87,10 +87,7 @@ MiracastController::~MiracastController() } - if (m_controller_thread !=NULL) { - delete m_controller_thread; - m_controller_thread = NULL: - } + // ControllerThreadCallback(this); //destroy_ControllerFramework(); MIRACASTLOG_INFO("Exiting..."); From 5739a017805274f4ab225f712d0a3dc3bbf19b12 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 20:35:01 +0530 Subject: [PATCH 25/53] Update MiracastController.cpp From 2088ce21e1c38eebc7fdc783f8b9998137e0277f Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 20:58:03 +0530 Subject: [PATCH 26/53] Update MiracastController.cpp --- Miracast/MiracastService/MiracastController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index 704d504b..02bd13e6 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -524,7 +524,7 @@ void MiracastController::event_handler(P2P_EVENTS eventId, void *data, size_t le strncpy(controller_msgq_data.msg_buffer, event_buffer.c_str(), sizeof(controller_msgq_data.msg_buffer)); controller_msgq_data.msg_buffer[sizeof(controller_msgq_data.msg_buffer) - 1] = '\0'; - MIRACASTLOG_INFO("event_handler to Controller Action[%#08X] buffer:%s ", controller_msgq_data.state, event_buffer.c_str()); + MIRACASTLOG_INFO("event_handler to Controller Action[%#08X] buffer:%s len %d", controller_msgq_data.state, event_buffer.c_str(),len); m_controller_thread->send_message(&controller_msgq_data, sizeof(controller_msgq_data)); MIRACASTLOG_VERBOSE("event received : %d buffer:%s ", eventId, event_buffer.c_str()); } From 5a9936aa29c259c16428c2f1eb9bb76c109cc36a Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 22:02:07 +0530 Subject: [PATCH 27/53] Update MiracastCommon.cpp --- Miracast/common/MiracastCommon.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Miracast/common/MiracastCommon.cpp b/Miracast/common/MiracastCommon.cpp index 8dd7f3cf..2509d2c6 100644 --- a/Miracast/common/MiracastCommon.cpp +++ b/Miracast/common/MiracastCommon.cpp @@ -91,7 +91,7 @@ void MiracastThread::send_message(void *message, size_t msg_size) if (nullptr != m_g_queue){ - + #if 0 MIRACASTLOG_TRACE("msg size %d", msg_size); void *buffer = malloc(msg_size); @@ -106,10 +106,17 @@ void MiracastThread::send_message(void *message, size_t msg_size) MIRACASTLOG_TRACE(""); memcpy(buffer, message, msg_size); MIRACASTLOG_TRACE("copied"); - g_async_queue_push(m_g_queue, buffer); + #endif + auto buffer = std::make_shared>((char*)message, (char*)message + msg_size); + + + // Allocate wrapper and push to queue + auto* wrapper = new std::shared_ptr>(buffer); + g_async_queue_push(m_g_queue, wrapper); MIRACASTLOG_TRACE("pushed"); sem_post(&m_empty_msgq_sem_obj); MIRACASTLOG_TRACE("sempost"); + } MIRACASTLOG_TRACE("Exiting..."); } @@ -125,6 +132,7 @@ int8_t MiracastThread::receive_message(void *message, size_t msg_size, int sem_w int count = 0; sem_getvalue(&m_empty_msgq_sem_obj,&count); if ((0 < count ) || (THREAD_RECV_MSG_INDEFINITE_WAIT == sem_wait_timedout)){ + sem_wait(&m_empty_msgq_sem_obj); status = true; } @@ -147,6 +155,17 @@ int8_t MiracastThread::receive_message(void *message, size_t msg_size, int sem_w if (true == status) { + void *data_ptr = static_cast(g_async_queue_pop(m_g_queue)); + auto* buffer_ptr = static_cast>*>(data_ptr); + if (buffer_ptr && *buffer_ptr) { + std::shared_ptr> buffer = *buffer_ptr; + message.assign(buffer->data(), buffer->size()); + } + delete buffer_ptr; // Clean up the wrapper + + } + + #if 0 void *data_ptr = static_cast(g_async_queue_pop(m_g_queue)); if ((nullptr != message) && (nullptr != data_ptr)) { @@ -154,6 +173,7 @@ int8_t MiracastThread::receive_message(void *message, size_t msg_size, int sem_w memcpy(message, data_ptr, msg_size); free(data_ptr); } + #endif } } MIRACASTLOG_TRACE("Exiting..."); From b4fa0eb20fe21c2242183fcec58a92b4871e5ec2 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 21 Aug 2025 22:16:40 +0530 Subject: [PATCH 28/53] Update MiracastCommon.cpp --- Miracast/common/MiracastCommon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Miracast/common/MiracastCommon.cpp b/Miracast/common/MiracastCommon.cpp index 2509d2c6..b3dae419 100644 --- a/Miracast/common/MiracastCommon.cpp +++ b/Miracast/common/MiracastCommon.cpp @@ -159,7 +159,7 @@ int8_t MiracastThread::receive_message(void *message, size_t msg_size, int sem_w auto* buffer_ptr = static_cast>*>(data_ptr); if (buffer_ptr && *buffer_ptr) { std::shared_ptr> buffer = *buffer_ptr; - message.assign(buffer->data(), buffer->size()); + memcpy(message, buffer->data(), buffer->size()); } delete buffer_ptr; // Clean up the wrapper @@ -175,7 +175,7 @@ int8_t MiracastThread::receive_message(void *message, size_t msg_size, int sem_w } #endif } - } + MIRACASTLOG_TRACE("Exiting..."); return status; } From 1a0e2bf314501aa01f37a1aa2ea6a9f4676dcba9 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Fri, 22 Aug 2025 08:12:05 +0530 Subject: [PATCH 29/53] Update MiracastCommon.cpp --- Miracast/common/MiracastCommon.cpp | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/Miracast/common/MiracastCommon.cpp b/Miracast/common/MiracastCommon.cpp index b3dae419..aa2af6c0 100644 --- a/Miracast/common/MiracastCommon.cpp +++ b/Miracast/common/MiracastCommon.cpp @@ -91,7 +91,7 @@ void MiracastThread::send_message(void *message, size_t msg_size) if (nullptr != m_g_queue){ - #if 0 + MIRACASTLOG_TRACE("msg size %d", msg_size); void *buffer = malloc(msg_size); @@ -106,12 +106,6 @@ void MiracastThread::send_message(void *message, size_t msg_size) MIRACASTLOG_TRACE(""); memcpy(buffer, message, msg_size); MIRACASTLOG_TRACE("copied"); - #endif - auto buffer = std::make_shared>((char*)message, (char*)message + msg_size); - - - // Allocate wrapper and push to queue - auto* wrapper = new std::shared_ptr>(buffer); g_async_queue_push(m_g_queue, wrapper); MIRACASTLOG_TRACE("pushed"); sem_post(&m_empty_msgq_sem_obj); @@ -132,8 +126,9 @@ int8_t MiracastThread::receive_message(void *message, size_t msg_size, int sem_w int count = 0; sem_getvalue(&m_empty_msgq_sem_obj,&count); if ((0 < count ) || (THREAD_RECV_MSG_INDEFINITE_WAIT == sem_wait_timedout)){ - + MIRACASTLOG_TRACE("Waiting for sem_wait to finish..."); sem_wait(&m_empty_msgq_sem_obj); + MIRACASTLOG_TRACE("Exit from sem_wait..."); status = true; } } @@ -142,30 +137,22 @@ int8_t MiracastThread::receive_message(void *message, size_t msg_size, int sem_w struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); ts.tv_sec += sem_wait_timedout; - + MIRACASTLOG_TRACE("sem_wait timed..."); if (-1 != sem_timedwait(&m_empty_msgq_sem_obj, &ts)) { status = true; } + MIRACASTLOG_TRACE("Exit from sem_timedwait..."); } else { status = -1; } - + MIRACASTLOG_TRACE("check if status is true..."); if (true == status) { - void *data_ptr = static_cast(g_async_queue_pop(m_g_queue)); - auto* buffer_ptr = static_cast>*>(data_ptr); - if (buffer_ptr && *buffer_ptr) { - std::shared_ptr> buffer = *buffer_ptr; - memcpy(message, buffer->data(), buffer->size()); - } - delete buffer_ptr; // Clean up the wrapper - - } - - #if 0 + MIRACASTLOG_TRACE("status true..."); + #if 1 void *data_ptr = static_cast(g_async_queue_pop(m_g_queue)); if ((nullptr != message) && (nullptr != data_ptr)) { @@ -175,6 +162,7 @@ int8_t MiracastThread::receive_message(void *message, size_t msg_size, int sem_w } #endif } + } MIRACASTLOG_TRACE("Exiting..."); return status; From 79794345c211dfe600ef5b34b73a9af78820fe67 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Fri, 22 Aug 2025 08:22:15 +0530 Subject: [PATCH 30/53] Update MiracastCommon.cpp --- Miracast/common/MiracastCommon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Miracast/common/MiracastCommon.cpp b/Miracast/common/MiracastCommon.cpp index aa2af6c0..56b80773 100644 --- a/Miracast/common/MiracastCommon.cpp +++ b/Miracast/common/MiracastCommon.cpp @@ -106,7 +106,7 @@ void MiracastThread::send_message(void *message, size_t msg_size) MIRACASTLOG_TRACE(""); memcpy(buffer, message, msg_size); MIRACASTLOG_TRACE("copied"); - g_async_queue_push(m_g_queue, wrapper); + g_async_queue_push(m_g_queue, buffer); MIRACASTLOG_TRACE("pushed"); sem_post(&m_empty_msgq_sem_obj); MIRACASTLOG_TRACE("sempost"); From a2fa25c21e308dbeead49f2409df038a774b3186 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Fri, 22 Aug 2025 09:01:01 +0530 Subject: [PATCH 31/53] Update MiracastController.cpp --- Miracast/MiracastService/MiracastController.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index 02bd13e6..2d93f667 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -1131,6 +1131,7 @@ void MiracastController::Controller_Thread(void *args) p2p_group_instance_alive = false; } m_connect_req_notified = false; + MIRACASTLOG_ERROR("####exit from failure condition"); } if ( true == session_restart_required ) @@ -1149,6 +1150,7 @@ void MiracastController::Controller_Thread(void *args) session_restart_required = false; } } + MIRACASTLOG_ERROR("####exit from CONTROLLER_GO_GROUP_FORMATION_FAILURE"); break; case CONTROLLER_GO_GROUP_REMOVED: { @@ -1344,7 +1346,8 @@ void MiracastController::Controller_Thread(void *args) MIRACASTLOG_ERROR("!!! Invalid MsgType Received[%#08X]Data[%s] !!!", controller_msgq_data.msg_type, event_buffer.c_str()); } break; - } + } + MIRACASTLOG_ERROR("!!! exit from outer switch"); } MIRACASTLOG_TRACE("Exiting..."); } From fa8e4bfd2afda69b256b59cebd1767ccc68921de Mon Sep 17 00:00:00 2001 From: preeja33 Date: Fri, 22 Aug 2025 09:41:52 +0530 Subject: [PATCH 32/53] Update MiracastServiceImplementation.cpp --- Miracast/MiracastService/MiracastServiceImplementation.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Miracast/MiracastService/MiracastServiceImplementation.cpp b/Miracast/MiracastService/MiracastServiceImplementation.cpp index 22dc914c..87ab1301 100644 --- a/Miracast/MiracastService/MiracastServiceImplementation.cpp +++ b/Miracast/MiracastService/MiracastServiceImplementation.cpp @@ -858,6 +858,7 @@ namespace WPEFramework eventDetails["source_dev_name"] = client_name; eventDetails["reason_code"] = static_cast(reason_code); dispatchEvent(MIRACASTSERVICE_EVENT_CLIENT_CONNECTION_ERROR, eventDetails); + MIRACASTLOG_TRACE("dispatched ..."); } MIRACASTLOG_TRACE("Exiting ..."); } From 07cb92a3368ff07c67ca73f17df00ac0b4e2d356 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Fri, 22 Aug 2025 09:43:17 +0530 Subject: [PATCH 33/53] Update test_MiracastService.cpp --- Tests/L1Tests/tests/test_MiracastService.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Tests/L1Tests/tests/test_MiracastService.cpp b/Tests/L1Tests/tests/test_MiracastService.cpp index cd53901a..7c072b50 100755 --- a/Tests/L1Tests/tests/test_MiracastService.cpp +++ b/Tests/L1Tests/tests/test_MiracastService.cpp @@ -248,14 +248,16 @@ class MiracastServiceEventTest : public MiracastServiceTest { virtual ~MiracastServiceEventTest() override { - dispatcher->Deactivate(); - dispatcher->Release(); - - PluginHost::IFactories::Assign(nullptr); + TEST_LOG("predebug Before destructor sleep "); //Wait for all the previous destructor process to complete std::this_thread::sleep_for(std::chrono::milliseconds(3000)); TEST_LOG("predebug After destructor sleep "); + + dispatcher->Deactivate(); + dispatcher->Release(); + + PluginHost::IFactories::Assign(nullptr); } }; From c5339da1c508846dc4a39d63a5d82b6ceb04e4ca Mon Sep 17 00:00:00 2001 From: preeja33 Date: Fri, 22 Aug 2025 10:01:45 +0530 Subject: [PATCH 34/53] Update test_MiracastService.cpp --- Tests/L1Tests/tests/test_MiracastService.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/L1Tests/tests/test_MiracastService.cpp b/Tests/L1Tests/tests/test_MiracastService.cpp index 7c072b50..8b53dc1a 100755 --- a/Tests/L1Tests/tests/test_MiracastService.cpp +++ b/Tests/L1Tests/tests/test_MiracastService.cpp @@ -249,10 +249,10 @@ class MiracastServiceEventTest : public MiracastServiceTest { virtual ~MiracastServiceEventTest() override { - TEST_LOG("predebug Before destructor sleep "); + TEST_LOG("predebug1 Before destructor sleep "); //Wait for all the previous destructor process to complete std::this_thread::sleep_for(std::chrono::milliseconds(3000)); - TEST_LOG("predebug After destructor sleep "); + TEST_LOG("predebug1 After destructor sleep "); dispatcher->Deactivate(); dispatcher->Release(); From 85ccdcadd1a30abb89e94aba0f6bfa2b7599e347 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Fri, 22 Aug 2025 10:32:23 +0530 Subject: [PATCH 35/53] Update test_MiracastService.cpp --- Tests/L1Tests/tests/test_MiracastService.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/L1Tests/tests/test_MiracastService.cpp b/Tests/L1Tests/tests/test_MiracastService.cpp index 8b53dc1a..58f88ae6 100755 --- a/Tests/L1Tests/tests/test_MiracastService.cpp +++ b/Tests/L1Tests/tests/test_MiracastService.cpp @@ -708,7 +708,7 @@ TEST_F(MiracastServiceEventTest, onClientConnectionRequestRejected) EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("acceptClientConnection"), _T("{\"requestStatus\": Reject}"), response)); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); - + sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -805,7 +805,7 @@ TEST_F(MiracastServiceEventTest, P2P_CONNECT_FAIL_onClientConnectionError) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionError"), _T("client.events"), message); - + sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -919,7 +919,7 @@ TEST_F(MiracastServiceEventTest, P2P_GO_NEGOTIATION_FAIL_onClientConnectionError EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionError"), _T("client.events"), message); - + sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1040,7 +1040,7 @@ TEST_F(MiracastServiceEventTest, P2P_GO_FORMATION_FAIL_onClientConnectionError) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionError"), _T("client.events"), message); - + sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); From e83e97f71bc979753f40bdfcce2e5223508bd02e Mon Sep 17 00:00:00 2001 From: preeja33 Date: Fri, 22 Aug 2025 11:30:05 +0530 Subject: [PATCH 36/53] Update test_MiracastService.cpp --- Tests/L1Tests/tests/test_MiracastService.cpp | 24 +++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Tests/L1Tests/tests/test_MiracastService.cpp b/Tests/L1Tests/tests/test_MiracastService.cpp index 58f88ae6..9aea2cea 100755 --- a/Tests/L1Tests/tests/test_MiracastService.cpp +++ b/Tests/L1Tests/tests/test_MiracastService.cpp @@ -273,6 +273,7 @@ TEST_F(MiracastServiceTest, P2PCtrlInterfaceNameNotFound) // WIFI_P2P_CTRL_INTERFACE not configured in device properties file EXPECT_NE(string(""), plugin->Initialize(&service)); + sleep(3); plugin->Deinitialize(nullptr); } @@ -332,7 +333,7 @@ TEST_F(MiracastServiceTest, P2P_DiscoveryStatus) EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("getEnable"), _T("{}"), response)); EXPECT_EQ(response, string("{\"enabled\":false,\"success\":true}")); - +sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -347,7 +348,7 @@ TEST_F(MiracastServiceTest, BackendDiscoveryStatus) EXPECT_EQ(string(""), plugin->Initialize(&service)); EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("setP2PBackendDiscovery"), _T("{\"enabled\": true}"), response)); - +sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -445,7 +446,7 @@ TEST_F(MiracastServiceEventTest, stopClientConnection) EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("stopClientConnection"), _T("{\"name\": \"Sample-Test-Android-2\",\"mac\": \"96:52:44:b6:7d:14\"}"), response)); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); - +sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -626,7 +627,7 @@ TEST_F(MiracastServiceEventTest, P2P_GOMode_onClientConnectionAndLaunchRequest) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onLaunchRequest"), _T("client.events"), message); - +sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1194,7 +1195,7 @@ TEST_F(MiracastServiceEventTest, P2P_ClientMode_onClientConnectionAndLaunchReque EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onLaunchRequest"), _T("client.events"), message); - +sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1300,7 +1301,7 @@ TEST_F(MiracastServiceEventTest, P2P_ClientMode_DirectonClientConnectionAndLaunc EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onLaunchRequest"), _T("client.events"), message); - +sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1400,7 +1401,7 @@ TEST_F(MiracastServiceEventTest, P2P_ClientMode_DirectGroupStartWithName) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onLaunchRequest"), _T("client.events"), message); - +sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1500,7 +1501,7 @@ TEST_F(MiracastServiceEventTest, P2P_ClientMode_DirectGroupStartWithoutName) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onLaunchRequest"), _T("client.events"), message); - +sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1624,7 +1625,7 @@ TEST_F(MiracastServiceEventTest, P2P_ClientMode_DirectP2PGoNegotiationGroupStart EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onLaunchRequest"), _T("client.events"), message); - +sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1780,7 +1781,7 @@ TEST_F(MiracastServiceEventTest, P2P_ClientMode_GENERIC_FAILURE) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionError"), _T("client.events"), message); - +sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1919,7 +1920,7 @@ TEST_F(MiracastServiceEventTest, P2P_GOMode_GENERIC_FAILURE) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionError"), _T("client.events"), message); - +sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -2042,6 +2043,7 @@ TEST_F(MiracastServiceEventTest, powerStateChange) EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("setEnable"), _T("{\"enabled\": false}"), response)); Plugin::MiracastServiceImplementation::_instance->onPowerModeChanged(WPEFramework::Exchange::IPowerManager::POWER_STATE_STANDBY_DEEP_SLEEP, WPEFramework::Exchange::IPowerManager::POWER_STATE_ON); EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("setEnable"), _T("{\"enabled\": true}"), response)); + sleep(3); plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); From 93329d9aac576eb4381401586a790f4a714140d9 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Wed, 27 Aug 2025 14:28:20 +0530 Subject: [PATCH 37/53] Update MiracastServiceImplementation.cpp --- Miracast/MiracastService/MiracastServiceImplementation.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Miracast/MiracastService/MiracastServiceImplementation.cpp b/Miracast/MiracastService/MiracastServiceImplementation.cpp index 87ab1301..be5191c8 100644 --- a/Miracast/MiracastService/MiracastServiceImplementation.cpp +++ b/Miracast/MiracastService/MiracastServiceImplementation.cpp @@ -320,13 +320,16 @@ namespace WPEFramework void MiracastServiceImplementation::dispatchEvent(Event event, const JsonObject ¶ms) { + MIRACASTLOG_TRACE("Entering ..."); Core::IWorkerPool::Instance().Submit(Job::Create(this, event, params)); + MIRACASTLOG_TRACE("Exiting ..."); } void MiracastServiceImplementation::Dispatch(Event event,const JsonObject& params) { + MIRACASTLOG_TRACE("Entering ..."); _adminLock.Lock(); - + MIRACASTLOG_TRACE("get lock ..."); std::list::const_iterator index(_miracastServiceNotification.begin()); switch (event) @@ -426,6 +429,7 @@ namespace WPEFramework break; } _adminLock.Unlock(); + MIRACASTLOG_TRACE("Exiting ..."); } /* COMRPC Methods Start */ From 873d70de49f9cfbfd95fa8cf09d06d689d9e6bb9 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Wed, 27 Aug 2025 14:32:25 +0530 Subject: [PATCH 38/53] remove sleep hack --- Tests/L1Tests/tests/test_MiracastService.cpp | 34 ++++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Tests/L1Tests/tests/test_MiracastService.cpp b/Tests/L1Tests/tests/test_MiracastService.cpp index 9aea2cea..738d76f9 100755 --- a/Tests/L1Tests/tests/test_MiracastService.cpp +++ b/Tests/L1Tests/tests/test_MiracastService.cpp @@ -273,7 +273,7 @@ TEST_F(MiracastServiceTest, P2PCtrlInterfaceNameNotFound) // WIFI_P2P_CTRL_INTERFACE not configured in device properties file EXPECT_NE(string(""), plugin->Initialize(&service)); - sleep(3); + plugin->Deinitialize(nullptr); } @@ -333,7 +333,7 @@ TEST_F(MiracastServiceTest, P2P_DiscoveryStatus) EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("getEnable"), _T("{}"), response)); EXPECT_EQ(response, string("{\"enabled\":false,\"success\":true}")); -sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -348,7 +348,7 @@ TEST_F(MiracastServiceTest, BackendDiscoveryStatus) EXPECT_EQ(string(""), plugin->Initialize(&service)); EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("setP2PBackendDiscovery"), _T("{\"enabled\": true}"), response)); -sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -446,7 +446,7 @@ TEST_F(MiracastServiceEventTest, stopClientConnection) EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("stopClientConnection"), _T("{\"name\": \"Sample-Test-Android-2\",\"mac\": \"96:52:44:b6:7d:14\"}"), response)); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); -sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -627,7 +627,7 @@ TEST_F(MiracastServiceEventTest, P2P_GOMode_onClientConnectionAndLaunchRequest) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onLaunchRequest"), _T("client.events"), message); -sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -709,7 +709,7 @@ TEST_F(MiracastServiceEventTest, onClientConnectionRequestRejected) EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("acceptClientConnection"), _T("{\"requestStatus\": Reject}"), response)); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); - sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -806,7 +806,7 @@ TEST_F(MiracastServiceEventTest, P2P_CONNECT_FAIL_onClientConnectionError) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionError"), _T("client.events"), message); - sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -920,7 +920,7 @@ TEST_F(MiracastServiceEventTest, P2P_GO_NEGOTIATION_FAIL_onClientConnectionError EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionError"), _T("client.events"), message); - sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1041,7 +1041,7 @@ TEST_F(MiracastServiceEventTest, P2P_GO_FORMATION_FAIL_onClientConnectionError) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionError"), _T("client.events"), message); - sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1195,7 +1195,7 @@ TEST_F(MiracastServiceEventTest, P2P_ClientMode_onClientConnectionAndLaunchReque EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onLaunchRequest"), _T("client.events"), message); -sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1301,7 +1301,7 @@ TEST_F(MiracastServiceEventTest, P2P_ClientMode_DirectonClientConnectionAndLaunc EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onLaunchRequest"), _T("client.events"), message); -sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1401,7 +1401,7 @@ TEST_F(MiracastServiceEventTest, P2P_ClientMode_DirectGroupStartWithName) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onLaunchRequest"), _T("client.events"), message); -sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1501,7 +1501,7 @@ TEST_F(MiracastServiceEventTest, P2P_ClientMode_DirectGroupStartWithoutName) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onLaunchRequest"), _T("client.events"), message); -sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1625,7 +1625,7 @@ TEST_F(MiracastServiceEventTest, P2P_ClientMode_DirectP2PGoNegotiationGroupStart EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onLaunchRequest"), _T("client.events"), message); -sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1781,7 +1781,7 @@ TEST_F(MiracastServiceEventTest, P2P_ClientMode_GENERIC_FAILURE) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionError"), _T("client.events"), message); -sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -1920,7 +1920,7 @@ TEST_F(MiracastServiceEventTest, P2P_GOMode_GENERIC_FAILURE) EVENT_UNSUBSCRIBE(0, _T("onClientConnectionRequest"), _T("client.events"), message); EVENT_UNSUBSCRIBE(0, _T("onClientConnectionError"), _T("client.events"), message); -sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); @@ -2043,7 +2043,7 @@ TEST_F(MiracastServiceEventTest, powerStateChange) EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("setEnable"), _T("{\"enabled\": false}"), response)); Plugin::MiracastServiceImplementation::_instance->onPowerModeChanged(WPEFramework::Exchange::IPowerManager::POWER_STATE_STANDBY_DEEP_SLEEP, WPEFramework::Exchange::IPowerManager::POWER_STATE_ON); EXPECT_EQ(Core::ERROR_NONE, handler.Invoke(connection, _T("setEnable"), _T("{\"enabled\": true}"), response)); - sleep(3); + plugin->Deinitialize(nullptr); removeEntryFromFile("/etc/device.properties","WIFI_P2P_CTRL_INTERFACE=p2p0"); From 85d314dc5b7c17ac3b8f6a642348129f2a7f0b9c Mon Sep 17 00:00:00 2001 From: preeja33 Date: Wed, 27 Aug 2025 14:38:15 +0530 Subject: [PATCH 39/53] comment plyaer test --- Tests/L1Tests/tests/test_MiracastPlayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/L1Tests/tests/test_MiracastPlayer.cpp b/Tests/L1Tests/tests/test_MiracastPlayer.cpp index 7a7a7628..e2450443 100755 --- a/Tests/L1Tests/tests/test_MiracastPlayer.cpp +++ b/Tests/L1Tests/tests/test_MiracastPlayer.cpp @@ -647,7 +647,7 @@ TEST_F(MiracastPlayerTest, GetInformation) { EXPECT_EQ("This MiracastPlayer Plugin Facilitates Miracast session like RTSP communication and GStreamer Playback", plugin->Information()); } - +#if 0 TEST_F(MiracastPlayerEventTest, APP_REQUESTED_TO_STOP) { std::string rtsp_response = ""; From a07917b3e4e633d53180d0985b6d975a8ba53a1b Mon Sep 17 00:00:00 2001 From: preeja33 Date: Wed, 27 Aug 2025 15:00:07 +0530 Subject: [PATCH 40/53] Update test_MiracastPlayer.cpp --- Tests/L1Tests/tests/test_MiracastPlayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/L1Tests/tests/test_MiracastPlayer.cpp b/Tests/L1Tests/tests/test_MiracastPlayer.cpp index e2450443..7a7a7628 100755 --- a/Tests/L1Tests/tests/test_MiracastPlayer.cpp +++ b/Tests/L1Tests/tests/test_MiracastPlayer.cpp @@ -647,7 +647,7 @@ TEST_F(MiracastPlayerTest, GetInformation) { EXPECT_EQ("This MiracastPlayer Plugin Facilitates Miracast session like RTSP communication and GStreamer Playback", plugin->Information()); } -#if 0 + TEST_F(MiracastPlayerEventTest, APP_REQUESTED_TO_STOP) { std::string rtsp_response = ""; From f2b90409dd51d19a5337110b946dcaa150381b99 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 28 Aug 2025 16:36:33 +0530 Subject: [PATCH 41/53] Update MiracastService.cpp --- Miracast/MiracastService/MiracastService.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Miracast/MiracastService/MiracastService.cpp b/Miracast/MiracastService/MiracastService.cpp index c3d401b9..5ea531cf 100644 --- a/Miracast/MiracastService/MiracastService.cpp +++ b/Miracast/MiracastService/MiracastService.cpp @@ -130,7 +130,7 @@ namespace WPEFramework void MiracastService::Deinitialize(PluginHost::IShell* service) { SYSLOG(Logging::Startup, (_T("MiracastService::Deinitialize: PID=%u"), getpid())); - +LOGINFO("MiracastService::Deinitialize in"); ASSERT(mCurrentService == service); ASSERT(0 == mConnectionId); @@ -177,6 +177,7 @@ namespace WPEFramework mCurrentService = nullptr; } mConnectionId = 0; + LOGINFO("MiracastService::Deinitialize out"); SYSLOG(Logging::Shutdown, (string(_T("MiracastService de-initialised")))); } @@ -194,4 +195,4 @@ namespace WPEFramework } } } // namespace Plugin -} // namespace WPEFramework \ No newline at end of file +} // namespace WPEFramework From 8f933c6b57f989d27836d51021cf8562216a2c50 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 28 Aug 2025 18:42:19 +0530 Subject: [PATCH 42/53] Update MiracastServiceImplementation.cpp --- .../MiracastServiceImplementation.cpp | 76 ++++++++++++++++++- 1 file changed, 74 insertions(+), 2 deletions(-) diff --git a/Miracast/MiracastService/MiracastServiceImplementation.cpp b/Miracast/MiracastService/MiracastServiceImplementation.cpp index be5191c8..fe376737 100644 --- a/Miracast/MiracastService/MiracastServiceImplementation.cpp +++ b/Miracast/MiracastService/MiracastServiceImplementation.cpp @@ -438,11 +438,79 @@ namespace WPEFramework { MIRACASTLOG_TRACE("Entering ..."); uint32_t result = Core::ERROR_GENERAL; + + if ((m_CurrentService) && (nullptr == service)) + { + + ASSERT(0 == mConnectionId); - ASSERT(nullptr != service); + if (nullptr != mMiracastServiceImpl) + { + if (mRegisterEvents) + { + mMiracastServiceImpl->Unregister(&mMiracastServiceNotification); + Exchange::JMiracastService::Unregister(*this); + mRegisterEvents = false; + } - m_CurrentService = service; + mConfigure = mMiracastServiceImpl->QueryInterface(); + if (mConfigure) + { + uint32_t result = mConfigure->Configure(nullptr); // nullptr this deinitializing + if(result != Core::ERROR_NONE) + { + SYSLOG(Logging::Startup, (_T("MiracastService::Initialize: Failed to Configure %s"), PLUGIN_MIRACAST_SERVICE_IMPLEMENTATION_NAME)); + retStatus = _T("MiracastService plugin could not be initialised"); + } + else + { + /* Register for notifications */ + mMiracastServiceImpl->Register(&mMiracastServiceNotification); + /* Invoking Plugin API register to wpeframework */ + Exchange::JMiracastService::Register(*this, mMiracastServiceImpl); + mRegisterEvents = true; + } + mConfigure->Release(); + } + /* Stop processing: */ + RPC::IRemoteConnection* connection = nullptr; + if (service) + { + connection = service->RemoteConnection(mConnectionId); + } + VARIABLE_IS_NOT_USED uint32_t result = mMiracastServiceImpl->Release(); + mMiracastServiceImpl = nullptr; + + /* It should have been the last reference we are releasing, + * so it should endup in a DESTRUCTION_SUCCEEDED, if not we + * are leaking... */ + ASSERT(result == Core::ERROR_DESTRUCTION_SUCCEEDED); + + /* If this was running in a (container) process... */ + if (nullptr != connection) + { + /* Lets trigger the cleanup sequence for + * out-of-process code. Which will guard + * that unwilling processes, get shot if + * not stopped friendly :-) + */ + connection->Terminate(); + connection->Release(); + } + } + if (nullptr != mCurrentService) + { + /* Make sure the Activated and Deactivated are no longer called before we start cleaning up.. */ + mCurrentService->Unregister(&mMiracastServiceNotification); + mCurrentService->Release(); + mCurrentService = nullptr; + } + mConnectionId = 0; + } + else if ((service) && ( nullptr == m_CurrentService )) + { + m_CurrentService = service; if (nullptr != m_CurrentService) { m_CurrentService->AddRef(); @@ -516,6 +584,10 @@ namespace WPEFramework } } } + }else + { + ASSERT(nullptr != service); + } MIRACASTLOG_TRACE("Exiting ..."); return result; } From c908a60dfc3ac915587db0d8900b89d8800d7242 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 28 Aug 2025 18:55:59 +0530 Subject: [PATCH 43/53] Update MiracastServiceImplementation.cpp --- .../MiracastServiceImplementation.cpp | 162 ++++++------------ 1 file changed, 48 insertions(+), 114 deletions(-) diff --git a/Miracast/MiracastService/MiracastServiceImplementation.cpp b/Miracast/MiracastService/MiracastServiceImplementation.cpp index fe376737..b680a2b9 100644 --- a/Miracast/MiracastService/MiracastServiceImplementation.cpp +++ b/Miracast/MiracastService/MiracastServiceImplementation.cpp @@ -66,55 +66,7 @@ namespace WPEFramework MiracastServiceImplementation::~MiracastServiceImplementation() { - LOGINFO("Call MiracastServiceImplementation destructor"); - if (m_FriendlyNameMonitorTimerID) - { - g_source_remove(m_FriendlyNameMonitorTimerID); - m_FriendlyNameMonitorTimerID = 0; - } - remove_wifi_connection_state_timer(); - remove_miracast_connection_timer(); - - if (_powerManagerPlugin) - { - _powerManagerPlugin->Unregister(_pwrMgrNotification.baseInterface()); - _powerManagerPlugin.Reset(); - } - _registeredEventHandlers = false; - - if (m_WiFiPluginObj) - { - m_WiFiPluginObj->Unsubscribe(1000, _T("onWIFIStateChanged")); - delete m_WiFiPluginObj; - m_WiFiPluginObj = nullptr; - } - - if (m_SystemPluginObj) - { - m_SystemPluginObj->Unsubscribe(1000, _T("onFriendlyNameChanged")); - delete m_SystemPluginObj; - m_SystemPluginObj = nullptr; - } - - MIRACASTLOG_INFO("predebug Disconnect from the COM-RPC socket"); - - if (m_isServiceInitialized) - { - MiracastController::destroyInstance(); - m_CurrentService = nullptr; - m_miracast_ctrler_obj = nullptr; - m_isServiceInitialized = false; - m_isServiceEnabled = false; - MIRACASTLOG_INFO("Done..!!!"); - } - if(m_CurrentService) - { - m_CurrentService->Release(); - m_CurrentService = nullptr; - } - MIRACAST::logger_deinit(); - MiracastServiceImplementation::_instance = nullptr; - MIRACASTLOG_INFO("predebug destruction done"); + } /** @@ -438,79 +390,62 @@ namespace WPEFramework { MIRACASTLOG_TRACE("Entering ..."); uint32_t result = Core::ERROR_GENERAL; - + if ((m_CurrentService) && (nullptr == service)) { - - ASSERT(0 == mConnectionId); + LOGINFO("Call MiracastServiceImplementation destructor"); + if (m_FriendlyNameMonitorTimerID) + { + g_source_remove(m_FriendlyNameMonitorTimerID); + m_FriendlyNameMonitorTimerID = 0; + } + remove_wifi_connection_state_timer(); + remove_miracast_connection_timer(); - if (nullptr != mMiracastServiceImpl) + if (_powerManagerPlugin) { - if (mRegisterEvents) - { - mMiracastServiceImpl->Unregister(&mMiracastServiceNotification); - Exchange::JMiracastService::Unregister(*this); - mRegisterEvents = false; - } + _powerManagerPlugin->Unregister(_pwrMgrNotification.baseInterface()); + _powerManagerPlugin.Reset(); + } + _registeredEventHandlers = false; - mConfigure = mMiracastServiceImpl->QueryInterface(); - if (mConfigure) - { - uint32_t result = mConfigure->Configure(nullptr); // nullptr this deinitializing - if(result != Core::ERROR_NONE) - { - SYSLOG(Logging::Startup, (_T("MiracastService::Initialize: Failed to Configure %s"), PLUGIN_MIRACAST_SERVICE_IMPLEMENTATION_NAME)); - retStatus = _T("MiracastService plugin could not be initialised"); - } - else - { - /* Register for notifications */ - mMiracastServiceImpl->Register(&mMiracastServiceNotification); - /* Invoking Plugin API register to wpeframework */ - Exchange::JMiracastService::Register(*this, mMiracastServiceImpl); - mRegisterEvents = true; - } - mConfigure->Release(); - } + if (m_WiFiPluginObj) + { + m_WiFiPluginObj->Unsubscribe(1000, _T("onWIFIStateChanged")); + delete m_WiFiPluginObj; + m_WiFiPluginObj = nullptr; + } - /* Stop processing: */ - RPC::IRemoteConnection* connection = nullptr; - if (service) - { - connection = service->RemoteConnection(mConnectionId); - } - VARIABLE_IS_NOT_USED uint32_t result = mMiracastServiceImpl->Release(); - mMiracastServiceImpl = nullptr; - - /* It should have been the last reference we are releasing, - * so it should endup in a DESTRUCTION_SUCCEEDED, if not we - * are leaking... */ - ASSERT(result == Core::ERROR_DESTRUCTION_SUCCEEDED); - - /* If this was running in a (container) process... */ - if (nullptr != connection) - { - /* Lets trigger the cleanup sequence for - * out-of-process code. Which will guard - * that unwilling processes, get shot if - * not stopped friendly :-) - */ - connection->Terminate(); - connection->Release(); - } + if (m_SystemPluginObj) + { + m_SystemPluginObj->Unsubscribe(1000, _T("onFriendlyNameChanged")); + delete m_SystemPluginObj; + m_SystemPluginObj = nullptr; + } + + MIRACASTLOG_INFO("Disconnect from the COM-RPC socket"); + + if (m_isServiceInitialized) + { + MiracastController::destroyInstance(); + m_CurrentService = nullptr; + m_miracast_ctrler_obj = nullptr; + m_isServiceInitialized = false; + m_isServiceEnabled = false; + MIRACASTLOG_INFO("Done..!!!"); } - if (nullptr != mCurrentService) + if(m_CurrentService) { - /* Make sure the Activated and Deactivated are no longer called before we start cleaning up.. */ - mCurrentService->Unregister(&mMiracastServiceNotification); - mCurrentService->Release(); - mCurrentService = nullptr; + m_CurrentService->Release(); + m_CurrentService = nullptr; } - mConnectionId = 0; + MIRACAST::logger_deinit(); + MiracastServiceImplementation::_instance = nullptr; } else if ((service) && ( nullptr == m_CurrentService )) { - m_CurrentService = service; + m_CurrentService = service; + if (nullptr != m_CurrentService) { m_CurrentService->AddRef(); @@ -584,10 +519,9 @@ namespace WPEFramework } } } - }else - { - ASSERT(nullptr != service); - } + } else { + ASSERT(nullptr != service); + } MIRACASTLOG_TRACE("Exiting ..."); return result; } From 829410b25160c7bc549582ec3280fdce74a0c9fe Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 28 Aug 2025 18:59:57 +0530 Subject: [PATCH 44/53] Update MiracastService.cpp --- Miracast/MiracastService/MiracastService.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Miracast/MiracastService/MiracastService.cpp b/Miracast/MiracastService/MiracastService.cpp index 5ea531cf..17eaaabf 100644 --- a/Miracast/MiracastService/MiracastService.cpp +++ b/Miracast/MiracastService/MiracastService.cpp @@ -172,7 +172,22 @@ LOGINFO("MiracastService::Deinitialize in"); if (nullptr != mCurrentService) { /* Make sure the Activated and Deactivated are no longer called before we start cleaning up.. */ - mCurrentService->Unregister(&mMiracastServiceNotification); + mCurrentService->Unregister(&mMiracastServiceNotification); + mConfigure = mMiracastServiceImpl->QueryInterface(); + if (mConfigure) + { + uint32_t result = mConfigure->Configure(NULL); + if(result != Core::ERROR_NONE) + { + SYSLOG(Logging::Startup, (_T("MiracastService::DeInitialize: Failed to Configure %s"), PLUGIN_MIRACAST_SERVICE_IMPLEMENTATION_NAME)); + retStatus = _T("MiracastService plugin could not be deinitialised"); + } + else + { + LOGINFO("Successfully deinitialized"); + } + mConfigure->Release(); + } mCurrentService->Release(); mCurrentService = nullptr; } From 09fe76715192cb6bd109742627cb2e49e78d5c89 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 28 Aug 2025 19:23:26 +0530 Subject: [PATCH 45/53] Update MiracastService.cpp --- Miracast/MiracastService/MiracastService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Miracast/MiracastService/MiracastService.cpp b/Miracast/MiracastService/MiracastService.cpp index 17eaaabf..5d7194bd 100644 --- a/Miracast/MiracastService/MiracastService.cpp +++ b/Miracast/MiracastService/MiracastService.cpp @@ -180,7 +180,7 @@ LOGINFO("MiracastService::Deinitialize in"); if(result != Core::ERROR_NONE) { SYSLOG(Logging::Startup, (_T("MiracastService::DeInitialize: Failed to Configure %s"), PLUGIN_MIRACAST_SERVICE_IMPLEMENTATION_NAME)); - retStatus = _T("MiracastService plugin could not be deinitialised"); + // retStatus = _T("MiracastService plugin could not be deinitialised"); } else { From 682f835ebc14d2b3d836cdae82970d9b87c8c3b1 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 28 Aug 2025 20:00:13 +0530 Subject: [PATCH 46/53] Update MiracastService.cpp --- Miracast/MiracastService/MiracastService.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Miracast/MiracastService/MiracastService.cpp b/Miracast/MiracastService/MiracastService.cpp index 5d7194bd..a0bb696e 100644 --- a/Miracast/MiracastService/MiracastService.cpp +++ b/Miracast/MiracastService/MiracastService.cpp @@ -130,7 +130,7 @@ namespace WPEFramework void MiracastService::Deinitialize(PluginHost::IShell* service) { SYSLOG(Logging::Startup, (_T("MiracastService::Deinitialize: PID=%u"), getpid())); -LOGINFO("MiracastService::Deinitialize in"); + LOGINFO("MiracastService::Deinitialize in"); ASSERT(mCurrentService == service); ASSERT(0 == mConnectionId); @@ -173,10 +173,10 @@ LOGINFO("MiracastService::Deinitialize in"); { /* Make sure the Activated and Deactivated are no longer called before we start cleaning up.. */ mCurrentService->Unregister(&mMiracastServiceNotification); - mConfigure = mMiracastServiceImpl->QueryInterface(); - if (mConfigure) - { - uint32_t result = mConfigure->Configure(NULL); + Exchange::IConfiguration* mConfigure1 = mMiracastServiceImpl->QueryInterface(); + if (mConfigure1) + { LOGINFO("MiracastService::configure with nullptr"); + uint32_t result = mConfigure1->Configure(NULL); if(result != Core::ERROR_NONE) { SYSLOG(Logging::Startup, (_T("MiracastService::DeInitialize: Failed to Configure %s"), PLUGIN_MIRACAST_SERVICE_IMPLEMENTATION_NAME)); @@ -186,7 +186,7 @@ LOGINFO("MiracastService::Deinitialize in"); { LOGINFO("Successfully deinitialized"); } - mConfigure->Release(); + mConfigure1->Release(); } mCurrentService->Release(); mCurrentService = nullptr; From 5286bc1ebe1b53683477182e2b70bfdfedefb53b Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 28 Aug 2025 20:09:34 +0530 Subject: [PATCH 47/53] Update MiracastService.cpp --- Miracast/MiracastService/MiracastService.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Miracast/MiracastService/MiracastService.cpp b/Miracast/MiracastService/MiracastService.cpp index a0bb696e..d58a9416 100644 --- a/Miracast/MiracastService/MiracastService.cpp +++ b/Miracast/MiracastService/MiracastService.cpp @@ -188,9 +188,7 @@ namespace WPEFramework } mConfigure1->Release(); } - mCurrentService->Release(); - mCurrentService = nullptr; - } + } mConnectionId = 0; LOGINFO("MiracastService::Deinitialize out"); SYSLOG(Logging::Shutdown, (string(_T("MiracastService de-initialised")))); From 43653bb0853bc16b57a6b2d851fa43a6cf0920ff Mon Sep 17 00:00:00 2001 From: preeja33 Date: Thu, 28 Aug 2025 20:28:00 +0530 Subject: [PATCH 48/53] Update MiracastService.cpp --- Miracast/MiracastService/MiracastService.cpp | 21 +++++++------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/Miracast/MiracastService/MiracastService.cpp b/Miracast/MiracastService/MiracastService.cpp index d58a9416..96a055e7 100644 --- a/Miracast/MiracastService/MiracastService.cpp +++ b/Miracast/MiracastService/MiracastService.cpp @@ -99,7 +99,7 @@ namespace WPEFramework Exchange::JMiracastService::Register(*this, mMiracastServiceImpl); mRegisterEvents = true; } - mConfigure->Release(); + //mConfigure->Release(); } else { @@ -173,20 +173,13 @@ namespace WPEFramework { /* Make sure the Activated and Deactivated are no longer called before we start cleaning up.. */ mCurrentService->Unregister(&mMiracastServiceNotification); - Exchange::IConfiguration* mConfigure1 = mMiracastServiceImpl->QueryInterface(); - if (mConfigure1) + + if (mConfigure) { LOGINFO("MiracastService::configure with nullptr"); - uint32_t result = mConfigure1->Configure(NULL); - if(result != Core::ERROR_NONE) - { - SYSLOG(Logging::Startup, (_T("MiracastService::DeInitialize: Failed to Configure %s"), PLUGIN_MIRACAST_SERVICE_IMPLEMENTATION_NAME)); - // retStatus = _T("MiracastService plugin could not be deinitialised"); - } - else - { - LOGINFO("Successfully deinitialized"); - } - mConfigure1->Release(); + uint32_t result = mConfigure->Configure(NULL); + + mConfigure->Release(); + mConfigure = NULL; } } mConnectionId = 0; From e379875bab80dea9e162130f91d7b9d2b7e14f45 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Fri, 29 Aug 2025 11:04:57 +0530 Subject: [PATCH 49/53] Update MiracastController.cpp --- Miracast/MiracastService/MiracastController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index 2d93f667..478331c4 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -1616,7 +1616,7 @@ void ControllerThreadCallback(void *args) { MiracastController *miracast_ctrler_obj = (MiracastController *)args; MIRACASTLOG_TRACE("Entering..."); - // sleep(1); + sleep(1); if ( nullptr != miracast_ctrler_obj ) { miracast_ctrler_obj->Controller_Thread(nullptr); From 11728ad40843559ea70d251b926e2445d32d3857 Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 29 Aug 2025 12:23:42 +0530 Subject: [PATCH 50/53] Update MiracastService.cpp --- Miracast/MiracastService/MiracastService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Miracast/MiracastService/MiracastService.cpp b/Miracast/MiracastService/MiracastService.cpp index 96a055e7..26cc45f1 100644 --- a/Miracast/MiracastService/MiracastService.cpp +++ b/Miracast/MiracastService/MiracastService.cpp @@ -176,7 +176,7 @@ namespace WPEFramework if (mConfigure) { LOGINFO("MiracastService::configure with nullptr"); - uint32_t result = mConfigure->Configure(NULL); + //uint32_t result = mConfigure->Configure(NULL); mConfigure->Release(); mConfigure = NULL; From 70c35a210c6cb6b47600eed50fb193e93b4b92ab Mon Sep 17 00:00:00 2001 From: balav08 <54432605+balav08@users.noreply.github.com> Date: Fri, 29 Aug 2025 12:46:51 +0530 Subject: [PATCH 51/53] Update test_MiracastService.cpp --- Tests/L1Tests/tests/test_MiracastService.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Tests/L1Tests/tests/test_MiracastService.cpp b/Tests/L1Tests/tests/test_MiracastService.cpp index 738d76f9..59d42027 100755 --- a/Tests/L1Tests/tests/test_MiracastService.cpp +++ b/Tests/L1Tests/tests/test_MiracastService.cpp @@ -248,16 +248,15 @@ class MiracastServiceEventTest : public MiracastServiceTest { virtual ~MiracastServiceEventTest() override { - + dispatcher->Deactivate(); + dispatcher->Release(); + + PluginHost::IFactories::Assign(nullptr); + TEST_LOG("predebug1 Before destructor sleep "); //Wait for all the previous destructor process to complete std::this_thread::sleep_for(std::chrono::milliseconds(3000)); TEST_LOG("predebug1 After destructor sleep "); - - dispatcher->Deactivate(); - dispatcher->Release(); - - PluginHost::IFactories::Assign(nullptr); } }; From f18129e79884254613756925284ff4606eb177bd Mon Sep 17 00:00:00 2001 From: preeja33 Date: Fri, 29 Aug 2025 13:13:49 +0530 Subject: [PATCH 52/53] Update MiracastServiceImplementation.cpp --- Miracast/MiracastService/MiracastServiceImplementation.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Miracast/MiracastService/MiracastServiceImplementation.cpp b/Miracast/MiracastService/MiracastServiceImplementation.cpp index b680a2b9..c14e8861 100644 --- a/Miracast/MiracastService/MiracastServiceImplementation.cpp +++ b/Miracast/MiracastService/MiracastServiceImplementation.cpp @@ -441,6 +441,7 @@ namespace WPEFramework } MIRACAST::logger_deinit(); MiracastServiceImplementation::_instance = nullptr; + result = Core::ERROR_NONE; } else if ((service) && ( nullptr == m_CurrentService )) { From fae9ae2adbc21a9fdedbbd36a061f25b91fae852 Mon Sep 17 00:00:00 2001 From: preeja33 Date: Fri, 29 Aug 2025 13:24:36 +0530 Subject: [PATCH 53/53] Update MiracastService.cpp --- Miracast/MiracastService/MiracastService.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Miracast/MiracastService/MiracastService.cpp b/Miracast/MiracastService/MiracastService.cpp index 26cc45f1..5f0105c6 100644 --- a/Miracast/MiracastService/MiracastService.cpp +++ b/Miracast/MiracastService/MiracastService.cpp @@ -175,15 +175,17 @@ namespace WPEFramework mCurrentService->Unregister(&mMiracastServiceNotification); if (mConfigure) - { LOGINFO("MiracastService::configure with nullptr"); - //uint32_t result = mConfigure->Configure(NULL); - + { + uint32_t result = mConfigure->Configure(NULL); + if (result == Core::ERROR_NONE) { + SYSLOG(Logging::Shutdown, (string(_T("MiracastService successfully destructed")))); + } mConfigure->Release(); mConfigure = NULL; } } mConnectionId = 0; - LOGINFO("MiracastService::Deinitialize out"); + SYSLOG(Logging::Shutdown, (string(_T("MiracastService de-initialised")))); }