From 142117991fae65646bc5dd59d96c4a5c5e8559ca Mon Sep 17 00:00:00 2001
From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期四, 10 八月 2017 14:54:25 +0800
Subject: [PATCH] bug fix
---
VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFuncClient.cpp | 53 ++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 38 insertions(+), 15 deletions(-)
diff --git a/VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFuncClient.cpp b/VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFuncClient.cpp
index 5bc9c0d..8d0cd6d 100644
--- a/VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFuncClient.cpp
+++ b/VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFuncClient.cpp
@@ -5,22 +5,45 @@
#include "RemoteFuncClient.h"
#include "RemoteFunc.h"
#include "RtspNativeCodecJNIClient.h"
-RemoteServer<RtspFaceDetectImpl> remoteServer("127.0.0.1",8111);
-void startRemoteServer(){
- remoteServer.start();
+
+RemoteServer<RtspFaceDetectImpl> remoteServer("127.0.0.1", 8111);
+static RtspFaceViewClient* rtspFaceViewClient = nullptr;
+
+void startRemoteServer()
+{
+ remoteServer.start();
}
-RtspFaceViewClient rtspFaceViewClient;
-RtspFaceViewClient& RtspFaceViewClient(){
- return rtspFaceViewClient;
+
+RtspFaceViewClient* getRtspFaceViewClient()
+{
+ if (rtspFaceViewClient != nullptr)
+ {
+ try
+ {
+ rtspFaceViewClient = new RtspFaceViewClient;
+ }
+ catch(...)
+ {
+ delete rtspFaceViewClient;
+ rtspFaceViewClient = nullptr;
+ LOG_ERROR << "aaaaaaaa"<<LOG_ENDL;//#todo
+ }
+ }
+ return rtspFaceViewClient;
}
-RtspFaceViewClient::RtspFaceViewClient():rpcClient("127.0.0.1",8112),
- RtspFaceView::Client(rpcClient.getMain<RtspFaceView>())
+
+RtspFaceViewClient::RtspFaceViewClient() :
+ rpcClient("127.0.0.1", 8112), RtspFaceView::Client(rpcClient.getMain<RtspFaceView>())
{}
-::kj::WaitScope& RtspFaceViewClient::getWaitScope(){
- return rpcClient.getWaitScope();
+
+::kj::WaitScope &RtspFaceViewClient::getWaitScope()
+{
+ return rpcClient.getWaitScope();
}
-::kj::Promise<void> RtspFaceDetectImpl::fireFaceCountListener(FireFaceCountListenerContext context) {
- auto results = context.getResults();
- remoteFireFaceCountListener(context.getParams(), results);
- context.setResults(results);
-}
\ No newline at end of file
+
+::kj::Promise<void> RtspFaceDetectImpl::fireFaceCountListener(FireFaceCountListenerContext context)
+{
+ auto results = context.getResults();
+ remoteFireFaceCountListener(context.getParams(), results);
+ context.setResults(results);
+}
--
Gitblit v1.8.0