[FFmpeg-devel] WinCE port and api visibility

Pavel Pavlov pavel
Sat May 9 22:33:43 CEST 2009


> The patch is extremely intrusive and seems to contain some unrelated
> changes.

Yes, that's what I was talking about. However, there is no other way to
make it properly for windows, has to be done like that. Check inside any
cross platform project that supports windows builds properly and has dll
builds.

For windows, an exported function has to be marked at definition. It
also should have a mark at declaration in .h file to help builds that
import it. Since ffmpeg has more than one dll, it means that when
building avutil functions has to be declared as dllexport, but when
building avcodec these same functions are already dllimport. That's why
there are AVUTIL_API AVFMT_API etc.

Unrelated changes?.. 
At the end of dsputil.c these are:
+#undef W0
+#undef W1
+#undef W2
+#undef W3
+#undef W4
+#undef W5
+#undef W6
+#undef W7

Which I added at the end of .c file that defines them. The reason for
that is because there is another .c file that defines these. Instead of
building entire lib, sometimes I create .c file that includes other .c
files that I need to compile. I had errors/warnings because of redefined
macro.

Same for 
+#ifdef FIX
+#undef FIX
+#endif
+#ifdef CONST_BITS
+#undef CONST_BITS
+#endif


And in some places I had to add includes, so that FFMPEG_API was defined
before it's used.

The rest of the changes are *_API macro added for each public api
function. IMO that's the way it has to be done, that also makes it
obvious if a function is public API. Surely, I missed some of the public
api, and they wouldn't be exported anymore that potentially could affect
some other projects, so anything like that should be handled by people
who know well ffmpeg code who could ensure that only public functions
are exported and nothing else.




More information about the ffmpeg-devel mailing list