mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-03-31 09:07:13 +09:00
Add plugin support (-p option)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
typedef struct gsr_egl gsr_egl;
|
||||
|
||||
#define NUM_ARGS 30
|
||||
#define NUM_ARGS 31
|
||||
|
||||
typedef enum {
|
||||
ARG_TYPE_STRING,
|
||||
|
||||
@@ -105,6 +105,7 @@ typedef void(*__GLXextFuncPtr)(void);
|
||||
#define GL_RGBA 0x1908
|
||||
#define GL_RGB8 0x8051
|
||||
#define GL_RGBA8 0x8058
|
||||
#define GL_RGBA16 0x805B
|
||||
#define GL_R8 0x8229
|
||||
#define GL_RG8 0x822B
|
||||
#define GL_R16 0x822A
|
||||
|
||||
38
include/plugins.h
Normal file
38
include/plugins.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef GSR_PLUGINS_H
|
||||
#define GSR_PLUGINS_H
|
||||
|
||||
#include "../plugin/plugin.h"
|
||||
#include <stdbool.h>
|
||||
#include "color_conversion.h"
|
||||
|
||||
#define GSR_MAX_PLUGINS 128
|
||||
|
||||
typedef bool (*gsr_plugin_init_func)(const gsr_plugin_init_params *params, gsr_plugin_init_return *ret);
|
||||
typedef void (*gsr_plugin_deinit_func)(void *userdata);
|
||||
|
||||
typedef struct {
|
||||
gsr_plugin_init_return data;
|
||||
void *lib;
|
||||
gsr_plugin_init_func gsr_plugin_init;
|
||||
gsr_plugin_deinit_func gsr_plugin_deinit;
|
||||
} gsr_plugin;
|
||||
|
||||
typedef struct {
|
||||
gsr_plugin plugins[GSR_MAX_PLUGINS];
|
||||
int num_plugins;
|
||||
|
||||
gsr_plugin_init_params init_params;
|
||||
gsr_egl *egl;
|
||||
|
||||
unsigned int texture;
|
||||
gsr_color_conversion color_conversion;
|
||||
} gsr_plugins;
|
||||
|
||||
bool gsr_plugins_init(gsr_plugins *self, gsr_plugin_init_params init_params, gsr_egl *egl);
|
||||
/* Plugins are unloaded in reverse order */
|
||||
void gsr_plugins_deinit(gsr_plugins *self);
|
||||
|
||||
bool gsr_plugins_load_plugin(gsr_plugins *self, const char *plugin_filepath);
|
||||
void gsr_plugins_draw(gsr_plugins *self);
|
||||
|
||||
#endif /* GSR_PLUGINS_H */
|
||||
Reference in New Issue
Block a user