FFmpeg include header
Here is an early patch, it uses trick similar to what FreeType does to declare include header paths. You may have noticed that there are quite many places where #ifdef are used to include ffmpeg headers from default system location or from internal mplayer one. This code duplication could be removed if we #define the path string and include the define. The patch I created remove about 27 lines total, please take a look and test it. At least I was able to compile mplayer with this patch applied. I would like to hear your recommendations: the names of the defines. FF_AVCODEC_H is too similar to the AVCODEC_H used by avcodec.h itself. I was thinking about FF_AVCODEC_HEADER (too long but..). Do you have better ideas? jpeg_enc.c and vf_zrmjpeg.c are unchanged by my patch. They include quite many internal headers and i think they behave more like parts of lavc. I'm not going to mess with them ;) vf_qp - does it really need all these heavy includes. I think we can remove at least the dsputil one. After this patch is committed I will make another for avformat and postprocess. Let's talk about code.
Hi On Wed, Apr 19, 2006 at 11:52:53PM +0300, Ivan Kalvachev wrote:
Here is an early patch, it uses trick similar to what FreeType does to declare include header paths. You may have noticed that there are quite many places where #ifdef are used to include ffmpeg headers from default system location or from internal mplayer one. This code duplication could be removed if we #define the path string and include the define.
The patch I created remove about 27 lines total, please take a look and test it. At least I was able to compile mplayer with this patch applied.
I would like to hear your recommendations:
what about using gcc ... -I<path to the headers> ? [...] -- Michael In the past you could go to a library and read, borrow or copy any book Today you'd get arrested for mere telling someone where the library is
2006/4/20, Michael Niedermayer <michaelni@gmx.at>:
Hi
On Wed, Apr 19, 2006 at 11:52:53PM +0300, Ivan Kalvachev wrote:
Here is an early patch, it uses trick similar to what FreeType does to declare include header paths. You may have noticed that there are quite many places where #ifdef are used to include ffmpeg headers from default system location or from internal mplayer one. This code duplication could be removed if we #define the path string and include the define.
The patch I created remove about 27 lines total, please take a look and test it. At least I was able to compile mplayer with this patch applied.
I would like to hear your recommendations:
what about using gcc ... -I<path to the headers> ?
I may write a new patch, after you explain me why ffmpeg headers are put in separate "..include/ffmpeg/" directory.
Hi On Thu, Apr 20, 2006 at 11:16:47AM +0300, Ivan Kalvachev wrote:
2006/4/20, Michael Niedermayer <michaelni@gmx.at>:
Hi
On Wed, Apr 19, 2006 at 11:52:53PM +0300, Ivan Kalvachev wrote:
Here is an early patch, it uses trick similar to what FreeType does to declare include header paths. You may have noticed that there are quite many places where #ifdef are used to include ffmpeg headers from default system location or from internal mplayer one. This code duplication could be removed if we #define the path string and include the define.
The patch I created remove about 27 lines total, please take a look and test it. At least I was able to compile mplayer with this patch applied.
I would like to hear your recommendations:
what about using gcc ... -I<path to the headers> ?
I may write a new patch, after you explain me why ffmpeg headers are put in separate "..include/ffmpeg/" directory.
ahh thats easy to awnser, i have not the faintest clue why :) [...] -- Michael In the past you could go to a library and read, borrow or copy any book Today you'd get arrested for mere telling someone where the library is
2006/4/20, Michael Niedermayer <michaelni@gmx.at>:
Hi
On Thu, Apr 20, 2006 at 11:16:47AM +0300, Ivan Kalvachev wrote:
2006/4/20, Michael Niedermayer <michaelni@gmx.at>:
Hi
On Wed, Apr 19, 2006 at 11:52:53PM +0300, Ivan Kalvachev wrote:
Here is an early patch, it uses trick similar to what FreeType does to declare include header paths. You may have noticed that there are quite many places where #ifdef are used to include ffmpeg headers from default system location or from internal mplayer one. This code duplication could be removed if we #define the path string and include the define.
The patch I created remove about 27 lines total, please take a look and test it. At least I was able to compile mplayer with this patch applied.
I would like to hear your recommendations:
what about using gcc ... -I<path to the headers> ?
I may write a new patch, after you explain me why ffmpeg headers are put in separate "..include/ffmpeg/" directory.
ahh thats easy to awnser, i have not the faintest clue why :)
Well unfortunately the reason not to use -I is the same as the reason to put all headers in ffmpeg/ . ;) As side note, to do so, we would need to make some kind of detection where external include headers are. 1. using gcc to tell us where it does look (may be gcc specific) 2. using ffmpeg-config like system (won't work with older versions) 3. trying to guess all locations, including the strange one (e.g. mingw). Any other comments before i commit?
On Wed, Apr 19, 2006 at 11:52:53PM +0300, Ivan Kalvachev wrote:
Here is an early patch, it uses trick similar to what FreeType does to declare include header paths.
Can you point me at this, please?
I would like to hear your recommendations:
the names of the defines. FF_AVCODEC_H is too similar to the AVCODEC_H used by avcodec.h itself. I was thinking about FF_AVCODEC_HEADER (too long but..). Do you have better ideas?
What about HEADER_AVCODEC_H?
Let's talk about code.
:) Diego
On Wed, Apr 19, 2006 at 11:52:53PM +0300, Ivan Kalvachev wrote:
Let's talk about code.
--- develop/mplayer/main/configure 2006-04-19 20:32:46.000000000 +0300 +++ build/main/configure 2006-04-19 23:07:58.000000000 +0300 @@ -6127,6 +6131,9 @@ elif test "$_libavcodec_so" = yes ; then + _def_libavcodec_header="#define FF_AVCODEC_H <ffmpeg/avcodec.h>" + _def_libavdsp_header="#define FF_AVC_DSPUTIL_H <ffmpeg/dsputil.h>" +# _def_lavc_dsputil_header="#define FF_AVUTIL_H <ffmpeg/avutil.h>"
The problem here is that dsputil.h is a private header and not installed in the system-wide include directories. This cannot work. Diego
participants (3)
-
Diego Biurrun -
Ivan Kalvachev -
Michael Niedermayer