mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-27 05:00:37 +00: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