MCPcopy Create free account
hub / github.com/WiVRn/WiVRn / sender

Method sender

server/encoder/video_encoder.cpp:49–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47{
48
49video_encoder::sender::sender() :
50 thread([this](std::stop_token t) {
51 while (not t.stop_requested())
52 {
53 data * d = nullptr;
54 {
55 std::unique_lock lock(mutex);
56 if (pending.empty())
57 cv.wait_for(lock, std::chrono::milliseconds(100));
58 else
59 d = &pending.front();
60 }
61 if (d and not d->span.empty())
62 {
63 d->encoder->SendData(d->span, true, d->prefer_control);
64 std::unique_lock lock(mutex);
65 pending.pop_front();
66 cv.notify_all();
67 }
68 }
69 std::unique_lock lock(mutex);
70 pending.clear();
71 cv.notify_all();
72 })
73{
74}
75
76void video_encoder::sender::push(data && d)
77{

Callers

nothing calls this directly

Calls 7

wait_forMethod · 0.80
SendDataMethod · 0.80
notify_allMethod · 0.80
emptyMethod · 0.45
frontMethod · 0.45
pop_frontMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected