mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-01-05 14:54:26 +01:00
The struct decoder is defined in decoder.h. For naming consistency, define the struct controller in controller.h.
30 lines
790 B
C
30 lines
790 B
C
#ifndef CONTROL_H
|
|
#define CONTROL_H
|
|
|
|
#include "controlevent.h"
|
|
|
|
#include <SDL2/SDL_mutex.h>
|
|
#include <SDL2/SDL_net.h>
|
|
#include <SDL2/SDL_stdinc.h>
|
|
|
|
struct controller {
|
|
TCPsocket video_socket;
|
|
SDL_Thread *thread;
|
|
SDL_mutex *mutex;
|
|
SDL_cond *event_cond;
|
|
SDL_bool stopped;
|
|
struct control_event_queue queue;
|
|
};
|
|
|
|
SDL_bool controller_init(struct controller *controller, TCPsocket video_socket);
|
|
void controller_destroy(struct controller *controller);
|
|
|
|
SDL_bool controller_start(struct controller *controller);
|
|
void controller_stop(struct controller *controller);
|
|
void controller_join(struct controller *controller);
|
|
|
|
// expose simple API to hide control_event_queue
|
|
SDL_bool controller_push_event(struct controller *controller, const struct control_event *event);
|
|
|
|
#endif
|