[FFmpeg-devel] [RFC] print license and configuration for each lib

Måns Rullgård mans
Fri Oct 30 19:53:39 CET 2009


Diego Biurrun <diego at biurrun.de> writes:

> On Wed, Oct 28, 2009 at 06:59:11PM +0000, M?ns Rullg?rd wrote:
>> Diego Biurrun <diego at biurrun.de> writes:
>> 
>> > Here's something I started and wanted to have some feedback on before I
>> > progress.  Sometimes it can be useful to have the exact configuration
>> > and license string in each library and have it printed by each library.
>> >
>> > Here is a proof of concept patch that does it for libavutil and
>> > libavcodec.  Once the chinks are worked out I can lather, rinse, repeat
>> > for the others.
>> >
>> > I made two alternative implementations, choose the one you prefer.
>> > Things that could possibly be improved (but might not be worth the
>> > trouble):
>> >
>> > - The licensing information for each library could be more detailed.
>> >   For example, libavutil is always LGPL, even when FFmpeg was compiled
>> >   in GPL mode.
>> > - Use a single function to perform the job.
>> >
>> > +void avutil_configuration(void)
>> > +{
>> > +    const char* configuration = "libavutil configuration: " FFMPEG_CONFIGURATION;
>> > +    av_log(NULL, AV_LOG_INFO, "%s\n", configuration);
>> > +}
>> > +
>> > +void avutil_license(void)
>> > +{
>> > +    const char* libavutil_license = "libavutil license: "FFMPEG_LICENSE;
>> > +    av_log(NULL, AV_LOG_INFO, "%s\n", libavutil_license);
>> > +}
>> 
>> Returning the string would probably be more flexible.
>
> Like I have done in $attached for libavcodec?  Anything else?
>
> +const char* avcodec_configuration(void)
> +{
> +    return "libavcodec configuration: " FFMPEG_CONFIGURATION "\n";
> +}
> +
> +const char* avcodec_license(void)
> +{
> +    return "libavcodec license: " FFMPEG_LICENSE "\n";
> +}

Drop the "libfoo thing:" prefixes.  Whatever is using the string can
add those in a way that makes sense in its context.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list