#include <assert.h>
#include <stdlib.h>
+#include "rtmp_sys.h"
#include "amf.h"
#include "log.h"
#include "bytes.h"
*/
#include <stdint.h>
+
+#ifdef _XBOX
+
+#ifndef __cplusplus
+#define bool _Bool
+typedef unsigned char _Bool;
+#define false 0
+#define true 1
+#endif
+
+#else
#include <stdbool.h>
+#endif
#ifdef __cplusplus
extern "C"
#include <stdint.h>
-#ifdef WIN32
+#if defined(WIN32) || defined(_XBOX)
/* Windows is little endian only */
#define __LITTLE_ENDIAN 1234
#define __BIG_ENDIAN 4321
}
sa.sin_port = htons(port);
sb.sb_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (sb.sb_socket < 0)
+ if (sb.sb_socket == -1)
return HTTPRES_LOST_CONNECTION;
i =
sprintf(sb.sb_buf,
AVal home, hpre;
date[0] = '\0';
-#ifdef WIN32
+#if defined(WIN32) || defined(_XBOX)
+#ifdef _XBOX
+ hpre.av_val = "Q:";
+ hpre.av_len = 2;
+ home.av_val = "\\UserData\\cache";
+#else
hpre.av_val = getenv("HOMEDRIVE");
hpre.av_len = strlen(hpre.av_val);
home.av_val = getenv("HOMEPATH");
+#endif
#define DIRSEP "\\"
-#else
+
+#else /* !WIN32 */
hpre.av_val = "";
hpre.av_len = 0;
home.av_val = getenv("HOME");
#include <assert.h>
#include <ctype.h>
+#include "rtmp_sys.h"
#include "log.h"
#define MAX_PRINT_LEN 2048
#ifdef __cplusplus
}
#endif
+
#endif
}
}
- setsockopt(r->m_sb.sb_socket, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
+ setsockopt(r->m_sb.sb_socket, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof(on));
return true;
}
* packets, 0 if ignorable error, >0 if there is a media packet
*/
static int
-Read_1_Packet(RTMP *r, char *buf, int buflen)
+Read_1_Packet(RTMP *r, char *buf, unsigned int buflen)
{
uint32_t prevTagSize = 0;
int rtnGetNextMediaPacket = 0, ret = RTMP_READ_EOF;
* http://www.gnu.org/copyleft/lgpl.html
*/
-#ifndef NO_CRYPTO
+#if !defined(NO_CRYPTO) && !defined(CRYPTO)
#define CRYPTO
#endif
* http://www.gnu.org/copyleft/lgpl.html
*/
-#ifdef WIN32
+#if defined(WIN32) || defined(_XBOX)
+
+#ifdef _XBOX
+#include <xtl.h>
+#include <winsockx.h>
+#define snprintf _snprintf
+#define strcasecmp stricmp
+#define strncasecmp strnicmp
+#define vsnprintf _vsnprintf
+
+#else /* !_XBOX */
#include <winsock2.h>
#include <ws2tcpip.h>
+#endif
+
#define GetSockError() WSAGetLastError()
#define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e)
#define EWOULDBLOCK WSAETIMEDOUT /* we don't use nonblocking, but we do use timeouts */
#define sleep(n) Sleep(n*1000)
#define msleep(n) Sleep(n)
#define SET_RCVTIMEO(tv,s) int tv = s*1000
-#else
+#else /* !WIN32 && !_XBOX */
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/times.h>