From 67deba8a416d818f3d95aef0aa916589090396e2 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 16 Dec 2015 18:01:34 +0100 Subject: Use avpriv_report_missing_feature() where appropriate --- libavcodec/aacdec.c | 3 +-- libavcodec/alac.c | 8 ++++---- libavcodec/bmp.c | 3 ++- libavcodec/fraps.c | 4 +--- libavcodec/g2meet.c | 11 +++++------ libavcodec/g723_1enc.c | 3 ++- libavcodec/h264_ps.c | 5 ++--- libavcodec/hevc_ps.c | 7 +++---- libavcodec/hevc_ps_enc.c | 10 ++++++---- libavcodec/libopenjpegdec.c | 2 +- libavcodec/libopusenc.c | 5 +++-- libavcodec/mjpegdec.c | 7 ++++--- libavcodec/opus_silk.c | 2 +- libavcodec/shorten.c | 4 ++-- libavcodec/takdec.c | 2 +- libavcodec/txd.c | 7 +++---- libavcodec/vp5.c | 2 +- libavcodec/xwddec.c | 2 +- 18 files changed, 43 insertions(+), 44 deletions(-) (limited to 'libavcodec') diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 6a06062c53..22ebcdc570 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -1246,8 +1246,7 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics, return AVERROR_INVALIDDATA; } else { if (aot == AOT_ER_AAC_LD) { - av_log(ac->avctx, AV_LOG_ERROR, - "LTP in ER AAC LD not yet implemented.\n"); + avpriv_report_missing_feature(ac->avctx, "LTP in ER AAC LD"); return AVERROR_PATCHWELCOME; } if ((ics->ltp.present = get_bits(gb, 1))) diff --git a/libavcodec/alac.c b/libavcodec/alac.c index 0d2a7ca01d..83d777c760 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -266,7 +266,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, alac->extra_bits = get_bits(&alac->gb, 2) << 3; bps = alac->sample_size - alac->extra_bits + channels - 1; if (bps > 32) { - av_log(avctx, AV_LOG_ERROR, "bps is unsupported: %d\n", bps); + avpriv_report_missing_feature(avctx, "bps %d", bps); return AVERROR_PATCHWELCOME; } @@ -424,7 +424,7 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data, break; } if (element > TYPE_CPE && element != TYPE_LFE) { - av_log(avctx, AV_LOG_ERROR, "syntax element unsupported: %d", element); + avpriv_report_missing_feature(avctx, "Syntax element %d", element); return AVERROR_PATCHWELCOME; } @@ -568,8 +568,8 @@ static av_cold int alac_decode_init(AVCodecContext * avctx) avctx->channels = alac->channels; } if (avctx->channels > ALAC_MAX_CHANNELS) { - av_log(avctx, AV_LOG_ERROR, "Unsupported channel count: %d\n", - avctx->channels); + avpriv_report_missing_feature(avctx, "Channel count %d", + avctx->channels); return AVERROR_PATCHWELCOME; } avctx->channel_layout = ff_alac_channel_layouts[alac->channels - 1]; diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index 648fa68e1f..5c7acb6e72 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -98,7 +98,8 @@ static int bmp_decode_frame(AVCodecContext *avctx, height = bytestream_get_le16(&buf); break; default: - av_log(avctx, AV_LOG_ERROR, "unsupported BMP file, patch welcome\n"); + avpriv_report_missing_feature(avctx, "Information header size %u", + ihsize); return AVERROR_PATCHWELCOME; } diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c index c4ec23e281..55051ffe7e 100644 --- a/libavcodec/fraps.c +++ b/libavcodec/fraps.c @@ -163,9 +163,7 @@ static int decode_frame(AVCodecContext *avctx, prev_pic_bit = header & (1U << 31); /* bit 31 means same as previous pic */ if (version > 5) { - av_log(avctx, AV_LOG_ERROR, - "This file is encoded with Fraps version %u. " - "This codec can only decode versions <= 5.\n", version); + avpriv_report_missing_feature(avctx, "Fraps version %u", version); return AVERROR_PATCHWELCOME; } diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index a89610d6c3..7e90916274 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -1424,9 +1424,8 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data, } c->compression = bytestream2_get_be32(&bc); if (c->compression != 2 && c->compression != 3) { - av_log(avctx, AV_LOG_ERROR, - "Unknown compression method %d\n", - c->compression); + avpriv_report_missing_feature(avctx, "Compression method %d", + c->compression); return AVERROR_PATCHWELCOME; } c->tile_width = bytestream2_get_be32(&bc); @@ -1453,9 +1452,9 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data, g_mask = bytestream2_get_be32(&bc); b_mask = bytestream2_get_be32(&bc); if (r_mask != 0xFF0000 || g_mask != 0xFF00 || b_mask != 0xFF) { - av_log(avctx, AV_LOG_ERROR, - "Invalid or unsupported bitmasks: R=%"PRIX32", G=%"PRIX32", B=%"PRIX32"\n", - r_mask, g_mask, b_mask); + avpriv_report_missing_feature(avctx, + "Bitmasks: R=%"PRIX32", G=%"PRIX32", B=%"PRIX32, + r_mask, g_mask, b_mask); return AVERROR_PATCHWELCOME; } } else { diff --git a/libavcodec/g723_1enc.c b/libavcodec/g723_1enc.c index 1ebd465416..82f5cecfa2 100644 --- a/libavcodec/g723_1enc.c +++ b/libavcodec/g723_1enc.c @@ -57,7 +57,8 @@ static av_cold int g723_1_encode_init(AVCodecContext *avctx) if (avctx->bit_rate == 6300) { p->cur_rate = RATE_6300; } else if (avctx->bit_rate == 5300) { - av_log(avctx, AV_LOG_ERROR, "Bitrate not supported yet, use 6300\n"); + av_log(avctx, AV_LOG_ERROR, "Use bitrate 6300 instead of 5300.\n"); + avpriv_report_missing_feature(avctx, "Bitrate 5300"); return AVERROR_PATCHWELCOME; } else { av_log(avctx, AV_LOG_ERROR, "Bitrate not supported, use 6300\n"); diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c index 36902e8e77..37c3be1cb9 100644 --- a/libavcodec/h264_ps.c +++ b/libavcodec/h264_ps.c @@ -700,9 +700,8 @@ int ff_h264_decode_picture_parameter_set(GetBitContext *gb, AVCodecContext *avct sps = (SPS*)ps->sps_list[pps->sps_id]->data; if (sps->bit_depth_luma > 10) { - av_log(avctx, AV_LOG_ERROR, - "Unimplemented luma bit depth=%d (max=10)\n", - sps->bit_depth_luma); + avpriv_report_missing_feature(avctx, "Luma bit depth=%d (max=10)", + sps->bit_depth_luma); ret = AVERROR_PATCHWELCOME; goto fail; } diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index 6a8cfebaf7..c28e86b34a 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -657,13 +657,12 @@ static int map_pixel_format(AVCodecContext *avctx, HEVCSPS *sps) case 9: sps->pix_fmt = AV_PIX_FMT_YUV420P9; break; case 10: sps->pix_fmt = AV_PIX_FMT_YUV420P10; break; default: - av_log(avctx, AV_LOG_ERROR, "Unsupported bit depth: %d\n", - sps->bit_depth); + avpriv_report_missing_feature(avctx, "Bit depth %d", + sps->bit_depth); return AVERROR_PATCHWELCOME; } } else { - av_log(avctx, AV_LOG_ERROR, - "non-4:2:0 support is currently unspecified.\n"); + avpriv_report_missing_feature(avctx, "Non-4:2:0 support"); return AVERROR_PATCHWELCOME; } diff --git a/libavcodec/hevc_ps_enc.c b/libavcodec/hevc_ps_enc.c index 1e86757d7c..4864e6ebfc 100644 --- a/libavcodec/hevc_ps_enc.c +++ b/libavcodec/hevc_ps_enc.c @@ -90,9 +90,10 @@ int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id, put_bits(&pb, 6, vps->vps_max_layer_id); set_ue_golomb(&pb, vps->vps_num_layer_sets - 1); - // writing layer_id_included_flag not supported - if (vps->vps_num_layer_sets > 1) + if (vps->vps_num_layer_sets > 1) { + avpriv_report_missing_feature(NULL, "Writing layer_id_included_flag"); return AVERROR_PATCHWELCOME; + } put_bits(&pb, 1, vps->vps_timing_info_present_flag); if (vps->vps_timing_info_present_flag) { @@ -102,9 +103,10 @@ int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id, if (vps->vps_poc_proportional_to_timing_flag) set_ue_golomb(&pb, vps->vps_num_ticks_poc_diff_one - 1); - // writing HRD parameters not supported - if (vps->vps_num_hrd_parameters) + if (vps->vps_num_hrd_parameters) { + avpriv_report_missing_feature(NULL, "Writing HRD parameters"); return AVERROR_PATCHWELCOME; + } } put_bits(&pb, 1, 0); // extension flag diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 401ea9b801..6b8e210ac6 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -396,7 +396,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, } break; default: - av_log(avctx, AV_LOG_ERROR, "unsupported pixel size %d\n", pixel_size); + avpriv_report_missing_feature(avctx, "Pixel size %d", pixel_size); ret = AVERROR_PATCHWELCOME; goto done; } diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c index 1fb597bd33..500e58c85e 100644 --- a/libavcodec/libopusenc.c +++ b/libavcodec/libopusenc.c @@ -164,8 +164,9 @@ static int av_cold libopus_encode_init(AVCodecContext *avctx) /* FIXME: Opus can handle up to 255 channels. However, the mapping for * anything greater than 8 is undefined. */ if (avctx->channels > 8) { - av_log(avctx, AV_LOG_ERROR, - "Channel layout undefined for %d channels.\n", avctx->channels); + avpriv_report_missing_feature(avctx, + "Undefined channel layout for %d channels", + avctx->channels); return AVERROR_PATCHWELCOME; } if (!avctx->bit_rate) { diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index c670f357c9..a4a6c63411 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -373,7 +373,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; break; default: - av_log(s->avctx, AV_LOG_ERROR, "Unhandled pixel format 0x%x\n", pix_fmt_id); + avpriv_report_missing_feature(s->avctx, "Pixel format 0x%x", pix_fmt_id); return AVERROR_PATCHWELCOME; } if (s->ls) { @@ -1035,8 +1035,9 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask, len = get_bits(&s->gb, 16); nb_components = get_bits(&s->gb, 8); if (nb_components == 0 || nb_components > MAX_COMPONENTS) { - av_log(s->avctx, AV_LOG_ERROR, - "decode_sos: nb_components (%d) unsupported\n", nb_components); + avpriv_report_missing_feature(s->avctx, + "decode_sos: nb_components (%d)", + nb_components); return AVERROR_PATCHWELCOME; } if (len != 6 + 2 * nb_components) { diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c index d83fb373c6..5db1b26c6f 100644 --- a/libavcodec/opus_silk.c +++ b/libavcodec/opus_silk.c @@ -1530,7 +1530,7 @@ int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc, redundancy[i] = opus_rc_p2model(rc, 1); if (redundancy[i]) { - av_log(s->avctx, AV_LOG_ERROR, "LBRR frames present; this is unsupported\n"); + avpriv_report_missing_feature(s->avctx, "LBRR frames"); return AVERROR_PATCHWELCOME; } } diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index ee6dc70942..00d1661779 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -515,8 +515,8 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data, case FN_BLOCKSIZE: { unsigned blocksize = get_uint(s, av_log2(s->blocksize)); if (blocksize > s->blocksize) { - av_log(avctx, AV_LOG_ERROR, - "Increasing block size is not supported\n"); + avpriv_report_missing_feature(avctx, + "Increasing block size"); return AVERROR_PATCHWELCOME; } if (!blocksize || blocksize > MAX_BLOCKSIZE) { diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index c9db928c5c..394567bbba 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -702,7 +702,7 @@ static int tak_decode_frame(AVCodecContext *avctx, void *data, if (s->ti.codec != TAK_CODEC_MONO_STEREO && s->ti.codec != TAK_CODEC_MULTICHANNEL) { - av_log(avctx, AV_LOG_ERROR, "unsupported codec: %d\n", s->ti.codec); + avpriv_report_missing_feature(avctx, "TAK codec type %d", s->ti.codec); return AVERROR_PATCHWELCOME; } if (s->ti.data_type) { diff --git a/libavcodec/txd.c b/libavcodec/txd.c index ac46608f61..db1d954032 100644 --- a/libavcodec/txd.c +++ b/libavcodec/txd.c @@ -56,8 +56,7 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, flags = bytestream2_get_byte(&gb); if (version < 8 || version > 9) { - av_log(avctx, AV_LOG_ERROR, "texture data version %u is unsupported\n", - version); + avpriv_report_missing_feature(avctx, "Texture data version %u", version); return AVERROR_PATCHWELCOME; } @@ -66,7 +65,7 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } else if (depth == 16 || depth == 32) { avctx->pix_fmt = AV_PIX_FMT_RGBA; } else { - av_log(avctx, AV_LOG_ERROR, "depth of %u is unsupported\n", depth); + avpriv_report_missing_feature(avctx, "Color depth of %u", depth); return AVERROR_PATCHWELCOME; } @@ -143,7 +142,7 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return avpkt->size; unsupported: - av_log(avctx, AV_LOG_ERROR, "unsupported d3d format (%08x)\n", d3d_format); + avpriv_report_missing_feature(avctx, "d3d format (%08x)", d3d_format); return AVERROR_PATCHWELCOME; } diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c index 2d8ba1a0f7..e5036e62a9 100644 --- a/libavcodec/vp5.c +++ b/libavcodec/vp5.c @@ -51,7 +51,7 @@ static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size, return AVERROR_INVALIDDATA; vp56_rac_gets(c, 2); if (vp56_rac_get(c)) { - av_log(s->avctx, AV_LOG_ERROR, "interlacing not supported\n"); + avpriv_report_missing_feature(s->avctx, "Interlacing"); return AVERROR_PATCHWELCOME; } rows = vp56_rac_gets(c, 8); /* number of stored macroblock rows */ diff --git a/libavcodec/xwddec.c b/libavcodec/xwddec.c index 1c9874aa32..387b697491 100644 --- a/libavcodec/xwddec.c +++ b/libavcodec/xwddec.c @@ -147,7 +147,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, } if (pixformat != XWD_Z_PIXMAP) { - av_log(avctx, AV_LOG_ERROR, "pixmap format %"PRIu32" unsupported\n", pixformat); + avpriv_report_missing_feature(avctx, "Pixmap format %"PRIu32, pixformat); return AVERROR_PATCHWELCOME; } -- cgit v1.2.3