Files
scrcpy/app/src/display.h
Romain Vimont a104a84700 Set display texture from a frame
Add a function to set a texture from an AVFrame on a sc_display.
2026-02-04 20:16:32 +01:00

48 lines
1012 B
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"
enum sc_texture_type {
SC_TEXTURE_TYPE_FRAME,
SC_TEXTURE_TYPE_ICON,
};
struct sc_display {
SDL_Renderer *renderer; // owned by the caller
SDL_Texture *texture;
// Only valid if texture != NULL
struct sc_size texture_size;
enum sc_texture_type texture_type;
struct sc_opengl gl;
bool mipmaps;
uint32_t texture_id; // only set if mipmaps is enabled
};
bool
sc_display_init(struct sc_display *display, SDL_Renderer *renderer,
bool mipmaps);
void
sc_display_destroy(struct sc_display *display);
bool
sc_display_set_texture_from_frame(struct sc_display *display,
const AVFrame *frame);
bool
sc_display_set_texture_from_surface(struct sc_display *display,
SDL_Surface *surface);
#endif