[FFmpeg-devel] [RFC] gcc garbage collection unused code

matthieu castet castet.matthieu
Fri Jun 13 19:21:38 CEST 2008


M?ns Rullg?rd wrote:
> matthieu castet <castet.matthieu at free.fr> writes:
> 
>> What should be the best way to unhide private symbol shared across
>> libraries ? Working at header level or function level ?
> 
> Symbols are either exported or not.  There is no way to export symbols
> only to certain other libraries.
> 
That's not the point.
FFmpeg define public API with headers that are installed by make 
install. But there also a private API that is shared between libraries 
but that shouldn't used outside ffmpeg.
In my opinion that's not really a clean design. Why put aes stuff in 
libavutil, if it's not in public (installed) headers of libavutil, not 
used in libavutil and used in libavformat ?
There also strange layer violation : dv1394 device (libavdevice) doing 
direct call to dv demuxer (libavformat).

I will try to consider the header containing these functions public, and 
treat them with the same #pragma as public header, or try to build an 
only one big library and see what happen.

Matthieu

PS :
Public header
$grep HEADERS */Makefile
libavcodec/Makefile:HEADERS = avcodec.h opt.h
libavdevice/Makefile:HEADERS = avdevice.h
libavfilter/Makefile:HEADERS = avfilter.h
libavformat/Makefile:HEADERS = avformat.h avio.h rtsp.h rtspcodes.h
libavutil/Makefile:HEADERS = adler32.h \
           avstring.h \
           avutil.h \
           base64.h \
           common.h \
           crc.h \
           fifo.h \
           intfloat_readwrite.h \
           log.h \
           lzo.h \
           mathematics.h \
           md5.h \
           mem.h \
           random.h \
           rational.h \
           sha1.h
libpostproc/Makefile:HEADERS = postprocess.h
libswscale/Makefile:HEADERS = swscale.h rgb2rgb.h


private headers used across libraries
$grep "include \"libav.*\/" */*.c | cut -d' ' -f2 | sort | uniq -c | 
grep -v -e adler32.h -e avstring.h -e avutil.h -e base64.h -e common.h 
-e crc.h -e fifo.h -e intfloat_readwrite.h -e log.h -e lzo.h -e 
mathematics.h -e md5.h -e mem.h -e random.h -e rational.h -e sha1.h -e 
avcodec.h -e opt.h -e avdevice.h -e avfilter.h -e avformat.h -e avio.h 
-e rtsp.h -e rtspcodes.h -e postprocess.h -e swscale.h -e rgb2rgb.h 
                               1 "libavcodec/ac3_parser.h"
       1 "libavcodec/bethsoftvideo.h"
      17 "libavcodec/bitstream.h"
       7 "libavcodec/bytestream.h"
       2 "libavcodec/dsputil.h"
       2 "libavcodec/dvdata.h"
       1 "libavcodec/eval.h"
       2 "libavcodec/imgconvert.h"
       3 "libavcodec/mpeg4audio.h"
       2 "libavcodec/mpegaudiodata.h"
       1 "libavcodec/mpegaudiodecheader.h"
       2 "libavcodec/mpegaudio.h"
       1 "libavcodec/mpegvideo.h"
       1 "libavcodec/unary.h"
       2 "libavcodec/xiph.h"
       1 "libavformat/dv.h"
       6 "libavformat/framehook.h"
       1 "libavutil/aes.h"
      12 "libavutil/bswap.h"
       1 "libavutil/des.h"
       1 "libavutil/integer.h"
       3 "libavutil/intreadwrite.h"
       1 "libavutil/lls.h"
       1 "libavutil/rc4.h"
       3 "libavutil/tree.h"
       3 "libavutil/x86_cpu.h"






More information about the ffmpeg-devel mailing list