pans
2017-08-04 b4edb9b542a8399484b892cddb72ef79975f1a8e
add RemoteFunc

git-svn-id: http://192.168.1.226/svn/proxy@975 454eff88-639b-444f-9e54-f578c98de674
6个文件已添加
142 ■■■■■ 已修改文件
VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFunc.cpp 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFunc.h 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFuncClient.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFuncClient.h 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFuncServer.cpp 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFuncServer.h 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFunc.cpp
New file
@@ -0,0 +1,4 @@
//
// Created by pansen on 2017/8/4.
//
VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFunc.h
New file
@@ -0,0 +1,18 @@
//
// Created by pansen on 2017/8/4.
//
#ifndef RTSPNATIVECODEC_REMOTEFUNC_H
#define RTSPNATIVECODEC_REMOTEFUNC_H
#include <iostream>
#include "RemoteMethod.proto.h"
#include "CameraWrapperServer.h"
class RemoteFunc{
public:
};
#endif //RTSPNATIVECODEC_REMOTEFUNC_H
VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFuncClient.cpp
New file
@@ -0,0 +1,5 @@
//
// Created by pansen on 2017/8/4.
//
VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFuncClient.h
New file
@@ -0,0 +1,37 @@
//
// Created by pansen on 2017/8/4.
//
#ifndef RTSPNATIVECODEC_REMOTEMETHODCLIENT_H
#define RTSPNATIVECODEC_REMOTEMETHODCLIENT_H
#include <iostream>
#include <capnp/ez-rpc.h>
#include "RemoteMethod.proto.h"
#include "CameraWrapperServer.h"
const RtspFaceView::Client getRtspFaceViewClient();
class RtspFaceViewClient{
public:
    RtspFaceViewClient();
    ~RtspFaceViewClient();
    RtspFaceView::GetFaceListResults::Reader getFaceList(int cameraIndex);
    RtspFaceView::GetFaceListResults::Reader getFaceImages(int cameraIndex);
    void setFaceLable(int cameraIndex,int trackId,std::string label);
private:
    capnp::EzRpcClient rpcClient;
    RtspFaceDetect::Client client;
};
class RtspFaceDetectImpl final : public RtspFaceDetect::Server{
public:
    RtspFaceDetectImpl();
    ~RtspFaceDetectImpl();
    virtual ::kj::Promise<void> fireFaceCountListener(FireFaceCountListenerContext context) override ;
};
#endif //RTSPNATIVECODEC_REMOTEMETHODCLIENT_H
VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFuncServer.cpp
New file
@@ -0,0 +1,32 @@
//
// Created by pansen on 2017/8/4.
//
#include "RemoteFuncServer.h"
RtspFaceDetectClient rtspFaceDetectClient;
const RtspFaceDetectClient& getRtspFaceDetectClient(){
   return rtspFaceDetectClient;
}
//#todo
RtspFaceDetectClient::RtspFaceDetectClient():rpcClient("127.0.0.1",8111),
                           client(rpcClient.getMain<RtspFaceDetect>())
{}
void RtspFaceDetectClient::fireFaceCountListener(int cameraIndex, int faceCount){
        auto req = client.fireFaceCountListenerRequest();
        req.setCameraIndex(cameraIndex);
        req.setFaceCount(faceCount);
        auto send = req.send();
        send.wait(rpcClient.getWaitScope());
}
//#todo
::kj::Promise<void> RtspFaceViewImpl::RtspFaceViewImpl() {}
::kj::Promise<void> RtspFaceViewImpl::~RtspFaceViewImpl(){}
::kj::Promise<void> RtspFaceViewImpl::getFaceList(GetFaceListContext context) override{}
::kj::Promise<void> RtspFaceViewImpl::getFaceImages(GetFaceImagesContext context) override{}
::kj::Promise<void> RtspFaceViewImpl::setFaceLabel(SetFaceLabelContext context) override {}
VisitFace/RtspNativeCodec/app/src/main/cpp/RemoteFuncServer.h
New file
@@ -0,0 +1,46 @@
//
// Created by pansen on 2017/8/4.
//
#ifndef RTSPNATIVECODEC_REMOTEMETHODSERVER_H
#define RTSPNATIVECODEC_REMOTEMETHODSERVER_H
#include <iostream>
#include <capnp/ez-rpc.h>
#include "RemoteMethod.proto.h"
#include "CameraWrapperServer.h"
const RtspFaceDetectClient& getRtspFaceDetectClient();
class RtspFaceDetectClient{
public:
    RtspFaceDetectClient();
    ~RtspFaceDetectClient();
    void fireFaceCountListener(int cameraIndex, int faceCount);
private:
    capnp::EzRpcClient rpcClient;
    RtspFaceDetect::Client client;
};
class RtspFaceViewImpl final : public RtspFaceView::Server {
public:
    RtspFaceViewImpl();
    ~RtspFaceViewImpl();
    virtual ::kj::Promise<void> getFaceList(GetFaceListContext context) override;
    virtual ::kj::Promise<void> getFaceImages(GetFaceImagesContext context) override;
    virtual ::kj::Promise<void> setFaceLabel(SetFaceLabelContext context) override ;
private:
    CameraWrapper cameraWrapper;
};
#endif //RTSPNATIVECODEC_REMOTEMETHODSERVER_H