[Ffmpeg-devel] Network patch for MingW users
Ryan Martell
rdm4
Wed Feb 21 20:42:02 CET 2007
On Feb 21, 2007, at 8:38 AM, Alex Beregszaszi wrote:
> 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
Trying to help Alex out here, how does this look. (his code,
rearranged into a smaller patch)
This fixes the fcntl & issue that Diego (i think) spotted, changes
the version number to a < instead of an equal to (as I think that's
probably what was intended), and wraps them with calls. I don't like
the naming convention on av_initialize_socket_instance, and am
definitely open to ideas.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: os_support.patch
Type: application/octet-stream
Size: 1597 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070221/e980f078/attachment.obj>
-------------- next part --------------
Thanks!
-Ryan
More information about the ffmpeg-devel
mailing list