libobs: Add filter_remove callback for sources

Adds a source callback function that is used when a filter is removed
from a source.  This ensures that any data that might be associated with
that source can be cleaned up if necessary.
This commit is contained in:
jp9000 2015-03-07 09:33:08 -08:00
parent cd7d045ff3
commit 7878fda442
2 changed files with 12 additions and 0 deletions

View File

@ -1342,6 +1342,10 @@ void obs_source_filter_remove(obs_source_t *source, obs_source_t *filter)
calldata_free(&cd);
if (filter->info.filter_remove)
filter->info.filter_remove(filter->context.data,
filter->filter_parent);
filter->filter_parent = NULL;
filter->filter_target = NULL;

View File

@ -364,6 +364,14 @@ struct obs_source_info {
* @param source Transitioning sub-source to get the volume of
*/
float (*get_transition_volume)(void *data, obs_source_t *source);
/**
* Called when the filter is removed from a source
*
* @param data Filter data
* @param source Source that the filter being removed from
*/
void (*filter_remove)(void *data, obs_source_t *source);
};
EXPORT void obs_register_source_s(const struct obs_source_info *info,