Reduce some copies in serialization

Also update a bunch of stuff
This commit is contained in:
Patrick Nicolas
2023-11-22 00:00:55 +01:00
parent c799fa6aa4
commit 8b0895913b
22 changed files with 805 additions and 820 deletions
+2 -2
View File
@@ -112,10 +112,11 @@ void VideoEncoder::Encode(wivrn_session & cnx,
}
void VideoEncoder::SendData(std::vector<uint8_t> && data)
void VideoEncoder::SendData(std::vector<uint8_t> && data_)
{
auto & max_payload_size = to_headset::video_stream_data_shard::max_payload_size;
std::lock_guard lock(mutex);
data = std::move(data_);
#if 0
std::ofstream debug("/tmp/video_dump-" + std::to_string(stream_idx), std::ios::app);
debug.write((char*)data.data(), data.size());
@@ -138,7 +139,6 @@ void VideoEncoder::SendData(std::vector<uint8_t> && data)
begin = next;
flags = 0;
}
shard.data = std::move(data);
}
void VideoEncoder::PushShard(const std::span<uint8_t> & payload, uint8_t flags)