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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user