Add API to scrcpy library to send control messages to Android device.

This commit is contained in:
TeofilisMartisius 2021-08-30 23:48:26 +01:00
commit ad7212beb1
2 changed files with 12 additions and 0 deletions

View file

@ -555,3 +555,10 @@ scrcpy_add_sink(struct scrcpy_process *p,
decoder_add_sink(&s->decoder, sink);
return true;
}
void
scrcpy_push_event(struct scrcpy_process *p,
const struct control_msg *msg) {
struct scrcpy *s = p->scrcpy_struct;
controller_push_msg(&s->controller, msg);
}

View file

@ -3,6 +3,7 @@
#include "common.h"
#include "coords.h"
#include "control_msg.h"
#include <stdbool.h>
#include <stddef.h>
@ -171,6 +172,10 @@ scrcpy_add_sink(struct scrcpy_process *p,
void (*close)(void *sink),
bool (*push)(void *sink, const void *avframe));
void
scrcpy_push_event(struct scrcpy_process *p,
const struct control_msg *msg);
void
scrcpy_stop(struct scrcpy_process *p);