mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-21 12:49:40 +08:00
libobs: Add obs_load_effect function
Just creates an effect to the target variable only if its current value is null. This will be used for deinterlacing effects to prevent having to compile the shaders unless they're actually being used.
This commit is contained in:
@@ -371,6 +371,8 @@ extern struct obs_core *obs;
|
||||
|
||||
extern void *obs_video_thread(void *param);
|
||||
|
||||
extern gs_effect_t *obs_load_effect(gs_effect_t **effect, const char *file);
|
||||
|
||||
extern bool audio_callback(void *param,
|
||||
uint64_t start_ts_in, uint64_t end_ts_in, uint64_t *out_ts,
|
||||
uint32_t mixers, struct audio_output_data *mixes);
|
||||
|
||||
@@ -215,6 +215,17 @@ static bool obs_init_textures(struct obs_video_info *ovi)
|
||||
return true;
|
||||
}
|
||||
|
||||
gs_effect_t *obs_load_effect(gs_effect_t **effect, const char *file)
|
||||
{
|
||||
if (!*effect) {
|
||||
char *filename = find_libobs_data_file(file);
|
||||
*effect = gs_effect_create_from_file(filename, NULL);
|
||||
bfree(filename);
|
||||
}
|
||||
|
||||
return *effect;
|
||||
}
|
||||
|
||||
static int obs_init_graphics(struct obs_video_info *ovi)
|
||||
{
|
||||
struct obs_core_video *video = &obs->video;
|
||||
|
||||
Reference in New Issue
Block a user