[FFmpeg-devel] [PATCH] libavcodec/makefile: prevent from installing disabled headers.
Matt Oliver
protogonoi at gmail.com
Mon Oct 20 10:40:55 CEST 2014
On 20 October 2014 17:57, Reimar Döffinger <Reimar.Doeffinger at gmx.de> wrote:
> On 19.10.2014, at 20:53, Matt Oliver <protogonoi at gmail.com> wrote:
> > This stops headers based on disabled functionality from being installed.
> > Things like VDA and VDPAU dont work on windows etc. So any attempt to use
> > these headers will result in compilation errors so best not to install
> them
> > to avoid confusion. Also no point having a header for functionality that
> > wasnt built into the libs.
> > So exclude headers if they cannot be used.
>
> I don't see any real advantage whatsoever for this, the few kB saved are
> not of much advantage, especially as they are only saved on developer
> systems.
> Also, VDPAU as an API can most certainly work on Windows if one wanted it
> to.
> In fact, it will probably compile just fine at the least under cygwin
> (even if there is not backend implementation).
> Lastly, if you remove a header it will also break programs that try to use
> runtime detection e.g. via dlopen or other mechanisms to figure out if the
> feature exists or not, and they suddenly have to check at compile time
> instead.
> The last part IMHO makes that this is in fact just wrong to do.
>
I can see now how removing the headers is an ABI break and can cause
issues, which is fair enough. It was mainly as these headers are marked for
install and then distributed with compiled libs. Which for platforms such
as windows means you have headers that you can never use and attempting to
include will cause compile errors.
So this was due to issues I was seeing with people just including all
headers and wondering why it doesnt compile.
FYI VDA and VDPAU etc. wont compile with mingw as the system headers
(vdpau.h etc) are missing by default. Which is why these headers error on
Windows as they include other headers that just are not available on that
platform.
Of course someone serious could copy headers from a supported system to
avoid errors but given that there is no way for the backend to work this
seems like an unreasonable amount of effort to get it to work. Which
someone would have to do on Windows to get runtime detection (as previously
mentioned) to work. So atleast on that platform I dont think that this is a
likely situation.
So disabling headers based on whether the config option is set is probably
not the right way. But perhaps headers can be prevented from being
installed on platforms that can just plain never use them.
Perhaps something like HEADERS-$(have_dxva_h) or based on the platform
being compiled for.
Just thinking aloud.
More information about the ffmpeg-devel
mailing list