#define ADPCM_DECODER_0(id_, sample_fmts_, name_, long_name_)
#define ADPCM_DECODER_1(id_, sample_fmts_, name_, long_name_) \
const FFCodec ff_ ## name_ ## _decoder = {                  \
    .p.name         = #name_,                               \
    CODEC_LONG_NAME(long_name_),                            \
    .p.type         = AVMEDIA_TYPE_AUDIO,                   \
    .p.id           = id_,                                  \
    .p.capabilities = AV_CODEC_CAP_DR1,                     \
    .p.sample_fmts  = sample_fmts_,                         \
    .priv_data_size = sizeof(ADPCMDecodeContext),           \
    .init           = adpcm_decode_init,                    \
    FF_CODEC_DECODE_CB(adpcm_decode_frame),                 \
    .flush          = adpcm_flush,                          \
};
#define ADPCM_DECODER_2(enabled, codec_id, name, sample_fmts, long_name) \
    ADPCM_DECODER_ ## enabled(codec_id, name, sample_fmts, long_name)
#define ADPCM_DECODER_3(config, codec_id, name, sample_fmts, long_name) \
    ADPCM_DECODER_2(config, codec_id, name, sample_fmts, long_name)
#define ADPCM_DECODER(codec, name, sample_fmts, long_name) \
    ADPCM_DECODER_3(CONFIG_ ## codec ## _DECODER, AV_CODEC_ID_ ## codec, \
                    name, sample_fmts, long_name)

/* Note: Do not forget to add new entries to the Makefile as well. */
ADPCM_DECODER(ADPCM_4XM,         sample_fmts_s16p, adpcm_4xm,         "ADPCM 4X Movie")
ADPCM_DECODER(ADPCM_AFC,         sample_fmts_s16p, adpcm_afc,         "ADPCM Nintendo Gamecube AFC")
ADPCM_DECODER(ADPCM_AGM,         sample_fmts_s16,  adpcm_agm,         "ADPCM AmuseGraphics Movie")
ADPCM_DECODER(ADPCM_AICA,        sample_fmts_s16p, adpcm_aica,        "ADPCM Yamaha AICA")
ADPCM_DECODER(ADPCM_ARGO,        sample_fmts_s16p, adpcm_argo,        "ADPCM Argonaut Games")
ADPCM_DECODER(ADPCM_CT,          sample_fmts_s16,  adpcm_ct,          "ADPCM Creative Technology")
ADPCM_DECODER(ADPCM_DTK,         sample_fmts_s16p, adpcm_dtk,         "ADPCM Nintendo Gamecube DTK")

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部