From b1d6d50a4a30a7897fe06129e650cc5f252e8ecc Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Fri, 15 Aug 2025 23:40:40 +0200 Subject: [PATCH] Replace unused frames() method with empty() --- client/scenes/stream.cpp | 9 ++++----- client/scenes/stream.h | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/client/scenes/stream.cpp b/client/scenes/stream.cpp index 9db56dbb..dccc3291 100644 --- a/client/scenes/stream.cpp +++ b/client/scenes/stream.cpp @@ -527,7 +527,7 @@ void scenes::stream::push_blit_handle(shard_accumulator * decoder, std::shared_p } if (state_ != state::streaming and std::ranges::all_of(decoders, [](accumulator_images & i) { - return i.alpha() or not i.frames().empty(); + return i.alpha() or not i.empty(); })) { state_ = state::streaming; @@ -546,15 +546,14 @@ bool scenes::stream::accumulator_images::alpha() const return decoder->desc().channels == wivrn::to_headset::video_stream_description::channels_t::alpha; } -std::vector scenes::stream::accumulator_images::frames() const +bool scenes::stream::accumulator_images::empty() const { - std::vector result; for (const auto & frame: latest_frames) { if (frame) - result.push_back(frame->feedback.frame_index); + return false; } - return result; + return true; } std::vector> scenes::stream::common_frame(XrTime display_time) diff --git a/client/scenes/stream.h b/client/scenes/stream.h index 1b61d4ed..391d2a9b 100644 --- a/client/scenes/stream.h +++ b/client/scenes/stream.h @@ -67,12 +67,12 @@ private: vk::DescriptorSet descriptor_set = nullptr; vk::raii::PipelineLayout blit_pipeline_layout = nullptr; vk::raii::Pipeline blit_pipeline = nullptr; - // latest frames from oldest to most recent + // latest frames, rolling buffer std::array, image_buffer_size> latest_frames; std::shared_ptr frame(uint64_t id) const; bool alpha() const; - std::vector frames() const; + bool empty() const; }; wifi_lock::wifi wifi;