diff options
author | Alfred E. Heggestad <aeh@db.org> | 2014-12-25 17:28:27 +0100 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2014-12-25 17:28:27 +0100 |
commit | 5e4499b1543f62ba82f9e4f66c921bafe24bf497 (patch) | |
tree | 5a863e6915a260aea29044d64fd1d0233a4a37c0 /src/vidcodec.c | |
parent | 6c8ba7db8c417f1a457dc1a2e22ac11c17860a90 (diff) |
vidcodec: add support for encode- or decode-only vidcodec modules
Diffstat (limited to 'src/vidcodec.c')
-rw-r--r-- | src/vidcodec.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/vidcodec.c b/src/vidcodec.c index 7624ae7..620674a 100644 --- a/src/vidcodec.c +++ b/src/vidcodec.c @@ -71,6 +71,58 @@ const struct vidcodec *vidcodec_find(const char *name, const char *variant) /** + * Find a Video Encoder by name + * + * @param name Name of the Video Encoder to find + * + * @return Matching Video Encoder if found, otherwise NULL + */ +const struct vidcodec *vidcodec_find_encoder(const char *name) +{ + struct le *le; + + for (le=vidcodecl.head; le; le=le->next) { + + struct vidcodec *vc = le->data; + + if (name && 0 != str_casecmp(name, vc->name)) + continue; + + if (vc->ench) + return vc; + } + + return NULL; +} + + +/** + * Find a Video Decoder by name + * + * @param name Name of the Video Decoder to find + * + * @return Matching Video Decoder if found, otherwise NULL + */ +const struct vidcodec *vidcodec_find_decoder(const char *name) +{ + struct le *le; + + for (le=vidcodecl.head; le; le=le->next) { + + struct vidcodec *vc = le->data; + + if (name && 0 != str_casecmp(name, vc->name)) + continue; + + if (vc->dech) + return vc; + } + + return NULL; +} + + +/** * Get the list of Video Codecs * * @return List of Video Codecs |