mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-02-14 10:24:29 +01:00
Make sc_screen the owner of both the SDL window and the SDL renderer. This is the first step toward limiting the role of sc_display to texture management.
52 lines
1.2 KiB
C
52 lines
1.2 KiB
C
#ifndef SC_DISPLAY_H
|
|
#define SC_DISPLAY_H
|
|
|
|
#include "common.h"
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <libavutil/frame.h>
|
|
#include <SDL3/SDL.h>
|
|
|
|
#include "coords.h"
|
|
#include "opengl.h"
|
|
#include "options.h"
|
|
|
|
#ifdef __APPLE__
|
|
# define SC_DISPLAY_FORCE_OPENGL_CORE_PROFILE
|
|
#endif
|
|
|
|
struct sc_display {
|
|
SDL_Renderer *renderer; // owned by the caller
|
|
SDL_Texture *texture;
|
|
|
|
struct sc_opengl gl;
|
|
#ifdef SC_DISPLAY_FORCE_OPENGL_CORE_PROFILE
|
|
SDL_GLContext gl_context;
|
|
#endif
|
|
|
|
bool mipmaps;
|
|
uint32_t texture_id; // only set if mipmaps is enabled
|
|
};
|
|
|
|
bool
|
|
sc_display_init(struct sc_display *display, SDL_Renderer *renderer,
|
|
SDL_Surface *icon_novideo, bool mipmaps);
|
|
|
|
void
|
|
sc_display_destroy(struct sc_display *display);
|
|
|
|
bool
|
|
sc_display_prepare_texture(struct sc_display *display, struct sc_size size,
|
|
enum AVColorSpace color_space,
|
|
enum AVColorRange color_range);
|
|
|
|
bool
|
|
sc_display_update_texture(struct sc_display *display, const AVFrame *frame);
|
|
|
|
bool
|
|
sc_display_render(struct sc_display *display, const SDL_Rect *geometry,
|
|
enum sc_orientation orientation);
|
|
|
|
#endif
|