]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/avfilter.h
typo in the mail, the 4am commit is always the worst
[ffmpeg] / libavfilter / avfilter.h
index a3b646488aca5965d774d8734b41b25dbfcf23e0..9f455bb4474e3a644697b9c7df12e701e23b694a 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef FFMPEG_AVFILTER_H
-#define FFMPEG_AVFILTER_H
+#ifndef AVFILTER_AVFILTER_H
+#define AVFILTER_AVFILTER_H
 
-#define LIBAVFILTER_VERSION      0.0.0
+#define LIBAVFILTER_VERSION_MAJOR  0
+#define LIBAVFILTER_VERSION_MINOR  4
+#define LIBAVFILTER_VERSION_MICRO  0
+
+#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
+                                               LIBAVFILTER_VERSION_MINOR, \
+                                               LIBAVFILTER_VERSION_MICRO)
+#define LIBAVFILTER_VERSION     AV_VERSION(LIBAVFILTER_VERSION_MAJOR,   \
+                                           LIBAVFILTER_VERSION_MINOR,   \
+                                           LIBAVFILTER_VERSION_MICRO)
+#define LIBAVFILTER_BUILD       LIBAVFILTER_VERSION_INT
 
 #include <stddef.h>
-#include "avcodec.h"
+#include "libavcodec/avcodec.h"
+
+/**
+ * Returns the LIBAVFILTER_VERSION_INT constant.
+ */
+unsigned avfilter_version(void);
 
 typedef struct AVFilterContext AVFilterContext;
 typedef struct AVFilterLink    AVFilterLink;
@@ -110,7 +125,7 @@ void avfilter_unref_pic(AVFilterPicRef *ref);
  * list of the formats supported by each input and output pad. The list
  * given for each pad need not be distinct - they may be references to the
  * same list of formats, as is often the case when a filter supports multiple
- * formats, but will always outut the same format as it is given in input.
+ * formats, but will always output the same format as it is given in input.
  *
  * In this way, a list of possible input formats and a list of possible
  * output formats are associated with each link. When a set of formats is
@@ -169,8 +184,8 @@ AVFilterFormats *avfilter_all_colorspaces(void);
 
 /**
  * Returns a format list which contains the intersection of the formats of
- * a and b. And all the references of a and b, and a and b will be
- * deallocated.
+ * a and b. Also, all the references of a, all the references of b, and
+ * a and b themselves will be deallocated.
  *
  * If a and b do not share any common formats, neither is modified, and NULL
  * is returned.
@@ -178,22 +193,32 @@ AVFilterFormats *avfilter_all_colorspaces(void);
 AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b);
 
 /**
- * Adds *ref as a new reference to f.
+ * Adds *ref as a new reference to formats.
  * That is the pointers will point like in the ascii art below:
  *   ________
- *  |   f    |<--------.
- *  |  ____  |         |
- *  | |refs| |       __|_
- *  | |* * | |      |  | |
+ *  |formats |<--------.
+ *  |  ____  |     ____|___________________
+ *  | |refs| |    |  __|_
+ *  | |* * | |    | |  | |  AVFilterLink
  *  | |* *--------->|*ref|
- *  | |____| |      |____|
- *  |________|
+ *  | |____| |    | |____|
+ *  |________|    |________________________
  */
-void avfilter_formats_ref(AVFilterFormats *f, AVFilterFormats **ref);
+void avfilter_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref);
 
 /**
  * Remove *ref as a reference to the format list it currently points to,
  * deallocate that list if this was the last reference, and set *ref to NULL.
+ *
+ *         Before                                 After
+ *   ________                               ________         NULL
+ *  |formats |<--------.                   |formats |         ^
+ *  |  ____  |     ____|________________   |  ____  |     ____|________________
+ *  | |refs| |    |  __|_                  | |refs| |    |  __|_
+ *  | |* * | |    | |  | |  AVFilterLink   | |* * | |    | |  | |  AVFilterLink
+ *  | |* *--------->|*ref|                 | |*   | |    | |*ref|
+ *  | |____| |    | |____|                 | |____| |    | |____|
+ *  |________|    |_____________________   |________|    |_____________________
  */
 void avfilter_formats_unref(AVFilterFormats **ref);
 
@@ -201,7 +226,7 @@ void avfilter_formats_unref(AVFilterFormats **ref);
  *
  *         Before                                 After
  *   ________                         ________
- *  |   f    |<---------.            |   f    |<---------.
+ *  |formats |<---------.            |formats |<---------.
  *  |  ____  |       ___|___         |  ____  |       ___|___
  *  | |refs| |      |   |   |        | |refs| |      |   |   |   NULL
  *  | |* *--------->|*oldref|        | |* *--------->|*newref|     ^
