在libavcodec下avcodec.h中定义所有codec的ID
enum AVCodecID { AV_CODEC_ID_NONE, /* video codecs */ AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
【特别注意】ffmpeg是通过解码器的ID来调用解码器的API进行编解码
下面是 CAVS解码器的定义:libavocdec下cavsdec.c中定义
AVCodec ff_cavs_decoder = { .name = "cavs", .long_name = NULL_IF_CONFIG_SMALL("Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile)"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_CAVS, .priv_data_size = sizeof(AVSContext), .init = ff_cavs_init, .close = ff_cavs_end, .decode = cavs_decode_frame, .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY, .flush = cavs_flush, };