[Ffmpeg-devel] Network patch for MingW users

Alex Beregszaszi alex
Wed Feb 21 15:38:57 CET 2007


Hi,

> >> > Possible changes:
> >> > * move neterrno to os_support.h or network.h
> >> > * create socketblockio (or something similar) for setting non-blocking
> >> > io on socket
> >
> > These two macros should be moved into os_support.h or network.h?
> 
> Actually, I don't like the neterrno macro at all.  I'd prefer a macro
> for retrieving the error code and some form of translation from E* codes
> to WS* codes.  The former of these would simply return errno on POSIX
> systems and call WSAGetLastErrorUsingAnUglyFunctionName() on Windows.  The
> latter I don't know exactly what is required for.

Actually neterrno() does the same what you say.


> For setting nonblocking mode, I'd like a function (or macro) like
> 
> int ff_socket_nonblock(int enable);
> 
> defined os_support.c (or network.h).

/**
 * sets the non-blocking io on socket
 */
static inline int av_socket_nonblock(int socket, int enable)
{
#ifdef __MINGW32__
   return ioctlsocket(socket, FIONBIO, enable);
#else
   if (enable)
      return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) |
O_NONBLOCK);
   else
      return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) |
~O_NONBLOCK);
#endif
}

> > Btw, what about merging barpainet.h into network.h?
> 
> First I'd like to determine whether its contents are actually needed at all.
> barpainet.h is only #included in os_support.c, and then only if inet_aton()
> doesn't exist, and none of what is in it is used there.
> 
> I've repeatedly asked the Beos guys about this, but they haven't answered.
> If I don't get an answer by the end of the week, I'll remove it.

As barpainet.h is only used in one place (os_support.c), it might be a
better idea merging it into that place instead network.h

--
Alex Beregszaszi





More information about the ffmpeg-devel mailing list