Move utilities to util/

This commit is contained in:
Romain Vimont 2019-11-24 11:53:00 +01:00
parent 83ace84280
commit dfd0707a29
40 changed files with 58 additions and 57 deletions

View file

@ -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'
]],
]

View file

@ -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;

View file

@ -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) {

View file

@ -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) {

View file

@ -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);

View file

@ -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

View file

@ -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) {

View file

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

View file

@ -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,

View file

@ -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/"

View file

@ -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,

View file

@ -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

View file

@ -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)

View file

@ -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;

View file

@ -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) {

View file

@ -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

View file

@ -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

View file

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

View file

@ -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;

View file

@ -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

View file

@ -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"

View file

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

View file

@ -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

View file

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

View file

@ -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) {

View file

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

View file

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

View file

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

View file

@ -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,

View file

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

View file

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

View file

@ -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";