#include <iostream>
|
#include <QtCore/QDebug>
|
#include <Ice/Ice.h>
|
#include <IceUtil/IceUtil.h>
|
#include "RecordVideoI.h"
|
#include "ImageGrabberI.h"
|
#include "LoopRecordVideoI.h"
|
#include <basic/util/app/AppPreference.hpp>
|
#include <basic/rpc/IceRpc.hpp>
|
#include <basic/util/app/AppConfig.h>
|
#include <basic/debug/Debug.h>
|
|
|
using namespace std;
|
|
int main2(int argc, char **argv) {
|
SAVE_APP_ARGS;
|
ENABLEGLOG("~/work/log/");
|
auto ich = Ice::initialize(argc, argv);
|
|
std::string identity = ich->getProperties()->getProperty("user.record.video.identity");
|
std::string identityCapture = ich->getProperties()->getProperty("user.capture.image.identity");
|
std::string identityLoop = ich->getProperties()->getProperty("user.loop.record.video.identity");
|
std::string adapterName = ich->getProperties()->getProperty("user.adapter.name");
|
std::string absolutePath = ich->getProperties()->getProperty("user.absolute.path");
|
std::string loopAbsolutePath = ich->getProperties()->getProperty("user.loop.absolute.path");
|
std::string intervalDuration = ich->getProperties()->getProperty("user.interval.duration");
|
std::string ipPort = ich->getProperties()->getProperty("user.ip.port");
|
std::string timeOut = ich->getProperties()->getProperty("user.timeout");
|
|
appPref.setStringData("user.absolute.path", absolutePath);
|
appPref.setStringData("user.loop.absolute.path", loopAbsolutePath);
|
appPref.setLongData("user.interval.duration", atol(intervalDuration.c_str()));
|
appPref.setStringData("user.ip.port", ipPort);
|
appPref.setLongData("user.timeout", atol(timeOut.c_str()));
|
|
auto adapter = ich->createObjectAdapter(adapterName);
|
adapter->add(new RecordVideoI(), Ice::stringToIdentity(identity));
|
adapter->add(new ImageGrabberI(), Ice::stringToIdentity(identityCapture));
|
adapter->add(new LoopRecordVideoI(), Ice::stringToIdentity(identityLoop));
|
adapter->activate();
|
ich->waitForShutdown();
|
|
return 0;
|
}
|
|
#include "jsoncpp/json/json.h"
|
|
int main(int argc, char **argv) {
|
std::cout<<__DATE__<<" "<<__TIME__<<std::endl;
|
SAVE_APP_ARGS;
|
ENABLEGLOG(GET_STR_CONFIG("logPath").c_str());
|
auto ich = Ice::initialize(argc, argv);
|
|
std::string identity = "RecordVideoServer";
|
std::string identityCapture = "CaptureVideoImgServer";
|
std::string identityLoop = "LoopRecordVideoServer";
|
std::string adapterName = "RecordVideoServerAdapter";
|
std::string absolutePath = "build";
|
// std::string loopAbsolutePath = "/home/bsk/test/";
|
std::string loopAbsolutePath = appConfig.getStringProperty("cutPath");
|
std::string intervalDuration = "600000";
|
std::string ipPort = "192.168.1.65:8888";
|
std::string timeOut = "6000000";
|
|
appPref.setStringData("user.absolute.path", absolutePath);
|
appPref.setStringData("user.loop.absolute.path", loopAbsolutePath);
|
appPref.setLongData("user.interval.duration", atol(intervalDuration.c_str()));
|
appPref.setStringData("user.ip.port", ipPort);
|
appPref.setLongData("user.timeout", atol(timeOut.c_str()));
|
|
// auto adapter = ich->createObjectAdapter(adapterName);
|
// adapter->add(new RecordVideoI(), Ice::stringToIdentity(identity));
|
// adapter->add(new ImageGrabberI(), Ice::stringToIdentity(identityCapture));
|
// adapter->add(new LoopRecordVideoI(), Ice::stringToIdentity(identityLoop));
|
// adapter->activate();
|
// ich->waitForShutdown();
|
|
// Ice::ObjectAdapterPtr adapter = ich->createObjectAdapterWithEndpoints(identityLoop + "Adapter",
|
// " tcp -p " + std::to_string(10010));
|
//
|
// adapter->add(new LoopRecordVideoI, Ice::stringToIdentity(identityLoop));
|
// adapter->activate();
|
// ich->waitForShutdown();
|
|
IceRpcServer<LoopRecordVideoI> server("LoopRecordVideoServer", 10010, "tcp");
|
server.setMessageSizeMax(1024 * 1024 * 50);
|
server.setPoolInitSize(5);
|
server.setPoolMaxSize(32);
|
server.runWaitShutDown();
|
|
return 0;
|
}
|