diff --git a/src/content/frame_stream2.hpp b/src/content/frame_stream2.hpp index b2addc0..9e1d31c 100644 --- a/src/content/frame_stream2.hpp +++ b/src/content/frame_stream2.hpp @@ -107,7 +107,7 @@ struct FrameStream2MultiSource : public FrameStream2SourceI, public F // TODO: forward args instead std::shared_ptr> subscribe(void) override { // TODO: args??? - size_t queue_size = 10; + size_t queue_size = 8; bool lossy = true; std::lock_guard lg{_sub_stream_lock}; diff --git a/src/content/sdl_audio_frame_stream2.cpp b/src/content/sdl_audio_frame_stream2.cpp index 7c4a705..a04a5f3 100644 --- a/src/content/sdl_audio_frame_stream2.cpp +++ b/src/content/sdl_audio_frame_stream2.cpp @@ -59,10 +59,12 @@ SDLAudioInputDeviceDefault::SDLAudioInputDeviceDefault(void) : _stream{nullptr, std::this_thread::sleep_for(std::chrono::milliseconds(int64_t(interval_ms/2))); } else { std::cerr << "i guess no one is listening\n"; + std::cerr << "first value: " << buffer.front() << "\n"; // we just sleep 32x as long, bc no one is listening // with the hardcoded settings, this is ~320ms // TODO: just hardcode something like 500ms? // TODO: suspend + // TODO: this is not gonna cut it, since playback slows down dramatically and will be very behind std::this_thread::sleep_for(std::chrono::milliseconds(int64_t(interval_ms*32))); } } diff --git a/src/content/sdl_audio_frame_stream2.hpp b/src/content/sdl_audio_frame_stream2.hpp index d5bc782..a506346 100644 --- a/src/content/sdl_audio_frame_stream2.hpp +++ b/src/content/sdl_audio_frame_stream2.hpp @@ -17,7 +17,7 @@ using AudioFrameStream2 = AudioFrameStream2MultiSource::sub_stream_type_t; // ju // object components? // source -struct SDLAudioInputDeviceDefault : protected AudioFrameStream2MultiSource { +struct SDLAudioInputDeviceDefault : public AudioFrameStream2MultiSource { std::unique_ptr _stream; std::atomic _thread_should_quit {false}; diff --git a/src/debug_tox_call.cpp b/src/debug_tox_call.cpp index 5a5888c..c8ba558 100644 --- a/src/debug_tox_call.cpp +++ b/src/debug_tox_call.cpp @@ -379,7 +379,7 @@ float DebugToxCall::render(void) { auto new_vsink = std::make_unique(_toxav, fid); call.outgoing_vsink.emplace(new_vsink.get()); call.outgoing_vsink.emplace>(std::move(new_vsink)); - call.outgoing_vsink.emplace(Components::StreamSink::create("ToxAV friend call video")); + call.outgoing_vsink.emplace(Components::StreamSink::create("ToxAV Friend Call Outgoing Video")); _os.throwEventConstruct(call.outgoing_vsink); } call.outgoing_asink = {_os.registry(), _os.registry().create()}; @@ -387,7 +387,7 @@ float DebugToxCall::render(void) { auto new_asink = std::make_unique(_toxav, fid); call.outgoing_asink.emplace(new_asink.get()); call.outgoing_asink.emplace>(std::move(new_asink)); - call.outgoing_asink.emplace(Components::StreamSink::create("ToxAV friend call audio")); + call.outgoing_asink.emplace(Components::StreamSink::create("ToxAV Friend Call Outgoing Audio")); _os.throwEventConstruct(call.outgoing_asink); } @@ -398,7 +398,7 @@ float DebugToxCall::render(void) { auto new_vsrc = std::make_unique(); call.incoming_vsrc.emplace(new_vsrc.get()); call.incoming_vsrc.emplace>(std::move(new_vsrc)); - call.incoming_vsrc.emplace(Components::StreamSource::create("ToxAV friend call video")); + call.incoming_vsrc.emplace(Components::StreamSource::create("ToxAV Friend Call Incoming Video")); _os.throwEventConstruct(call.incoming_vsrc); } } @@ -408,7 +408,7 @@ float DebugToxCall::render(void) { auto new_asrc = std::make_unique(); call.incoming_asrc.emplace(new_asrc.get()); call.incoming_asrc.emplace>(std::move(new_asrc)); - call.incoming_asrc.emplace(Components::StreamSource::create("ToxAV friend call audio")); + call.incoming_asrc.emplace(Components::StreamSource::create("ToxAV Friend Call Incoming Audio")); _os.throwEventConstruct(call.incoming_asrc); } } diff --git a/src/main_screen.cpp b/src/main_screen.cpp index 00cd09f..b468f22 100644 --- a/src/main_screen.cpp +++ b/src/main_screen.cpp @@ -162,10 +162,16 @@ MainScreen::MainScreen(SimpleConfigModel&& conf_, SDL_Renderer* renderer_, Theme } } - { // audio in + if (false) { // audio in ObjectHandle asrc {os.registry(), os.registry().create()}; try { - throw int(2); + asrc.emplace>( + std::make_unique() + ); + + asrc.emplace(Components::StreamSource::create("SDL Audio Default Recording Device")); + + os.throwEventConstruct(asrc); } catch (...) { os.registry().destroy(asrc); } @@ -178,7 +184,7 @@ MainScreen::MainScreen(SimpleConfigModel&& conf_, SDL_Renderer* renderer_, Theme std::make_unique() ); - asink.emplace(Components::StreamSink::create("LoudSpeaker")); + asink.emplace(Components::StreamSink::create("SDL Audio Default Playback Device")); os.throwEventConstruct(asink); } catch (...) {