Skip to content

Commit

Permalink
libobs: Add functions to get output capability flags
Browse files Browse the repository at this point in the history
  • Loading branch information
computerquip-streamlabs authored and jp9000 committed Apr 25, 2018
1 parent c4b482e commit 189e535
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/sphinx/reference-outputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,13 @@ General Output Functions

---------------------

.. function:: uint32_t obs_output_get_flags(const obs_output_t *output)
uint32_t obs_get_output_flags(const char *id)
:return: The output capability flags

---------------------

Functions used by outputs
-------------------------

Expand Down
12 changes: 12 additions & 0 deletions libobs/obs-output.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,18 @@ bool obs_output_active(const obs_output_t *output)
(active(output) || reconnecting(output)) : false;
}

uint32_t obs_output_get_flags(const obs_output_t *output)
{
return obs_output_valid(output, "obs_output_get_flags") ?
output->info.flags : 0;
}

uint32_t obs_get_output_flags(const char *id)
{
const struct obs_output_info *info = find_output(id);
return info ? info->flags : 0;
}

static inline obs_data_t *get_defaults(const struct obs_output_info *info)
{
obs_data_t *settings = obs_data_create();
Expand Down
6 changes: 6 additions & 0 deletions libobs/obs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,12 @@ EXPORT void obs_output_force_stop(obs_output_t *output);
/** Returns whether the output is active */
EXPORT bool obs_output_active(const obs_output_t *output);

/** Returns output capability flags */
EXPORT uint32_t obs_output_get_flags(const obs_output_t *output);

/** Returns output capability flags */
EXPORT uint32_t obs_get_output_flags(const char *id);

/** Gets the default settings for an output type */
EXPORT obs_data_t *obs_output_defaults(const char *id);

Expand Down

0 comments on commit 189e535

Please sign in to comment.