[FFmpeg-devel] [PATCH] fftools/ffprobe: print exported stream AVOptions

Stefano Sabatini stefasab at gmail.com
Mon May 8 00:20:50 EEST 2023


On date Friday 2023-05-05 20:18:56 -0300, James Almer wrote:
> Similar to the decoder AVOptions above.

Please briefly specify the use case in the log.

> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  fftools/ffprobe.c             | 12 ++++++++++++
>  tests/ref/fate/flv-demux      |  4 ++--
>  tests/ref/fate/ts-demux       |  6 +++---
>  tests/ref/fate/ts-opus-demux  |  2 +-
>  tests/ref/fate/ts-small-demux |  2 +-
>  5 files changed, 19 insertions(+), 7 deletions(-)
> 
> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> index 43bf10db54..9599b3b1b2 100644
> --- a/fftools/ffprobe.c
> +++ b/fftools/ffprobe.c
> @@ -3127,6 +3127,18 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
>          }
>      }
>  
> +    if (fmt_ctx->iformat->priv_class && show_private_data) {
> +        const AVOption *opt = NULL;
> +        while (opt = av_opt_next(fmt_ctx->priv_data, opt)) {
> +            uint8_t *str;
> +            if (!(opt->flags & AV_OPT_FLAG_EXPORT)) continue;
> +            if (av_opt_get(fmt_ctx->priv_data, opt->name, 0, &str) >= 0) {
> +                print_str(opt->name, str);
> +                av_free(str);
> +            }
> +        }
> +    }

maybe factorize with the other similar code?

[...]

LGTM otherwise.


More information about the ffmpeg-devel mailing list