Move frame updating to screen.c

Replace screen_update() by a higher-level screen_update_frame() handling
the whole frame updating, so that scrcpy.c just call it without managing
implementation details.
This commit is contained in:
Romain Vimont
2018-02-09 11:14:47 +01:00
parent 7458d8271e
commit fe21d9dfb5
3 changed files with 12 additions and 17 deletions

View File

@@ -5,6 +5,7 @@
#include <libavformat/avformat.h>
#include "common.h"
#include "frames.h"
struct screen {
SDL_Window *window;
@@ -47,8 +48,8 @@ SDL_bool screen_init_rendering(struct screen *screen,
// destroy window, renderer and texture (if any)
void screen_destroy(struct screen *screen);
// resize if necessary and write the frame into the texture
SDL_bool screen_update(struct screen *screen, const AVFrame *frame);
// resize if necessary and write the rendered frame into the texture
SDL_bool screen_update_frame(struct screen *screen, struct frames *frames);
// render the texture to the renderer
void screen_render(struct screen *screen);