]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/avfilter.h
Reorder nut specific codec tags and add a comment for marking them as
[ffmpeg] / libavfilter / avfilter.h
index e2731336ccd3194cfcb3b65c29dea2b51622a5b0..716dc0b45fe2e5bcfa1653179ba9161328a77e46 100644 (file)
@@ -25,7 +25,7 @@
 #include "libavutil/avutil.h"
 
 #define LIBAVFILTER_VERSION_MAJOR  1
-#define LIBAVFILTER_VERSION_MINOR  9
+#define LIBAVFILTER_VERSION_MINOR 20
 #define LIBAVFILTER_VERSION_MICRO  0
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -47,12 +47,12 @@ unsigned avfilter_version(void);
 /**
  * Returns the libavfilter build-time configuration.
  */
-const char * avfilter_configuration(void);
+const char *avfilter_configuration(void);
 
 /**
  * Returns the libavfilter license.
  */
-const char * avfilter_license(void);
+const char *avfilter_license(void);
 
 
 typedef struct AVFilterContext AVFilterContext;
@@ -105,6 +105,7 @@ typedef struct AVFilterPicRef
     int h;                      ///< image height
 
     int64_t pts;                ///< presentation timestamp in units of 1/AV_TIME_BASE
+    int64_t pos;                ///< byte position in stream, -1 if unknown
 
     AVRational pixel_aspect;    ///< pixel aspect ratio
 
@@ -114,6 +115,9 @@ typedef struct AVFilterPicRef
 #define AV_PERM_PRESERVE 0x04   ///< nobody else can overwrite the buffer
 #define AV_PERM_REUSE    0x08   ///< can output the buffer multiple times, with the same contents each time
 #define AV_PERM_REUSE2   0x10   ///< can output the buffer multiple times, modified each time
+
+    int interlaced;             ///< is frame interlaced
+    int top_field_first;
 } AVFilterPicRef;
 
 /**
@@ -191,6 +195,16 @@ struct AVFilterFormats
  */
 AVFilterFormats *avfilter_make_format_list(const enum PixelFormat *pix_fmts);
 
+/**
+ * Adds pix_fmt to the list of pixel formats contained in *avff.
+ * If *avff is NULL the function allocates the filter formats struct
+ * and puts its pointer in *avff.
+ *
+ * @return a non negative value in case of success, or a negative
+ * value corresponding to an AVERROR code in case of error
+ */
+int avfilter_add_colorspace(AVFilterFormats **avff, enum PixelFormat pix_fmt);
+
 /**
  * Returns a list of all colorspaces supported by FFmpeg.
  */
@@ -221,8 +235,9 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b);
 void avfilter_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref);
 
 /**
- * Removes *ref as a reference to the format list it currently points to,
- * deallocates that list if this was the last reference, and sets *ref to NULL.
+ * If *ref is non-NULL, removes *ref as a reference to the format list
+ * it currently points to, deallocates that list if this was the last
+ * reference, and sets *ref to NULL.
  *
  *         Before                                 After
  *   ________                               ________         NULL
@@ -268,7 +283,7 @@ struct AVFilterPad
      * AVFilterPad type. Only video supported now, hopefully someone will
      * add audio in the future.
      */
-    enum CodecType type;
+    enum AVMediaType type;
 
     /**
      * Minimum required permissions on incoming buffers. Any buffer with
@@ -322,7 +337,7 @@ struct AVFilterPad
      *
      * Input video pads only.
      */
-    void (*draw_slice)(AVFilterLink *link, int y, int height);
+    void (*draw_slice)(AVFilterLink *link, int y, int height, int slice_dir);
 
     /**
      * Frame poll callback. This returns the number of immediately available
@@ -364,7 +379,7 @@ struct AVFilterPad
 /** default handler for start_frame() for video inputs */
 void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref);
 /** default handler for draw_slice() for video inputs */
-void avfilter_default_draw_slice(AVFilterLink *link, int y, int h);
+void avfilter_default_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
 /** default handler for end_frame() for video inputs */
 void avfilter_default_end_frame(AVFilterLink *link);
 /** default handler for config_props() for video outputs */
@@ -383,6 +398,19 @@ void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
 /** Default handler for query_formats() */
 int avfilter_default_query_formats(AVFilterContext *ctx);
 
+/** start_frame() handler for filters which simply pass video along */
+void avfilter_null_start_frame(AVFilterLink *link, AVFilterPicRef *picref);
+
+/** draw_slice() handler for filters which simply pass video along */
+void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
+
+/** end_frame() handler for filters which simply pass video along */
+void avfilter_null_end_frame(AVFilterLink *link);
+
+/** get_video_buffer() handler for filters which simply pass video along */
+AVFilterPicRef *avfilter_null_get_video_buffer(AVFilterLink *link,
+                                                  int perms, int w, int h);
+
 /**
  * Filter definition. This defines the pads a filter contains, and all the
  * callback functions used to interact with the filter.
@@ -409,11 +437,12 @@ typedef struct AVFilter
     void (*uninit)(AVFilterContext *ctx);
 
     /**
-     * Query formats supported by the filter and its pads. Should set the
+     * Queries formats supported by the filter and its pads, and sets the
      * in_formats for links connected to its output pads, and out_formats
      * for links connected to its input pads.
      *
-     * Should return zero on success.
+     * @return zero on success, a negative value corresponding to an
+     * AVERROR code otherwise
      */
     int (*query_formats)(AVFilterContext *);
 
@@ -425,11 +454,6 @@ typedef struct AVFilter
      * NULL_IF_CONFIG_SMALL() macro to define it.
      */
     const char *description;
-
-    /**
-     * The next registered filter, NULL if this is the last one.
-     */
-    struct AVFilter *next;
 } AVFilter;
 
 /** An instance of a filter */
@@ -563,11 +587,20 @@ void avfilter_end_frame(AVFilterLink *link);
 
 /**
  * Sends a slice to the next filter.
+ *
+ * Slices have to be provided in sequential order, either in
+ * top-bottom or bottom-top order. If slices are provided in
+ * non-sequential order the behavior of the function is undefined.
+ *
  * @param link the output link over which the frame is being sent
  * @param y    offset in pixels from the top of the image for this slice
  * @param h    height of this slice in pixels
+ * @param slice_dir the assumed direction for sending slices,
+ *             from the top slice to the bottom slice if the value is 1,
+ *             from the bottom slice to the top slice if the value is -1,
+ *             for other values the behavior of the function is undefined.
  */
-void avfilter_draw_slice(AVFilterLink *link, int y, int h);
+void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
 
 /** Initializes the filter system. Registers all builtin filters. */
 void avfilter_register_all(void);
@@ -594,6 +627,14 @@ int avfilter_register(AVFilter *filter);
  */
 AVFilter *avfilter_get_by_name(const char *name);
 
+/**
+ * If filter is NULL, returns a pointer to the first registered filter pointer,
+ * if filter is non-NULL, returns the next pointer after filter.
+ * If the returned pointer points to NULL, the last registered filter
+ * was already reached.
+ */
+AVFilter **av_filter_next(AVFilter **filter);
+
 /**
  * Creates a filter instance.
  * @param filter    the filter to create an instance of