mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-01-29 02:24:26 +01:00
Introduce non-droppable control messages
Control messages are queued from the main thread and sent to the device from a separate thread. When the queue is full, messages are just dropped. This avoids to accumulate too much delay between the client and the device in case of network issue. However, some messages should not be dropped: for example, dropping a UHID_CREATE message would make all further UHID_INPUT messages invalid. Therefore, mark these messages as non-droppable. A non-droppable event is queued anyway (resizing the queue if necessary, unless the allocation fails). PR #5270 <https://github.com/Genymobile/scrcpy/pull/5270>
This commit is contained in:
@@ -116,6 +116,11 @@ sc_control_msg_serialize(const struct sc_control_msg *msg, uint8_t *buf);
|
||||
void
|
||||
sc_control_msg_log(const struct sc_control_msg *msg);
|
||||
|
||||
// Even when the buffer is "full", some messages must absolutely not be dropped
|
||||
// to avoid inconsistencies.
|
||||
bool
|
||||
sc_control_msg_is_droppable(const struct sc_control_msg *msg);
|
||||
|
||||
void
|
||||
sc_control_msg_destroy(struct sc_control_msg *msg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user