houxiao
2017-08-14 1b88ab83de66fec80e895fa9fbd4a47d1d4af772
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// Created by pansen on 2017/8/4.
//
 
#include "RemoteFuncClient.h"
#include "RemoteFunc.h"
#include "RtspNativeCodecJNIClient.h"
 
RemoteServer<RtspFaceDetectImpl> remoteServer("127.0.0.1", 8111);
static RtspFaceViewClient* rtspFaceViewClient = nullptr;
 
void startRemoteServer()
{
    remoteServer.start();
}
 
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>())
{}
 
::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);
}