diff --git a/core-buffer/include/buffer_config.hpp b/core-buffer/include/buffer_config.hpp index 8ef7b02..9fcfc9f 100644 --- a/core-buffer/include/buffer_config.hpp +++ b/core-buffer/include/buffer_config.hpp @@ -40,13 +40,6 @@ namespace core_buffer { const int BUFFER_ZMQ_SNDHWM = 100; // IPC address of the live stream. const std::string BUFFER_LIVE_IPC_URL = "ipc:///tmp/sf-live-"; - - // N of IO threads to receive data from modules. - const int STREAM_ZMQ_IO_THREADS = 4; - // How long should the RECV queue be. - const size_t STREAM_RCVHWM = 100; - // Size of buffer between the receiving and sending part. - const int STREAM_FASTQUEUE_SLOTS = 5; } #endif //BUFFERCONFIG_HPP diff --git a/sf-stream/include/stream_config.hpp b/sf-stream/include/stream_config.hpp new file mode 100644 index 0000000..6d0d1e4 --- /dev/null +++ b/sf-stream/include/stream_config.hpp @@ -0,0 +1,9 @@ +namespace stream_config +{ + // N of IO threads to receive data from modules. + const int STREAM_ZMQ_IO_THREADS = 4; + // How long should the RECV queue be. + const size_t STREAM_RCVHWM = 100; + // Size of buffer between the receiving and sending part. + const int STREAM_FASTQUEUE_SLOTS = 5; +} diff --git a/sf-stream/src/LiveRecvModule.cpp b/sf-stream/src/LiveRecvModule.cpp index bd7ef05..f40a027 100644 --- a/sf-stream/src/LiveRecvModule.cpp +++ b/sf-stream/src/LiveRecvModule.cpp @@ -4,10 +4,12 @@ #include #include "zmq.h" #include "buffer_config.hpp" +#include "stream_config.hpp" using namespace std; using namespace chrono; using namespace core_buffer; +using namespace stream_config; LiveRecvModule::LiveRecvModule( FastQueue& queue_, diff --git a/sf-stream/src/main.cpp b/sf-stream/src/main.cpp index e539907..cf52764 100644 --- a/sf-stream/src/main.cpp +++ b/sf-stream/src/main.cpp @@ -1,23 +1,24 @@ #include #include -#include "buffer_config.hpp" - #include -#include #include #include -#include #include #include -#include +#include "rapidjson/istreamwrapper.h" +#include #include "rapidjson/document.h" #include "rapidjson/stringbuffer.h" #include "rapidjson/writer.h" -#include -#include + +#include "FastQueue.hpp" +#include "LiveRecvModule.hpp" +#include "buffer_config.hpp" +#include "stream_config.hpp" using namespace std; using namespace core_buffer; +using namespace stream_config; int main (int argc, char *argv[]) { @@ -50,8 +51,7 @@ int main (int argc, char *argv[]) size_t n_modules = config_parameters["n_modules"].GetInt(); FastQueue queue( - n_modules * MODULE_N_BYTES, - STREAM_FASTQUEUE_SLOTS); + n_modules * MODULE_N_BYTES, STREAM_FASTQUEUE_SLOTS); auto ctx = zmq_ctx_new(); zmq_ctx_set (ctx, ZMQ_IO_THREADS, STREAM_ZMQ_IO_THREADS); @@ -263,6 +263,4 @@ int main (int argc, char *argv[]) read_max_us = 0; } } - - return 0; }