[FFmpeg-cvslog] lavfi: add FF_*LINK_IDX convenience macros.
Nicolas George
git at videolan.org
Fri Jul 20 13:33:23 CEST 2012
ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Thu Jul 19 12:59:38 2012 +0200| [cb6a20fa5616f707e5249c1e949442a2e51e0765] | committer: Nicolas George
lavfi: add FF_*LINK_IDX convenience macros.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cb6a20fa5616f707e5249c1e949442a2e51e0765
---
libavfilter/internal.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index b80a6fe..5f0299c 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -350,4 +350,12 @@ int ff_request_frame(AVFilterLink *link);
AVFilterBufferRef *ff_copy_buffer_ref(AVFilterLink *outlink,
AVFilterBufferRef *ref);
+/**
+ * Find the index of a link.
+ *
+ * I.e. find i such that link == ctx->(in|out)puts[i]
+ */
+#define FF_INLINK_IDX(link) ((int)((link)->dstpad - (link)->dst->input_pads))
+#define FF_OUTLINK_IDX(link) ((int)((link)->srcpad - (link)->src->output_pads))
+
#endif /* AVFILTER_INTERNAL_H */
More information about the ffmpeg-cvslog
mailing list