[FFmpeg-cvslog] lavfi/setfield: add "progressive" option

Tim Nicholson git at videolan.org
Sat Apr 21 10:16:23 CEST 2012


ffmpeg | branch: master | Tim Nicholson <Tim.Nicholson at bbc.co.uk> | Fri Apr 20 10:51:42 2012 +0100| [c97201dd29d2762ae79cd09865793e5a1b74d4c0] | committer: Stefano Sabatini

lavfi/setfield: add "progressive" option

Add "prog" parameter value, and deprecate numeric values.

Signed-off-by: Stefano Sabatini <stefasab at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c97201dd29d2762ae79cd09865793e5a1b74d4c0
---

 doc/filters.texi          |   14 ++++++++------
 libavfilter/version.h     |    2 +-
 libavfilter/vf_setfield.c |   21 +++++++++++++--------
 3 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 6433593..5629977 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -2534,19 +2534,21 @@ Force field for the output video frame.
 The @code{setfield} filter marks the interlace type field for the
 output frames. It does not change the input frame, but only sets the
 corresponding property, which affects how the frame is treated by
-followig filters (e.g. @code{fieldorder} or @code{yadif}).
+following filters (e.g. @code{fieldorder} or @code{yadif}).
 
-It accepts a parameter representing an integer or a string, which can
-assume the following values:
+It accepts a string parameter, which can assume the following values:
 @table @samp
- at item -1, auto
+ at item auto
 Keep the same field property.
 
- at item 0, bff
+ at item bff
 Mark the frame as bottom-field-first.
 
- at item 1, tff
+ at item tff
 Mark the frame as top-field-first.
+
+ at item prog
+Mark the frame as progressive.
 @end table
 
 @section setpts
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 7ff2c35..361155f 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -30,7 +30,7 @@
 
 #define LIBAVFILTER_VERSION_MAJOR  2
 #define LIBAVFILTER_VERSION_MINOR 71
-#define LIBAVFILTER_VERSION_MICRO 101
+#define LIBAVFILTER_VERSION_MICRO 102
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
                                                LIBAVFILTER_VERSION_MINOR, \
diff --git a/libavfilter/vf_setfield.c b/libavfilter/vf_setfield.c
index bfb8006..6a9bf58 100644
--- a/libavfilter/vf_setfield.c
+++ b/libavfilter/vf_setfield.c
@@ -40,21 +40,24 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
         if (sscanf(args, "%d%c", &setfield->top_field_first, &c) != 1) {
             if      (!strcmp("tff",  args)) setfield->top_field_first = 1;
             else if (!strcmp("bff",  args)) setfield->top_field_first = 0;
+            else if (!strcmp("prog", args)) setfield->top_field_first = 2;
             else if (!strcmp("auto", args)) setfield->top_field_first = -1;
             else {
                 av_log(ctx, AV_LOG_ERROR, "Invalid argument '%s'\n", args);
                 return AVERROR(EINVAL);
             }
+        } else {
+            if (setfield->top_field_first < -1 || setfield->top_field_first > 1) {
+                av_log(ctx, AV_LOG_ERROR,
+                       "Provided integer value %d must be included between -1 and +1\n",
+                       setfield->top_field_first);
+                return AVERROR(EINVAL);
+            }
+            av_log(ctx, AV_LOG_WARNING,
+                   "Using -1/0/1 is deprecated, use auto/tff/bff/prog\n", args);
         }
     }
 
-    if (setfield->top_field_first < -1 || setfield->top_field_first > 1) {
-        av_log(ctx, AV_LOG_ERROR,
-               "Provided integer value %d must be included between -1 and +1\n",
-               setfield->top_field_first);
-        return AVERROR(EINVAL);
-    }
-
     return 0;
 }
 
@@ -63,7 +66,9 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
     SetFieldContext *setfield = inlink->dst->priv;
     AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
 
-    if (setfield->top_field_first != -1) {
+    if (setfield->top_field_first == 2) {
+        outpicref->video->interlaced = 0;
+    } else if (setfield->top_field_first != -1) {
         outpicref->video->interlaced = 1;
         outpicref->video->top_field_first = setfield->top_field_first;
     }



More information about the ffmpeg-cvslog mailing list