Move utilities to util/

pull/967/head
Romain Vimont 5 years ago
parent 83ace84280
commit dfd0707a29

@ -10,16 +10,16 @@ src = [
'src/file_handler.c',
'src/fps_counter.c',
'src/input_manager.c',
'src/net.c',
'src/receiver.c',
'src/recorder.c',
'src/scrcpy.c',
'src/screen.c',
'src/server.c',
'src/str_util.c',
'src/tiny_xpm.c',
'src/stream.c',
'src/tiny_xpm.c',
'src/video_buffer.c',
'src/util/net.c',
'src/util/str_util.c'
]
if not get_option('crossbuild_windows')
@ -147,7 +147,7 @@ tests = [
['test_control_event_serialize', [
'tests/test_control_msg_serialize.c',
'src/control_msg.c',
'src/str_util.c'
'src/util/str_util.c'
]],
['test_device_event_deserialize', [
'tests/test_device_msg_deserialize.c',
@ -158,7 +158,7 @@ tests = [
]],
['test_strutil', [
'tests/test_strutil.c',
'src/str_util.c'
'src/util/str_util.c'
]],
]

@ -7,8 +7,8 @@
#include "config.h"
#include "common.h"
#include "log.h"
#include "str_util.h"
#include "util/log.h"
#include "util/str_util.h"
static const char *adb_command;

@ -4,9 +4,9 @@
#include <SDL2/SDL_assert.h>
#include "config.h"
#include "buffer_util.h"
#include "log.h"
#include "str_util.h"
#include "util/buffer_util.h"
#include "util/log.h"
#include "util/str_util.h"
static void
write_position(uint8_t *buf, const struct position *position) {

@ -3,8 +3,8 @@
#include <SDL2/SDL_assert.h>
#include "config.h"
#include "lock_util.h"
#include "log.h"
#include "util/lock.h"
#include "util/log.h"
bool
controller_init(struct controller *controller, socket_t control_socket) {

@ -6,10 +6,10 @@
#include <SDL2/SDL_thread.h>
#include "config.h"
#include "cbuf.h"
#include "control_msg.h"
#include "net.h"
#include "receiver.h"
#include "util/cbuf.h"
#include "util/net.h"
struct control_msg_queue CBUF(struct control_msg, 64);

@ -10,12 +10,12 @@
#include "config.h"
#include "compat.h"
#include "buffer_util.h"
#include "events.h"
#include "lock_util.h"
#include "log.h"
#include "recorder.h"
#include "video_buffer.h"
#include "util/buffer_util.h"
#include "util/lock.h"
#include "util/log.h"
// set the decoded frame as ready for rendering, and notify
static void

@ -1,7 +1,7 @@
#include "device.h"
#include "config.h"
#include "log.h"
#include "util/log.h"
bool
device_read_info(socket_t device_socket, char *device_name, struct size *size) {

@ -5,7 +5,7 @@
#include "config.h"
#include "common.h"
#include "net.h"
#include "util/net.h"
#define DEVICE_NAME_FIELD_LENGTH 64

@ -4,8 +4,8 @@
#include <SDL2/SDL_assert.h>
#include "config.h"
#include "buffer_util.h"
#include "log.h"
#include "util/buffer_util.h"
#include "util/log.h"
ssize_t
device_msg_deserialize(const unsigned char *buf, size_t len,

@ -5,8 +5,8 @@
#include "config.h"
#include "command.h"
#include "lock_util.h"
#include "log.h"
#include "util/lock.h"
#include "util/log.h"
#define DEFAULT_PUSH_TARGET "/sdcard/"

@ -6,8 +6,8 @@
#include <SDL2/SDL_thread.h>
#include "config.h"
#include "cbuf.h"
#include "command.h"
#include "util/cbuf.h"
typedef enum {
ACTION_INSTALL_APK,

@ -4,8 +4,8 @@
#include <SDL2/SDL_timer.h>
#include "config.h"
#include "lock_util.h"
#include "log.h"
#include "util/lock.h"
#include "util/log.h"
#define FPS_COUNTER_INTERVAL_MS 1000

@ -4,8 +4,8 @@
#include "config.h"
#include "event_converter.h"
#include "lock_util.h"
#include "log.h"
#include "util/lock.h"
#include "util/log.h"
// Convert window coordinates (as provided by SDL_GetMouseState() to renderer
// coordinates (as provided in SDL mouse events)

@ -10,8 +10,8 @@
#include "config.h"
#include "compat.h"
#include "log.h"
#include "recorder.h"
#include "util/log.h"
struct args {
struct scrcpy_options opts;

@ -5,8 +5,8 @@
#include "config.h"
#include "device_msg.h"
#include "lock_util.h"
#include "log.h"
#include "util/lock.h"
#include "util/log.h"
bool
receiver_init(struct receiver *receiver, socket_t control_socket) {

@ -6,7 +6,7 @@
#include <SDL2/SDL_thread.h>
#include "config.h"
#include "net.h"
#include "util/net.h"
// receive events from the device
// managed by the controller

@ -5,8 +5,8 @@
#include "config.h"
#include "compat.h"
#include "lock_util.h"
#include "log.h"
#include "util/lock.h"
#include "util/log.h"
static const AVRational SCRCPY_TIME_BASE = {1, 1000000}; // timestamps in us

@ -8,7 +8,7 @@
#include "config.h"
#include "common.h"
#include "queue.h"
#include "util/queue.h"
enum recorder_format {
RECORDER_FORMAT_AUTO,

@ -18,15 +18,15 @@
#include "file_handler.h"
#include "fps_counter.h"
#include "input_manager.h"
#include "log.h"
#include "lock_util.h"
#include "net.h"
#include "recorder.h"
#include "screen.h"
#include "server.h"
#include "stream.h"
#include "tiny_xpm.h"
#include "video_buffer.h"
#include "util/lock.h"
#include "util/log.h"
#include "util/net.h"
static struct server server = SERVER_INITIALIZER;
static struct screen screen = SCREEN_INITIALIZER;

@ -7,10 +7,10 @@
#include "common.h"
#include "compat.h"
#include "icon.xpm"
#include "lock_util.h"
#include "log.h"
#include "tiny_xpm.h"
#include "video_buffer.h"
#include "util/lock.h"
#include "util/log.h"
#define DISPLAY_MARGINS 96

@ -9,8 +9,8 @@
#include "config.h"
#include "command.h"
#include "log.h"
#include "net.h"
#include "util/log.h"
#include "util/net.h"
#define SOCKET_NAME "scrcpy"
#define SERVER_FILENAME "scrcpy-server"

@ -6,7 +6,7 @@
#include "config.h"
#include "command.h"
#include "net.h"
#include "util/net.h"
struct server {
char *serial;

@ -10,12 +10,12 @@
#include "config.h"
#include "compat.h"
#include "buffer_util.h"
#include "decoder.h"
#include "events.h"
#include "lock_util.h"
#include "log.h"
#include "recorder.h"
#include "util/buffer_util.h"
#include "util/lock.h"
#include "util/log.h"
#define BUFSIZE 0x10000

@ -8,7 +8,7 @@
#include <SDL2/SDL_thread.h>
#include "config.h"
#include "net.h"
#include "util/net.h"
struct video_buffer;

@ -17,7 +17,8 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include "log.h"
#include "util/log.h"
enum process_result
cmd_execute(const char *path, const char *const argv[], pid_t *pid) {

@ -1,4 +1,4 @@
#include "net.h"
#include "util/net.h"
#include <unistd.h>

@ -6,7 +6,7 @@
#include <stdlib.h>
#include "config.h"
#include "log.h"
#include "util/log.h"
struct index {
char c;

@ -1,5 +1,5 @@
#ifndef LOCKUTIL_H
#define LOCKUTIL_H
#ifndef LOCK_H
#define LOCK_H
#include <stdint.h>
#include <SDL2/SDL_mutex.h>

@ -6,8 +6,8 @@
#include <libavformat/avformat.h>
#include "config.h"
#include "lock_util.h"
#include "log.h"
#include "util/lock.h"
#include "util/log.h"
bool
video_buffer_init(struct video_buffer *vb, struct fps_counter *fps_counter,

@ -1,7 +1,7 @@
#include <assert.h>
#include <string.h>
#include "cbuf.h"
#include "util/cbuf.h"
struct int_queue CBUF(int, 32);

@ -1,6 +1,6 @@
#include <assert.h>
#include <queue.h>
#include "util/queue.h"
struct foo {
int value;

@ -1,7 +1,7 @@
#include <assert.h>
#include <string.h>
#include "str_util.h"
#include "util/str_util.h"
static void test_xstrncpy_simple(void) {
char s[] = "xxxxxxxxxx";

Loading…
Cancel
Save