diff --git a/cmake/dependencies/common.cmake b/cmake/dependencies/common.cmake index ae61f0bb..e65ed408 100644 --- a/cmake/dependencies/common.cmake +++ b/cmake/dependencies/common.cmake @@ -3,10 +3,8 @@ # common dependencies -find_package(OpenSSL REQUIRED) find_package(PkgConfig REQUIRED) find_package(Threads REQUIRED) -pkg_check_modules(CURL REQUIRED libcurl) # ffmpeg pre-compiled binaries if(WIN32) diff --git a/src/main.cpp b/src/main.cpp index 54a91119..3e44b5e5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,6 +16,8 @@ #include "process.h" #include "version.h" #include "video.h" +#include "audio.h" +#include "input.h" #include "config.h" @@ -139,14 +141,49 @@ main(int argc, char *argv[]) { BOOST_LOG(error) << "Video failed to find working encoder"sv; } + auto video_capture = std::thread{[&](){ + video::capture(mail::man,video::config_t{ + 1920, 1080, 60, 6000, 1, 0, 1, 0, 0 + },NULL); + }}; + auto audio_capture = std::thread{[&](){ + audio::capture(mail::man,audio::config_t{ + 10,2,3,0 + },NULL); + }}; + + auto video_packets = mail::man->queue(mail::video_packets); + auto audio_packets = mail::man->queue(mail::audio_packets); + auto video_handle = std::thread{[&](){ + while (!shutdown_event->peek()) { + if(!video_packets->peek()) { + std::this_thread::sleep_for(1ms); + continue; + } - // FIXME: Temporary workaround: Simple-Web_server needs to be updated or replaced - if (shutdown_event->peek()) { - return 0; - } + auto packet = video_packets->pop(); + BOOST_LOG(info) << "Receive video packet size " << packet->data_size() << "\n"; + } + }}; + auto audio_handle = std::thread{[&](){ + while (!shutdown_event->peek()) { + if(!audio_packets->peek()) { + std::this_thread::sleep_for(1ms); + continue; + } + auto packet = audio_packets->pop(); + BOOST_LOG(info) << "Receive audio packet size " << packet->second.size() << "\n"; + } + }}; + while (!shutdown_event->peek()) + std::this_thread::sleep_for(1s); + video_handle.join(); + audio_handle.join(); + audio_capture.join(); + video_capture.join(); task_pool.stop(); task_pool.join(); diff --git a/sunshine.icns b/sunshine.icns deleted file mode 100644 index 0420582b..00000000 Binary files a/sunshine.icns and /dev/null differ