New upstream version 25.0.3+dfsg1

This commit is contained in:
Sebastian Ramacher 2020-03-25 09:07:22 +01:00
parent 04fe0efc67
commit 8b2e5f2130
569 changed files with 62491 additions and 5875 deletions

View file

@ -1,7 +1,7 @@
TextFreetype2="متن (FreeType 2)"
Font="فونت"
Text="متن"
TextFile="فایل متن (UTF-8 یا UTF-16)"
TextFile="فایل متن (UTF-8 یا UTF-16)"
TextFileFilter="فایل های متنی (*.txt);;"
ChatLogMode="حالت Chatlog"
ChatLogLines="خط های Chatlog"

View file

@ -35,16 +35,13 @@ MODULE_EXPORT const char *obs_module_description(void)
uint32_t texbuf_w = 2048, texbuf_h = 2048;
static struct obs_source_info freetype2_source_info = {
static struct obs_source_info freetype2_source_info_v1 = {
.id = "text_ft2_source",
.type = OBS_SOURCE_TYPE_INPUT,
.output_flags = OBS_SOURCE_VIDEO |
#ifdef _WIN32
OBS_SOURCE_DEPRECATED |
#endif
.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_CAP_OBSOLETE |
OBS_SOURCE_CUSTOM_DRAW,
.get_name = ft2_source_get_name,
.create = ft2_source_create,
.create = ft2_source_create_v1,
.destroy = ft2_source_destroy,
.update = ft2_source_update,
.get_width = ft2_source_get_width,
@ -52,6 +49,28 @@ static struct obs_source_info freetype2_source_info = {
.video_render = ft2_source_render,
.video_tick = ft2_video_tick,
.get_properties = ft2_source_properties,
.icon_type = OBS_ICON_TYPE_TEXT,
};
static struct obs_source_info freetype2_source_info_v2 = {
.id = "text_ft2_source",
.version = 2,
.type = OBS_SOURCE_TYPE_INPUT,
.output_flags = OBS_SOURCE_VIDEO |
#ifdef _WIN32
OBS_SOURCE_DEPRECATED |
#endif
OBS_SOURCE_CUSTOM_DRAW,
.get_name = ft2_source_get_name,
.create = ft2_source_create_v2,
.destroy = ft2_source_destroy,
.update = ft2_source_update,
.get_width = ft2_source_get_width,
.get_height = ft2_source_get_height,
.video_render = ft2_source_render,
.video_tick = ft2_video_tick,
.get_properties = ft2_source_properties,
.icon_type = OBS_ICON_TYPE_TEXT,
};
static bool plugin_initialized = false;
@ -82,7 +101,8 @@ bool obs_module_load()
bfree(config_dir);
}
obs_register_source(&freetype2_source_info);
obs_register_source(&freetype2_source_info_v1);
obs_register_source(&freetype2_source_info_v2);
return true;
}
@ -468,7 +488,8 @@ error:
#define DEFAULT_FACE "Sans Serif"
#endif
static void *ft2_source_create(obs_data_t *settings, obs_source_t *source)
static void *ft2_source_create(obs_data_t *settings, obs_source_t *source,
int ver)
{
struct ft2_source *srcdata = bzalloc(sizeof(struct ft2_source));
obs_data_t *font_obj = obs_data_create();
@ -476,10 +497,12 @@ static void *ft2_source_create(obs_data_t *settings, obs_source_t *source)
init_plugin();
srcdata->font_size = 32;
const uint16_t font_size = ver == 1 ? 32 : 256;
srcdata->font_size = font_size;
obs_data_set_default_string(font_obj, "face", DEFAULT_FACE);
obs_data_set_default_int(font_obj, "size", 32);
obs_data_set_default_int(font_obj, "size", font_size);
obs_data_set_default_obj(settings, "font", font_obj);
obs_data_set_default_int(settings, "log_lines", 6);
@ -493,3 +516,13 @@ static void *ft2_source_create(obs_data_t *settings, obs_source_t *source)
return srcdata;
}
static void *ft2_source_create_v1(obs_data_t *settings, obs_source_t *source)
{
return ft2_source_create(settings, source, 1);
}
static void *ft2_source_create_v2(obs_data_t *settings, obs_source_t *source)
{
return ft2_source_create(settings, source, 2);
}

View file

@ -69,7 +69,8 @@ struct ft2_source {
extern FT_Library ft2_lib;
static void *ft2_source_create(obs_data_t *settings, obs_source_t *source);
static void *ft2_source_create_v1(obs_data_t *settings, obs_source_t *source);
static void *ft2_source_create_v2(obs_data_t *settings, obs_source_t *source);
static void ft2_source_destroy(void *data);
static void ft2_source_update(void *data, obs_data_t *settings);
static void ft2_source_render(void *data, gs_effect_t *effect);