[FFmpeg-devel] [PATCH] example/filtering: extend comments about setting the filter graph endpoints

Clément Bœsch u at pkh.me
Wed Jan 28 12:25:30 CET 2015


On Tue, Jan 27, 2015 at 02:06:35PM +0100, Stefano Sabatini wrote:
> That part is a constant source of confusions for readers, this should
> help clarify the apparently inverted logic.
> ---
>  doc/examples/filtering_audio.c | 18 +++++++++++++++++-
>  doc/examples/filtering_video.c | 18 +++++++++++++++++-
>  2 files changed, 34 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/examples/filtering_audio.c b/doc/examples/filtering_audio.c
> index 46595fb..f5cb8eb 100644
> --- a/doc/examples/filtering_audio.c
> +++ b/doc/examples/filtering_audio.c
> @@ -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;
> diff --git a/doc/examples/filtering_video.c b/doc/examples/filtering_video.c
> index 601c3d8..c02040a 100644
> --- a/doc/examples/filtering_video.c
> +++ b/doc/examples/filtering_video.c
> @@ -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;

Damn.

Thanks a lot for this.

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150128/f95674c2/attachment.asc>


More information about the ffmpeg-devel mailing list