[FFmpeg-devel] [PATCH] Create a libavformat/version.h header
Fri Feb 27 00:13:41 CET 2009
On date Thursday 2009-02-26 14:41:34 -0800, Baptiste Coudurier encoded:
> Michael Niedermayer wrote:
> > On Tue, Feb 24, 2009 at 01:40:31PM -0800, Baptiste Coudurier wrote:
> >> Hi,
> >> On 2/24/2009 11:20 AM, Michael Niedermayer wrote:
> >>> On Tue, Feb 24, 2009 at 08:03:51PM +0100, Stefano Sabatini wrote:
> >>>> On date Monday 2009-02-23 00:39:31 +0100, Diego Biurrun encoded:
> >>>>> On Sun, Feb 22, 2009 at 04:37:43PM +0100, Stefano Sabatini wrote:
> >>>>>> the patch creates a separate version.h file, which makes possible to
> >>>>>> include in a project avio.h without to include before avformat.h.
> >>>>> Looks good to me, but you will need Michael to approve it.
> >>>> Michael?
> >>>> If we decide this is the way to go, then IMO this should be done
> >>>> before the release (currently being avio.h inclusion borken).
> >>> IMHO avio.h is not supposed to be included directly in user apps
> >>> is there a problem left after this assumtation?
> >>> did any app include avio.h directly? if so why?
> >> The very usefull ByteIOContext and get_be/le functions.
> > what are they usefull for without avformat.h ?
> You can use the API to open a file (url_fopen) and read content using
> Very useful, I actually use it.
> It doesn't need avformat.h, you can include <libavformat/avio.h> directly.
While I agree that avio.h is generally useful even without avformat.h,
its direct inclusion just works for chance, gcc/cpp seems to treat
undefined symbol like LIBAVFORMAT_VERSION_MAJOR like macros with a
value of 0, so #if VERSION >= 53 blocks are skipped and #if VERSION <
53 one are included, but I'm not sure this is the expected behaviour.
As for the creation of a version.h file, it has its technical merits
(for example it would be easier to spot API changes simply svn-logging
the version.h file).
Main drawbacks are IMO:
1) maybe overkill, if this is the only point when we need version.h
maybe we can simply force the user to import the whole avformat.h API.
2) if we apply it, then maybe we should do the same for the other libs
as well, even when not technically required.
FFmpeg = Fiendish and Funny Miracolous Portentous Elitarian Governor
More information about the ffmpeg-devel