Skip to content

Commit

Permalink
lavc: AV-prefix all codec capabilities
Browse files Browse the repository at this point in the history
Express bitfields more simply.

Signed-off-by: Vittorio Giovara <[email protected]>
  • Loading branch information
kodawah committed Jul 27, 2015
1 parent 7c6eb0a commit def9785
Show file tree
Hide file tree
Showing 276 changed files with 487 additions and 393 deletions.
6 changes: 3 additions & 3 deletions avconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static void abort_codec_experimental(AVCodec *c, int encoder)
"results.\nAdd '-strict experimental' if you want to use it.\n",
codec_string, c->name);
codec = encoder ? avcodec_find_encoder(c->id) : avcodec_find_decoder(c->id);
if (!(codec->capabilities & CODEC_CAP_EXPERIMENTAL))
if (!(codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL))
av_log(NULL, AV_LOG_FATAL, "Or use the non experimental %s '%s'.\n",
codec_string, codec->name);
exit_program(1);
Expand Down Expand Up @@ -614,7 +614,7 @@ static int poll_filter(OutputStream *ost)
filtered_frame = ost->filtered_frame;

if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
!(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
!(ost->enc->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE))
ret = av_buffersink_get_samples(ost->filter->filter, filtered_frame,
ost->enc_ctx->frame_size);
else
Expand Down Expand Up @@ -1353,7 +1353,7 @@ static void process_input_packet(InputStream *ist, const AVPacket *pkt)
ist->last_dts = ist->next_dts;

if (avpkt.size && avpkt.size != pkt->size &&
!(ist->dec->capabilities & CODEC_CAP_SUBFRAMES)) {
!(ist->dec->capabilities & AV_CODEC_CAP_SUBFRAMES)) {
av_log(NULL, ist->showed_multi_packet_warning ? AV_LOG_VERBOSE : AV_LOG_WARNING,
"Multiple frames in a packet from stream %d\n", pkt->stream_index);
ist->showed_multi_packet_warning = 1;
Expand Down
4 changes: 2 additions & 2 deletions avplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)

