mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-03 06:39:39 +00:00
refilter_on_resize
This commit is contained in:
parent
03cc0cf543
commit
ba09254b38
3 changed files with 21 additions and 0 deletions
|
@ -135,6 +135,7 @@ screen_generate_resized_frame(struct sc_frame_texture *ftex,
|
||||||
}
|
}
|
||||||
|
|
||||||
const AVFrame *input = ftex->decoded_frame;
|
const AVFrame *input = ftex->decoded_frame;
|
||||||
|
assert(input);
|
||||||
|
|
||||||
int flags = to_sws_filter(ftex->scale_filter);
|
int flags = to_sws_filter(ftex->scale_filter);
|
||||||
struct SwsContext *ctx =
|
struct SwsContext *ctx =
|
||||||
|
@ -232,3 +233,15 @@ sc_frame_texture_update(struct sc_frame_texture *ftex, const AVFrame *frame,
|
||||||
}
|
}
|
||||||
return sc_frame_texture_update_direct(ftex, frame);
|
return sc_frame_texture_update_direct(ftex, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
sc_frame_texture_resize(struct sc_frame_texture *ftex,
|
||||||
|
struct size target_size) {
|
||||||
|
if (is_swscale_enabled(ftex->scale_filter)) {
|
||||||
|
return sc_frame_texture_update_swscale(ftex, ftex->decoded_frame,
|
||||||
|
target_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Nothing to do
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
|
@ -38,4 +38,7 @@ bool
|
||||||
sc_frame_texture_update(struct sc_frame_texture *ftex, const AVFrame *frame,
|
sc_frame_texture_update(struct sc_frame_texture *ftex, const AVFrame *frame,
|
||||||
struct size target_size);
|
struct size target_size);
|
||||||
|
|
||||||
|
bool
|
||||||
|
sc_frame_texture_resize(struct sc_frame_texture *ftex, struct size target_size);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -377,6 +377,11 @@ void
|
||||||
screen_render(struct screen *screen, bool update_content_rect) {
|
screen_render(struct screen *screen, bool update_content_rect) {
|
||||||
if (update_content_rect) {
|
if (update_content_rect) {
|
||||||
screen_update_content_rect(screen);
|
screen_update_content_rect(screen);
|
||||||
|
struct size rect_size = {screen->rect.w, screen->rect.h};
|
||||||
|
if (!sc_frame_texture_resize(&screen->ftex, rect_size)) {
|
||||||
|
// FIXME return error
|
||||||
|
LOGC("oops");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct sc_frame_texture *ftex = &screen->ftex;
|
struct sc_frame_texture *ftex = &screen->ftex;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue