winlin

Merge branch 'allspace-master' into srs-librtmp

@@ -299,8 +299,9 @@ END @@ -299,8 +299,9 @@ END
299 GDBDebug=" -g -O0" 299 GDBDebug=" -g -O0"
300 # the warning level. 300 # the warning level.
301 WarnLevel=" -Wall" 301 WarnLevel=" -Wall"
302 -# the compile standard.  
303 -CppStd="-ansi" 302 +# the compile in c++ standard.
  303 +# @remark, donot specifies it for mingw.
  304 +CppStd="-ansi" && echo $MSYSTEM|grep "MINGW">/dev/null && CppStd=""
304 # for library compile 305 # for library compile
305 LibraryCompile=" -fPIC" 306 LibraryCompile=" -fPIC"
306 # performance of gprof 307 # performance of gprof
@@ -355,7 +356,7 @@ if [ $SRS_MIPS_UBUNTU12 = YES ]; then SrsLinkOptions="${SrsLinkOptions} -lgcc_eh @@ -355,7 +356,7 @@ if [ $SRS_MIPS_UBUNTU12 = YES ]; then SrsLinkOptions="${SrsLinkOptions} -lgcc_eh
355 MODULE_ID="CORE" 356 MODULE_ID="CORE"
356 MODULE_DEPENDS=() 357 MODULE_DEPENDS=()
357 ModuleLibIncs=(${SRS_OBJS_DIR}) 358 ModuleLibIncs=(${SRS_OBJS_DIR})
358 -MODULE_FILES=("srs_core" "srs_core_autofree") 359 +MODULE_FILES=("srs_core" "srs_core_autofree" "srs_platform")
359 CORE_INCS="src/core"; MODULE_DIR=${CORE_INCS} . auto/modules.sh 360 CORE_INCS="src/core"; MODULE_DIR=${CORE_INCS} . auto/modules.sh
360 CORE_OBJS="${MODULE_OBJS[@]}" 361 CORE_OBJS="${MODULE_OBJS[@]}"
361 # 362 #
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 // current release version 31 // current release version
32 #define VERSION_MAJOR 2 32 #define VERSION_MAJOR 2
33 #define VERSION_MINOR 0 33 #define VERSION_MINOR 0
34 -#define VERSION_REVISION 32 34 +#define VERSION_REVISION 33
35 // server info. 35 // server info.
36 #define RTMP_SIG_SRS_KEY "SRS" 36 #define RTMP_SIG_SRS_KEY "SRS"
37 #define RTMP_SIG_SRS_ROLE "origin/edge server" 37 #define RTMP_SIG_SRS_ROLE "origin/edge server"
@@ -110,5 +110,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -110,5 +110,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
110 className(const className&); \ 110 className(const className&); \
111 className& operator= (const className&) 111 className& operator= (const className&)
112 112
  113 +// for windows to compile srs-librtmp
  114 +// @see: https://github.com/winlinvip/simple-rtmp-server/issues/213
  115 +#include <srs_platform.hpp>
  116 +
