| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #include "simple_mq.h"
- #include "utility.hpp"
- #include "variable_defs.h"
- #include <spdlog/spdlog.h>
- #include <GLFW/glfw3.h>
- #include <cassert>
- using namespace simple_mq_singleton;
- extern GLFWwindow *main_window;
- void initialize_mq();
- void load_config();
- void initialize_cuda();
- void initialize_main_window();
- void cleanup();
- void prepare_imgui_frame();
- void handle_imgui_events();
- bool is_capturing();
- bool is_encoding();
- void wait_camera_frames();
- void process_camera_frames();
- void render_main_window();
- void generate_output_frame();
- int main() {
- #ifndef NDEBUG
- spdlog::set_level(spdlog::level::trace);
- #endif
- // initialize many staffs
- initialize_mq();
- initialize_cuda();
- load_config();
- initialize_main_window();
- while (!glfwWindowShouldClose(main_window)) {
- RESET_TIMER;
- prepare_imgui_frame();
- handle_imgui_events();
- if (is_capturing()) {
- wait_camera_frames();
- process_camera_frames();
- if (is_encoding()) {
- generate_output_frame();
- }
- }
- render_main_window();
- }
- cleanup();
- return 0;
- }
|