diff options
| author | pants <niklasjo2004@gmail.com> | 2026-09-21 14:16:59 -0700 |
|---|---|---|
| committer | pants <niklasjo2004@gmail.com> | 2026-09-21 14:16:59 -0700 |
| commit | a091c00c00c1d5ae5e3da7ef31b98293c76d479f (patch) | |
| tree | 62c4b3bc114faac9922873ae48672c46cc2cf7d4 /include/encoder/video/video.h | |
Diffstat (limited to 'include/encoder/video/video.h')
| -rw-r--r-- | include/encoder/video/video.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/encoder/video/video.h b/include/encoder/video/video.h new file mode 100644 index 0000000..a77a1aa --- /dev/null +++ b/include/encoder/video/video.h @@ -0,0 +1,30 @@ +#ifndef GSR_ENCODER_VIDEO_H +#define GSR_ENCODER_VIDEO_H + +#include "../../color_conversion.h" +#include <stdbool.h> + +#define GSR_MAX_RECORDING_DESTINATIONS 128 + +typedef struct gsr_video_encoder gsr_video_encoder; +typedef struct AVCodecContext AVCodecContext; +typedef struct AVFrame AVFrame; + +struct gsr_video_encoder { + bool (*start)(gsr_video_encoder *encoder, AVCodecContext *video_codec_context, AVFrame *frame); + void (*destroy)(gsr_video_encoder *encoder, AVCodecContext *video_codec_context); + void (*copy_textures_to_frame)(gsr_video_encoder *encoder, AVFrame *frame, gsr_color_conversion *color_conversion); /* Can be NULL */ + /* |textures| should be able to fit 2 elements */ + void (*get_textures)(gsr_video_encoder *encoder, unsigned int *textures, vec2i *texture_sizes, int *num_textures, gsr_destination_color *destination_color); + + void *priv; + bool started; +}; + +/* Set |replay_buffer_time_seconds| and |fps| to 0 to disable replay buffer */ +bool gsr_video_encoder_start(gsr_video_encoder *encoder, AVCodecContext *video_codec_context, AVFrame *frame); +void gsr_video_encoder_destroy(gsr_video_encoder *encoder, AVCodecContext *video_codec_context); +void gsr_video_encoder_copy_textures_to_frame(gsr_video_encoder *encoder, AVFrame *frame, gsr_color_conversion *color_conversion); +void gsr_video_encoder_get_textures(gsr_video_encoder *encoder, unsigned int *textures, vec2i *texture_sizes, int *num_textures, gsr_destination_color *destination_color); + +#endif /* GSR_ENCODER_VIDEO_H */ |