113 #endif 117 #endif
114 118
  1 +/*
  2 +The MIT License (MIT)
  3 +
  4 +Copyright (c) 2014 allspace
  5 +
  6 +Permission is hereby granted, free of charge, to any person obtaining a copy of
  7 +this software and associated documentation files (the "Software"), to deal in
  8 +the Software without restriction, including without limitation the rights to
  9 +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  10 +the Software, and to permit persons to whom the Software is furnished to do so,
  11 +subject to the following conditions:
  12 +
  13 +The above copyright notice and this permission notice shall be included in all
  14 +copies or substantial portions of the Software.
  15 +
  16 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  18 +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  19 +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  20 +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  21 +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22 +*/
  23 +
  24 +#include <srs_platform.hpp>
  25 +
  26 +#include <stdlib.h>
  27 +#include <stdio.h>
  28 +#include <sys/types.h>
  29 +
  30 +#if defined(_WIN32) && !defined(__CYGWIN__)
  31 +int socket_setup()
  32 +{
  33 + WORD wVersionRequested;
  34 + WSADATA wsaData;
  35 + int err;
  36 +
  37 + /* Use the MAKEWORD(lowbyte, highbyte) macro declared in Windef.h */
  38 + wVersionRequested = MAKEWORD(2, 2);
  39 +
  40 + err = WSAStartup(wVersionRequested, &wsaData);
  41 + if (err != 0) {
  42 + /* Tell the user that we could not find a usable */
  43 + /* Winsock DLL. */
  44 + //printf("WSAStartup failed with error: %d\n", err);
  45 + return -1;
  46 + }
  47 + return 0;
  48 +}
  49 +
  50 +int socket_cleanup()
  51 +{
  52 + WSACleanup();
  53 + return 0;
  54 +}
  55 +
  56 +int gettimeofday(struct timeval* tv, struct timezone* tz)
  57 +{
  58 + time_t clock;
  59 + struct tm tm;
  60 + SYSTEMTIME win_time;
  61 +
  62 + GetLocalTime(&win_time);
  63 +
  64 + tm.tm_year = win_time.wYear - 1900;
  65 + tm.tm_mon = win_time.wMonth - 1;
  66 + tm.tm_mday = win_time.wDay;
  67 + tm.tm_hour = win_time.wHour;
  68 + tm.tm_min = win_time.wMinute;
  69 + tm.tm_sec = win_time.wSecond;
  70 + tm.tm_isdst = -1;
  71 +
  72 + clock = mktime(&tm);
  73 +
  74 + tv->tv_sec = (long)clock;
  75 + tv->tv_usec = win_time.wMilliseconds * 1000;
  76 +
  77 + return 0;
  78 +}
  79 +
  80 +pid_t getpid(void)
  81 +{
  82 + return (pid_t)GetCurrentProcessId();
  83 +}
  84 +
  85 +int usleep(useconds_t usec)
  86 +{
  87 + Sleep((DWORD)(usec / 1000));
  88 + return 0;
  89 +}
  90 +
  91 +ssize_t writev(int fd, const struct iovec *iov, int iovcnt)
  92 +{
  93 + ssize_t nwrite = 0;
  94 + for (int i = 0; i < iovcnt; i++) {
  95 + const struct iovec* current = iov + i;
  96 +
  97 + int nsent = ::send(fd, (char*)current->iov_base, current->iov_len, 0);
  98 + if (nsent < 0) {
  99 + return nsent;
  100 + }
  101 +
  102 + nwrite += nsent;
  103 + if (nsent == 0) {
  104 + return nwrite;
  105 + }
  106 + }
  107 + return nwrite;
  108 +}
  109 +
  110 +//////////////////////// strlcpy.c (modified) //////////////////////////
  111 +
  112 +/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */
  113 +
  114 +/*-
  115 + * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
  116 + *
  117 + * Permission to use, copy, modify, and distribute this software for any
  118 + * purpose with or without fee is hereby granted, provided that the above
  119 + * copyright notice and this permission notice appear in all copies.
  120 + *
  121 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  122 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  123 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  124 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  125 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  126 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  127 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  128 + */
  129 +
  130 +//#include <sys/cdefs.h> // ****
  131 +//#include <cstddef> // ****
  132 +// __FBSDID("$FreeBSD: stable/9/sys/libkern/strlcpy.c 243811 2012-12-03 18:08:44Z delphij $"); // ****
  133 +
  134 +// #include <sys/types.h> // ****
  135 +// #include <sys/libkern.h> // ****
  136 +
  137 +/*
  138 + * Copy src to string dst of size siz. At most siz-1 characters
  139 + * will be copied. Always NUL terminates (unless siz == 0).
  140 + * Returns strlen(src); if retval >= siz, truncation occurred.
  141 + */
  142 +
  143 +//#define __restrict // ****
  144 +
  145 +size_t strlcpy(char * __restrict dst, const char * __restrict src, size_t siz)
  146 +{
  147 + char *d = dst;
  148 + const char *s = src;
  149 + size_t n = siz;
  150 +
  151 + /* Copy as many bytes as will fit */
  152 + if (n != 0) {
  153 + while (--n != 0) {
  154 + if ((*d++ = *s++) == '\0')
  155 + break;
  156 + }
  157 + }
  158 +
  159 + /* Not enough room in dst, add NUL and traverse rest of src */
  160 + if (n == 0) {
  161 + if (siz != 0)
  162 + *d = '\0'; /* NUL-terminate dst */
  163 + while (*s++)
  164 + ;
  165 + }
  166 +
  167 + return(s - src - 1); /* count does not include NUL */
  168 +}
  169 +
  170 +// http://www.cplusplus.com/forum/general/141779///////////////////////// inet_ntop.c (modified) //////////////////////////
  171 +/*
  172 + * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
  173 + * Copyright (c) 1996-1999 by Internet Software Consortium.
  174 + *
  175 + * Permission to use, copy, modify, and distribute this software for any
  176 + * purpose with or without fee is hereby granted, provided that the above
  177 + * copyright notice and this permission notice appear in all copies.
  178 + *
  179 + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
  180 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  181 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
  182 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  183 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  184 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
  185 + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  186 + */
  187 +
  188 +// #if defined(LIBC_SCCS) && !defined(lint) // ****
  189 +//static const char rcsid[] = "$Id: inet_ntop.c,v 1.3.18.2 2005/11/03 23:02:22 marka Exp $";
  190 +// #endif /* LIBC_SCCS and not lint */ // ****
  191 +// #include <sys/cdefs.h> // ****
  192 +// __FBSDID("$FreeBSD: stable/9/sys/libkern/inet_ntop.c 213103 2010-09-24 15:01:45Z attilio $"); // ****
  193 +
  194 +//#define _WIN32_WINNT _WIN32_WINNT_WIN8 // ****
  195 +//#include <Ws2tcpip.h> // ****
  196 +//#pragma comment(lib, "Ws2_32.lib") // ****
  197 +//#include <cstdio> // ****
  198 +
  199 +// #include <sys/param.h> // ****
  200 +// #include <sys/socket.h> // ****
  201 +// #include <sys/systm.h> // ****
  202 +
  203 +// #include <netinet/in.h> // ****
  204 +
  205 +/*%
  206 + * WARNING: Don't even consider trying to compile this on a system where
  207 + * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
  208 + */
  209 +
  210 +static char *inet_ntop4(const u_char *src, char *dst, socklen_t size);
  211 +static char *inet_ntop6(const u_char *src, char *dst, socklen_t size);
  212 +
  213 +/* char *
  214 + * inet_ntop(af, src, dst, size)
  215 + * convert a network format address to presentation format.
  216 + * return:
  217 + * pointer to presentation format address (`dst'), or NULL (see errno).
  218 + * author:
  219 + * Paul Vixie, 1996.
  220 + */
  221 +const char* inet_ntop(int af, const void *src, char *dst, socklen_t size)
  222 +{
  223 + switch (af) {
  224 + case AF_INET:
  225 + return (inet_ntop4( (unsigned char*)src, (char*)dst, size)); // ****
  226 +#ifdef AF_INET6
  227 + //#error "IPv6 not supported"
  228 + //case AF_INET6:
  229 + // return (char*)(inet_ntop6( (unsigned char*)src, (char*)dst, size)); // ****
  230 +#endif
  231 + default:
  232 + // return (NULL); // ****
  233 + return 0 ; // ****
  234 + }
  235 + /* NOTREACHED */
  236 +}
  237 +
  238 +/* const char *
  239 + * inet_ntop4(src, dst, size)
  240 + * format an IPv4 address
  241 + * return:
  242 + * `dst' (as a const)
  243 + * notes:
  244 + * (1) uses no statics
  245 + * (2) takes a u_char* not an in_addr as input
  246 + * author:
  247 + * Paul Vixie, 1996.
  248 + */
  249 +static char * inet_ntop4(const u_char *src, char *dst, socklen_t size)
  250 +{
  251 + static const char fmt[128] = "%u.%u.%u.%u";
  252 + char tmp[sizeof "255.255.255.255"];
  253 + int l;
  254 +
  255 + l = snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]); // ****
  256 + if (l <= 0 || (socklen_t) l >= size) {
  257 + return (NULL);
  258 + }
  259 + strlcpy(dst, tmp, size);
  260 + return (dst);
  261 +}
  262 +
  263 +/* const char *
  264 + * inet_ntop6(src, dst, size)
  265 + * convert IPv6 binary address into presentation (printable) format
  266 + * author:
  267 + * Paul Vixie, 1996.
  268 + */
  269 +static char * inet_ntop6(const u_char *src, char *dst, socklen_t size)
  270 +{
  271 + /*
  272 + * Note that int32_t and int16_t need only be "at least" large enough
  273 + * to contain a value of the specified size. On some systems, like
  274 + * Crays, there is no such thing as an integer variable with 16 bits.
  275 + * Keep this in mind if you think this function should have been coded
  276 + * to use pointer overlays. All the world's not a VAX.
  277 + */
  278 + char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
  279 + struct { int base, len; } best, cur;
  280 +#define NS_IN6ADDRSZ 16
  281 +#define NS_INT16SZ 2
  282 + u_int words[NS_IN6ADDRSZ / NS_INT16SZ];
  283 + int i;
  284 +
  285 + /*
  286 + * Preprocess:
  287 + * Copy the input (bytewise) array into a wordwise array.
  288 + * Find the longest run of 0x00's in src[] for :: shorthanding.
  289 + */
  290 + memset(words, '\0', sizeof words);
  291 + for (i = 0; i < NS_IN6ADDRSZ; i++)
  292 + words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
  293 + best.base = -1;
  294 + best.len = 0;
  295 + cur.base = -1;
  296 + cur.len = 0;
  297 + for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
  298 + if (words[i] == 0) {
  299 + if (cur.base == -1)
  300 + cur.base = i, cur.len = 1;
  301 + else
  302 + cur.len++;
  303 + } else {
  304 + if (cur.base != -1) {
  305 + if (best.base == -1 || cur.len > best.len)
  306 + best = cur;
  307 + cur.base = -1;
  308 + }
  309 + }
  310 + }
  311 + if (cur.base != -1) {
  312 + if (best.base == -1 || cur.len > best.len)
  313 + best = cur;
  314 + }
  315 + if (best.base != -1 && best.len < 2)
  316 + best.base = -1;
  317 +
  318 + /*
  319 + * Format the result.
  320 + */
  321 + tp = tmp;
  322 + for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
  323 + /* Are we inside the best run of 0x00's? */
  324 + if (best.base != -1 && i >= best.base &&
  325 + i < (best.base + best.len)) {
  326 + if (i == best.base)
  327 + *tp++ = ':';
  328 + continue;
  329 + }
  330 + /* Are we following an initial run of 0x00s or any real hex? */
  331 + if (i != 0)
  332 + *tp++ = ':';
  333 + /* Is this address an encapsulated IPv4? */
  334 + if (i == 6 && best.base == 0 && (best.len == 6 ||
  335 + (best.len == 7 && words[7] != 0x0001) ||
  336 + (best.len == 5 && words[5] == 0xffff))) {
  337 + if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
  338 + return (NULL);
  339 + tp += strlen(tp);
  340 + break;
  341 + }
  342 + tp += sprintf(tp, "%x", words[i]); // ****
  343 + }
  344 + /* Was it a trailing run of 0x00's? */
  345 + if (best.base != -1 && (best.base + best.len) ==
  346 + (NS_IN6ADDRSZ / NS_INT16SZ))
  347 + *tp++ = ':';
  348 + *tp++ = '\0';
  349 +
  350 + /*
  351 + * Check for overflow, copy, and we're done.
  352 + */
  353 + if ((socklen_t)(tp - tmp) > size) {
  354 + return (NULL);
  355 + }
  356 + strcpy(dst, tmp);
  357 + return (dst);
  358 +}
  359 +
  360 +#define Set_errno(num) SetLastError((num))
  361 +
  362 +/* INVALID_SOCKET == INVALID_HANDLE_VALUE == (unsigned int)(~0) */
  363 +/* SOCKET_ERROR == -1 */
  364 +//#define ENOTSOCK WSAENOTSOCK
  365 +//#define EINTR WSAEINTR
  366 +//#define ENOBUFS WSAENOBUFS
  367 +//#define EWOULDBLOCK WSAEWOULDBLOCK
  368 +#define EAFNOSUPPORT WSAEAFNOSUPPORT
  369 +/* from public\sdk\inc\crt\errno.h */
  370 +#define ENOSPC 28
  371 +
  372 +#endif
  373 +
  1 +/*
  2 +The MIT License (MIT)
  3 +
  4 +Copyright (c) 2014 allspace
  5 +
  6 +Permission is hereby granted, free of charge, to any person obtaining a copy of
  7 +this software and associated documentation files (the "Software"), to deal in
  8 +the Software without restriction, including without limitation the rights to
  9 +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  10 +the Software, and to permit persons to whom the Software is furnished to do so,
  11 +subject to the following conditions:
  12 +
  13 +The above copyright notice and this permission notice shall be included in all
  14 +copies or substantial portions of the Software.
  15 +
  16 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  18 +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  19 +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  20 +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  21 +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22 +*/
  23 +
  24 +#ifndef SRS_WIN_PORTING_H
  25 +#define SRS_WIN_PORTING_H
  26 +
  27 +// for srs-librtmp, @see https://github.com/winlinvip/simple-rtmp-server/issues/213
  28 +#if defined(_WIN32)
  29 + #include <windows.h>
  30 +#endif
  31 +
  32 +/**
  33 +* for linux like,
  34 +* for example, not on windows or it's cygwin.
  35 +* while the _WIN32 includes both 32-bit and 64-bit
  36 +*/
  37 +#if !defined(_WIN32) || defined(__CYGWIN__)
  38 + #define SOCKET_ETIME ETIME
  39 + #define SOCKET_ECONNRESET ECONNRESET
  40 +
  41 + #define SOCKET int
  42 + #define SOCKET_ERRNO() errno
  43 + #define SOCKET_RESET(fd) fd = -1; (void)0
  44 + #define SOCKET_CLOSE(fd) \
  45 + if (fd > 0) {\
  46 + ::close(fd); \
  47 + fd = -1; \
  48 + } \
  49 + (void)0
  50 + #define SOCKET_VALID(x) (x > 0)
  51 + #define SOCKET_SETUP() (void)0
  52 + #define SOCKET_CLEANUP() (void)0
  53 +#else /*on windows, but not on cygwin*/
  54 + #include <sys/stat.h>
  55 + #include <time.h>
  56 + #include <winsock2.h>
  57 + #include <stdint.h>
  58 +
  59 + #ifdef _MSC_VER //for VS2010
  60 + #include <io.h>
  61 + #include <fcntl.h>
  62 + #define S_IRUSR _S_IREAD
  63 + #define S_IWUSR _S_IWRITE
  64 + #define open _open
  65 + #define close _close
  66 + #define lseek _lseek
  67 + #define write _write
  68 + #define read _read
  69 +
  70 + typedef int ssize_t;
  71 + typedef int pid_t;
  72 + typedef int mode_t;
  73 + typedef int64_t useconds_t;
  74 + #endif
  75 +
  76 + #define S_IRGRP 0
  77 + #define S_IWGRP 0
  78 + #define S_IXGRP 0
  79 + #define S_IRWXG 0
  80 + #define S_IROTH 0
  81 + #define S_IWOTH 0
  82 + #define S_IXOTH 0
  83 + #define S_IRWXO 0
  84 +
  85 + #define PRId64 "lld"
  86 +
  87 + #define SOCKET_ETIME WSAETIMEDOUT
  88 + #define SOCKET_ECONNRESET WSAECONNRESET
  89 + #define SOCKET_ERRNO() WSAGetLastError()
  90 + #define SOCKET_RESET(x) x=INVALID_SOCKET
  91 + #define SOCKET_CLOSE(x) if(x!=INVALID_SOCKET){::closesocket(x);x=INVALID_SOCKET;}
  92 + #define SOCKET_VALID(x) (x!=INVALID_SOCKET)
  93 + #define SOCKET_BUFF(x) ((char*)x)
  94 + #define SOCKET_SETUP() socket_setup()
  95 + #define SOCKET_CLEANUP() socket_cleanup()
  96 +
  97 + typedef uint32_t u_int32_t;
  98 + typedef uint8_t u_int8_t;
  99 + typedef int socklen_t;
  100 + struct iovec {
  101 + void* iov_base; /* Starting address */
  102 + size_t iov_len; /* Length in bytes */
  103 + };
  104 +
  105 + #define snprintf _snprintf
  106 + ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
  107 + const char* inet_ntop(int af, const void *src, char *dst, socklen_t size);
  108 + int gettimeofday(struct timeval* tv, struct timezone* tz);
  109 + pid_t getpid(void);
  110 + int usleep(useconds_t usec);
  111 + int socket_setup();
  112 + int socket_cleanup();
  113 +#endif
  114 +
  115 +#endif //SRS_WIN_PORTING_H
