Add 'update_properties' signal and obs_source_update_properties call
obs_source_update_properties should be called by sources when property values change, e.g. a capture device source would use this when it detects a new capture device (in case its properties contain a list of available capture devices or similar)
This commit is contained in:
parent
088a05db8f
commit
b99c378e33
@ -82,6 +82,7 @@ static const char *source_signals[] = {
|
||||
"void volume(ptr source, in out float volume)",
|
||||
"void volume_level(ptr source, float level, float magnitude, "
|
||||
"float peak)",
|
||||
"void update_properties(ptr source)",
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -389,6 +390,21 @@ void obs_source_update(obs_source_t *source, obs_data_t *settings)
|
||||
}
|
||||
}
|
||||
|
||||
void obs_source_update_properties(obs_source_t *source)
|
||||
{
|
||||
calldata_t calldata;
|
||||
|
||||
if (!source) return;
|
||||
|
||||
calldata_init(&calldata);
|
||||
calldata_set_ptr(&calldata, "source", source);
|
||||
|
||||
signal_handler_signal(obs_source_get_signal_handler(source),
|
||||
"update_properties", &calldata);
|
||||
|
||||
calldata_free(&calldata);
|
||||
}
|
||||
|
||||
void obs_source_send_mouse_click(obs_source_t *source,
|
||||
const struct obs_mouse_event *event,
|
||||
int32_t type, bool mouse_up,
|
||||
|
@ -730,6 +730,9 @@ EXPORT void obs_source_output_video(obs_source_t *source,
|
||||
EXPORT void obs_source_output_audio(obs_source_t *source,
|
||||
const struct obs_source_audio *audio);
|
||||
|
||||
/** Signal an update to any currently used properties via 'update_properties' */
|
||||
EXPORT void obs_source_update_properties(obs_source_t *source);
|
||||
|
||||
/** Gets the current async video frame */
|
||||
EXPORT struct obs_source_frame *obs_source_get_frame(obs_source_t *source);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user