The build system still needs some love regarding Doxygen,
looking into it...
On Mon, Feb 10, 2014 at 09:23:40PM +0100, Anton Khirnov wrote:
> --- /dev/null
> +++ b/doc/examples/filter_audio.c
> @@ -0,0 +1,362 @@
> +
> +/**
> + * @file
> + * libavfilter API use example.
usage
> + * @example doc/examples/filter.c
This does not match the file name.
> + * This example will generate a sine wave audio
> + * pass it through a simple filter chain, and then compute the md5 checksum
> of
> + * the output data
Add a comma after audio, MD5, end in a period.
> + * The filter chain it uses is:
> + * (input) -> abuffer -> volume -> aformat -> abuffersink -> (output)
> + *
> + * abuffer: this provides the endpoint where you can feed the decoded
> samples.
> + * volume: in this example we hardcode it to 0.90
> + * aformat: this converts the samples to the samplefreq, channel layout,
> + * and sample format required by the audio device.
> + * abuffersink: this provides the endpoint where you can read the samples
> after
> + * they have passed through the filter chain.
> + */
Start sentences capitalized.
> +#define INPUT_SAMPLERATE 48000
> +#define INPUT_FORMAT AV_SAMPLE_FMT_FLTP
> +#define INPUT_CHANNEL_LAYOUT AV_CH_LAYOUT_5POINT0
nit: align
> +static int init_filter_graph(AVFilterGraph **graph, AVFilterContext **src,
> AVFilterContext **sink)
nit: long line
> + /* create the abuffer filter
> + * it will be used for feeding the data into the graph */
I suggest proper punctuation in comments consisting of multiple sentences.
It increases readability.
> + /* set the filter options through the AVOptions API */
> + av_get_channel_layout_string(ch_layout, sizeof(ch_layout), 0,
> INPUT_CHANNEL_LAYOUT);
> + av_opt_set (abuffer_ctx, "channel_layout", ch_layout ,
> AV_OPT_SEARCH_CHILDREN);
> + av_opt_set (abuffer_ctx, "sample_fmt",
> av_get_sample_fmt_name(INPUT_FORMAT), AV_OPT_SEARCH_CHILDREN);
> + av_opt_set_q (abuffer_ctx, "time_base", (AVRational){ 1,
> INPUT_SAMPLERATE }, AV_OPT_SEARCH_CHILDREN);
> + av_opt_set_int(abuffer_ctx, "sample_rate", INPUT_SAMPLERATE,
> AV_OPT_SEARCH_CHILDREN);
stray spaces before comma
> + /* create the aformat filter
> + * it ensures that the output is of the format we want */
see above
> + /* finally create the abuffersink filter
> + * it will be used to get the filtered data out of the graph */
again
Why not just use proper punctuation everywhere?
> + /* connect the filters
> + * in this simple case the filters just form a linear chain */
ditto
> + /* configure the graph*/
missing space before *
> +/* this function does something useful with the filtered data in this simple
> + * example we just print the md5 checksum of each plane to stdout */
MD5
> +/* this function constructs a frame of audio data to be filtered
> + * in this simple example we just synthesise sine wave */
Here and above I'd drop "this function" and just directly explain what
the function does.
> + /* setup the filtergraph */
set up
> + av_freep(&md5);
> +
> + return 0;
> +fail:
> + av_strerror(err, errstr, sizeof(errstr));
> + fprintf(stderr, "%s\n", errstr);
> + return 1;
> +}
I suggest an empty line before the goto label.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel