mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
lavc: add avcodec_descriptor_get_by_name().
This commit is contained in:
parent
0a0f19b577
commit
91e59fea30
@ -4548,6 +4548,12 @@ const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id);
|
||||
*/
|
||||
const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev);
|
||||
|
||||
/**
|
||||
* @return codec descriptor with the given name or NULL if no such descriptor
|
||||
* exists.
|
||||
*/
|
||||
const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "avcodec.h"
|
||||
|
||||
#include "libavutil/common.h"
|
||||
@ -1939,3 +1941,14 @@ const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev)
|
||||
return prev + 1;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name)
|
||||
{
|
||||
const AVCodecDescriptor *desc = NULL;
|
||||
|
||||
while ((desc = avcodec_descriptor_next(desc))) {
|
||||
if (!strcmp(desc->name, name))
|
||||
return desc;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user