libobs: Add encoder caps (with deprecated flag)

Allows the ability to mark an encoder as deprecated (such as the media
foundation h264 encoders)
This commit is contained in:
jp9000 2016-04-11 05:02:39 -07:00
parent bc231eda75
commit e38a5c61d3
3 changed files with 12 additions and 0 deletions

View file

@ -1150,3 +1150,9 @@ const char *obs_encoder_get_id(const obs_encoder_t *encoder)
return obs_encoder_valid(encoder, "obs_encoder_get_id")
? encoder->info.id : NULL;
}
uint32_t obs_get_encoder_caps(const char *encoder_id)
{
struct obs_encoder_info *info = find_encoder(encoder_id);
return info ? info->caps : 0;
}

View file

@ -29,6 +29,8 @@
extern "C" {
#endif
#define OBS_ENCODER_CAP_DEPRECATED (1<<0)
/** Specifies the encoder type */
enum obs_encoder_type {
OBS_ENCODER_AUDIO, /**< The encoder provides an audio codec */
@ -227,6 +229,8 @@ struct obs_encoder_info {
void *type_data;
void (*free_type_data)(void *type_data);
uint32_t caps;
};
EXPORT void obs_register_encoder_s(const struct obs_encoder_info *info,

View file

@ -1633,6 +1633,8 @@ EXPORT void *obs_encoder_get_type_data(obs_encoder_t *encoder);
EXPORT const char *obs_encoder_get_id(const obs_encoder_t *encoder);
EXPORT uint32_t obs_get_encoder_caps(const char *encoder_id);
/** Duplicates an encoder packet */
EXPORT void obs_duplicate_encoder_packet(struct encoder_packet *dst,
const struct encoder_packet *src);