avcodec: Allow choosing the dump format field separator.
The default is to maintain the previous ", " for now. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
f22f873ef0
commit
e051d09c58
@ -3079,6 +3079,17 @@ typedef struct AVCodecContext {
|
|||||||
* - decoding: unused.
|
* - decoding: unused.
|
||||||
*/
|
*/
|
||||||
uint16_t *chroma_intra_matrix;
|
uint16_t *chroma_intra_matrix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dump format seperator.
|
||||||
|
* can be ", " or "\n " or anything else
|
||||||
|
* Code outside libavcodec should access this field using AVOptions
|
||||||
|
* (NO direct access).
|
||||||
|
* - encoding: Set by user.
|
||||||
|
* - decoding: Set by user.
|
||||||
|
*/
|
||||||
|
uint8_t *dump_separator;
|
||||||
|
|
||||||
} AVCodecContext;
|
} AVCodecContext;
|
||||||
|
|
||||||
AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx);
|
AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx);
|
||||||
|
@ -469,6 +469,7 @@ static const AVOption avcodec_options[] = {
|
|||||||
{"bb", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_BB }, 0, 0, V|D|E, "field_order" },
|
{"bb", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_BB }, 0, 0, V|D|E, "field_order" },
|
||||||
{"tb", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_TB }, 0, 0, V|D|E, "field_order" },
|
{"tb", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_TB }, 0, 0, V|D|E, "field_order" },
|
||||||
{"bt", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_BT }, 0, 0, V|D|E, "field_order" },
|
{"bt", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_BT }, 0, 0, V|D|E, "field_order" },
|
||||||
|
{"dump_separator", "set information dump field separator", OFFSET(dump_separator), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, A|V|S|D|E},
|
||||||
{NULL},
|
{NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2950,6 +2950,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
|
|||||||
int bitrate;
|
int bitrate;
|
||||||
int new_line = 0;
|
int new_line = 0;
|
||||||
AVRational display_aspect_ratio;
|
AVRational display_aspect_ratio;
|
||||||
|
const char *separator = enc->dump_separator ? enc->dump_separator : ", ";
|
||||||
|
|
||||||
if (!buf || buf_size <= 0)
|
if (!buf || buf_size <= 0)
|
||||||
return;
|
return;
|
||||||
@ -2987,7 +2988,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
|
|||||||
char detail[256] = "(";
|
char detail[256] = "(";
|
||||||
const char *colorspace_name;
|
const char *colorspace_name;
|
||||||
|
|
||||||
av_strlcat(buf, "\n ", buf_size);
|
av_strlcat(buf, separator, buf_size);
|
||||||
|
|
||||||
snprintf(buf + strlen(buf), buf_size - strlen(buf),
|
snprintf(buf + strlen(buf), buf_size - strlen(buf),
|
||||||
"%s", enc->pix_fmt == AV_PIX_FMT_NONE ? "none" :
|
"%s", enc->pix_fmt == AV_PIX_FMT_NONE ? "none" :
|
||||||
@ -3039,7 +3040,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AVMEDIA_TYPE_AUDIO:
|
case AVMEDIA_TYPE_AUDIO:
|
||||||
av_strlcat(buf, "\n ", buf_size);
|
av_strlcat(buf, separator, buf_size);
|
||||||
if (enc->sample_rate) {
|
if (enc->sample_rate) {
|
||||||
snprintf(buf + strlen(buf), buf_size - strlen(buf),
|
snprintf(buf + strlen(buf), buf_size - strlen(buf),
|
||||||
"%d Hz, ", enc->sample_rate);
|
"%d Hz, ", enc->sample_rate);
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
#include "libavutil/version.h"
|
#include "libavutil/version.h"
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_MAJOR 56
|
#define LIBAVCODEC_VERSION_MAJOR 56
|
||||||
#define LIBAVCODEC_VERSION_MINOR 3
|
#define LIBAVCODEC_VERSION_MINOR 4
|
||||||
#define LIBAVCODEC_VERSION_MICRO 101
|
#define LIBAVCODEC_VERSION_MICRO 100
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||||
LIBAVCODEC_VERSION_MINOR, \
|
LIBAVCODEC_VERSION_MINOR, \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user