2
0
mirror of https://github.com/Genymobile/scrcpy synced 2025-08-31 22:35:37 +00:00

Handle resized video stream

Accept a parameter to limit the video size.

For instance, with "-m 960", the great side of the video will be scaled
down to 960 (if necessary), while the other side will be scaled down so
that the aspect ratio is preserved. Both dimensions must be a multiple
of 8, so black bands might be added, and the mouse positions must be
computed accordingly.
This commit is contained in:
Romain Vimont
2018-01-29 15:40:33 +01:00
parent 2c4ea6869e
commit 89f6a3cfe7
18 changed files with 274 additions and 87 deletions

View File

@@ -382,7 +382,7 @@ void event_loop(void) {
}
}
SDL_bool scrcpy(const char *serial, Uint16 local_port) {
SDL_bool scrcpy(const char *serial, Uint16 local_port, Uint16 maximum_size) {
SDL_bool ret = 0;
process_t push_proc = push_server(serial);
@@ -402,7 +402,7 @@ SDL_bool scrcpy(const char *serial, Uint16 local_port) {
}
// server will connect to our socket
process_t server = start_server(serial);
process_t server = start_server(serial, maximum_size);
if (server == PROCESS_NONE) {
ret = SDL_FALSE;
SDLNet_TCP_Close(server_socket);