[FFmpeg-cvslog] lavfi: add avfilter_pad_get_type() and avfilter_pad_get_name().

Anton Khirnov git at videolan.org
Wed Jun 13 23:02:28 CEST 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Jun 12 19:57:57 2012 +0200| [84b9fbe05578c8b4058e72bb0b203665a446a95a] | committer: Anton Khirnov

lavfi: add avfilter_pad_get_type() and avfilter_pad_get_name().

This will allow making AVFilterPad opaque for the calling apps, since
those are the only two fields that can be useful to the users.

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

 doc/APIchanges         |    5 +++++
 libavfilter/avfilter.c |   10 ++++++++++
 libavfilter/avfilter.h |   22 ++++++++++++++++++++++
 libavfilter/version.h  |    2 +-
 4 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 729bddc..e0fec3c 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,11 @@ libavutil:     2011-04-18
 
 API changes, most recent first:
 
+2012-xx-xx - xxxxxxx - lavfi 2.22.0 - avfilter.h
+  Add avfilter_pad_get_type() and avfilter_pad_get_name(). Those
+  should now be used instead of accessing AVFilterPad members
+  directly.
+
 2012-xx-xx - xxxxxxx - lavu 51.32.0 - audioconvert.h
   Add av_get_channel_layout_channel_index(), av_get_channel_name()
   and av_channel_layout_extract_channel().
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 9b62be3..0507b2a 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -429,6 +429,16 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
     return ret;
 }
 
+const char *avfilter_pad_get_name(AVFilterPad *pads, int pad_idx)
+{
+    return pads[pad_idx].name;
+}
+
+enum AVMediaType avfilter_pad_get_type(AVFilterPad *pads, int pad_idx)
+{
+    return pads[pad_idx].type;
+}
+
 #if FF_API_DEFAULT_CONFIG_OUTPUT_LINK
 int avfilter_default_config_output_link(AVFilterLink *link)
 {
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 7fbc160..7ee18fb 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -359,6 +359,28 @@ struct AVFilterPad {
     int (*config_props)(AVFilterLink *link);
 };
 
+/**
+ * Get the name of an AVFilterPad.
+ *
+ * @param pads an array of AVFilterPads
+ * @param pad_idx index of the pad in the array it; is the caller's
+ *                responsibility to ensure the index is valid
+ *
+ * @return name of the pad_idx'th pad in pads
+ */
+const char *avfilter_pad_get_name(AVFilterPad *pads, int pad_idx);
+
+/**
+ * Get the type of an AVFilterPad.
+ *
+ * @param pads an array of AVFilterPads
+ * @param pad_idx index of the pad in the array; it is the caller's
+ *                responsibility to ensure the index is valid
+ *
+ * @return type of the pad_idx'th pad in pads
+ */
+enum AVMediaType avfilter_pad_get_type(AVFilterPad *pads, int pad_idx);
+
 #if FF_API_FILTERS_PUBLIC
 /** default handler for start_frame() for video inputs */
 attribute_deprecated
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 09cf4c6..d8baf0e 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -29,7 +29,7 @@
 #include "libavutil/avutil.h"
 
 #define LIBAVFILTER_VERSION_MAJOR  2
-#define LIBAVFILTER_VERSION_MINOR  21
+#define LIBAVFILTER_VERSION_MINOR  22
 #define LIBAVFILTER_VERSION_MICRO  0
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \



More information about the ffmpeg-cvslog mailing list