libobs: Add obs_get_encoder_codec function

This allows the ability to get the codec of an encoder via its
identifier string
master
jp9000 2015-02-03 19:48:34 -08:00
parent 0aec530e23
commit 0e398c89be
2 changed files with 9 additions and 0 deletions

View File

@ -446,6 +446,12 @@ const char *obs_encoder_get_codec(const obs_encoder_t *encoder)
return encoder ? encoder->info.codec : NULL;
}
const char *obs_get_encoder_codec(const char *id)
{
struct obs_encoder_info *info = find_encoder(id);
return info ? info->codec : NULL;
}
void obs_encoder_set_scaled_size(obs_encoder_t *encoder, uint32_t width,
uint32_t height)
{

View File

@ -1192,6 +1192,9 @@ EXPORT void obs_encoder_destroy(obs_encoder_t *encoder);
EXPORT void obs_encoder_set_name(obs_encoder_t *encoder, const char *name);
EXPORT const char *obs_encoder_get_name(const obs_encoder_t *encoder);
/** Returns the codec of an encoder by the id */
EXPORT const char *obs_get_encoder_codec(const char *id);
/** Returns the codec of the encoder */
EXPORT const char *obs_encoder_get_codec(const obs_encoder_t *encoder);