Support taking a screenshot (-o image.jpg/image.png)

This commit is contained in:
dec05eba
2025-02-16 14:21:17 +01:00
parent 62bbdd7c30
commit 1b5cde0789
10 changed files with 371 additions and 21 deletions

View File

@@ -14,7 +14,6 @@ typedef struct {
gsr_color_depth color_depth;
gsr_color_range color_range;
bool record_cursor;
bool use_software_video_encoder;
vec2i output_resolution;
} gsr_capture_nvfbc_params;

View File

@@ -22,7 +22,8 @@ typedef enum {
typedef enum {
GSR_DESTINATION_COLOR_NV12, /* YUV420, BT709, 8-bit */
GSR_DESTINATION_COLOR_P010 /* YUV420, BT2020, 10-bit */
GSR_DESTINATION_COLOR_P010, /* YUV420, BT2020, 10-bit */
GSR_DESTINATION_COLOR_RGB8
} gsr_destination_color;
typedef struct {

View File

@@ -104,11 +104,13 @@ typedef void(*__GLXextFuncPtr)(void);
#define GL_RG 0x8227
#define GL_RGB 0x1907
#define GL_RGBA 0x1908
#define GL_RGB8 0x8051
#define GL_RGBA8 0x8058
#define GL_R8 0x8229
#define GL_RG8 0x822B
#define GL_R16 0x822A
#define GL_RG16 0x822C
#define GL_RGB16 0x8054
#define GL_UNSIGNED_BYTE 0x1401
#define GL_COLOR_BUFFER_BIT 0x00004000
#define GL_TEXTURE_WRAP_S 0x2802

View File

@@ -0,0 +1,15 @@
#ifndef GSR_ENCODER_VIDEO_IMAGE_H
#define GSR_ENCODER_VIDEO_IMAGE_H
#include "video.h"
typedef struct gsr_egl gsr_egl;
typedef struct {
gsr_egl *egl;
gsr_color_depth color_depth;
} gsr_video_encoder_image_params;
gsr_video_encoder* gsr_video_encoder_image_create(const gsr_video_encoder_image_params *params);
#endif /* GSR_ENCODER_VIDEO_IMAGE_H */