From 4aa25c508a0363ad53acfe9e7490bbfb3e0a40ce Mon Sep 17 00:00:00 2001 From: wangshuo <584363327@qq.com> Date: Thu, 21 Dec 2023 20:07:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=80=82=E9=85=8D=E4=BA=91=E4=BE=A7?= =?UTF-8?q?=E4=BD=BF=E7=94=A8TCP=E8=BF=9E=E6=8E=A5=E7=9A=84=E5=9C=BA?= =?UTF-8?q?=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cloudphone/src/main/cpp/CasController.cpp | 5 ++++- cloudphone/src/main/cpp/CasController.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cloudphone/src/main/cpp/CasController.cpp b/cloudphone/src/main/cpp/CasController.cpp index 87b91d2..01a48b6 100644 --- a/cloudphone/src/main/cpp/CasController.cpp +++ b/cloudphone/src/main/cpp/CasController.cpp @@ -88,6 +88,7 @@ CasController::CasController() m_frameType = FrameType::H264; m_rotationDegrees = 0; m_mtrans = nullptr; + m_isMTransEnable = false; } CasController::~CasController() @@ -113,6 +114,7 @@ CasController::~CasController() cmdCallBack = nullptr; m_orientation = 0; m_mtrans = nullptr; + m_isMTransEnable = false; } void CasController::SetJniConf(string key, string value) @@ -781,7 +783,7 @@ int CasController::JniSendData(CasMsgType type, uint8_t *data, int length) { std::lock_guard lockGuard(this->m_lock); #if MTRANS_ENABLED - if (m_mtrans != nullptr) { + if (m_mtrans != nullptr && m_isMTransEnable) { if (type == VirtualCamera) { return length == m_mtrans->SendVideoData(data, length, "h264"); } else if (type == VirtualMicrophone) { @@ -1071,6 +1073,7 @@ void CasController::RecvdVideoData(uint8_t *data, int length) memcpy(videoData, data, length); m_videoPacketStream->Handle(videoData); } + m_isMTransEnable = true; } void CasController::RecvdAudioData(uint8_t *data, int length) diff --git a/cloudphone/src/main/cpp/CasController.h b/cloudphone/src/main/cpp/CasController.h index 5e8beb6..1261fb8 100644 --- a/cloudphone/src/main/cpp/CasController.h +++ b/cloudphone/src/main/cpp/CasController.h @@ -176,6 +176,7 @@ private: std::map m_mediaConfig; int m_orientation = 0; int m_rotationDegrees = 0; + bool m_isMTransEnable = false; }; #endif // CLOUDAPPSDK_CASCONTROLLRT_H \ No newline at end of file -- Gitee From 2be1adc4e64f27e333275988d5cee7c89b08174b Mon Sep 17 00:00:00 2001 From: wangshuo <584363327@qq.com> Date: Thu, 21 Dec 2023 20:13:39 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=80=82=E9=85=8D=E4=BA=91=E4=BE=A7?= =?UTF-8?q?=E4=BD=BF=E7=94=A8TCP=E8=BF=9E=E6=8E=A5=E7=9A=84=E5=9C=BA?= =?UTF-8?q?=E6=99=AF-=E4=BF=AE=E6=94=B9=E5=8F=98=E9=87=8F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cloudphone/src/main/cpp/CasController.cpp | 8 ++++---- cloudphone/src/main/cpp/CasController.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cloudphone/src/main/cpp/CasController.cpp b/cloudphone/src/main/cpp/CasController.cpp index 01a48b6..9eeab20 100644 --- a/cloudphone/src/main/cpp/CasController.cpp +++ b/cloudphone/src/main/cpp/CasController.cpp @@ -88,7 +88,7 @@ CasController::CasController() m_frameType = FrameType::H264; m_rotationDegrees = 0; m_mtrans = nullptr; - m_isMTransEnable = false; + m_isMTransValid = false; } CasController::~CasController() @@ -114,7 +114,7 @@ CasController::~CasController() cmdCallBack = nullptr; m_orientation = 0; m_mtrans = nullptr; - m_isMTransEnable = false; + m_isMTransValid = false; } void CasController::SetJniConf(string key, string value) @@ -783,7 +783,7 @@ int CasController::JniSendData(CasMsgType type, uint8_t *data, int length) { std::lock_guard lockGuard(this->m_lock); #if MTRANS_ENABLED - if (m_mtrans != nullptr && m_isMTransEnable) { + if (m_mtrans != nullptr && m_isMTransValid) { if (type == VirtualCamera) { return length == m_mtrans->SendVideoData(data, length, "h264"); } else if (type == VirtualMicrophone) { @@ -1073,7 +1073,7 @@ void CasController::RecvdVideoData(uint8_t *data, int length) memcpy(videoData, data, length); m_videoPacketStream->Handle(videoData); } - m_isMTransEnable = true; + m_isMTransValid = true; } void CasController::RecvdAudioData(uint8_t *data, int length) diff --git a/cloudphone/src/main/cpp/CasController.h b/cloudphone/src/main/cpp/CasController.h index 1261fb8..400c0e1 100644 --- a/cloudphone/src/main/cpp/CasController.h +++ b/cloudphone/src/main/cpp/CasController.h @@ -176,7 +176,7 @@ private: std::map m_mediaConfig; int m_orientation = 0; int m_rotationDegrees = 0; - bool m_isMTransEnable = false; + bool m_isMTransValid = false; }; #endif // CLOUDAPPSDK_CASCONTROLLRT_H \ No newline at end of file -- Gitee From c66ca502019bc7f205e420cc6cba18d1af2f0e43 Mon Sep 17 00:00:00 2001 From: wangshuo <584363327@qq.com> Date: Thu, 21 Dec 2023 20:19:46 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=80=82=E9=85=8D=E4=BA=91=E4=BE=A7?= =?UTF-8?q?=E4=BD=BF=E7=94=A8TCP=E8=BF=9E=E6=8E=A5=E7=9A=84=E5=9C=BA?= =?UTF-8?q?=E6=99=AF-=E5=81=9C=E6=AD=A2=E6=97=B6=E9=87=8D=E7=BD=AE?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cloudphone/src/main/cpp/CasController.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cloudphone/src/main/cpp/CasController.cpp b/cloudphone/src/main/cpp/CasController.cpp index 9eeab20..d6cde26 100644 --- a/cloudphone/src/main/cpp/CasController.cpp +++ b/cloudphone/src/main/cpp/CasController.cpp @@ -521,6 +521,7 @@ bool CasController::DestroyWorkers() m_mtrans->Stop(); } #endif + m_isMTransValid = false; INFO("Succeed to destroy workers"); return true; -- Gitee