mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Limit source code to 80 chars, and declare functions return type and modifiers on a separate line. This allows to avoid very long lines, and all function names are aligned. (We do this on VLC, and I like it.)
41 lines
835 B
C
41 lines
835 B
C
#ifndef CONTROL_H
|
|
#define CONTROL_H
|
|
|
|
#include "control_event.h"
|
|
|
|
#include <SDL2/SDL_mutex.h>
|
|
#include <SDL2/SDL_stdinc.h>
|
|
#include <SDL2/SDL_thread.h>
|
|
|
|
#include "net.h"
|
|
|
|
struct controller {
|
|
socket_t 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, socket_t 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
|