@@ -232,7 +257,7 @@ struct AVFilterPad
     enum CodecType type;
 
     /**
-     * Minimum required permissions on incoming buffers.  Any buffers with
+     * Minimum required permissions on incoming buffers.  Any buffer with
      * insufficient permissions will be automatically copied by the filter
      * system to a new buffer which provides the needed access permissions.
      *
@@ -242,9 +267,10 @@ struct AVFilterPad
 
     /**
      * Permissions which are not accepted on incoming buffers.  Any buffer
-     * which has any of these permissions set be automatically copied by the
-     * filter system to a new buffer which does not have those permissions.
-     * This can be used to easily disallow buffers with AV_PERM_REUSE.
+     * which has any of these permissions set will be automatically copied
+     * by the filter system to a new buffer which does not have those
+     * permissions.  This can be used to easily disallow buffers with
+     * AV_PERM_REUSE.
      *
      * Input pads only.
      */
@@ -321,15 +347,17 @@ struct AVFilterPad
     int (*config_props)(AVFilterLink *link);
 };
 
-/** Default handler for start_frame() for video inputs */
+/** default handler for start_frame() for video inputs */
 void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref);
-/** Default handler for end_frame() for video inputs */
+/** default handler for draw_slice() for video inputs */
+void avfilter_default_draw_slice(AVFilterLink *link, int y, int h);
+/** default handler for end_frame() for video inputs */
 void avfilter_default_end_frame(AVFilterLink *link);
-/** Default handler for config_props() for video outputs */
+/** default handler for config_props() for video outputs */
 int avfilter_default_config_output_link(AVFilterLink *link);
-/** Default handler for config_props() for video inputs */
+/** default handler for config_props() for video inputs */
 int avfilter_default_config_input_link (AVFilterLink *link);
-/** Default handler for get_video_buffer() for video inputs */
+/** default handler for get_video_buffer() for video inputs */
 AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link,
                                                   int perms);
 /**
@@ -382,7 +410,7 @@ typedef struct
 /** An instance of a filter */
 struct AVFilterContext
 {
-    AVClass *av_class;              ///< needed for av_log()
+    const AVClass *av_class;              ///< needed for av_log()
 
     AVFilter *filter;               ///< the AVFilter of which this is an instance
 
@@ -401,10 +429,10 @@ struct AVFilterContext
 
 /**
  * A link between two filters.  This contains pointers to the source and
- * destination filters between which this link exists, and the indices of
+ * destination filters between which this link exists, and the indexes of
  * the pads involved.  In addition, this link also contains the parameters
  * which have been negotiated and agreed upon between the filter, such as
- * image dimensions, format, etc
+ * image dimensions, format, etc.
  */
 struct AVFilterLink
 {
@@ -465,7 +493,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
 int avfilter_config_links(AVFilterContext *filter);
 
 /**
- * Request a picture buffer with a specific set of permissions
+ * Request a picture buffer with a specific set of permissions.
  * @param link  the output link to the filter from which the picture will
  *              be requested
  * @param perms the required access permissions
@@ -484,7 +512,8 @@ int avfilter_request_frame(AVFilterLink *link);
 /**
  * Poll a frame from the filter chain.
  * @param  link the input link
- * @return      the number of imediately available frames
+ * @return the number of immediately available frames, a negative
+ * number in case of error
  */
 int avfilter_poll_frame(AVFilterLink *link);
 
@@ -499,7 +528,7 @@ int avfilter_poll_frame(AVFilterLink *link);
 void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref);
 
 /**
- * Notify the next filter that the current frame has finished
+ * Notify the next filter that the current frame has finished.
  * @param link the output link the frame was sent over
  */
 void avfilter_end_frame(AVFilterLink *link);
@@ -587,7 +616,7 @@ void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
                          AVFilterPad **pads, AVFilterLink ***links,
                          AVFilterPad *newpad);
 
-/** insert a new input pad for the filter */
+/** Insert a new input pad for the filter. */
 static inline void avfilter_insert_inpad(AVFilterContext *f, unsigned index,
                                          AVFilterPad *p)
 {
@@ -595,7 +624,7 @@ static inline void avfilter_insert_inpad(AVFilterContext *f, unsigned index,
                         &f->input_pads, &f->inputs, p);
 }
 
-/** insert a new output pad for the filter */
+/** Insert a new output pad for the filter. */
 static inline void avfilter_insert_outpad(AVFilterContext *f, unsigned index,
                                           AVFilterPad *p)
 {
@@ -603,4 +632,4 @@ static inline void avfilter_insert_outpad(AVFilterContext *f, unsigned index,
                         &f->output_pads, &f->outputs, p);
 }
 
-#endif  /* FFMPEG_AVFILTER_H */
+#endif  /* AVFILTER_AVFILTER_H */