if (!got_frame) {
/* stop sending empty packets if the decoder is finished */
if (!pkt_temp->data && dec->codec->capabilities & CODEC_CAP_DELAY)
if (!pkt_temp->data && (dec->codec->capabilities & AV_CODEC_CAP_DELAY))
flush_complete = 1;
continue;
}
Expand Down Expand Up @@ -2470,7 +2470,7 @@ static int decode_thread(void *arg)
packet_queue_put(&is->videoq, pkt);
}
if (is->audio_stream >= 0 &&
is->audio_st->codec->codec->capabilities & CODEC_CAP_DELAY) {
(is->audio_st->codec->codec->capabilities & AV_CODEC_CAP_DELAY)) {
av_init_packet(pkt);
pkt->data = NULL;
pkt->size = 0;
Expand Down
18 changes: 9 additions & 9 deletions cmdutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,12 +979,12 @@ static void print_codec(const AVCodec *c)

if (c->type == AVMEDIA_TYPE_VIDEO) {
printf(" Threading capabilities: ");
switch (c->capabilities & (CODEC_CAP_FRAME_THREADS |
CODEC_CAP_SLICE_THREADS)) {
case CODEC_CAP_FRAME_THREADS |
CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break;
case CODEC_CAP_FRAME_THREADS: printf("frame"); break;
case CODEC_CAP_SLICE_THREADS: printf("slice"); break;
switch (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS |
AV_CODEC_CAP_SLICE_THREADS)) {
case AV_CODEC_CAP_FRAME_THREADS |
AV_CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break;
case AV_CODEC_CAP_FRAME_THREADS: printf("frame"); break;
case AV_CODEC_CAP_SLICE_THREADS: printf("slice"); break;
default: printf("no"); break;
}
printf("\n");
Expand Down Expand Up @@ -1115,9 +1115,9 @@ static void print_codecs(int encoder)

while ((codec = next_codec_for_id(desc->id, codec, encoder))) {
printf("%c", get_media_type_char(desc->type));
printf((codec->capabilities & CODEC_CAP_FRAME_THREADS) ? "F" : ".");
printf((codec->capabilities & CODEC_CAP_SLICE_THREADS) ? "S" : ".");
printf((codec->capabilities & CODEC_CAP_EXPERIMENTAL) ? "X" : ".");
printf((codec->capabilities & AV_CODEC_CAP_FRAME_THREADS) ? "F" : ".");
printf((codec->capabilities & AV_CODEC_CAP_SLICE_THREADS) ? "S" : ".");
printf((codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) ? "X" : ".");

printf(" %-20s %s", codec->name, codec->long_name ? codec->long_name : "");
if (strcmp(codec->name, desc->name))
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/avcodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ static void video_decode_example(const char *outfilename, const char *filename)
c = avcodec_alloc_context3(codec);
picture = av_frame_alloc();

if(codec->capabilities&CODEC_CAP_TRUNCATED)
if (codec->capabilities & AV_CODEC_CAP_TRUNCATED)
c->flags |= AV_CODEC_FLAG_TRUNCATED; // we do not send complete frames

/* For some codecs, such as msmpeg4 and mpeg4, width and height
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static void open_audio(AVFormatContext *oc, OutputStream *ost)
/* increment frequency by 110 Hz per second */
ost->tincr2 = 2 * M_PI * 110.0 / c->sample_rate / c->sample_rate;

if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)
if (c->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)
nb_samples = 10000;
else
nb_samples = c->frame_size;
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/4xm.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,5 +981,5 @@ AVCodec ff_fourxm_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
};
2 changes: 1 addition & 1 deletion libavcodec/8bps.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,5 @@ AVCodec ff_eightbps_decoder = {
.priv_data_size = sizeof(EightBpsContext),
.init = decode_init,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
};
6 changes: 3 additions & 3 deletions libavcodec/8svx.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ AVCodec ff_eightsvx_fib_decoder = {
.init = eightsvx_decode_init,
.close = eightsvx_decode_close,
.decode = eightsvx_decode_frame,
.capabilities = CODEC_CAP_DELAY | CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_NONE },
};
Expand All @@ -219,7 +219,7 @@ AVCodec ff_eightsvx_exp_decoder = {
.init = eightsvx_decode_init,
.close = eightsvx_decode_close,
.decode = eightsvx_decode_frame,
.capabilities = CODEC_CAP_DELAY | CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_NONE },
};
Expand All @@ -233,7 +233,7 @@ AVCodec ff_pcm_s8_planar_decoder = {
.init = eightsvx_decode_init,
.close = eightsvx_decode_close,
.decode = eightsvx_decode_frame,
.capabilities = CODEC_CAP_DELAY | CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_NONE },
};
4 changes: 2 additions & 2 deletions libavcodec/a64multienc.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ AVCodec ff_a64multi_encoder = {
.encode2 = a64multi_encode_frame,
.close = a64multi_close_encoder,
.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
.capabilities = CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY,
};

AVCodec ff_a64multi5_encoder = {
Expand All @@ -405,5 +405,5 @@ AVCodec ff_a64multi5_encoder = {
.encode2 = a64multi_encode_frame,
.close = a64multi_close_encoder,
.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
.capabilities = CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY,
};
4 changes: 2 additions & 2 deletions libavcodec/aacdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -3318,7 +3318,7 @@ AVCodec ff_aac_decoder = {
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
},
.capabilities = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.channel_layouts = aac_channel_layout,
};

