On Fri, Jun 11, 2021 at 10:38 PM Diederick Niehorster <dcni...@gmail.com> wrote: > > This function allows formatting an option value stored in a double (such > as the min and max fields of an AVOption, or min_value and max_value of > an AVOptionRange) properly, e.g. 1 for a AV_OPT_TYPE_PIXEL_FMT -> yuyv422. > > Useful when printing more info about an option than just its value. > Usage will be shown in upcoming device_get_capabilities example.
This solution is not perfect, since multiple of the options returned are not formatted properly now: - "codec", which is just printed as int since there is no AV_OPT_TYPE_CODEC or something like that - "frame_size"/"window_size": these are reported as three components: "pixel_count", "width", "height", none of which have a known type (and thus we default to printing the provided double. The other solution which enables handling this is to add a new function avdevice_capabilities_print, which you pass a single AVOptionRange* (not AVOptionRanges** as that would create many lines of output) and it returns a formatted string. In the implementation of that function, since we know all the options (and related components), we can special-case the formatting where needed so that it all comes out right. Cheers, Dee _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".