• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavformat/network.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2007 The FFmpeg Project
00003  *
00004  * This file is part of FFmpeg.
00005  *
00006  * FFmpeg is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * FFmpeg is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with FFmpeg; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00019  */
00020 
00021 #ifndef AVFORMAT_NETWORK_H
00022 #define AVFORMAT_NETWORK_H
00023 
00024 #include "config.h"
00025 
00026 #if HAVE_WINSOCK2_H
00027 #include <winsock2.h>
00028 #include <ws2tcpip.h>
00029 
00030 #define ff_neterrno() WSAGetLastError()
00031 #define FF_NETERROR(err) WSA##err
00032 #define WSAEAGAIN WSAEWOULDBLOCK
00033 #else
00034 #include <sys/types.h>
00035 #include <sys/socket.h>
00036 #include <netinet/in.h>
00037 #include <netdb.h>
00038 
00039 #define ff_neterrno() errno
00040 #define FF_NETERROR(err) err
00041 #endif
00042 
00043 #if HAVE_ARPA_INET_H
00044 #include <arpa/inet.h>
00045 #endif
00046 
00047 int ff_socket_nonblock(int socket, int enable);
00048 
00049 static inline int ff_network_init(void)
00050 {
00051 #if HAVE_WINSOCK2_H
00052     WSADATA wsaData;
00053     if (WSAStartup(MAKEWORD(1,1), &wsaData))
00054         return 0;
00055 #endif
00056     return 1;
00057 }
00058 
00059 static inline void ff_network_close(void)
00060 {
00061 #if HAVE_WINSOCK2_H
00062     WSACleanup();
00063 #endif
00064 }
00065 
00066 #if !HAVE_INET_ATON
00067 /* in os_support.c */
00068 int inet_aton (const char * str, struct in_addr * add);
00069 #endif
00070 
00071 #endif /* AVFORMAT_NETWORK_H */

Generated on Sat Feb 16 2013 09:23:15 for ffmpeg by  doxygen 1.7.1