00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef FFMPEG_OS_SUPPORT_H
00023 #define FFMPEG_OS_SUPPORT_H
00024
00030 #ifndef HAVE_SOCKLEN_T
00031 typedef int socklen_t;
00032 #endif
00033
00034 #ifdef __MINGW32__
00035 __declspec(dllimport) void __stdcall Sleep(unsigned long dwMilliseconds);
00036
00037 # define usleep(t) Sleep((t) / 1000)
00038 # include <fcntl.h>
00039 # define lseek(f,p,w) _lseeki64((f), (p), (w))
00040 #endif
00041
00042 #ifdef __BEOS__
00043 # include <sys/socket.h>
00044 # include <netinet/in.h>
00045
00046 # include <BeBuild.h>
00047
00048 # if B_BEOS_VERSION <= B_BEOS_VERSION_5
00049 # include <OS.h>
00050
00051 # define usleep(t) snooze((bigtime_t)(t))
00052 # endif
00053 # ifndef SA_RESTART
00054 # warning SA_RESTART not implemented; ffserver might misbehave.
00055 # define SA_RESTART 0
00056 # endif
00057 #endif
00058
00059
00060 #ifndef HAVE_CLOSESOCKET
00061 #define closesocket close
00062 #endif
00063
00064 #ifdef CONFIG_FFSERVER
00065 #ifndef HAVE_SYS_POLL_H
00066 typedef unsigned long nfds_t;
00067
00068 struct pollfd {
00069 int fd;
00070 short events;
00071 short revents;
00072 };
00073
00074
00075 #define POLLIN 0x0001
00076 #define POLLOUT 0x0002
00077 #define POLLRDNORM POLLIN
00078 #define POLLWRNORM POLLOUT
00079 #define POLLRDBAND 0x0008
00080 #define POLLWRBAND 0x0010
00081 #define POLLPRI 0x0020
00082
00083
00084 #define POLLERR 0x0004
00085 #define POLLHUP 0x0080
00086 #define POLLNVAL 0x1000
00087
00088
00089 extern int poll(struct pollfd *fds, nfds_t numfds, int timeout);
00090 #endif
00091 #endif
00092
00093 #endif