From d65522e826fccd97c40d7cc4a170e027910c60b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 6 Mar 2013 21:18:00 +0200 Subject: [PATCH 1/2] h264: Rename the jpeg_420 pixfmt list to match the common naming structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavcodec/h264.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index aa2b1a7910..610c815732 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -78,7 +78,7 @@ static const enum AVPixelFormat h264_hwaccel_pixfmt_list_420[] = { AV_PIX_FMT_NONE }; -static const enum AVPixelFormat hwaccel_pixfmt_list_h264_jpeg_420[] = { +static const enum AVPixelFormat h264_hwaccel_pixfmt_list_jpeg_420[] = { #if CONFIG_H264_DXVA2_HWACCEL AV_PIX_FMT_DXVA2_VLD, #endif @@ -2839,7 +2839,7 @@ static enum PixelFormat get_pixel_format(H264Context *h) return h->avctx->get_format(h->avctx, h->avctx->codec->pix_fmts ? h->avctx->codec->pix_fmts : h->avctx->color_range == AVCOL_RANGE_JPEG ? - hwaccel_pixfmt_list_h264_jpeg_420 : + h264_hwaccel_pixfmt_list_jpeg_420 : h264_hwaccel_pixfmt_list_420); } break; From 70762508ec5919474edb92a5b1f266fd06640f9c Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sat, 26 May 2012 01:38:03 +0200 Subject: [PATCH 2/2] lavc: Prettify printing of codec tags containing non alphanumeric characters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make av_get_codec_tag_string() show codec tag string characters in a more intelligible ways. For example the ascii char "@" is used as a number, so should be displayed like "[64]" rather than as a printable character. Apart alphanumeric chars, only the characters ' ' and '.' are used literally in codec tags, all the other characters represent numbers. This also avoids relying on locale-dependent character class functions. Signed-off-by: Martin Storsjö --- libavcodec/utils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 4148264eb1..b2fdd32458 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1562,9 +1562,14 @@ size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_ta { int i, len, ret = 0; +#define TAG_PRINT(x) \ + (((x) >= '0' && (x) <= '9') || \ + ((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z') || \ + ((x) == '.' || (x) == ' ')) + for (i = 0; i < 4; i++) { len = snprintf(buf, buf_size, - isprint(codec_tag & 0xFF) ? "%c" : "[%d]", codec_tag & 0xFF); + TAG_PRINT(codec_tag & 0xFF) ? "%c" : "[%d]", codec_tag & 0xFF); buf += len; buf_size = buf_size > len ? buf_size - len : 0; ret += len;