@@ -30,8 +30,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -30,8 +30,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 30
31 #include <srs_core.hpp> 31 #include <srs_core.hpp>
32 32
33 -// success, ok 33 +// for srs-librtmp, @see https://github.com/winlinvip/simple-rtmp-server/issues/213
  34 +#ifndef _WIN32
34 #define ERROR_SUCCESS 0 35 #define ERROR_SUCCESS 0
  36 +#endif
35 37
36 /////////////////////////////////////////////////////// 38 ///////////////////////////////////////////////////////
37 // system error. 39 // system error.
@@ -45,22 +45,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -45,22 +45,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
45 45
46 SimpleSocketStream::SimpleSocketStream() 46 SimpleSocketStream::SimpleSocketStream()
47 { 47 {
48 - fd = -1; 48 + SOCKET_RESET(fd);
49 send_timeout = recv_timeout = ST_UTIME_NO_TIMEOUT; 49 send_timeout = recv_timeout = ST_UTIME_NO_TIMEOUT;
50 recv_bytes = send_bytes = 0; 50 recv_bytes = send_bytes = 0;
  51 + SOCKET_SETUP();
51 } 52 }
52 53
53 SimpleSocketStream::~SimpleSocketStream() 54 SimpleSocketStream::~SimpleSocketStream()
54 { 55 {
55 - if (fd != -1) {  
56 - ::close(fd);  
57 - fd = -1;  
58 - } 56 + SOCKET_CLOSE(fd);
  57 + SOCKET_CLEANUP();
59 } 58 }
60 59
61 int SimpleSocketStream::create_socket() 60 int SimpleSocketStream::create_socket()
62 { 61 {
63 - if((fd = ::socket(AF_INET, SOCK_STREAM, 0)) < 0){ 62 + fd = ::socket(AF_INET, SOCK_STREAM, 0);
  63 + if (!SOCKET_VALID(fd)) {
64 return ERROR_SOCKET_CREATE; 64 return ERROR_SOCKET_CREATE;
65 } 65 }
66 66
@@ -95,12 +95,12 @@ int SimpleSocketStream::read(void* buf, size_t size, ssize_t* nread) @@ -95,12 +95,12 @@ int SimpleSocketStream::read(void* buf, size_t size, ssize_t* nread)
95 // On success a non-negative integer indicating the number of bytes actually read is returned 95 // On success a non-negative integer indicating the number of bytes actually read is returned
96 // (a value of 0 means the network connection is closed or end of file is reached). 96 // (a value of 0 means the network connection is closed or end of file is reached).
97 if (nb_read <= 0) { 97 if (nb_read <= 0) {
98 - if (nb_read < 0 && errno == ETIME) { 98 + if (nb_read < 0 && SOCKET_ERRNO() == SOCKET_ETIME) {
99 return ERROR_SOCKET_TIMEOUT; 99 return ERROR_SOCKET_TIMEOUT;
100 } 100 }
101 101
102 if (nb_read == 0) { 102 if (nb_read == 0) {
103 - errno = ECONNRESET; 103 + errno = SOCKET_ECONNRESET;
104 } 104 }
105 105
106 return ERROR_SOCKET_READ; 106 return ERROR_SOCKET_READ;
@@ -158,7 +158,7 @@ int SimpleSocketStream::writev(const iovec *iov, int iov_size, ssize_t* nwrite) @@ -158,7 +158,7 @@ int SimpleSocketStream::writev(const iovec *iov, int iov_size, ssize_t* nwrite)
158 // returned, and errno is set appropriately. 158 // returned, and errno is set appropriately.
159 if (nb_write <= 0) { 159 if (nb_write <= 0) {
160 // @see https://github.com/winlinvip/simple-rtmp-server/issues/200 160 // @see https://github.com/winlinvip/simple-rtmp-server/issues/200
161 - if (nb_write < 0 && errno == ETIME) { 161 + if (nb_write < 0 && SOCKET_ERRNO() == SOCKET_ETIME) {
162 return ERROR_SOCKET_TIMEOUT; 162 return ERROR_SOCKET_TIMEOUT;
163 } 163 }
164 164
@@ -215,7 +215,7 @@ int SimpleSocketStream::write(void* buf, size_t size, ssize_t* nwrite) @@ -215,7 +215,7 @@ int SimpleSocketStream::write(void* buf, size_t size, ssize_t* nwrite)
215 215
216 if (nb_write <= 0) { 216 if (nb_write <= 0) {
217 // @see https://github.com/winlinvip/simple-rtmp-server/issues/200 217 // @see https://github.com/winlinvip/simple-rtmp-server/issues/200
218 - if (nb_write < 0 && errno == ETIME) { 218 + if (nb_write < 0 && SOCKET_ERRNO() == SOCKET_ETIME) {
219 return ERROR_SOCKET_TIMEOUT; 219 return ERROR_SOCKET_TIMEOUT;
220 } 220 }
221 221
@@ -43,7 +43,7 @@ private: @@ -43,7 +43,7 @@ private:
43 int64_t send_timeout; 43 int64_t send_timeout;
44 int64_t recv_bytes; 44 int64_t recv_bytes;
45 int64_t send_bytes; 45 int64_t send_bytes;
46 - int fd; 46 + SOCKET fd;
47 public: 47 public:
48 SimpleSocketStream(); 48 SimpleSocketStream();
49 virtual ~SimpleSocketStream(); 49 virtual ~SimpleSocketStream();
@@ -34,6 +34,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -34,6 +34,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 #include <sstream> 34 #include <sstream>
35 using namespace std; 35 using namespace std;
36 36
  37 +#include <srs_platform.hpp>
37 #include <srs_kernel_error.hpp> 38 #include <srs_kernel_error.hpp>
38 #include <srs_protocol_rtmp.hpp> 39 #include <srs_protocol_rtmp.hpp>
39 #include <srs_lib_simple_socket.hpp> 40 #include <srs_lib_simple_socket.hpp>
@@ -107,356 +108,6 @@ struct Context @@ -107,356 +108,6 @@ struct Context
107 } 108 }
108 }; 109 };
109 110
110 -// for srs-librtmp, @see https://github.com/winlinvip/simple-rtmp-server/issues/213  
111 -#ifdef _WIN32  
112 - int gettimeofday(struct timeval* tv, struct timezone* tz)  
113 - {  
114 - time_t clock;  
115 - struct tm tm;  
116 - SYSTEMTIME win_time;  
117 -  
118 - GetLocalTime(&win_time);  
119 -  
120 - tm.tm_year = win_time.wYear - 1900;  
121 - tm.tm_mon = win_time.wMonth - 1;  
122 - tm.tm_mday = win_time.wDay;  
123 - tm.tm_hour = win_time.wHour;  
124 - tm.tm_min = win_time.wMinute;  
125 - tm.tm_sec = win_time.wSecond;  
126 - tm.tm_isdst = -1;  
127 -  
128 - clock = mktime(&tm);  
129 -  
130 - tv->tv_sec = (long)clock;  
131 - tv->tv_usec = win_time.wMilliseconds * 1000;  
132 -  
133 - return 0;  
134 - }  
135 -  
136 - int open(const char *pathname, int flags)  
137 - {  
138 - return open(pathname, flags, 0);  
139 - }  
140 -  
141 - int open(const char *pathname, int flags, mode_t mode)  
142 - {  
143 - FILE* file = NULL;  
144 -  
145 - if ((flags & O_RDONLY) == O_RDONLY) {  
146 - file = fopen(pathname, "r");  
147 - } else {  
148 - file = fopen(pathname, "w+");  
149 - }  
150 -  
151 - if (file == NULL) {  
152 - return -1;  
153 - }  
154 -  
155 - return (int)file;  
156 - }  
157 -  
158 - int close(int fd)  
159 - {  
160 - FILE* file = (FILE*)fd;  
161 - return fclose(file);  
162 - }  
163 -  
164 - off_t lseek(int fd, off_t offset, int whence)  
165 - {  
166 - return (off_t)fseek((FILE*)fd, offset, whence);  
167 - }  
168 -  
169 - ssize_t write(int fd, const void *buf, size_t count)  
170 - {  
171 - return (ssize_t)fwrite(buf, count, 1, (FILE*)fd);  
172 - }  
173 -  
174 - ssize_t read(int fd, void *buf, size_t count)  
175 - {  
176 - return (ssize_t)fread(buf, count, 1, (FILE*)fd);  
177 - }  
178 -  
179 - pid_t getpid(void)  
180 - {  
181 - return (pid_t)GetCurrentProcessId();  
182 - }  
183 -  
184 - int usleep(useconds_t usec)  
185 - {  
186 - Sleep((DWORD)(usec / 1000));  
187 - return 0;  
188 - }  
189 -  
190 - ssize_t writev(int fd, const struct iovec *iov, int iovcnt)  
191 - {  
192 - ssize_t nwrite = 0;  
193 - for (int i = 0; i < iovcnt; i++) {  
194 - const struct iovec* current = iov + i;  
195 -  
196 - int nsent = ::send(fd, (char*)current->iov_base, current->iov_len, 0);  
197 - if (nsent < 0) {  
198 - return nsent;  
199 - }  
200 -  
201 - nwrite += nsent;  
202 - if (nsent == 0) {  
203 - return nwrite;  
204 - }  
205 - }  
206 - return nwrite;  
207 - }  
208 -  
209 - //////////////////////// strlcpy.c (modified) //////////////////////////  
210 -  
211 - /* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */  
212 -  
213 - /*-  
214 - * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>  
215 - *  
216 - * Permission to use, copy, modify, and distribute this software for any  
217 - * purpose with or without fee is hereby granted, provided that the above  
218 - * copyright notice and this permission notice appear in all copies.  
219 - *  
220 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES  
221 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF  
222 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR  
223 - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES  
224 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN  
225 - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF  
226 - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  
227 - */  
228 -  
229 - //#include <sys/cdefs.h> // ****  
230 - //#include <cstddef> // ****  
231 - // __FBSDID("$FreeBSD: stable/9/sys/libkern/strlcpy.c 243811 2012-12-03 18:08:44Z delphij $"); // ****  
232 -  
233 - // #include <sys/types.h> // ****  
234 - // #include <sys/libkern.h> // ****  
235 -  
236 - /*  
237 - * Copy src to string dst of size siz. At most siz-1 characters  
238 - * will be copied. Always NUL terminates (unless siz == 0).  
239 - * Returns strlen(src); if retval >= siz, truncation occurred.  
240 - */  
241 -  
242 - //#define __restrict // ****  
243 -  
244 - std::size_t strlcpy(char * __restrict dst, const char * __restrict src, size_t siz)  
245 - {  
246 - char *d = dst;  
247 - const char *s = src;  
248 - size_t n = siz;  
249 -  
250 - /* Copy as many bytes as will fit */  
251 - if (n != 0) {  
252 - while (--n != 0) {  
253 - if ((*d++ = *s++) == '\0')  
254 - break;  
255 - }  
256 - }  
257 -  
258 - /* Not enough room in dst, add NUL and traverse rest of src */  
259 - if (n == 0) {  
260 - if (siz != 0)  
261 - *d = '\0'; /* NUL-terminate dst */  
262 - while (*s++)  
263 - ;  
264 - }  
265 -  
266 - return(s - src - 1); /* count does not include NUL */  
267 - }  
268 -  
269 - // http://www.cplusplus.com/forum/general/141779///////////////////////// inet_ntop.c (modified) //////////////////////////  
270 - /*  
271 - * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")  
272 - * Copyright (c) 1996-1999 by Internet Software Consortium.  
273 - *  
274 - * Permission to use, copy, modify, and distribute this software for any  
275 - * purpose with or without fee is hereby granted, provided that the above  
276 - * copyright notice and this permission notice appear in all copies.  
277 - *  
278 - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES  
279 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF  
280 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR  
281 - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES  
282 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN  
283 - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT  
284 - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  
285 - */  
286 -  
287 - // #if defined(LIBC_SCCS) && !defined(lint) // ****  
288 - //static const char rcsid[] = "$Id: inet_ntop.c,v 1.3.18.2 2005/11/03 23:02:22 marka Exp $";  
289 - // #endif /* LIBC_SCCS and not lint */ // ****  
290 - // #include <sys/cdefs.h> // ****  
291 - // __FBSDID("$FreeBSD: stable/9/sys/libkern/inet_ntop.c 213103 2010-09-24 15:01:45Z attilio $"); // ****  
292 -  
293 - //#define _WIN32_WINNT _WIN32_WINNT_WIN8 // ****  
294 - //#include <Ws2tcpip.h> // ****  
295 - #pragma comment(lib, "Ws2_32.lib") // ****  
296 - //#include <cstdio> // ****  
297 -  
298 - // #include <sys/param.h> // ****  
299 - // #include <sys/socket.h> // ****  
300 - // #include <sys/systm.h> // ****  
301 -  
302 - // #include <netinet/in.h> // ****  
303 -  
304 - /*%  
305 - * WARNING: Don't even consider trying to compile this on a system where  
306 - * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.  
307 - */  
308 -  
309 - static char *inet_ntop4(const u_char *src, char *dst, socklen_t size);  
310 - static char *inet_ntop6(const u_char *src, char *dst, socklen_t size);  
311 -  
312 - /* char *  
313 - * inet_ntop(af, src, dst, size)  
314 - * convert a network format address to presentation format.  
315 - * return:  
316 - * pointer to presentation format address (`dst'), or NULL (see errno).  
317 - * author:  
318 - * Paul Vixie, 1996.  
319 - */  
320 - const char* inet_ntop(int af, const void *src, char *dst, socklen_t size)  
321 - {  
322 - switch (af) {  
323 - case AF_INET:  
324 - return (inet_ntop4( (unsigned char*)src, (char*)dst, size)); // ****  
325 - #ifdef AF_INET6  
326 - #error "IPv6 not supported"  
327 - //case AF_INET6:  
328 - // return (char*)(inet_ntop6( (unsigned char*)src, (char*)dst, size)); // ****  
329 - #endif  
330 - default:  
331 - // return (NULL); // ****  
332 - return 0 ; // ****  
333 - }  
334 - /* NOTREACHED */  
335 - }  
336 -  
337 - /* const char *  
338 - * inet_ntop4(src, dst, size)  
339 - * format an IPv4 address  
340 - * return:  
341 - * `dst' (as a const)  
342 - * notes:  
343 - * (1) uses no statics  
344 - * (2) takes a u_char* not an in_addr as input  
345 - * author:  
346 - * Paul Vixie, 1996.  
347 - */  
348 - static char * inet_ntop4(const u_char *src, char *dst, socklen_t size)  
349 - {  
350 - static const char fmt[128] = "%u.%u.%u.%u";  
351 - char tmp[sizeof "255.255.255.255"];  
352 - int l;  
353 -  
354 - l = snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]); // ****  
355 - if (l <= 0 || (socklen_t) l >= size) {  
356 - return (NULL);  
357 - }  
358 - strlcpy(dst, tmp, size);  
359 - return (dst);  
360 - }  
361 -  
362 - /* const char *  
363 - * inet_ntop6(src, dst, size)  
364 - * convert IPv6 binary address into presentation (printable) format  
365 - * author:  
366 - * Paul Vixie, 1996.  
367 - */  
368 - static char * inet_ntop6(const u_char *src, char *dst, socklen_t size)  
369 - {  
370 - /*  
371 - * Note that int32_t and int16_t need only be "at least" large enough  
372 - * to contain a value of the specified size. On some systems, like  
373 - * Crays, there is no such thing as an integer variable with 16 bits.  
374 - * Keep this in mind if you think this function should have been coded  
375 - * to use pointer overlays. All the world's not a VAX.  
376 - */  
377 - char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;  
378 - struct { int base, len; } best, cur;  
379 - #define NS_IN6ADDRSZ 16  
380 - #define NS_INT16SZ 2  
381 - u_int words[NS_IN6ADDRSZ / NS_INT16SZ];  
382 - int i;  
383 -  
384 - /*  
385 - * Preprocess:  
386 - * Copy the input (bytewise) array into a wordwise array.  
387 - * Find the longest run of 0x00's in src[] for :: shorthanding.  
388 - */  
389 - memset(words, '\0', sizeof words);  
390 - for (i = 0; i < NS_IN6ADDRSZ; i++)  
391 - words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));  
392 - best.base = -1;  
393 - best.len = 0;  
394 - cur.base = -1;  
395 - cur.len = 0;  
396 - for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {  
397 - if (words[i] == 0) {  
398 - if (cur.base == -1)  
399 - cur.base = i, cur.len = 1;  
400 - else  
401 - cur.len++;  
402 - } else {  
403 - if (cur.base != -1) {  
404 - if (best.base == -1 || cur.len > best.len)  
405 - best = cur;  
406 - cur.base = -1;  
407 - }  
408 - }  
409 - }  
410 - if (cur.base != -1) {  
411 - if (best.base == -1 || cur.len > best.len)  
412 - best = cur;  
413 - }  
414 - if (best.base != -1 && best.len < 2)  
415 - best.base = -1;  
416 -  
417 - /*  
418 - * Format the result.  
419 - */  
420 - tp = tmp;  
421 - for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {  
422 - /* Are we inside the best run of 0x00's? */  
423 - if (best.base != -1 && i >= best.base &&  
424 - i < (best.base + best.len)) {  
425 - if (i == best.base)  
426 - *tp++ = ':';  
427 - continue;  
428 - }  
429 - /* Are we following an initial run of 0x00s or any real hex? */  
430 - if (i != 0)  
431 - *tp++ = ':';  
432 - /* Is this address an encapsulated IPv4? */  
433 - if (i == 6 && best.base == 0 && (best.len == 6 ||  
434 - (best.len == 7 && words[7] != 0x0001) ||  
435 - (best.len == 5 && words[5] == 0xffff))) {  
436 - if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))  
437 - return (NULL);  
438 - tp += strlen(tp);  
439 - break;  
440 - }  
441 - tp += std::sprintf(tp, "%x", words[i]); // ****  
442 - }  
443 - /* Was it a trailing run of 0x00's? */  
444 - if (best.base != -1 && (best.base + best.len) ==  
445 - (NS_IN6ADDRSZ / NS_INT16SZ))  
446 - *tp++ = ':';  
447 - *tp++ = '\0';  
448 -  
449 - /*  
450 - * Check for overflow, copy, and we're done.  
451 - */  
452 - if ((socklen_t)(tp - tmp) > size) {  
453 - return (NULL);  
454 - }  
455 - strcpy(dst, tmp);  
456 - return (dst);  
457 - }  
458 -#endif  
459 -  
460 int srs_librtmp_context_parse_uri(Context* context) 111 int srs_librtmp_context_parse_uri(Context* context)
461 { 112 {
462 int ret = ERROR_SUCCESS; 113 int ret = ERROR_SUCCESS;
@@ -30,47 +30,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -30,47 +30,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 30
31 #include <sys/types.h> 31 #include <sys/types.h>
32 32
33 -// for srs-librtmp, @see https://github.com/winlinvip/simple-rtmp-server/issues/213  
34 -#ifdef _WIN32  
35 - #define _CRT_SECURE_NO_WARNINGS  
36 - typedef unsigned long long u_int64_t;  
37 - typedef long long int64_t;  
38 - typedef unsigned int u_int32_t;  
39 - typedef int int32_t;  
40 - typedef unsigned char u_int8_t;  
41 - typedef char int8_t;  
42 - typedef unsigned short u_int16_t;  
43 - typedef short int16_t;  
44 - typedef int64_t ssize_t;  
45 - struct iovec {  
46 - void *iov_base; /* Starting address */  
47 - size_t iov_len; /* Number of bytes to transfer */  
48 - };  
49 - #include <time.h>  
50 - #include <windows.h>  
51 - int gettimeofday(struct timeval* tv, struct timezone* tz);  
52 - #define PRId64 "lld"  
53 - typedef int socklen_t;  
54 - const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);  
55 - typedef int mode_t;  
56 - #define S_IRUSR 0  
57 - #define S_IWUSR 0  
58 - #define S_IRGRP 0  
59 - #define S_IWGRP 0  
60 - #define S_IROTH 0  
61 - int open(const char *pathname, int flags);  
62 - int open(const char *pathname, int flags, mode_t mode);  
63 - int close(int fd);  
64 - off_t lseek(int fd, off_t offset, int whence);  
65 - ssize_t write(int fd, const void *buf, size_t count);  
66 - ssize_t read(int fd, void *buf, size_t count);  
67 - typedef int pid_t;  
68 - pid_t getpid(void);  
69 - #define snprintf _snprintf  
70 - ssize_t writev(int fd, const struct iovec *iov, int iovcnt);  
71 - typedef int64_t useconds_t;  
72 - int usleep(useconds_t usec);  
73 -#endif  
74 33
75 /** 34 /**
76 * srs-librtmp is a librtmp like library, 35 * srs-librtmp is a librtmp like library,
@@ -15,6 +15,8 @@ file @@ -15,6 +15,8 @@ file
15 ..\core\srs_core.cpp, 15 ..\core\srs_core.cpp,
16 ..\core\srs_core_autofree.hpp, 16 ..\core\srs_core_autofree.hpp,
17 ..\core\srs_core_autofree.cpp, 17 ..\core\srs_core_autofree.cpp,
  18 + ..\core\srs_platform.hpp,
  19 + ..\core\srs_platform.cpp,
18 kernel readonly separator, 20 kernel readonly separator,
19 ..\kernel\srs_kernel_buffer.hpp, 21 ..\kernel\srs_kernel_buffer.hpp,
20 ..\kernel\srs_kernel_buffer.cpp, 22 ..\kernel\srs_kernel_buffer.cpp,
  1 +LIBRARY
  2 +EXPORTS
  3 +srs_rtmp_create
  4 +srs_rtmp_create2
  5 +srs_rtmp_destroy
  6 +srs_rtmp_handshake
  7 +srs_rtmp_connect_app
  8 +srs_rtmp_connect_app2
  9 +srs_rtmp_play_stream
  10 +srs_rtmp_publish_stream
  11 +srs_rtmp_read_packet
  12 +srs_rtmp_write_packet
  13 +srs_version_major
  14 +srs_version_minor
  15 +srs_version_revision
  16 +srs_utils_parse_timestamp
  17 +srs_human_format_time
  18 +srs_human_print_rtmp_packet
  19 +srs_rtmp_bandwidth_check
  20 +;
  21 +__srs_rtmp_do_simple_handshake
  22 +__srs_rtmp_connect_server
  23 +__srs_rtmp_dns_resolve
  24 +
  25 +;;;;;;;;for flv read/write;;;;;;;;
  26 +srs_flv_open_read
  27 +srs_flv_open_write
  28 +srs_flv_close
  29 +srs_flv_read_header
  30 +srs_flv_read_tag_header
  31 +srs_flv_read_tag_data
  32 +srs_flv_write_header
  33 +srs_flv_write_tag
  34 +srs_flv_size_tag
  35 +srs_flv_tellg
  36 +srs_flv_lseek
  37 +srs_flv_is_eof
  38 +srs_flv_is_sequence_header
  39 +srs_flv_is_keyframe
  40 +
  41 +;;;;;;;;for h264 read/write;;;;;;;;
  42 +srs_h264_write_raw_frames
  43 +srs_h264_is_dvbsp_error
  44 +srs_h264_is_duplicated_sps_error
  45 +srs_h264_is_duplicated_pps_error
  46 +srs_h264_startswith_annexb
  1 +
  2 +Microsoft Visual Studio Solution File, Format Version 11.00
  3 +# Visual Studio 2010
  4 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "srs-librtmp", "srs-librtmp_vs2010.vcxproj", "{051CC3D8-5A99-4534-90EE-AED40EDDEEB2}"
  5 +EndProject
  6 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "srs_play", "srs_play.vcxproj", "{5149B9A9-5085-4A10-AD6F-23FBE6854390}"
  7 +EndProject
  8 +Global
  9 + GlobalSection(SolutionConfigurationPlatforms) = preSolution
  10 + Debug|Win32 = Debug|Win32
  11 + Release|Win32 = Release|Win32
  12 + EndGlobalSection
  13 + GlobalSection(ProjectConfigurationPlatforms) = postSolution
  14 + {051CC3D8-5A99-4534-90EE-AED40EDDEEB2}.Debug|Win32.ActiveCfg = Debug|Win32
  15 + {051CC3D8-5A99-4534-90EE-AED40EDDEEB2}.Debug|Win32.Build.0 = Debug|Win32
  16 + {051CC3D8-5A99-4534-90EE-AED40EDDEEB2}.Release|Win32.ActiveCfg = Release|Win32
  17 + {051CC3D8-5A99-4534-90EE-AED40EDDEEB2}.Release|Win32.Build.0 = Release|Win32
  18 + {5149B9A9-5085-4A10-AD6F-23FBE6854390}.Debug|Win32.ActiveCfg = Debug|Win32
  19 + {5149B9A9-5085-4A10-AD6F-23FBE6854390}.Debug|Win32.Build.0 = Debug|Win32
  20 + {5149B9A9-5085-4A10-AD6F-23FBE6854390}.Release|Win32.ActiveCfg = Release|Win32
  21 + {5149B9A9-5085-4A10-AD6F-23FBE6854390}.Release|Win32.Build.0 = Release|Win32
  22 + EndGlobalSection
  23 + GlobalSection(SolutionProperties) = preSolution
  24 + HideSolutionNode = FALSE
  25 + EndGlobalSection
  26 +EndGlobal
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3 + <ItemGroup Label="ProjectConfigurations">
  4 + <ProjectConfiguration Include="Debug|Win32">
  5 + <Configuration>Debug</Configuration>
  6 + <Platform>Win32</Platform>
  7 + </ProjectConfiguration>
  8 + <ProjectConfiguration Include="Release|Win32">
  9 + <Configuration>Release</Configuration>
  10 + <Platform>Win32</Platform>
  11 + </ProjectConfiguration>
  12 + </ItemGroup>
  13 + <ItemGroup>
  14 + <ClCompile Include="..\src\core\srs_core.cpp" />
  15 + <ClCompile Include="..\src\core\srs_core_autofree.cpp" />
  16 + <ClCompile Include="..\src\core\srs_platform.cpp" />
  17 + <ClCompile Include="..\src\kernel\srs_kernel_buffer.cpp" />
  18 + <ClCompile Include="..\src\kernel\srs_kernel_codec.cpp" />
  19 + <ClCompile Include="..\src\kernel\srs_kernel_consts.cpp" />
  20 + <ClCompile Include="..\src\kernel\srs_kernel_error.cpp" />
  21 + <ClCompile Include="..\src\kernel\srs_kernel_file.cpp" />
  22 + <ClCompile Include="..\src\kernel\srs_kernel_flv.cpp" />
  23 + <ClCompile Include="..\src\kernel\srs_kernel_log.cpp" />
  24 + <ClCompile Include="..\src\kernel\srs_kernel_stream.cpp" />
  25 + <ClCompile Include="..\src\kernel\srs_kernel_utility.cpp" />
  26 + <ClCompile Include="..\src\libs\srs_librtmp.cpp" />
  27 + <ClCompile Include="..\src\libs\srs_lib_bandwidth.cpp" />
  28 + <ClCompile Include="..\src\libs\srs_lib_simple_socket.cpp" />
  29 + <ClCompile Include="..\src\rtmp\srs_protocol_amf0.cpp" />
  30 + <ClCompile Include="..\src\rtmp\srs_protocol_handshake.cpp" />
  31 + <ClCompile Include="..\src\rtmp\srs_protocol_io.cpp" />
  32 + <ClCompile Include="..\src\rtmp\srs_protocol_msg_array.cpp" />
  33 + <ClCompile Include="..\src\rtmp\srs_protocol_rtmp.cpp" />
  34 + <ClCompile Include="..\src\rtmp\srs_protocol_stack.cpp" />
  35 + <ClCompile Include="..\src\rtmp\srs_protocol_utility.cpp" />
  36 + </ItemGroup>
  37 + <ItemGroup>
  38 + <ClInclude Include="..\src\core\srs_core.hpp" />
  39 + <ClInclude Include="..\src\core\srs_core_autofree.hpp" />
  40 + <ClInclude Include="..\src\core\srs_platform.hpp" />
  41 + <ClInclude Include="..\src\kernel\srs_kernel_buffer.hpp" />
  42 + <ClInclude Include="..\src\kernel\srs_kernel_codec.hpp" />
  43 + <ClInclude Include="..\src\kernel\srs_kernel_consts.hpp" />
  44 + <ClInclude Include="..\src\kernel\srs_kernel_error.hpp" />
  45 + <ClInclude Include="..\src\kernel\srs_kernel_file.hpp" />
  46 + <ClInclude Include="..\src\kernel\srs_kernel_flv.hpp" />
  47 + <ClInclude Include="..\src\kernel\srs_kernel_log.hpp" />
  48 + <ClInclude Include="..\src\kernel\srs_kernel_stream.hpp" />
  49 + <ClInclude Include="..\src\kernel\srs_kernel_utility.hpp" />
  50 + <ClInclude Include="..\src\libs\srs_librtmp.hpp" />
  51 + <ClInclude Include="..\src\libs\srs_lib_bandwidth.hpp" />
  52 + <ClInclude Include="..\src\libs\srs_lib_simple_socket.hpp" />
  53 + <ClInclude Include="..\src\rtmp\srs_protocol_amf0.hpp" />
  54 + <ClInclude Include="..\src\rtmp\srs_protocol_handshake.hpp" />
  55 + <ClInclude Include="..\src\rtmp\srs_protocol_io.hpp" />
  56 + <ClInclude Include="..\src\rtmp\srs_protocol_msg_array.hpp" />
  57 + <ClInclude Include="..\src\rtmp\srs_protocol_rtmp.hpp" />
  58 + <ClInclude Include="..\src\rtmp\srs_protocol_stack.hpp" />
  59 + <ClInclude Include="..\src\rtmp\srs_protocol_utility.hpp" />
  60 + </ItemGroup>
  61 + <ItemGroup>
  62 + <None Include="srs-librtmp.def" />
  63 + </ItemGroup>
  64 + <PropertyGroup Label="Globals">
  65 + <ProjectGuid>{051CC3D8-5A99-4534-90EE-AED40EDDEEB2}</ProjectGuid>
  66 + <Keyword>Win32Proj</Keyword>
  67 + <RootNamespace>srslibrtmp</RootNamespace>
  68 + <ProjectName>srs-librtmp</ProjectName>
  69 + </PropertyGroup>
  70 + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  71 + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
  72 + <ConfigurationType>DynamicLibrary</ConfigurationType>
  73 + <UseDebugLibraries>true</UseDebugLibraries>
  74 + <CharacterSet>Unicode</CharacterSet>
  75 + </PropertyGroup>
  76 + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
  77 + <ConfigurationType>DynamicLibrary</ConfigurationType>
  78 + <UseDebugLibraries>false</UseDebugLibraries>
  79 + <WholeProgramOptimization>true</WholeProgramOptimization>
  80 + <CharacterSet>Unicode</CharacterSet>
  81 + </PropertyGroup>
  82 + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  83 + <ImportGroup Label="ExtensionSettings">
  84 + </ImportGroup>
  85 + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  86 + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  87 + </ImportGroup>
  88 + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  89 + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  90 + </ImportGroup>
  91 + <PropertyGroup Label="UserMacros" />
  92 + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  93 + <LinkIncremental>true</LinkIncremental>
  94 + </PropertyGroup>
  95 + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  96 + <LinkIncremental>false</LinkIncremental>
  97 + </PropertyGroup>
  98 + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  99 + <ClCompile>
  100 + <PrecompiledHeader>
  101 + </PrecompiledHeader>
  102 + <WarningLevel>Level3</WarningLevel>
  103 + <Optimization>Disabled</Optimization>
  104 + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SRSLIBRTMP_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  105 + <AdditionalIncludeDirectories>..\src\rtmp;..\src\libs;..\src\kernel;..\src\core;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  106 + </ClCompile>
  107 + <Link>
  108 + <SubSystem>Windows</SubSystem>
  109 + <GenerateDebugInformation>true</GenerateDebugInformation>
  110 + <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
  111 + <ModuleDefinitionFile>srs-librtmp.def</ModuleDefinitionFile>
  112 + </Link>
  113 + </ItemDefinitionGroup>
  114 + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  115 + <ClCompile>
  116 + <WarningLevel>Level3</WarningLevel>
  117 + <PrecompiledHeader>
  118 + </PrecompiledHeader>
  119 + <Optimization>MaxSpeed</Optimization>
  120 + <FunctionLevelLinking>true</FunctionLevelLinking>
  121 + <IntrinsicFunctions>true</IntrinsicFunctions>
  122 + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SRSLIBRTMP_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  123 + <AdditionalIncludeDirectories>..\src\rtmp;..\src\libs;..\src\kernel;..\src\core;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  124 + </ClCompile>
  125 + <Link>
  126 + <SubSystem>Windows</SubSystem>
  127 + <GenerateDebugInformation>true</GenerateDebugInformation>
  128 + <EnableCOMDATFolding>true</EnableCOMDATFolding>
  129 + <OptimizeReferences>true</OptimizeReferences>
  130 + <ModuleDefinitionFile>srs-librtmp.def</ModuleDefinitionFile>
  131 + <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
  132 + </Link>
  133 + </ItemDefinitionGroup>
  134 + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  135 + <ImportGroup Label="ExtensionTargets">
  136 + </ImportGroup>
  137 +</Project>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3 + <ItemGroup>
  4 + <Filter Include="core">
  5 + <UniqueIdentifier>{8e33c6db-7a35-4d09-92d0-cc28491abbd6}</UniqueIdentifier>
  6 + </Filter>
  7 + <Filter Include="kernel">
  8 + <UniqueIdentifier>{eac81f26-3b4f-4905-85c5-2c0b915107b0}</UniqueIdentifier>
  9 + </Filter>
  10 + <Filter Include="libs">
  11 + <UniqueIdentifier>{cbb45db3-c682-48bd-9a8c-1ae081aeddbf}</UniqueIdentifier>
  12 + </Filter>
  13 + <Filter Include="rtmp">
  14 + <UniqueIdentifier>{6a284cec-b287-4aeb-b991-e11ebb4be6ec}</UniqueIdentifier>
  15 + </Filter>
  16 + </ItemGroup>
  17 + <ItemGroup>
  18 + <ClCompile Include="..\src\core\srs_core.cpp">
  19 + <Filter>core</Filter>
  20 + </ClCompile>
  21 + <ClCompile Include="..\src\core\srs_core_autofree.cpp">
  22 + <Filter>core</Filter>
  23 + </ClCompile>
  24 + <ClCompile Include="..\src\core\srs_platform.cpp">
  25 + <Filter>core</Filter>
  26 + </ClCompile>
  27 + <ClCompile Include="..\src\kernel\srs_kernel_buffer.cpp">
  28 + <Filter>kernel</Filter>
  29 + </ClCompile>
  30 + <ClCompile Include="..\src\kernel\srs_kernel_codec.cpp">
  31 + <Filter>kernel</Filter>
  32 + </ClCompile>
  33 + <ClCompile Include="..\src\kernel\srs_kernel_consts.cpp">
  34 + <Filter>kernel</Filter>
  35 + </ClCompile>
  36 + <ClCompile Include="..\src\kernel\srs_kernel_error.cpp">
  37 + <Filter>kernel</Filter>
  38 + </ClCompile>
  39 + <ClCompile Include="..\src\kernel\srs_kernel_file.cpp">
  40 + <Filter>kernel</Filter>
  41 + </ClCompile>
  42 + <ClCompile Include="..\src\kernel\srs_kernel_flv.cpp">
  43 + <Filter>kernel</Filter>
  44 + </ClCompile>
  45 + <ClCompile Include="..\src\kernel\srs_kernel_log.cpp">
  46 + <Filter>kernel</Filter>
  47 + </ClCompile>
  48 + <ClCompile Include="..\src\kernel\srs_kernel_stream.cpp">
  49 + <Filter>kernel</Filter>
  50 + </ClCompile>
  51 + <ClCompile Include="..\src\kernel\srs_kernel_utility.cpp">
  52 + <Filter>kernel</Filter>
  53 + </ClCompile>
  54 + <ClCompile Include="..\src\libs\srs_lib_bandwidth.cpp">
  55 + <Filter>libs</Filter>
  56 + </ClCompile>
  57 + <ClCompile Include="..\src\libs\srs_lib_simple_socket.cpp">
  58 + <Filter>libs</Filter>
  59 + </ClCompile>
  60 + <ClCompile Include="..\src\libs\srs_librtmp.cpp">
  61 + <Filter>libs</Filter>
  62 + </ClCompile>
  63 + <ClCompile Include="..\src\rtmp\srs_protocol_amf0.cpp">
  64 + <Filter>rtmp</Filter>
  65 + </ClCompile>
  66 + <ClCompile Include="..\src\rtmp\srs_protocol_handshake.cpp">
  67 + <Filter>rtmp</Filter>
  68 + </ClCompile>
  69 + <ClCompile Include="..\src\rtmp\srs_protocol_io.cpp">
  70 + <Filter>rtmp</Filter>
  71 + </ClCompile>
  72 + <ClCompile Include="..\src\rtmp\srs_protocol_msg_array.cpp">
  73 + <Filter>rtmp</Filter>
  74 + </ClCompile>
  75 + <ClCompile Include="..\src\rtmp\srs_protocol_rtmp.cpp">
  76 + <Filter>rtmp</Filter>
  77 + </ClCompile>
  78 + <ClCompile Include="..\src\rtmp\srs_protocol_stack.cpp">
  79 + <Filter>rtmp</Filter>
  80 + </ClCompile>
  81 + <ClCompile Include="..\src\rtmp\srs_protocol_utility.cpp">
  82 + <Filter>rtmp</Filter>
  83 + </ClCompile>
  84 + </ItemGroup>
  85 + <ItemGroup>
  86 + <ClInclude Include="..\src\core\srs_core.hpp">
  87 + <Filter>core</Filter>
  88 + </ClInclude>
  89 + <ClInclude Include="..\src\core\srs_core_autofree.hpp">
  90 + <Filter>core</Filter>
  91 + </ClInclude>
  92 + <ClInclude Include="..\src\core\srs_platform.hpp">
  93 + <Filter>core</Filter>
  94 + </ClInclude>
  95 + <ClInclude Include="..\src\kernel\srs_kernel_buffer.hpp">
  96 + <Filter>kernel</Filter>
  97 + </ClInclude>
  98 + <ClInclude Include="..\src\kernel\srs_kernel_codec.hpp">
  99 + <Filter>kernel</Filter>
  100 + </ClInclude>
  101 + <ClInclude Include="..\src\kernel\srs_kernel_consts.hpp">
  102 + <Filter>kernel</Filter>
  103 + </ClInclude>
  104 + <ClInclude Include="..\src\kernel\srs_kernel_error.hpp">
  105 + <Filter>kernel</Filter>
  106 + </ClInclude>
  107 + <ClInclude Include="..\src\kernel\srs_kernel_file.hpp">
  108 + <Filter>kernel</Filter>
  109 + </ClInclude>
  110 + <ClInclude Include="..\src\kernel\srs_kernel_flv.hpp">
  111 + <Filter>kernel</Filter>
  112 + </ClInclude>
  113 + <ClInclude Include="..\src\kernel\srs_kernel_log.hpp">
  114 + <Filter>kernel</Filter>
  115 + </ClInclude>
  116 + <ClInclude Include="..\src\kernel\srs_kernel_stream.hpp">
  117 + <Filter>kernel</Filter>
  118 + </ClInclude>
  119 + <ClInclude Include="..\src\kernel\srs_kernel_utility.hpp">
  120 + <Filter>kernel</Filter>
  121 + </ClInclude>
  122 + <ClInclude Include="..\src\libs\srs_lib_bandwidth.hpp">
  123 + <Filter>libs</Filter>
  124 + </ClInclude>
  125 + <ClInclude Include="..\src\libs\srs_lib_simple_socket.hpp">
  126 + <Filter>libs</Filter>
  127 + </ClInclude>
  128 + <ClInclude Include="..\src\libs\srs_librtmp.hpp">
  129 + <Filter>libs</Filter>
  130 + </ClInclude>
  131 + <ClInclude Include="..\src\rtmp\srs_protocol_amf0.hpp">
  132 + <Filter>rtmp</Filter>
  133 + </ClInclude>
  134 + <ClInclude Include="..\src\rtmp\srs_protocol_handshake.hpp">
  135 + <Filter>rtmp</Filter>
  136 + </ClInclude>
  137 + <ClInclude Include="..\src\rtmp\srs_protocol_io.hpp">
  138 + <Filter>rtmp</Filter>
  139 + </ClInclude>
  140 + <ClInclude Include="..\src\rtmp\srs_protocol_msg_array.hpp">
  141 + <Filter>rtmp</Filter>
  142 + </ClInclude>
  143 + <ClInclude Include="..\src\rtmp\srs_protocol_rtmp.hpp">
  144 + <Filter>rtmp</Filter>
  145 + </ClInclude>
  146 + <ClInclude Include="..\src\rtmp\srs_protocol_stack.hpp">
  147 + <Filter>rtmp</Filter>
  148 + </ClInclude>
  149 + <ClInclude Include="..\src\rtmp\srs_protocol_utility.hpp">
  150 + <Filter>rtmp</Filter>
  151 + </ClInclude>
  152 + </ItemGroup>
  153 + <ItemGroup>
  154 + <None Include="srs-librtmp.def" />
  155 + </ItemGroup>
  156 +</Project>
  1 +// auto generated by configure
  2 +#ifndef SRS_AUTO_HEADER_HPP
  3 +#define SRS_AUTO_HEADER_HPP
  4 +
  5 +#define SRS_AUTO_BUILD_TS "1416731672"
  6 +#define SRS_AUTO_BUILD_DATE "2014-11-23 16:34:32"
  7 +#define SRS_AUTO_UNAME "WIN_NT-6.1 WZY-PC2 1.0.18(0.48/3/2) 2012-11-21 22:34 i686 WINNT"
  8 +#define SRS_AUTO_USER_CONFIGURE "--x86-x64 --export-librtmp-project=../srs-librtmp"
  9 +#define SRS_AUTO_CONFIGURE "--prefix=/usr/local/srs --without-hls --without-dvr --without-nginx --without-ssl --without-ffmpeg --without-transcode --without-ingest --without-stat --without-http-callback --without-http-server --without-http-api --with-librtmp --with-research --without-utest --without-gperf --without-gmc --without-gmp --without-gcp --without-gprof --without-arm-ubuntu12 --without-mips-ubuntu12 --log-trace"
  10 +
  11 +#define SRS_AUTO_EMBEDED_TOOL_CHAIN "normal x86/x64 gcc"
  12 +
  13 +#undef SRS_AUTO_HTTP_PARSER
  14 +#undef SRS_AUTO_HTTP_SERVER
  15 +#undef SRS_AUTO_HTTP_API
  16 +#undef SRS_AUTO_NGINX
  17 +#undef SRS_AUTO_DVR
  18 +#undef SRS_AUTO_HLS
  19 +#undef SRS_AUTO_HTTP_CALLBACK
  20 +#undef SRS_AUTO_SSL
  21 +#undef SRS_AUTO_FFMPEG_TOOL
  22 +#undef SRS_AUTO_FFMPEG_STUB
  23 +#undef SRS_AUTO_TRANSCODE
  24 +#undef SRS_AUTO_INGEST
  25 +#undef SRS_AUTO_STAT
  26 +#undef SRS_AUTO_GPERF
  27 +#undef SRS_AUTO_GPERF_MC
  28 +#undef SRS_AUTO_GPERF_MP
  29 +#undef SRS_AUTO_GPERF_CP
  30 +#undef SRS_AUTO_EMBEDED_CPU
  31 +#undef SRS_AUTO_ARM_UBUNTU12
  32 +#undef SRS_AUTO_MIPS_UBUNTU12
  33 +
  34 +#undef SRS_AUTO_VERBOSE
  35 +#undef SRS_AUTO_INFO
  36 +#define SRS_AUTO_TRACE
  37 +
  38 +#define SRS_AUTO_PREFIX "/usr/local/srs"
  39 +
  40 +#define SRS_AUTO_CONSTRIBUTORS "\
  41 +winlin<winlin@vip.126.com> \
  42 +wenjie.zhao<740936897@qq.com> \
  43 +xiangcheng.liu<liuxc0116@foxmail.com> \
  44 +naijia.liu<youngcow@youngcow.net> \
  45 +alcoholyi<alcoholyi@qq.com> \
  46 +byteman<wangchen2011@gmail.com> \
  47 +chad.wang<chad.wang.cn@gmail.com> \
  48 +suhetao<suhetao@gmail.com> \
  49 +Johnny<fengjihu@163.com> \
  50 +karthikeyan<keyanmca@gmail.com> \
  51 +StevenLiu<lq@chinaffmpeg.org> \
  52 +zhengfl<zhengfl_1989@126.com> \
  53 +"
  54 +
  55 +#endif
  56 +
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3 + <ItemGroup Label="ProjectConfigurations">
  4 + <ProjectConfiguration Include="Debug|Win32">
  5 + <Configuration>Debug</Configuration>
  6 + <Platform>Win32</Platform>
  7 + </ProjectConfiguration>
  8 + <ProjectConfiguration Include="Release|Win32">
  9 + <Configuration>Release</Configuration>
  10 + <Platform>Win32</Platform>
  11 + </ProjectConfiguration>
  12 + </ItemGroup>
  13 + <PropertyGroup Label="Globals">
  14 + <ProjectGuid>{5149B9A9-5085-4A10-AD6F-23FBE6854390}</ProjectGuid>
  15 + <Keyword>Win32Proj</Keyword>
  16 + <RootNamespace>srs_play</RootNamespace>
  17 + </PropertyGroup>
  18 + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  19 + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
  20 + <ConfigurationType>Application</ConfigurationType>
  21 + <UseDebugLibraries>true</UseDebugLibraries>
  22 + <CharacterSet>Unicode</CharacterSet>
  23 + </PropertyGroup>
  24 + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
  25 + <ConfigurationType>Application</ConfigurationType>
  26 + <UseDebugLibraries>false</UseDebugLibraries>
  27 + <WholeProgramOptimization>true</WholeProgramOptimization>
  28 + <CharacterSet>Unicode</CharacterSet>
  29 + </PropertyGroup>
  30 + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  31 + <ImportGroup Label="ExtensionSettings">
  32 + </ImportGroup>
  33 + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  34 + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  35 + </ImportGroup>
  36 + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  37 + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  38 + </ImportGroup>
  39 + <PropertyGroup Label="UserMacros" />
  40 + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  41 + <LinkIncremental>true</LinkIncremental>
  42 + </PropertyGroup>
  43 + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  44 + <LinkIncremental>false</LinkIncremental>
  45 + </PropertyGroup>
  46 + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  47 + <ClCompile>
  48 + <PrecompiledHeader>
  49 + </PrecompiledHeader>
  50 + <WarningLevel>Level3</WarningLevel>
  51 + <Optimization>Disabled</Optimization>
  52 + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  53 + <AdditionalIncludeDirectories>..\src\core;..\src\libs;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  54 + </ClCompile>
  55 + <Link>
  56 + <SubSystem>Console</SubSystem>
  57 + <GenerateDebugInformation>true</GenerateDebugInformation>
  58 + <AdditionalDependencies>srs-librtmp.lib;%(AdditionalDependencies)</AdditionalDependencies>
  59 + <AdditionalLibraryDirectories>./debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
  60 + </Link>
  61 + </ItemDefinitionGroup>
  62 + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  63 + <ClCompile>
  64 + <WarningLevel>Level3</WarningLevel>
  65 + <PrecompiledHeader>
  66 + </PrecompiledHeader>
  67 + <Optimization>MaxSpeed</Optimization>
  68 + <FunctionLevelLinking>true</FunctionLevelLinking>
  69 + <IntrinsicFunctions>true</IntrinsicFunctions>
  70 + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  71 + </ClCompile>
  72 + <Link>
  73 + <SubSystem>Console</SubSystem>
  74 + <GenerateDebugInformation>true</GenerateDebugInformation>
  75 + <EnableCOMDATFolding>true</EnableCOMDATFolding>
  76 + <OptimizeReferences>true</OptimizeReferences>
  77 + </Link>
  78 + </ItemDefinitionGroup>
  79 + <ItemGroup>
  80 + <ClCompile Include="srs_play.c" />
  81 + </ItemGroup>
  82 + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  83 + <ImportGroup Label="ExtensionTargets">
  84 + </ImportGroup>
  85 +</Project>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3 + <ItemGroup>
  4 + <Filter Include="Source Files">
  5 + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
  6 + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
  7 + </Filter>
  8 + <Filter Include="Header Files">
  9 + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
  10 + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
  11 + </Filter>
  12 + <Filter Include="Resource Files">
  13 + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
  14 + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
  15 + </Filter>
  16 + </ItemGroup>
  17 + <ItemGroup>
  18 + <ClCompile Include="srs_play.c">
  19 + <Filter>Source Files</Filter>
  20 + </ClCompile>
  21 + </ItemGroup>
  22 +</Project>