summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-07-07 01:41:27 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-07-27 15:24:58 +0100
commitdef97856de6021965db86c25a732d78689bd6bb0 (patch)
treeeec43bbcd7da3f0811fe3f523803e51a1e32efc9 /libavcodec/utils.c
parent7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615 (diff)
lavc: AV-prefix all codec capabilities
Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 2ac2d42304..50311dee68 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1146,7 +1146,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
}
avctx->frame_number = 0;
- if (avctx->codec->capabilities & CODEC_CAP_EXPERIMENTAL &&
+ if ((avctx->codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) &&
avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
ret = AVERROR_EXPERIMENTAL;
goto free_and_end;
@@ -1164,7 +1164,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
goto free_and_end;
}
}
- if (!HAVE_THREADS && !(codec->capabilities & CODEC_CAP_AUTO_THREADS))
+ if (!HAVE_THREADS && !(codec->capabilities & AV_CODEC_CAP_AUTO_THREADS))
avctx->thread_count = 1;
if (av_codec_is_encoder(avctx->codec)) {
@@ -1403,7 +1403,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
*got_packet_ptr = 0;
- if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) {
av_free_packet(avpkt);
av_init_packet(avpkt);
return 0;
@@ -1434,10 +1434,10 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
/* check for valid frame size */
if (frame) {
- if (avctx->codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) {
+ if (avctx->codec->capabilities & AV_CODEC_CAP_SMALL_LAST_FRAME) {
if (frame->nb_samples > avctx->frame_size)
return AVERROR(EINVAL);
- } else if (!(avctx->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)) {
+ } else if (!(avctx->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)) {
if (frame->nb_samples < avctx->frame_size &&
!avctx->internal->last_audio_frame) {
ret = pad_last_frame(avctx, &padded_frame, frame);
@@ -1458,7 +1458,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
if (!ret) {
if (*got_packet_ptr) {
- if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY)) {
if (avpkt->pts == AV_NOPTS_VALUE)
avpkt->pts = frame->pts;
if (!avpkt->duration)
@@ -1510,7 +1510,7 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
*got_packet_ptr = 0;
- if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) {
av_free_packet(avpkt);
av_init_packet(avpkt);
avpkt->size = 0;
@@ -1526,7 +1526,7 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
if (!ret) {
if (!*got_packet_ptr)
avpkt->size = 0;
- else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY))
+ else if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY))
avpkt->pts = avpkt->dts = frame->pts;
if (!user_packet && avpkt->size) {
@@ -1570,7 +1570,7 @@ static int apply_param_change(AVCodecContext *avctx, AVPacket *avpkt)
if (!data)
return 0;
- if (!(avctx->codec->capabilities & CODEC_CAP_PARAM_CHANGE)) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_PARAM_CHANGE)) {
av_log(avctx, AV_LOG_ERROR, "This decoder does not support parameter "
"changes, but PARAM_CHANGE side data was sent to it.\n");
return AVERROR(EINVAL);
@@ -1683,7 +1683,8 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
av_frame_unref(picture);
- if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type & FF_THREAD_FRAME)) {
+ if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size ||
+ (avctx->active_thread_type & FF_THREAD_FRAME)) {
if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME)
ret = ff_thread_decode_frame(avctx, picture, got_picture_ptr,
avpkt);
@@ -1692,7 +1693,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
avpkt);
picture->pkt_dts = avpkt->dts;
/* get_buffer is supposed to set frame parameters */
- if (!(avctx->codec->capabilities & CODEC_CAP_DR1)) {
+ if (!(avctx->codec->capabilities & AV_CODEC_CAP_DR1)) {
picture->sample_aspect_ratio = avctx->sample_aspect_ratio;
picture->width = avctx->width;
picture->height = avctx->height;
@@ -1749,7 +1750,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
av_frame_unref(frame);
- if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size) {
+ if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size) {
ret = avctx->codec->decode(avctx, frame, got_frame_ptr, avpkt);
if (ret >= 0 && *got_frame_ptr) {
avctx->frame_number++;
@@ -1849,7 +1850,7 @@ static AVCodec *find_encdec(enum AVCodecID id, int encoder)
while (p) {
if ((encoder ? av_codec_is_encoder(p) : av_codec_is_decoder(p)) &&
p->id == id) {
- if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) {
+ if (p->capabilities & AV_CODEC_CAP_EXPERIMENTAL && !experimental) {
experimental = p;
} else
return p;