diff options
author | James Almer <jamrial@gmail.com> | 2023-05-05 20:18:13 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2023-05-08 11:04:37 -0300 |
commit | 63d7ea38c79cb91b40b2f238ee13e2a18a1b7a50 (patch) | |
tree | 7b1ecbb651a4a9d77cdd329afd4a9b4d25169cb0 /fftools | |
parent | 2d43c23b812ade93b60f5025dd18bf55dbea5e3d (diff) | |
download | ffmpeg-63d7ea38c79cb91b40b2f238ee13e2a18a1b7a50.tar.gz |
fftools/ffprobe: print exported stream AVOptions
Similar to the decoder AVOptions, this is useful to show values from options
exported by the demuxer.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'fftools')
-rw-r--r-- | fftools/ffprobe.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 43bf10db54..1ff76ce809 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2398,6 +2398,19 @@ static void print_pkt_side_data(WriterContext *w, writer_print_section_footer(w); } +static void print_private_data(WriterContext *w, void *priv_data) +{ + const AVOption *opt = NULL; + while (opt = av_opt_next(priv_data, opt)) { + uint8_t *str; + if (!(opt->flags & AV_OPT_FLAG_EXPORT)) continue; + if (av_opt_get(priv_data, opt->name, 0, &str) >= 0) { + print_str(opt->name, str); + av_free(str); + } + } +} + static void print_color_range(WriterContext *w, enum AVColorRange color_range) { const char *val = av_color_range_name(color_range); @@ -2448,7 +2461,6 @@ static void print_chroma_location(WriterContext *w, enum AVChromaLocation chroma } } - static void clear_log(int need_lock) { int i; @@ -3115,16 +3127,11 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id break; } - if (dec_ctx && dec_ctx->codec->priv_class && show_private_data) { - const AVOption *opt = NULL; - while (opt = av_opt_next(dec_ctx->priv_data,opt)) { - uint8_t *str; - if (!(opt->flags & AV_OPT_FLAG_EXPORT)) continue; - if (av_opt_get(dec_ctx->priv_data, opt->name, 0, &str) >= 0) { - print_str(opt->name, str); - av_free(str); - } - } + if (show_private_data) { + if (dec_ctx && dec_ctx->codec->priv_class) + print_private_data(w, dec_ctx->priv_data); + if (fmt_ctx->iformat->priv_class) + print_private_data(w, fmt_ctx->priv_data); } if (fmt_ctx->iformat->flags & AVFMT_SHOW_IDS) print_fmt ("id", "0x%x", stream->id); |