#include "API/WebAPI.h" #include #include #include #include #include int main(int argc, char** argv) { try { Logging::OpenLog(); Logging::SetLogMask(Logging::Severity::Debug); int port(8000); ctpl::thread_pool threadPool(6); std::string ffmpeg = "ffmpeg"; Http::HttpServer::CallbackMethod callback = std::bind(&StreamRecoder::API::WebAPI::ProcessQuery, &threadPool, ffmpeg, std::placeholders::_1, std::placeholders::_2); Http::HttpServer server(port, callback); Logging::Log(Logging::Severity::Info, "Startup Complete"); server.Wait(); Logging::Log(Logging::Severity::Info, "Stopping StreamRecoder..."); Logging::CloseLog(); } catch (const std::exception& e) { std::cerr << "Exception caught" << std::endl; std::stringstream ss; ss << "Type : " << typeid(e).name() << std::endl; ss << "ERROR: " << e.what() << std::endl; Logging::Log(Logging::Severity::Error, ss.str()); Logging::CloseLog(); return -1; } return 0; }