I would like to use the lame encoder in an embedded application. I have it
all up and running but I have had to make some alterations to the code base:

1) Enforced the use of the macros at the end of util.h - there are a number
of places where the code still uses fflush(stderr), etc.

2) Changed the macros to make calls via function pointers rather than
explicitly using stdout/stderr. The pointers by default map to printf and
fprintf(stderr). However, an application using the lame library can redirect
them to use the applications own private reporting system.

3) Added a set of function pointers to the lame_global_flags structure to
use for bitrate history and time status reports. Again, the defaults for
these are to use the built in code however, an application can set them to
its own versions.

4) Wrapped lots of code with makefile level defines to turn it on/off:
    All the bitrate history code is wrapped with NO_BRHIST.
    All the timestatus code is wrapped with NO_TIMESTATUS.
    All the analysis code is wrapped with NO_ANALYSIS. The front end for
this does not have to be GTK so the stuff inside the library should not
really be called gtk*. Hence the extra define rather than re-using HAVEGTK.

5) Moved a number of files outside of libmp3lame. Stuff like parse.c,
gtk*.[ch] & get_audio.c are really parts of the standard LAME command line
frontend rather than the LAME library. As such, they do not really belong in
the library IMHO.


The net result of all this is that my version of the LAME library is fully
embeddable in that it makes no assumptions on how it interacts with either
the user or the rest of the system (no dependance on stdout/stderr, no code
that is only used by a non-existant command line interface, etc.).

My changes are all based on the release of 3.86. I do not have a CVS setup
at present so I don't have the latest source nor can I check my changes in.
Does anyone have any problems with my proposed changes? Would anyone be
interested in me producing a patch file between my code and 3.86 so that
they can check it in?



John Harrison
For and on behalf of myself.

--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to