[FFmpeg-devel] [RFC] OS support library

Michael Niedermayer michaelni
Mon Dec 3 18:58:44 CET 2007


On Mon, Dec 03, 2007 at 05:04:41PM +0100, Luca Abeni wrote:
> Hi all,
>
> ok, here is a start... It is not a complete libossupport yet
> (so this is an RFC, not a real patch submission), but I post
> it so that the discussion can move on.
>
> Basically, I just moved os_support.* and network.h from
> libavformat to the new library. After this, libavformat should
> not contain any OS-dependent code.
>
> Some things to think about:
> 1) I think the lrintf() replacement that we currently have in
> libavutil/internal.h should be moved to libossupport too.
> What do other people think about it?

yes


> 2) Also, av_tempfile() (from libavcodec/utils.c) should be a good
> candidate for libossupport...

no, not as is
also my info mkstemp says:
"Don?t  use this function, use tmpfile(3) instead.  It is better defined
 and more portable."


> 3) Maybe libossupport can be used to provide support for missing
> error numbers

yes, though that likely should be done after loss is in svn


> 4) Finally, the ff_socket_nonblock() function can be probably
> eliminated by providing (inside libossupport) a partial fcntl()
> replacement for windows, as suggested by Michael (I think).
>
> Note that in some cases libossupport.a could really be an empty
> library (and libossupport could be needed only for providing some
> #defines and inline functions inside the headers). I still have
> to address this situation.
>
> The new library can be created by doing
> svn mkdir libossupport
> svn mv libavformat/os_support.h libossupport
> svn mv libavformat/os_support.c libossupport
> svn cp libavformat/Makefile libossupport
> svn mv libavformat/network.h libossupport
> and applying the attached patch.
>
> I tested it on linux and mingw (by cross-compiling from linux and
> using wine to execute the resulting binary), static and dynamic
> libraries.
>
> Before going on, I'd like to see some more discussion, and to be sure
> that this is the way we want to go (if it is not, suggestions about
> the right thing to do are welcome ;-)

i think the right thing is to start small and move things slowly over
(like *tempfile() if its still needed or the errnos)


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

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- 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-devel/attachments/20071203/26dc1c4b/attachment.pgp>



More information about the ffmpeg-devel mailing list