Only send I frames when necessary

This commit is contained in:
Patrick Nicolas
2023-12-16 14:16:46 +01:00
committed by Guillaume Meunier
parent 6e14bac589
commit df786362e7
10 changed files with 42 additions and 15 deletions
+7 -2
View File
@@ -21,6 +21,7 @@
#include "vk/vk_cmd_pool.h"
#include "vk/vk_helpers.h"
#include <atomic>
#include <chrono>
#include <memory>
#include <mutex>
@@ -52,6 +53,8 @@ private:
// shard to send
to_headset::video_stream_data_shard shard;
std::atomic_bool sync_needed = true;
public:
static std::unique_ptr<VideoEncoder> Create(vk_bundle * vk,
vk_cmd_pool & pool,
@@ -77,11 +80,13 @@ public:
virtual void PresentImage(int index, VkCommandBuffer * out_buffer)
{}
// The other end lost a frame and needs to resynchronize
void SyncNeeded();
void Encode(wivrn_session & cnx,
const to_headset::video_stream_data_shard::view_info_t & view_info,
uint64_t frame_index,
int index,
bool idr);
int index);
protected:
// encode the image at provided index.