[FFmpeg-cvslog] r29354 - trunk/libswscale/swscale-example.c

Michael Niedermayer michaelni
Thu Jun 11 20:42:57 CEST 2009


On Thu, Jun 11, 2009 at 07:27:35PM +0200, Diego Biurrun wrote:
> On Thu, Jun 11, 2009 at 06:41:41PM +0200, Michael Niedermayer wrote:
> > On Thu, Jun 11, 2009 at 06:08:35PM +0200, Diego Biurrun wrote:
> > > On Thu, Jun 11, 2009 at 05:46:11PM +0200, Michael Niedermayer wrote:
> > > > On Thu, Jun 11, 2009 at 05:15:43PM +0200, diego wrote:
> > > > > 
> > > > > Log:
> > > > > Fix compilation: #undef standard library functions that are
> > > > > forbidden within FFmpeg, but allowed in example code.
> > > > 
> > > > example code should not define HAVE_AV_CONFIG_H and if it does not,
> > > > it also does ot need the undefs
> > > 
> > > Well...:
> > > 
> > > diego at slaughter:/var/tmp/ffmpeg$ make examples
> > > gcc -DHAVE_AV_CONFIG_H -I. -I"/var/tmp/ffmpeg" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno        -c -o libswscale/swscale-example.o libswscale/swscale-example.c
> > > libswscale/swscale-example.c: In function `doTest':
> > > libswscale/swscale-example.c:81: warning: implicit declaration of function `please_use_av_malloc'
> > > libswscale/swscale-example.c:85: warning: implicit declaration of function `please_use_av_log_instead_of_perror'
> > > libswscale/swscale-example.c:94: warning: implicit declaration of function `please_use_av_log_instead_of_fprintf'
> > > libswscale/swscale-example.c:139: warning: implicit declaration of function `please_use_av_log_instead_of_printf'
> > > libswscale/swscale-example.c:152: warning: implicit declaration of function `please_use_av_free'
> > > 
> > > The compile command line does indeed contain -DHAVE_AV_CONFIG_H, which
> > > arguably is false, but:
> > > 
> > > diego at slaughter:/var/tmp/ffmpeg$ gcc -I.  -I"/var/tmp/ffmpeg" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno        -c -o libswscale/swscale-example.o libswscale/swscale-example.c
> > > libswscale/swscale-example.c: In function `doTest':
> > > libswscale/swscale-example.c:81: warning: implicit declaration of function `please_use_av_malloc'
> > > libswscale/swscale-example.c:85: warning: implicit declaration of function `please_use_av_log_instead_of_perror'
> > > libswscale/swscale-example.c:94: warning: implicit declaration of function `please_use_av_log_instead_of_fprintf'
> > > libswscale/swscale-example.c:139: warning: implicit declaration of function `please_use_av_log_instead_of_printf'
> > > libswscale/swscale-example.c:152: warning: implicit declaration of function `please_use_av_free'
> > > 
> > > There is no improvement if I remove the definition from the command
> > > line...
> > > 
> > > > this commit is not the correct solution
> > > 
> > > Whoever knows the correct solution shall step forward...
> > 
> > I do, revert your previous commit to swscale (r29353) as well and it works
> 
> No, it does not.

yes it does, i tested it before making that claim

upon further investigation libavutil/mem.h here contained DECLARE_ALIGNED
and was in C state, svn skiped it during updates

now if you also revert your r16781 commit, swscale-example.c compiles

to quote your commit message from r16781:
    Move DECLARE_ALIGNED and DECLARE_ASM_CONST to internal.h.
    Their definition depends on preprocessor directives from config.h,
    thus they cannot be declared in a public header since public headers
    cannot #include config.h.

internal.h is no public header -> it cannot be used outside libavutil
but DECLARE_ALIGNED is used all over the place outside libavutil

example code and applications are not libav* internal and thus
cannot use internal APIs, its also very bad if examples do because
people follow this practice when writing applications,
to elabrate further, using internal API that can change between
any revission means that distros like debian will have to update
every application when they update libavutil or live with random
breakages


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20090611/3ac2bb01/attachment-0001.pgp>



More information about the ffmpeg-cvslog mailing list