]> git.sesse.net Git - ffmpeg/commitdiff
examples/filtering: extend comments about setting the filter graph endpoints
authorStefano Sabatini <stefasab@gmail.com>
Tue, 27 Jan 2015 12:22:48 +0000 (13:22 +0100)
committerStefano Sabatini <stefasab@gmail.com>
Thu, 29 Jan 2015 10:12:39 +0000 (11:12 +0100)
That part is a constant source of confusions for readers, this should
help clarify the apparently inverted logic.

doc/examples/filtering_audio.c
doc/examples/filtering_video.c

index 46595fb3b8f062d065848a44a6b52957087e3043..f5cb8eb8a1a4ac20ca8b8560269068e16ced48ee 100644 (file)
@@ -145,12 +145,28 @@ static int init_filters(const char *filters_descr)
         goto end;
     }
 
-    /* Endpoints for the filter graph. */
+    /*
+     * Set the endpoints for the filter graph. The filter_graph will
+     * be linked to the graph described by filters_descr.
+     */
+
+    /*
+     * The buffer source output must be connected to the input pad of
+     * the first filter described by filters_descr; since the first
+     * filter input label is not specified, it is set to "in" by
+     * default.
+     */
     outputs->name       = av_strdup("in");
     outputs->filter_ctx = buffersrc_ctx;
     outputs->pad_idx    = 0;
     outputs->next       = NULL;
 
+    /*
+     * The buffer sink input must be connected to the output pad of
+     * the last filter described by filters_descr; since the last
+     * filter output label is not specified, it is set to "out" by
+     * default.
+     */
     inputs->name       = av_strdup("out");
     inputs->filter_ctx = buffersink_ctx;
     inputs->pad_idx    = 0;
index 601c3d87f0a419d433384df53e1f55e00083bf61..c02040ae3508e0f51f3ebb78d2688e17540ff4c7 100644 (file)
@@ -128,12 +128,28 @@ static int init_filters(const char *filters_descr)
         goto end;
     }
 
-    /* Endpoints for the filter graph. */
+    /*
+     * Set the endpoints for the filter graph. The filter_graph will
+     * be linked to the graph described by filters_descr.
+     */
+
+    /*
+     * The buffer source output must be connected to the input pad of
+     * the first filter described by filters_descr; since the first
+     * filter input label is not specified, it is set to "in" by
+     * default.
+     */
     outputs->name       = av_strdup("in");
     outputs->filter_ctx = buffersrc_ctx;
     outputs->pad_idx    = 0;
     outputs->next       = NULL;
 
+    /*
+     * The buffer sink input must be connected to the output pad of
+     * the last filter described by filters_descr; since the last
+     * filter output label is not specified, it is set to "out" by
+     * default.
+     */
     inputs->name       = av_strdup("out");
     inputs->filter_ctx = buffersink_ctx;
     inputs->pad_idx    = 0;