Expand All @@ -3339,6 +3339,6 @@ AVCodec ff_aac_latm_decoder = {
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE
},
.capabilities = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.channel_layouts = aac_channel_layout,
};
4 changes: 2 additions & 2 deletions libavcodec/aacenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,8 @@ AVCodec ff_aac_encoder = {
.init = aac_encode_init,
.encode2 = aac_encode_frame,
.close = aac_encode_end,
.capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY |
CODEC_CAP_EXPERIMENTAL,
.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_EXPERIMENTAL,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.priv_class = &aacenc_class,
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/aasc.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,5 @@ AVCodec ff_aasc_decoder = {
.init = aasc_decode_init,
.close = aasc_decode_end,
.decode = aasc_decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
};
4 changes: 2 additions & 2 deletions libavcodec/ac3dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ AVCodec ff_ac3_decoder = {
.init = ac3_decode_init,
.close = ac3_decode_end,
.decode = ac3_decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.priv_class = &ac3_decoder_class,
Expand All @@ -1581,7 +1581,7 @@ AVCodec ff_eac3_decoder = {
.init = ac3_decode_init,
.close = ac3_decode_end,
.decode = ac3_decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
.priv_class = &eac3_decoder_class,
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/adpcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ AVCodec ff_ ## name_ ## _decoder = { \
.priv_data_size = sizeof(ADPCMDecodeContext), \
.init = adpcm_decode_init, \
.decode = adpcm_decode_frame, \
.capabilities = CODEC_CAP_DR1, \
.capabilities = AV_CODEC_CAP_DR1, \
.sample_fmts = sample_fmts_, \
}

Expand Down
2 changes: 1 addition & 1 deletion libavcodec/adxdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ AVCodec ff_adpcm_adx_decoder = {
.init = adx_decode_init,
.decode = adx_decode_frame,
.flush = adx_decode_flush,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
};
2 changes: 1 addition & 1 deletion libavcodec/aic.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,5 +484,5 @@ AVCodec ff_aic_decoder = {
.init = aic_decode_init,
.close = aic_decode_close,
.decode = aic_decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
};
2 changes: 1 addition & 1 deletion libavcodec/alac.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,5 +587,5 @@ AVCodec ff_alac_decoder = {
.init = alac_decode_init,
.close = alac_decode_close,
.decode = alac_decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
};
2 changes: 1 addition & 1 deletion libavcodec/alacenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ AVCodec ff_alac_encoder = {
.init = alac_encode_init,
.encode2 = alac_encode_frame,
.close = alac_encode_close,
.capabilities = CODEC_CAP_SMALL_LAST_FRAME,
.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME,
.channel_layouts = ff_alac_channel_layouts,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P,
AV_SAMPLE_FMT_S16P,
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/aliaspixdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ AVCodec ff_alias_pix_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ALIAS_PIX,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
};
2 changes: 1 addition & 1 deletion libavcodec/alsdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1812,5 +1812,5 @@ AVCodec ff_als_decoder = {
.close = decode_end,
.decode = decode_frame,
.flush = flush,
.capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
};
2 changes: 1 addition & 1 deletion libavcodec/amrnbdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ AVCodec ff_amrnb_decoder = {
.priv_data_size = sizeof(AMRContext),
.init = amrnb_decode_init,
.decode = amrnb_decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE },
};
2 changes: 1 addition & 1 deletion libavcodec/amrwbdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ AVCodec ff_amrwb_decoder = {
.priv_data_size = sizeof(AMRWBContext),
.init = amrwb_decode_init,
.decode = amrwb_decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_NONE },
};
2 changes: 1 addition & 1 deletion libavcodec/anm.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,5 @@ AVCodec ff_anm_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
};
2 changes: 1 addition & 1 deletion libavcodec/ansi.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,5 +450,5 @@ AVCodec ff_ansi_decoder = {
.init = decode_init,
.close = decode_close,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
};
3 changes: 2 additions & 1 deletion libavcodec/apedec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,8 @@ AVCodec ff_ape_decoder = {
.init = ape_decode_init,
.close = ape_decode_close,
.decode = ape_decode_frame,
.capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DELAY | CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_DR1,
.flush = ape_flush,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_S16P,
Expand Down
4 changes: 2 additions & 2 deletions libavcodec/asvdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ AVCodec ff_asv1_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
};

AVCodec ff_asv2_decoder = {
Expand All @@ -338,5 +338,5 @@ AVCodec ff_asv2_decoder = {
.init = decode_init,
.close = decode_end,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
};
2 changes: 1 addition & 1 deletion libavcodec/atrac1.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ AVCodec ff_atrac1_decoder = {
.init = atrac1_decode_init,
.close = atrac1_decode_end,
.decode = atrac1_decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
};
2 changes: 1 addition & 1 deletion libavcodec/atrac3.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ AVCodec ff_atrac3_decoder = {
.init_static_data = atrac3_init_static_data,
.close = atrac3_decode_close,
.decode = atrac3_decode_frame,
.capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
};
2 changes: 1 addition & 1 deletion libavcodec/atrac3plusdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ AVCodec ff_atrac3p_decoder = {
.long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ (Adaptive TRansform Acoustic Coding 3+)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_ATRAC3P,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
.priv_data_size = sizeof(ATRAC3PContext),
.init = atrac3p_decode_init,
.init_static_data = ff_atrac3p_init_vlcs,
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/aura.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@ AVCodec ff_aura2_decoder = {
.id = AV_CODEC_ID_AURA2,
.init = aura_decode_init,
.decode = aura_decode_frame,
.capabilities = CODEC_CAP_DR1,
.capabilities = AV_CODEC_CAP_DR1,
};
Loading

0 comments on commit def9785

Please sign in to comment.