diff mbox series

[FFmpeg-devel] avfilter/vf_scale: don't expose framesync options in vf_scale2ref

Message ID 20240505140219.3508-1-jamrial@gmail.com
State Accepted
Commit eb392e41004c825551693d84db24666853950e4b
Headers show
Series [FFmpeg-devel] avfilter/vf_scale: don't expose framesync options in vf_scale2ref | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer May 5, 2024, 2:02 p.m. UTC
It doesn't use it.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavfilter/vf_scale.c | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 60d301dcd8..07e9025335 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -1228,7 +1228,7 @@  static const AVOption scale_options[] = {
 };
 
 static const AVClass scale_class = {
-    .class_name       = "scale(2ref)",
+    .class_name       = "scale",
     .item_name        = av_default_item_name,
     .option           = scale_options,
     .version          = LIBAVUTIL_VERSION_INT,
@@ -1268,6 +1268,31 @@  const AVFilter ff_vf_scale = {
     .flags           = AVFILTER_FLAG_DYNAMIC_INPUTS,
 };
 
+static const AVClass *scale2ref_child_class_iterate(void **iter)
+{
+    const AVClass *c = *iter ? NULL : sws_get_class();
+    *iter = (void*)(uintptr_t)c;
+    return c;
+}
+
+static void *scale2ref_child_next(void *obj, void *prev)
+{
+    ScaleContext *s = obj;
+    if (!prev)
+        return s->sws_opts;
+    return NULL;
+}
+
+static const AVClass scale2ref_class = {
+    .class_name       = "scale(2ref)",
+    .item_name        = av_default_item_name,
+    .option           = scale_options,
+    .version          = LIBAVUTIL_VERSION_INT,
+    .category         = AV_CLASS_CATEGORY_FILTER,
+    .child_class_iterate = scale2ref_child_class_iterate,
+    .child_next          = scale2ref_child_next,
+};
+
 static const AVFilterPad avfilter_vf_scale2ref_inputs[] = {
     {
         .name         = "default",
@@ -1303,7 +1328,7 @@  const AVFilter ff_vf_scale2ref = {
     .init            = init,
     .uninit          = uninit,
     .priv_size       = sizeof(ScaleContext),
-    .priv_class      = &scale_class,
+    .priv_class      = &scale2ref_class,
     FILTER_INPUTS(avfilter_vf_scale2ref_inputs),
     FILTER_OUTPUTS(avfilter_vf_scale2ref_outputs),
     FILTER_QUERY_FUNC(query_formats),