Compare commits
3 Commits
v1.13
...
logical_si
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09564e167a | ||
|
|
20cde79980 | ||
|
|
2ed8f5009b |
@@ -100,30 +100,30 @@ dist-win32: build-server build-win32 build-win32-noconsole
|
||||
cp "$(SERVER_BUILD_DIR)"/server/scrcpy-server "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp "$(WIN32_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp "$(WIN32_NOCONSOLE_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN32_TARGET_DIR)/scrcpy-noconsole.exe"
|
||||
cp prebuilt-deps/ffmpeg-4.2.2-win32-shared/bin/avutil-56.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.2-win32-shared/bin/avcodec-58.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.2-win32-shared/bin/avformat-58.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.2-win32-shared/bin/swresample-3.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.2-win32-shared/bin/swscale-5.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.1-win32-shared/bin/avutil-56.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.1-win32-shared/bin/avcodec-58.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.1-win32-shared/bin/avformat-58.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.1-win32-shared/bin/swresample-3.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.1-win32-shared/bin/swscale-5.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/platform-tools/adb.exe "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/platform-tools/AdbWinApi.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/platform-tools/AdbWinUsbApi.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/SDL2-2.0.12/i686-w64-mingw32/bin/SDL2.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
cp prebuilt-deps/SDL2-2.0.10/i686-w64-mingw32/bin/SDL2.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||
|
||||
dist-win64: build-server build-win64 build-win64-noconsole
|
||||
mkdir -p "$(DIST)/$(WIN64_TARGET_DIR)"
|
||||
cp "$(SERVER_BUILD_DIR)"/server/scrcpy-server "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp "$(WIN64_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp "$(WIN64_NOCONSOLE_BUILD_DIR)"/app/scrcpy.exe "$(DIST)/$(WIN64_TARGET_DIR)/scrcpy-noconsole.exe"
|
||||
cp prebuilt-deps/ffmpeg-4.2.2-win64-shared/bin/avutil-56.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.2-win64-shared/bin/avcodec-58.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.2-win64-shared/bin/avformat-58.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.2-win64-shared/bin/swresample-3.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.2-win64-shared/bin/swscale-5.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.1-win64-shared/bin/avutil-56.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.1-win64-shared/bin/avcodec-58.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.1-win64-shared/bin/avformat-58.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.1-win64-shared/bin/swresample-3.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/ffmpeg-4.2.1-win64-shared/bin/swscale-5.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/platform-tools/adb.exe "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/platform-tools/AdbWinApi.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/platform-tools/AdbWinUsbApi.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/SDL2-2.0.12/x86_64-w64-mingw32/bin/SDL2.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
cp prebuilt-deps/SDL2-2.0.10/x86_64-w64-mingw32/bin/SDL2.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||
|
||||
zip-win32: dist-win32
|
||||
cd "$(DIST)/$(WIN32_TARGET_DIR)"; \
|
||||
|
||||
@@ -37,7 +37,7 @@ control it using keyboard and mouse.
|
||||
|
||||
### Linux
|
||||
|
||||
On Debian (_testing_ and _sid_ for now) and Ubuntu (20.04):
|
||||
In Debian (_testing_ and _sid_ for now):
|
||||
|
||||
```
|
||||
apt install scrcpy
|
||||
|
||||
@@ -7,33 +7,6 @@
|
||||
#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)
|
||||
//
|
||||
// See my question:
|
||||
// <https://stackoverflow.com/questions/49111054/how-to-get-mouse-position-on-mouse-wheel-event>
|
||||
static void
|
||||
convert_to_renderer_coordinates(SDL_Renderer *renderer, int *x, int *y) {
|
||||
SDL_Rect viewport;
|
||||
float scale_x, scale_y;
|
||||
SDL_RenderGetViewport(renderer, &viewport);
|
||||
SDL_RenderGetScale(renderer, &scale_x, &scale_y);
|
||||
*x = (int) (*x / scale_x) - viewport.x;
|
||||
*y = (int) (*y / scale_y) - viewport.y;
|
||||
}
|
||||
|
||||
static struct point
|
||||
get_mouse_point(struct screen *screen) {
|
||||
int x;
|
||||
int y;
|
||||
SDL_GetMouseState(&x, &y);
|
||||
convert_to_renderer_coordinates(screen->renderer, &x, &y);
|
||||
return (struct point) {
|
||||
.x = x,
|
||||
.y = y,
|
||||
};
|
||||
}
|
||||
|
||||
static const int ACTION_DOWN = 1;
|
||||
static const int ACTION_UP = 1 << 1;
|
||||
|
||||
@@ -487,11 +460,17 @@ convert_touch(const SDL_TouchFingerEvent *from, struct screen *screen,
|
||||
|
||||
to->inject_touch_event.pointer_id = from->fingerId;
|
||||
to->inject_touch_event.position.screen_size = screen->frame_size;
|
||||
|
||||
int ww;
|
||||
int wh;
|
||||
SDL_GL_GetDrawableSize(screen->window, &ww, &wh);
|
||||
|
||||
// SDL touch event coordinates are normalized in the range [0; 1]
|
||||
float x = from->x * screen->content_size.width;
|
||||
float y = from->y * screen->content_size.height;
|
||||
int32_t x = from->x * ww;
|
||||
int32_t y = from->y * wh;
|
||||
to->inject_touch_event.position.point =
|
||||
screen_convert_to_frame_coords(screen, x, y);
|
||||
|
||||
to->inject_touch_event.pressure = from->pressure;
|
||||
to->inject_touch_event.buttons = 0;
|
||||
return true;
|
||||
@@ -508,13 +487,6 @@ input_manager_process_touch(struct input_manager *im,
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
is_outside_device_screen(struct input_manager *im, int x, int y)
|
||||
{
|
||||
return x < 0 || x >= im->screen->content_size.width ||
|
||||
y < 0 || y >= im->screen->content_size.height;
|
||||
}
|
||||
|
||||
static bool
|
||||
convert_mouse_button(const SDL_MouseButtonEvent *from, struct screen *screen,
|
||||
struct control_msg *to) {
|
||||
@@ -552,10 +524,14 @@ input_manager_process_mouse_button(struct input_manager *im,
|
||||
action_home(im->controller, ACTION_DOWN | ACTION_UP);
|
||||
return;
|
||||
}
|
||||
|
||||
// double-click on black borders resize to fit the device screen
|
||||
if (event->button == SDL_BUTTON_LEFT && event->clicks == 2) {
|
||||
bool outside =
|
||||
is_outside_device_screen(im, event->x, event->y);
|
||||
int x = event->x;
|
||||
int y = event->y;
|
||||
SDL_Rect *r = &im->screen->rect;
|
||||
bool outside = x < r->x || x >= r->x + r->w
|
||||
|| y < r->y || y >= r->y + r->h;
|
||||
if (outside) {
|
||||
screen_resize_to_fit(im->screen);
|
||||
return;
|
||||
@@ -579,9 +555,15 @@ input_manager_process_mouse_button(struct input_manager *im,
|
||||
static bool
|
||||
convert_mouse_wheel(const SDL_MouseWheelEvent *from, struct screen *screen,
|
||||
struct control_msg *to) {
|
||||
|
||||
// mouse_x and mouse_y are expressed in pixels relative to the window
|
||||
int mouse_x;
|
||||
int mouse_y;
|
||||
SDL_GetMouseState(&mouse_x, &mouse_y);
|
||||
|
||||
struct position position = {
|
||||
.screen_size = screen->frame_size,
|
||||
.point = get_mouse_point(screen),
|
||||
.point = screen_convert_to_frame_coords(screen, mouse_x, mouse_y),
|
||||
};
|
||||
|
||||
to->type = CONTROL_MSG_TYPE_INJECT_SCROLL_EVENT;
|
||||
|
||||
@@ -109,10 +109,9 @@ static int
|
||||
event_watcher(void *data, SDL_Event *event) {
|
||||
(void) data;
|
||||
if (event->type == SDL_WINDOWEVENT
|
||||
&& event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) {
|
||||
// In practice, it seems to always be called from the same thread in
|
||||
// that specific case. Anyway, it's just a workaround.
|
||||
screen_handle_window_event(&screen, &event->window);
|
||||
&& event->window.event == SDL_WINDOWEVENT_RESIZED) {
|
||||
// called from another thread, not very safe, but it's a workaround!
|
||||
screen_render(&screen);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
140
app/src/screen.c
140
app/src/screen.c
@@ -87,6 +87,26 @@ get_preferred_display_bounds(struct size *bounds) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Indicate if the width should be kept on computing the optimal rectangle size
|
||||
// to display the content in the window.
|
||||
// Return true if the width should be kept, false if the height should be kept.
|
||||
static bool
|
||||
should_keep_width(struct size window_size, struct size content_size) {
|
||||
// 32 bits because we need to multiply two 16 bits values
|
||||
uint32_t ww = window_size.width;
|
||||
uint32_t wh = window_size.height;
|
||||
uint32_t cw = content_size.width;
|
||||
uint32_t ch = content_size.height;
|
||||
|
||||
// To avoid keeping alternatively width and height on successive resizes
|
||||
// due to rounding to integer, always prefer height (arbitrarily) if in the
|
||||
// error range.
|
||||
|
||||
// err = ceil of content aspect ratio
|
||||
unsigned err = (cw + ch - 1) / ch;
|
||||
return cw * wh > ch * (ww + err);
|
||||
}
|
||||
|
||||
// return the optimal size of the window, with the following constraints:
|
||||
// - it attempts to keep at least one dimension of the current_size (i.e. it
|
||||
// crops the black borders)
|
||||
@@ -99,40 +119,33 @@ get_optimal_size(struct size current_size, struct size content_size) {
|
||||
return current_size;
|
||||
}
|
||||
|
||||
struct size display_size;
|
||||
// 32 bits because we need to multiply two 16 bits values
|
||||
uint32_t w;
|
||||
uint32_t h;
|
||||
struct size window_size;
|
||||
|
||||
struct size display_size;
|
||||
if (!get_preferred_display_bounds(&display_size)) {
|
||||
// could not get display bounds, do not constraint the size
|
||||
w = current_size.width;
|
||||
h = current_size.height;
|
||||
window_size.width = current_size.width;
|
||||
window_size.height = current_size.height;
|
||||
} else {
|
||||
w = MIN(current_size.width, display_size.width);
|
||||
h = MIN(current_size.height, display_size.height);
|
||||
window_size.width = MIN(current_size.width, display_size.width);
|
||||
window_size.height = MIN(current_size.height, display_size.height);
|
||||
}
|
||||
|
||||
if (h == w * content_size.height / content_size.width
|
||||
|| w == h * content_size.width / content_size.height) {
|
||||
// The size is already optimal, if we ignore rounding errors due to
|
||||
// integer window dimensions
|
||||
return (struct size) {w, h};
|
||||
}
|
||||
|
||||
bool keep_width = content_size.width * h > content_size.height * w;
|
||||
bool keep_width = should_keep_width(window_size, content_size);
|
||||
if (keep_width) {
|
||||
// remove black borders on top and bottom
|
||||
h = content_size.height * w / content_size.width;
|
||||
window_size.height = content_size.height * window_size.width
|
||||
/ content_size.width;
|
||||
} else {
|
||||
// remove black borders on left and right (or none at all if it already
|
||||
// fits)
|
||||
w = content_size.width * h / content_size.height;
|
||||
window_size.width = content_size.width * window_size.height
|
||||
/ content_size.height;
|
||||
}
|
||||
|
||||
// w and h must fit into 16 bits
|
||||
assert(w < 0x10000 && h < 0x10000);
|
||||
return (struct size) {w, h};
|
||||
// width and height must fit into 16 bits
|
||||
assert(window_size.width < 0x10000 && window_size.height < 0x10000);
|
||||
return window_size;
|
||||
}
|
||||
|
||||
// same as get_optimal_size(), but read the current size from the window
|
||||
@@ -169,6 +182,34 @@ get_initial_optimal_size(struct size content_size, uint16_t req_width,
|
||||
return window_size;
|
||||
}
|
||||
|
||||
static void
|
||||
update_content_rect(struct screen *screen) {
|
||||
int w;
|
||||
int h;
|
||||
SDL_GL_GetDrawableSize(screen->window, &w, &h);
|
||||
|
||||
struct size window_size = {w, h};
|
||||
uint16_t ww = window_size.width;
|
||||
uint16_t wh = window_size.height;
|
||||
uint16_t cw = screen->content_size.width;
|
||||
uint16_t ch = screen->content_size.height;
|
||||
|
||||
SDL_Rect *rect = &screen->rect;
|
||||
|
||||
bool keep_width = should_keep_width(window_size, screen->content_size);
|
||||
if (keep_width) {
|
||||
rect->x = 0;
|
||||
rect->w = ww;
|
||||
rect->h = ww * ch / cw;
|
||||
rect->y = (wh - rect->h) / 2;
|
||||
} else {
|
||||
rect->y = 0;
|
||||
rect->h = wh;
|
||||
rect->w = wh * cw / ch;
|
||||
rect->x = (ww - rect->w) / 2;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
screen_init(struct screen *screen) {
|
||||
*screen = (struct screen) SCREEN_INITIALIZER;
|
||||
@@ -258,14 +299,7 @@ screen_init_rendering(struct screen *screen, const char *window_title,
|
||||
const char *renderer_name = r ? NULL : renderer_info.name;
|
||||
LOGI("Renderer: %s", renderer_name ? renderer_name : "(unknown)");
|
||||
|
||||
if (SDL_RenderSetLogicalSize(screen->renderer, content_size.width,
|
||||
content_size.height)) {
|
||||
LOGE("Could not set renderer logical size: %s", SDL_GetError());
|
||||
screen_destroy(screen);
|
||||
return false;
|
||||
}
|
||||
|
||||
// starts with "opengl"
|
||||
// stats with "opengl"
|
||||
screen->use_opengl = renderer_name && !strncmp(renderer_name, "opengl", 6);
|
||||
if (screen->use_opengl) {
|
||||
struct sc_opengl *gl = &screen->gl;
|
||||
@@ -342,13 +376,6 @@ screen_set_rotation(struct screen *screen, unsigned rotation) {
|
||||
struct size new_content_size =
|
||||
get_rotated_size(screen->frame_size, rotation);
|
||||
|
||||
if (SDL_RenderSetLogicalSize(screen->renderer,
|
||||
new_content_size.width,
|
||||
new_content_size.height)) {
|
||||
LOGE("Could not set renderer logical size: %s", SDL_GetError());
|
||||
return;
|
||||
}
|
||||
|
||||
struct size windowed_size = get_windowed_window_size(screen);
|
||||
struct size target_size = {
|
||||
.width = (uint32_t) windowed_size.width * new_content_size.width
|
||||
@@ -363,6 +390,7 @@ screen_set_rotation(struct screen *screen, unsigned rotation) {
|
||||
screen->rotation = rotation;
|
||||
LOGI("Display rotation set to %u", rotation);
|
||||
|
||||
update_content_rect(screen);
|
||||
screen_render(screen);
|
||||
}
|
||||
|
||||
@@ -371,18 +399,11 @@ static bool
|
||||
prepare_for_frame(struct screen *screen, struct size new_frame_size) {
|
||||
if (screen->frame_size.width != new_frame_size.width
|
||||
|| screen->frame_size.height != new_frame_size.height) {
|
||||
struct size new_content_size =
|
||||
get_rotated_size(new_frame_size, screen->rotation);
|
||||
if (SDL_RenderSetLogicalSize(screen->renderer,
|
||||
new_content_size.width,
|
||||
new_content_size.height)) {
|
||||
LOGE("Could not set renderer logical size: %s", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
|
||||
// frame dimension changed, destroy texture
|
||||
SDL_DestroyTexture(screen->texture);
|
||||
|
||||
struct size new_content_size =
|
||||
get_rotated_size(new_frame_size, screen->rotation);
|
||||
struct size content_size = screen->content_size;
|
||||
struct size windowed_size = get_windowed_window_size(screen);
|
||||
struct size target_size = {
|
||||
@@ -434,6 +455,7 @@ screen_update_frame(struct screen *screen, struct video_buffer *vb) {
|
||||
mutex_unlock(vb->mutex);
|
||||
return false;
|
||||
}
|
||||
update_content_rect(screen);
|
||||
update_texture(screen, frame);
|
||||
mutex_unlock(vb->mutex);
|
||||
|
||||
@@ -441,11 +463,17 @@ screen_update_frame(struct screen *screen, struct video_buffer *vb) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
screen_window_resized(struct screen *screen) {
|
||||
update_content_rect(screen);
|
||||
screen_render(screen);
|
||||
}
|
||||
|
||||
void
|
||||
screen_render(struct screen *screen) {
|
||||
SDL_RenderClear(screen->renderer);
|
||||
if (screen->rotation == 0) {
|
||||
SDL_RenderCopy(screen->renderer, screen->texture, NULL, NULL);
|
||||
SDL_RenderCopy(screen->renderer, screen->texture, NULL, &screen->rect);
|
||||
} else {
|
||||
// rotation in RenderCopyEx() is clockwise, while screen->rotation is
|
||||
// counterclockwise (to be consistent with --lock-video-orientation)
|
||||
@@ -455,12 +483,14 @@ screen_render(struct screen *screen) {
|
||||
SDL_Rect *dstrect = NULL;
|
||||
SDL_Rect rect;
|
||||
if (screen->rotation & 1) {
|
||||
struct size size = screen->content_size;
|
||||
rect.x = (size.width - size.height) / 2;
|
||||
rect.y = (size.height - size.width) / 2;
|
||||
rect.w = size.height;
|
||||
rect.h = size.width;
|
||||
rect.x = screen->rect.x + (screen->rect.w - screen->rect.h) / 2;
|
||||
rect.y = screen->rect.y + (screen->rect.h - screen->rect.w) / 2;
|
||||
rect.w = screen->rect.h;
|
||||
rect.h = screen->rect.w;
|
||||
dstrect = ▭
|
||||
} else {
|
||||
assert(screen->rotation == 2);
|
||||
dstrect = &screen->rect;
|
||||
}
|
||||
|
||||
SDL_RenderCopyEx(screen->renderer, screen->texture, NULL, dstrect,
|
||||
@@ -539,7 +569,7 @@ screen_handle_window_event(struct screen *screen,
|
||||
// window is maximized or fullscreen is enabled.
|
||||
screen->windowed_window_size = get_window_size(screen->window);
|
||||
}
|
||||
screen_render(screen);
|
||||
screen_window_resized(screen);
|
||||
break;
|
||||
case SDL_WINDOWEVENT_MAXIMIZED:
|
||||
// The backup size must be non-nul.
|
||||
@@ -568,6 +598,12 @@ screen_convert_to_frame_coords(struct screen *screen, int32_t x, int32_t y) {
|
||||
|
||||
int32_t w = screen->content_size.width;
|
||||
int32_t h = screen->content_size.height;
|
||||
|
||||
// scale
|
||||
x = (x - screen->rect.x) * w / screen->rect.w;
|
||||
y = (y - screen->rect.y) * h / screen->rect.h;
|
||||
|
||||
// rotate
|
||||
struct point result;
|
||||
switch (rotation) {
|
||||
case 0:
|
||||
|
||||
@@ -28,6 +28,8 @@ struct screen {
|
||||
struct size windowed_window_size_backup;
|
||||
// client rotation: 0, 1, 2 or 3 (x90 degrees counterclockwise)
|
||||
unsigned rotation;
|
||||
// rectangle of the content (excluding black borders)
|
||||
struct SDL_Rect rect;
|
||||
bool has_frame;
|
||||
bool fullscreen;
|
||||
bool maximized;
|
||||
@@ -58,6 +60,12 @@ struct screen {
|
||||
.height = 0, \
|
||||
}, \
|
||||
.rotation = 0, \
|
||||
.rect = { \
|
||||
.x = 0, \
|
||||
.y = 0, \
|
||||
.w = 0, \
|
||||
.h = 0, \
|
||||
}, \
|
||||
.has_frame = false, \
|
||||
.fullscreen = false, \
|
||||
.maximized = false, \
|
||||
@@ -90,6 +98,10 @@ screen_destroy(struct screen *screen);
|
||||
bool
|
||||
screen_update_frame(struct screen *screen, struct video_buffer *vb);
|
||||
|
||||
// update content after window resizing
|
||||
void
|
||||
screen_window_resized(struct screen *screen);
|
||||
|
||||
// render the texture to the renderer
|
||||
void
|
||||
screen_render(struct screen *screen);
|
||||
|
||||
@@ -15,6 +15,6 @@ cpu = 'i686'
|
||||
endian = 'little'
|
||||
|
||||
[properties]
|
||||
prebuilt_ffmpeg_shared = 'ffmpeg-4.2.2-win32-shared'
|
||||
prebuilt_ffmpeg_dev = 'ffmpeg-4.2.2-win32-dev'
|
||||
prebuilt_sdl2 = 'SDL2-2.0.12/i686-w64-mingw32'
|
||||
prebuilt_ffmpeg_shared = 'ffmpeg-4.2.1-win32-shared'
|
||||
prebuilt_ffmpeg_dev = 'ffmpeg-4.2.1-win32-dev'
|
||||
prebuilt_sdl2 = 'SDL2-2.0.10/i686-w64-mingw32'
|
||||
|
||||
@@ -15,6 +15,6 @@ cpu = 'x86_64'
|
||||
endian = 'little'
|
||||
|
||||
[properties]
|
||||
prebuilt_ffmpeg_shared = 'ffmpeg-4.2.2-win64-shared'
|
||||
prebuilt_ffmpeg_dev = 'ffmpeg-4.2.2-win64-dev'
|
||||
prebuilt_sdl2 = 'SDL2-2.0.12/x86_64-w64-mingw32'
|
||||
prebuilt_ffmpeg_shared = 'ffmpeg-4.2.1-win64-shared'
|
||||
prebuilt_ffmpeg_dev = 'ffmpeg-4.2.1-win64-dev'
|
||||
prebuilt_sdl2 = 'SDL2-2.0.10/x86_64-w64-mingw32'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
project('scrcpy', 'c',
|
||||
version: '1.13',
|
||||
version: '1.12.1',
|
||||
meson_version: '>= 0.48',
|
||||
default_options: [
|
||||
'c_std=c11',
|
||||
|
||||
@@ -10,29 +10,29 @@ prepare-win32: prepare-sdl2 prepare-ffmpeg-shared-win32 prepare-ffmpeg-dev-win32
|
||||
prepare-win64: prepare-sdl2 prepare-ffmpeg-shared-win64 prepare-ffmpeg-dev-win64 prepare-adb
|
||||
|
||||
prepare-ffmpeg-shared-win32:
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-4.2.2-win32-shared.zip \
|
||||
ab5d603aaa54de360db2c2ffe378c82376b9343ea1175421dd644639aa07ee31 \
|
||||
ffmpeg-4.2.2-win32-shared
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-4.2.1-win32-shared.zip \
|
||||
9208255f409410d95147151d7e829b5699bf8d91bfe1e81c3f470f47c2fa66d2 \
|
||||
ffmpeg-4.2.1-win32-shared
|
||||
|
||||
prepare-ffmpeg-dev-win32:
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win32/dev/ffmpeg-4.2.2-win32-dev.zip \
|
||||
8d224be567a2950cad4be86f4aabdd045bfa52ad758e87c72cedd278613bc6c8 \
|
||||
ffmpeg-4.2.2-win32-dev
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win32/dev/ffmpeg-4.2.1-win32-dev.zip \
|
||||
c3469e6c5f031cbcc8cba88dee92d6548c5c6b6ff14f4097f18f72a92d0d70c4 \
|
||||
ffmpeg-4.2.1-win32-dev
|
||||
|
||||
prepare-ffmpeg-shared-win64:
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-4.2.2-win64-shared.zip \
|
||||
5aedf268952b7d9f6541dbfcb47cd86a7e7881a3b7ba482fd3bc4ca33bda7bf5 \
|
||||
ffmpeg-4.2.2-win64-shared
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-4.2.1-win64-shared.zip \
|
||||
55063d3cf750a75485c7bf196031773d81a1b25d0980c7db48ecfc7701a42331 \
|
||||
ffmpeg-4.2.1-win64-shared
|
||||
|
||||
prepare-ffmpeg-dev-win64:
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-4.2.2-win64-dev.zip \
|
||||
f4885f859c5b0d6663c2a0a4c1cf035b1c60b146402790b796bd3ad84f4f3ca2 \
|
||||
ffmpeg-4.2.2-win64-dev
|
||||
@./prepare-dep https://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-4.2.1-win64-dev.zip \
|
||||
5af393be5f25c0a71aa29efce768e477c35347f7f8e0d9696767d5b9d405b74e \
|
||||
ffmpeg-4.2.1-win64-dev
|
||||
|
||||
prepare-sdl2:
|
||||
@./prepare-dep https://libsdl.org/release/SDL2-devel-2.0.12-mingw.tar.gz \
|
||||
e614a60f797e35ef9f3f96aef3dc6a1d786de3cc7ca6216f97e435c0b6aafc46 \
|
||||
SDL2-2.0.12
|
||||
@./prepare-dep https://libsdl.org/release/SDL2-devel-2.0.10-mingw.tar.gz \
|
||||
a90a7cddaec4996f4d7be6d80c57ec69b062e132bffc513965f99217f603274a \
|
||||
SDL2-2.0.10
|
||||
|
||||
prepare-adb:
|
||||
@./prepare-dep https://dl.google.com/android/repository/platform-tools_r29.0.5-windows.zip \
|
||||
|
||||
@@ -6,8 +6,8 @@ android {
|
||||
applicationId "com.genymobile.scrcpy"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
versionCode 15
|
||||
versionName "1.13"
|
||||
versionCode 14
|
||||
versionName "1.12.1"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
set -e
|
||||
|
||||
SCRCPY_DEBUG=false
|
||||
SCRCPY_VERSION_NAME=1.13
|
||||
SCRCPY_VERSION_NAME=1.12.1
|
||||
|
||||
PLATFORM=${ANDROID_PLATFORM:-29}
|
||||
BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-29.0.2}
|
||||
|
||||
Reference in New Issue
Block a user