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

James Almer jamrial at gmail.com
Mon May 8 01:30:03 EEST 2023


On 5/7/2023 6:20 PM, Stefano Sabatini wrote:
> 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.

A line about how these are options whose values are changed by the 
demuxer and thus exported back to the caller?

> 
>> 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?

Sure.

> 
> [...]
> 
> LGTM otherwise.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list