diff --git a/app/src/icon.c b/app/src/icon.c index fd2b9e44..191faa6e 100644 --- a/app/src/icon.c +++ b/app/src/icon.c @@ -178,8 +178,8 @@ to_sdl_pixel_format(enum AVPixelFormat fmt) { } } -static SDL_Surface * -load_from_path(const char *path) { +SDL_Surface * +sc_icon_load(const char *path) { AVFrame *frame = decode_image(path); if (!frame) { return NULL; @@ -276,19 +276,19 @@ error: } SDL_Surface * -scrcpy_icon_load(void) { +sc_icon_load_scrcpy(void) { char *icon_path = get_icon_path(); if (!icon_path) { return NULL; } - SDL_Surface *icon = load_from_path(icon_path); + SDL_Surface *icon = sc_icon_load(icon_path); free(icon_path); return icon; } void -scrcpy_icon_destroy(SDL_Surface *icon) { +sc_icon_destroy(SDL_Surface *icon) { SDL_PropertiesID props = SDL_GetSurfaceProperties(icon); assert(props); AVFrame *frame = SDL_GetPointerProperty(props, "sc_frame", NULL); diff --git a/app/src/icon.h b/app/src/icon.h index 21fbc548..be6c23bf 100644 --- a/app/src/icon.h +++ b/app/src/icon.h @@ -6,9 +6,12 @@ #include SDL_Surface * -scrcpy_icon_load(void); +sc_icon_load(const char *path); + +SDL_Surface * +sc_icon_load_scrcpy(void); void -scrcpy_icon_destroy(SDL_Surface *icon); +sc_icon_destroy(SDL_Surface *icon); #endif diff --git a/app/src/screen.c b/app/src/screen.c index 61075ecf..86df8ef6 100644 --- a/app/src/screen.c +++ b/app/src/screen.c @@ -375,7 +375,7 @@ sc_screen_init(struct sc_screen *screen, goto error_destroy_window; } - SDL_Surface *icon = scrcpy_icon_load(); + SDL_Surface *icon = sc_icon_load_scrcpy(); if (icon) { if (!SDL_SetWindowIcon(screen->window, icon)) { LOGW("Could not set window icon: %s", SDL_GetError()); @@ -394,7 +394,7 @@ sc_screen_init(struct sc_screen *screen, ok = sc_display_init(&screen->display, screen->window, icon_novideo, mipmaps); if (icon) { - scrcpy_icon_destroy(icon); + sc_icon_destroy(icon); } if (!ok) { goto error_destroy_window; diff --git a/app/src/usb/screen_otg.c b/app/src/usb/screen_otg.c index 4fbccfb0..7100887b 100644 --- a/app/src/usb/screen_otg.c +++ b/app/src/usb/screen_otg.c @@ -60,8 +60,7 @@ sc_screen_otg_init(struct sc_screen_otg *screen, goto error_destroy_window; } - SDL_Surface *icon = scrcpy_icon_load(); - + SDL_Surface *icon = sc_icon_load_scrcpy(); if (icon) { bool ok = SDL_SetWindowIcon(screen->window, icon); if (!ok) { @@ -77,7 +76,7 @@ sc_screen_otg_init(struct sc_screen_otg *screen, } screen->texture = SDL_CreateTextureFromSurface(screen->renderer, icon); - scrcpy_icon_destroy(icon); + sc_icon_destroy(icon); if (!screen->texture) { goto error_destroy_renderer; }