]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/formats.c
vf_select: check for isnan when setting t from pts
[ffmpeg] / libavfilter / formats.c
index eccb52304b50974a4255861323618d2a625c2135..214718b77911ddf08895e83c2495d88f66907d6a 100644 (file)
@@ -22,6 +22,7 @@
 #include "libavutil/pixdesc.h"
 #include "libavutil/audioconvert.h"
 #include "avfilter.h"
+#include "internal.h"
 
 /**
  * Add all refs from a to ret and destroy a.
@@ -73,6 +74,17 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
     return ret;
 }
 
+int ff_fmt_is_in(int fmt, const int *fmts)
+{
+    const int *p;
+
+    for (p = fmts; *p != -1; p++) {
+        if (fmt == *p)
+            return 1;
+    }
+    return 0;
+}
+
 #define MAKE_FORMAT_LIST()                                              \
     AVFilterFormats *formats;                                           \
     int count = 0;                                                      \
@@ -161,6 +173,17 @@ AVFilterFormats *avfilter_all_channel_layouts(void)
     return avfilter_make_format64_list(chlayouts);
 }
 
+AVFilterFormats *avfilter_all_packing_formats(void)
+{
+    static int packing[] = {
+        AVFILTER_PACKED,
+        AVFILTER_PLANAR,
+        -1,
+    };
+
+    return avfilter_make_format_list(packing);
+}
+
 void avfilter_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
 {
     *ref = f;