init
This commit is contained in:
16
include/encoder/video/nvenc.h
Normal file
16
include/encoder/video/nvenc.h
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef GSR_ENCODER_VIDEO_NVENC_H
|
||||
#define GSR_ENCODER_VIDEO_NVENC_H
|
||||
|
||||
#include "video.h"
|
||||
|
||||
typedef struct gsr_egl gsr_egl;
|
||||
|
||||
typedef struct {
|
||||
gsr_egl *egl;
|
||||
bool overclock;
|
||||
gsr_color_depth color_depth;
|
||||
} gsr_video_encoder_nvenc_params;
|
||||
|
||||
gsr_video_encoder* gsr_video_encoder_nvenc_create(const gsr_video_encoder_nvenc_params *params);
|
||||
|
||||
#endif /* GSR_ENCODER_VIDEO_NVENC_H */
|
||||
15
include/encoder/video/software.h
Normal file
15
include/encoder/video/software.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef GSR_ENCODER_VIDEO_SOFTWARE_H
|
||||
#define GSR_ENCODER_VIDEO_SOFTWARE_H
|
||||
|
||||
#include "video.h"
|
||||
|
||||
typedef struct gsr_egl gsr_egl;
|
||||
|
||||
typedef struct {
|
||||
gsr_egl *egl;
|
||||
gsr_color_depth color_depth;
|
||||
} gsr_video_encoder_software_params;
|
||||
|
||||
gsr_video_encoder* gsr_video_encoder_software_create(const gsr_video_encoder_software_params *params);
|
||||
|
||||
#endif /* GSR_ENCODER_VIDEO_SOFTWARE_H */
|
||||
15
include/encoder/video/vaapi.h
Normal file
15
include/encoder/video/vaapi.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef GSR_ENCODER_VIDEO_VAAPI_H
|
||||
#define GSR_ENCODER_VIDEO_VAAPI_H
|
||||
|
||||
#include "video.h"
|
||||
|
||||
typedef struct gsr_egl gsr_egl;
|
||||
|
||||
typedef struct {
|
||||
gsr_egl *egl;
|
||||
gsr_color_depth color_depth;
|
||||
} gsr_video_encoder_vaapi_params;
|
||||
|
||||
gsr_video_encoder* gsr_video_encoder_vaapi_create(const gsr_video_encoder_vaapi_params *params);
|
||||
|
||||
#endif /* GSR_ENCODER_VIDEO_VAAPI_H */
|
||||
30
include/encoder/video/video.h
Normal file
30
include/encoder/video/video.h
Normal file
@ -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 */
|
||||
15
include/encoder/video/vulkan.h
Normal file
15
include/encoder/video/vulkan.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef GSR_ENCODER_VIDEO_VULKAN_H
|
||||
#define GSR_ENCODER_VIDEO_VULKAN_H
|
||||
|
||||
#include "video.h"
|
||||
|
||||
typedef struct gsr_egl gsr_egl;
|
||||
|
||||
typedef struct {
|
||||
gsr_egl *egl;
|
||||
gsr_color_depth color_depth;
|
||||
} gsr_video_encoder_vulkan_params;
|
||||
|
||||
gsr_video_encoder* gsr_video_encoder_vulkan_create(const gsr_video_encoder_vulkan_params *params);
|
||||
|
||||
#endif /* GSR_ENCODER_VIDEO_VULKAN_H */
|
||||
Reference in New Issue
Block a user