mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-09-20 05:16:38 +00:00
avformat: 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
e051d09c58
commit
f0a6874de8
@ -1713,6 +1713,16 @@ typedef struct AVFormatContext {
|
|||||||
* via AVOptions (NO direct access).
|
* via AVOptions (NO direct access).
|
||||||
*/
|
*/
|
||||||
int64_t probesize2;
|
int64_t probesize2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dump format seperator.
|
||||||
|
* can be ", " or "\n " or anything else
|
||||||
|
* Code outside libavformat should access this field using AVOptions
|
||||||
|
* (NO direct access).
|
||||||
|
* - muxing: Set by user.
|
||||||
|
* - demuxing: Set by user.
|
||||||
|
*/
|
||||||
|
uint8_t *dump_separator;
|
||||||
} AVFormatContext;
|
} AVFormatContext;
|
||||||
|
|
||||||
int av_format_get_probe_score(const AVFormatContext *s);
|
int av_format_get_probe_score(const AVFormatContext *s);
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
#include "libavutil/log.h"
|
#include "libavutil/log.h"
|
||||||
#include "libavutil/mathematics.h"
|
#include "libavutil/mathematics.h"
|
||||||
|
#include "libavutil/opt.h"
|
||||||
#include "libavutil/avstring.h"
|
#include "libavutil/avstring.h"
|
||||||
#include "libavutil/replaygain.h"
|
#include "libavutil/replaygain.h"
|
||||||
#include "libavutil/stereo3d.h"
|
#include "libavutil/stereo3d.h"
|
||||||
@ -345,6 +346,7 @@ static void dump_stream_format(AVFormatContext *ic, int i,
|
|||||||
int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
|
int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
|
||||||
AVStream *st = ic->streams[i];
|
AVStream *st = ic->streams[i];
|
||||||
AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
|
AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
|
||||||
|
char *separator = ic->dump_separator;
|
||||||
|
|
||||||
avcodec_string(buf, sizeof(buf), st->codec, is_output);
|
avcodec_string(buf, sizeof(buf), st->codec, is_output);
|
||||||
av_log(NULL, AV_LOG_INFO, " Stream #%d:%d", index, i);
|
av_log(NULL, AV_LOG_INFO, " Stream #%d:%d", index, i);
|
||||||
@ -378,7 +380,7 @@ static void dump_stream_format(AVFormatContext *ic, int i,
|
|||||||
int tbc = st->codec->time_base.den && st->codec->time_base.num;
|
int tbc = st->codec->time_base.den && st->codec->time_base.num;
|
||||||
|
|
||||||
if (fps || tbr || tbn || tbc)
|
if (fps || tbr || tbn || tbc)
|
||||||
av_log(NULL, AV_LOG_INFO, "\n ");
|
av_log(NULL, AV_LOG_INFO, "%s", separator);
|
||||||
|
|
||||||
if (fps)
|
if (fps)
|
||||||
print_fps(av_q2d(st->avg_frame_rate), tbr || tbn || tbc ? "fps, " : "fps");
|
print_fps(av_q2d(st->avg_frame_rate), tbr || tbn || tbc ? "fps, " : "fps");
|
||||||
|
@ -96,6 +96,7 @@ static const AVOption avformat_options[] = {
|
|||||||
{"unofficial", "allow unofficial extensions", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, D|E, "strict"},
|
{"unofficial", "allow unofficial extensions", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, D|E, "strict"},
|
||||||
{"experimental", "allow non-standardized experimental variants", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, D|E, "strict"},
|
{"experimental", "allow non-standardized experimental variants", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, D|E, "strict"},
|
||||||
{"max_ts_probe", "maximum number of packets to read while waiting for the first timestamp", OFFSET(max_ts_probe), AV_OPT_TYPE_INT, { .i64 = 50 }, 0, INT_MAX, D },
|
{"max_ts_probe", "maximum number of packets to read while waiting for the first timestamp", OFFSET(max_ts_probe), AV_OPT_TYPE_INT, { .i64 = 50 }, 0, INT_MAX, D },
|
||||||
|
{"dump_separator", "set information dump field separator", OFFSET(dump_separator), AV_OPT_TYPE_STRING, {.str = ", "}, CHAR_MIN, CHAR_MAX, D|E},
|
||||||
{NULL},
|
{NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include "libavutil/version.h"
|
#include "libavutil/version.h"
|
||||||
|
|
||||||
#define LIBAVFORMAT_VERSION_MAJOR 56
|
#define LIBAVFORMAT_VERSION_MAJOR 56
|
||||||
#define LIBAVFORMAT_VERSION_MINOR 8
|
#define LIBAVFORMAT_VERSION_MINOR 9
|
||||||
#define LIBAVFORMAT_VERSION_MICRO 100
|
#define LIBAVFORMAT_VERSION_MICRO 100
|
||||||
|
|
||||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||||
|
Loading…
Reference in New Issue
Block a user