mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-28 03:44:52 +08:00
libobs: Add obs_source_info::get_defaults2
Uses type_data to get the type-specific data of a source type
This commit is contained in:
+10
-3
@@ -323,8 +323,13 @@ static obs_source_t *obs_source_create_internal(const char *id,
|
||||
private))
|
||||
goto fail;
|
||||
|
||||
if (info && info->get_defaults)
|
||||
info->get_defaults(source->context.settings);
|
||||
if (info) {
|
||||
if (info->get_defaults2)
|
||||
info->get_defaults2(info->type_data,
|
||||
source->context.settings);
|
||||
else if (info->get_defaults)
|
||||
info->get_defaults(source->context.settings);
|
||||
}
|
||||
|
||||
if (!obs_source_init(source))
|
||||
goto fail;
|
||||
@@ -695,7 +700,9 @@ bool obs_source_removed(const obs_source_t *source)
|
||||
static inline obs_data_t *get_defaults(const struct obs_source_info *info)
|
||||
{
|
||||
obs_data_t *settings = obs_data_create();
|
||||
if (info->get_defaults)
|
||||
if (info->get_defaults2)
|
||||
info->get_defaults2(info->type_data, settings);
|
||||
else if (info->get_defaults)
|
||||
info->get_defaults(settings);
|
||||
return settings;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user