#include #include #include #include #include "RecordVideoI.h" #include "ImageGrabberI.h" #include "LoopRecordVideoI.h" #include #include #include #include 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__<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 server("LoopRecordVideoServer", 10010, "tcp"); server.setMessageSizeMax(1024 * 1024 * 50); server.setPoolInitSize(5); server.setPoolMaxSize(32); server.runWaitShutDown(); return 0; }