[PATCH 2/4] Prefix with "ff_" the functions: ff_avfilter_graph_check_validity() ff_avfilter_graph_config_links() ff_avfilter_graph_config_formats()

Stefano Sabatini stefano.sabatini-lala
Fri Nov 12 15:29:12 CET 2010


and move their declaration to internal.h. These functions are never
used in application code, so it is better to consider them internal
functions, this can be changed later if necessary. Simplify API.
---
 libavfilter/avfiltergraph.c |   13 +++++++------
 libavfilter/avfiltergraph.h |   27 +++------------------------
 libavfilter/internal.h      |   23 +++++++++++++++++++++++
 3 files changed, 33 insertions(+), 30 deletions(-)

diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 16c0355..b138e69 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -25,6 +25,7 @@
 
 #include "avfilter.h"
 #include "avfiltergraph.h"
+#include "internal.h"
 
 AVFilterGraph *avfilter_graph_alloc(void)
 {
@@ -52,7 +53,7 @@ int avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter)
     return 0;
 }
 
-int avfilter_graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx)
+int ff_avfilter_graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx)
 {
     AVFilterContext *filt;
     int i, j;
@@ -82,7 +83,7 @@ int avfilter_graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx)
     return 0;
 }
 
-int avfilter_graph_config_links(AVFilterGraph *graph, AVClass *log_ctx)
+int ff_avfilter_graph_config_links(AVFilterGraph *graph, AVClass *log_ctx)
 {
     AVFilterContext *filt;
     int i, ret;
@@ -194,7 +195,7 @@ static void pick_formats(AVFilterGraph *graph)
     }
 }
 
-int avfilter_graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx)
+int ff_avfilter_graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx)
 {
     /* find supported formats from sub-filters, and merge along links */
     if(query_formats(graph, log_ctx))
@@ -211,11 +212,11 @@ int avfilter_graph_config(AVFilterGraph *graphctx, AVClass *log_ctx)
 {
     int ret;
 
-    if ((ret = avfilter_graph_check_validity(graphctx, log_ctx)))
+    if ((ret = ff_avfilter_graph_check_validity(graphctx, log_ctx)))
         return ret;
-    if ((ret = avfilter_graph_config_formats(graphctx, log_ctx)))
+    if ((ret = ff_avfilter_graph_config_formats(graphctx, log_ctx)))
         return ret;
-    if ((ret = avfilter_graph_config_links(graphctx, log_ctx)))
+    if ((ret = ff_avfilter_graph_config_links(graphctx, log_ctx)))
         return ret;
 
     return 0;
diff --git a/libavfilter/avfiltergraph.h b/libavfilter/avfiltergraph.h
index 5bc8f0d..ca369aa 100644
--- a/libavfilter/avfiltergraph.h
+++ b/libavfilter/avfiltergraph.h
@@ -53,32 +53,11 @@ AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, char *name);
 int avfilter_graph_add_filter(AVFilterGraph *graphctx, AVFilterContext *filter);
 
 /**
- * Check for the validity of graph.
- *
- * A graph is considered valid if all its input and output pads are
- * connected.
- *
- * @return 0 in case of success, a negative value otherwise
- */
-int avfilter_graph_check_validity(AVFilterGraph *graphctx, AVClass *log_ctx);
-
-/**
- * Configure all the links of graphctx.
- *
- * @return 0 in case of success, a negative value otherwise
- */
-int avfilter_graph_config_links(AVFilterGraph *graphctx, AVClass *log_ctx);
-
-/**
- * Configure the formats of all the links in the graph.
- */
-int avfilter_graph_config_formats(AVFilterGraph *graphctx, AVClass *log_ctx);
-
-/**
  * Check validity and configure all the links and formats in the graph.
  *
- * @see avfilter_graph_check_validity(), avfilter_graph_config_links(),
- * avfilter_graph_config_formats()
+ * @param graphctx the filter graph
+ * @param log_ctx context used for logging
+ * @return 0 in case of success, a negative AVERROR code otherwise
  */
 int avfilter_graph_config(AVFilterGraph *graphctx, AVClass *log_ctx);
 
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 2f0dde1..37d085d 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -25,6 +25,7 @@
  */
 
 #include "avfilter.h"
+#include "avfiltergraph.h"
 
 void ff_dprintf_ref(void *ctx, AVFilterBufferRef *ref, int end);
 
@@ -34,4 +35,26 @@ void ff_dprintf_link(void *ctx, AVFilterLink *link, int end);
 
 #define FF_DPRINTF_START(ctx, func) dprintf(NULL, "%-16s: ", #func)
 
+/**
+ * Check for the validity of graph.
+ *
+ * A graph is considered valid if all its input and output pads are
+ * connected.
+ *
+ * @return 0 in case of success, a negative value otherwise
+ */
+int ff_avfilter_graph_check_validity(AVFilterGraph *graphctx, AVClass *log_ctx);
+
+/**
+ * Configure all the links of graphctx.
+ *
+ * @return 0 in case of success, a negative value otherwise
+ */
+int ff_avfilter_graph_config_links(AVFilterGraph *graphctx, AVClass *log_ctx);
+
+/**
+ * Configure the formats of all the links in the graph.
+ */
+int ff_avfilter_graph_config_formats(AVFilterGraph *graphctx, AVClass *log_ctx);
+
 #endif  /* AVFILTER_INTERNAL_H */
-- 
1.7.1


--OwLcNYc0lM97+oe1--



More information about the ffmpeg-devel mailing list