libobs: Add API to get base source dimensions

These functions are primarily for use with filters, filters need to be
able to get the width/height of a target source without it necessarily
getting the post-filtered dimensions.
This commit is contained in:
jp9000 2015-03-08 06:56:41 -07:00
parent 506e30da10
commit b9eef3c4f2
2 changed files with 20 additions and 0 deletions

View file

@ -1245,6 +1245,20 @@ uint32_t obs_source_get_height(obs_source_t *source)
get_base_height(source);
}
uint32_t obs_source_get_base_width(obs_source_t *source)
{
if (!source_valid(source)) return 0;
return get_base_width(source);
}
uint32_t obs_source_get_base_height(obs_source_t *source)
{
if (!source_valid(source)) return 0;
return get_base_height(source);
}
obs_source_t *obs_filter_get_parent(const obs_source_t *filter)
{
return filter ? filter->filter_parent : NULL;

View file

@ -922,6 +922,12 @@ EXPORT void obs_source_send_key_click(obs_source_t *source,
/** Sets the default source flags. */
EXPORT void obs_source_set_default_flags(obs_source_t *source, uint32_t flags);
/** Gets the base width for a source (not taking in to account filtering) */
EXPORT uint32_t obs_source_get_base_width(obs_source_t *source);
/** Gets the base height for a source (not taking in to account filtering) */
EXPORT uint32_t obs_source_get_base_height(obs_source_t *source);
/* ------------------------------------------------------------------------- */
/* Scenes */