Use two sockets for video and control

The socket used the device-to-computer direction to stream the video and
the computer-to-device direction to send control events.

Some features, like copy-paste from device to computer, require to send
non-video data from the device to the computer.

To make them possible, use two sockets:
 - one for streaming the video from the device to the client;
 - one for control/events in both directions.
This commit is contained in:
Romain Vimont
2019-05-28 21:03:54 +02:00
parent 69360c7407
commit ec71a3f66a
7 changed files with 81 additions and 49 deletions

View File

@@ -12,7 +12,7 @@
struct control_event_queue CBUF(struct control_event, 64);
struct controller {
socket_t video_socket;
socket_t control_socket;
SDL_Thread *thread;
SDL_mutex *mutex;
SDL_cond *event_cond;
@@ -21,7 +21,7 @@ struct controller {
};
bool
controller_init(struct controller *controller, socket_t video_socket);
controller_init(struct controller *controller, socket_t control_socket);
void
controller_destroy(struct controller *controller);