diff --git a/app/meson.build b/app/meson.build index 159ae695..005239b8 100644 --- a/app/meson.build +++ b/app/meson.build @@ -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' ]], ] diff --git a/app/src/command.c b/app/src/command.c index d914e6ab..33a9c587 100644 --- a/app/src/command.c +++ b/app/src/command.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; diff --git a/app/src/control_msg.c b/app/src/control_msg.c index e042dc5a..363483eb 100644 --- a/app/src/control_msg.c +++ b/app/src/control_msg.c @@ -4,9 +4,9 @@ #include #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) { diff --git a/app/src/controller.c b/app/src/controller.c index 7f90d787..ec706c95 100644 --- a/app/src/controller.c +++ b/app/src/controller.c @@ -3,8 +3,8 @@ #include #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) { diff --git a/app/src/controller.h b/app/src/controller.h index 1b0d005b..8011ef6a 100644 --- a/app/src/controller.h +++ b/app/src/controller.h @@ -6,10 +6,10 @@ #include #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); diff --git a/app/src/decoder.c b/app/src/decoder.c index cad19913..52176484 100644 --- a/app/src/decoder.c +++ b/app/src/decoder.c @@ -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 diff --git a/app/src/device.c b/app/src/device.c index 4f50ab48..f4c2628b 100644 --- a/app/src/device.c +++ b/app/src/device.c @@ -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) { diff --git a/app/src/device.h b/app/src/device.h index 34a5f17f..8a94cd86 100644 --- a/app/src/device.h +++ b/app/src/device.h @@ -5,7 +5,7 @@ #include "config.h" #include "common.h" -#include "net.h" +#include "util/net.h" #define DEVICE_NAME_FIELD_LENGTH 64 diff --git a/app/src/device_msg.c b/app/src/device_msg.c index 2fc90ae4..aba56bb3 100644 --- a/app/src/device_msg.c +++ b/app/src/device_msg.c @@ -4,8 +4,8 @@ #include #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, diff --git a/app/src/file_handler.c b/app/src/file_handler.c index e02ca2a9..c0b03bcf 100644 --- a/app/src/file_handler.c +++ b/app/src/file_handler.c @@ -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/" diff --git a/app/src/file_handler.h b/app/src/file_handler.h index 4c158296..078d0ca5 100644 --- a/app/src/file_handler.h +++ b/app/src/file_handler.h @@ -6,8 +6,8 @@ #include #include "config.h" -#include "cbuf.h" #include "command.h" +#include "util/cbuf.h" typedef enum { ACTION_INSTALL_APK, diff --git a/app/src/fps_counter.c b/app/src/fps_counter.c index 2a9478f6..0c3f13d4 100644 --- a/app/src/fps_counter.c +++ b/app/src/fps_counter.c @@ -4,8 +4,8 @@ #include #include "config.h" -#include "lock_util.h" -#include "log.h" +#include "util/lock.h" +#include "util/log.h" #define FPS_COUNTER_INTERVAL_MS 1000 diff --git a/app/src/input_manager.c b/app/src/input_manager.c index 7d333c1b..e0aa6054 100644 --- a/app/src/input_manager.c +++ b/app/src/input_manager.c @@ -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) diff --git a/app/src/main.c b/app/src/main.c index 8a835bf1..c17cc6bf 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -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; diff --git a/app/src/receiver.c b/app/src/receiver.c index 1c80bb00..23944d5a 100644 --- a/app/src/receiver.c +++ b/app/src/receiver.c @@ -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) { diff --git a/app/src/receiver.h b/app/src/receiver.h index 6108e545..8387903b 100644 --- a/app/src/receiver.h +++ b/app/src/receiver.h @@ -6,7 +6,7 @@ #include #include "config.h" -#include "net.h" +#include "util/net.h" // receive events from the device // managed by the controller diff --git a/app/src/recorder.c b/app/src/recorder.c index f6f6fd96..b5314daf 100644 --- a/app/src/recorder.c +++ b/app/src/recorder.c @@ -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 diff --git a/app/src/recorder.h b/app/src/recorder.h index 4ad77197..4f5d526c 100644 --- a/app/src/recorder.h +++ b/app/src/recorder.h @@ -8,7 +8,7 @@ #include "config.h" #include "common.h" -#include "queue.h" +#include "util/queue.h" enum recorder_format { RECORDER_FORMAT_AUTO, diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index 67f1de16..673ec678 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -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; diff --git a/app/src/screen.c b/app/src/screen.c index ab4d434e..4cc7cde3 100644 --- a/app/src/screen.c +++ b/app/src/screen.c @@ -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 diff --git a/app/src/server.c b/app/src/server.c index 6061b8b3..d9114356 100644 --- a/app/src/server.c +++ b/app/src/server.c @@ -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" diff --git a/app/src/server.h b/app/src/server.h index f46ced19..0cb1ab3a 100644 --- a/app/src/server.h +++ b/app/src/server.h @@ -6,7 +6,7 @@ #include "config.h" #include "command.h" -#include "net.h" +#include "util/net.h" struct server { char *serial; diff --git a/app/src/stream.c b/app/src/stream.c index 6c3192f2..c84de981 100644 --- a/app/src/stream.c +++ b/app/src/stream.c @@ -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 diff --git a/app/src/stream.h b/app/src/stream.h index cb50468e..f7c5e475 100644 --- a/app/src/stream.h +++ b/app/src/stream.h @@ -8,7 +8,7 @@ #include #include "config.h" -#include "net.h" +#include "util/net.h" struct video_buffer; diff --git a/app/src/sys/unix/command.c b/app/src/sys/unix/command.c index 6a3a5a47..512b9af7 100644 --- a/app/src/sys/unix/command.c +++ b/app/src/sys/unix/command.c @@ -17,7 +17,8 @@ #include #include #include -#include "log.h" + +#include "util/log.h" enum process_result cmd_execute(const char *path, const char *const argv[], pid_t *pid) { diff --git a/app/src/sys/unix/net.c b/app/src/sys/unix/net.c index d940f3bb..d67a660f 100644 --- a/app/src/sys/unix/net.c +++ b/app/src/sys/unix/net.c @@ -1,4 +1,4 @@ -#include "net.h" +#include "util/net.h" #include diff --git a/app/src/tiny_xpm.c b/app/src/tiny_xpm.c index 5ea89078..e96981fb 100644 --- a/app/src/tiny_xpm.c +++ b/app/src/tiny_xpm.c @@ -6,7 +6,7 @@ #include #include "config.h" -#include "log.h" +#include "util/log.h" struct index { char c; diff --git a/app/src/buffer_util.h b/app/src/util/buffer_util.h similarity index 100% rename from app/src/buffer_util.h rename to app/src/util/buffer_util.h diff --git a/app/src/cbuf.h b/app/src/util/cbuf.h similarity index 100% rename from app/src/cbuf.h rename to app/src/util/cbuf.h diff --git a/app/src/lock_util.h b/app/src/util/lock.h similarity index 96% rename from app/src/lock_util.h rename to app/src/util/lock.h index 260d2c12..8ebee241 100644 --- a/app/src/lock_util.h +++ b/app/src/util/lock.h @@ -1,5 +1,5 @@ -#ifndef LOCKUTIL_H -#define LOCKUTIL_H +#ifndef LOCK_H +#define LOCK_H #include #include diff --git a/app/src/log.h b/app/src/util/log.h similarity index 100% rename from app/src/log.h rename to app/src/util/log.h diff --git a/app/src/net.c b/app/src/util/net.c similarity index 100% rename from app/src/net.c rename to app/src/util/net.c diff --git a/app/src/net.h b/app/src/util/net.h similarity index 100% rename from app/src/net.h rename to app/src/util/net.h diff --git a/app/src/queue.h b/app/src/util/queue.h similarity index 100% rename from app/src/queue.h rename to app/src/util/queue.h diff --git a/app/src/str_util.c b/app/src/util/str_util.c similarity index 100% rename from app/src/str_util.c rename to app/src/util/str_util.c diff --git a/app/src/str_util.h b/app/src/util/str_util.h similarity index 100% rename from app/src/str_util.h rename to app/src/util/str_util.h diff --git a/app/src/video_buffer.c b/app/src/video_buffer.c index 2b5f1c2f..9de3ad7f 100644 --- a/app/src/video_buffer.c +++ b/app/src/video_buffer.c @@ -6,8 +6,8 @@ #include #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, diff --git a/app/tests/test_cbuf.c b/app/tests/test_cbuf.c index 9d5fdc27..dbe50aab 100644 --- a/app/tests/test_cbuf.c +++ b/app/tests/test_cbuf.c @@ -1,7 +1,7 @@ #include #include -#include "cbuf.h" +#include "util/cbuf.h" struct int_queue CBUF(int, 32); diff --git a/app/tests/test_queue.c b/app/tests/test_queue.c index bcbced2b..b0950bb0 100644 --- a/app/tests/test_queue.c +++ b/app/tests/test_queue.c @@ -1,6 +1,6 @@ #include -#include +#include "util/queue.h" struct foo { int value; diff --git a/app/tests/test_strutil.c b/app/tests/test_strutil.c index 18ac4a7d..64e62ed1 100644 --- a/app/tests/test_strutil.c +++ b/app/tests/test_strutil.c @@ -1,7 +1,7 @@ #include #include -#include "str_util.h" +#include "util/str_util.h" static void test_xstrncpy_simple(void) { char s[] = "xxxxxxxxxx";