summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorlu_zero <lu_zero@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-06-25 13:03:18 +0000
committerlu_zero <lu_zero@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-06-25 13:03:18 +0000
commit4989f301f1685c46015776c5a67741e662f30c6b (patch)
treed9f5b462ad50cec4f6ab9e0f27f7bd65f9d5e121 /stream
parent401c4717b973bfd729513f1b1f0db27c78c48367 (diff)
downloadmpv-4989f301f1685c46015776c5a67741e662f30c6b.tar.bz2
mpv-4989f301f1685c46015776c5a67741e662f30c6b.tar.xz
Fix the issue instead of reverting
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27136 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/librtsp/rtsp.c58
-rw-r--r--stream/librtsp/rtsp.h53
-rw-r--r--stream/librtsp/rtsp_session.c3
3 files changed, 56 insertions, 58 deletions
diff --git a/stream/librtsp/rtsp.c b/stream/librtsp/rtsp.c
index ca5e16d39b..30a2987e16 100644
--- a/stream/librtsp/rtsp.c
+++ b/stream/librtsp/rtsp.c
@@ -33,14 +33,6 @@
#include <stdio.h>
#include <assert.h>
#include "config.h"
-#ifndef HAVE_WINSOCK2
-#define closesocket close
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#else
-#include <winsock2.h>
-#endif
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -60,56 +52,6 @@
#define LOG
*/
-#define BUF_SIZE 4096
-#define HEADER_SIZE 1024
-#define MAX_FIELDS 256
-
-struct rtsp_s {
-
- int s;
-
- char *host;
- int port;
- char *path;
- char *param;
- char *mrl;
- char *user_agent;
-
- char *server;
- unsigned int server_state;
- uint32_t server_caps;
-
- unsigned int cseq;
- char *session;
-
- char *answers[MAX_FIELDS]; /* data of last message */
- char *scheduled[MAX_FIELDS]; /* will be sent with next message */
-};
-
-/*
- * constants
- */
-
-#define RTSP_PROTOCOL_VERSION "RTSP/1.0"
-
-/* server states */
-#define RTSP_CONNECTED 1
-#define RTSP_INIT 2
-#define RTSP_READY 4
-#define RTSP_PLAYING 8
-#define RTSP_RECORDING 16
-
-/* server capabilities */
-#define RTSP_OPTIONS 0x001
-#define RTSP_DESCRIBE 0x002
-#define RTSP_ANNOUNCE 0x004
-#define RTSP_SETUP 0x008
-#define RTSP_GET_PARAMETER 0x010
-#define RTSP_SET_PARAMETER 0x020
-#define RTSP_TEARDOWN 0x040
-#define RTSP_PLAY 0x080
-#define RTSP_RECORD 0x100
-
/*
* network utilities
*/
diff --git a/stream/librtsp/rtsp.h b/stream/librtsp/rtsp.h
index 352ac7ac82..efca1f7779 100644
--- a/stream/librtsp/rtsp.h
+++ b/stream/librtsp/rtsp.h
@@ -32,6 +32,7 @@
#ifndef MPLAYER_RTSP_H
#define MPLAYER_RTSP_H
+#include <inttypes.h>
/* some codes returned by rtsp_request_* functions */
@@ -45,6 +46,58 @@
#define RTSP_METHOD_TEARDOWN "TEARDOWN"
#define RTSP_METHOD_SET_PARAMETER "SET_PARAMETER"
+#define BUF_SIZE 4096
+#define HEADER_SIZE 1024
+#define MAX_FIELDS 256
+
+
+struct rtsp_s {
+
+ int s;
+
+ char *host;
+ int port;
+ char *path;
+ char *param;
+ char *mrl;
+ char *user_agent;
+
+ char *server;
+ unsigned int server_state;
+ uint32_t server_caps;
+
+ unsigned int cseq;
+ char *session;
+
+ char *answers[MAX_FIELDS]; /* data of last message */
+ char *scheduled[MAX_FIELDS]; /* will be sent with next message */
+};
+
+/*
+ * constants
+ */
+
+#define RTSP_PROTOCOL_VERSION "RTSP/1.0"
+
+/* server states */
+#define RTSP_CONNECTED 1
+#define RTSP_INIT 2
+#define RTSP_READY 4
+#define RTSP_PLAYING 8
+#define RTSP_RECORDING 16
+
+/* server capabilities */
+#define RTSP_OPTIONS 0x001
+#define RTSP_DESCRIBE 0x002
+#define RTSP_ANNOUNCE 0x004
+#define RTSP_SETUP 0x008
+#define RTSP_GET_PARAMETER 0x010
+#define RTSP_SET_PARAMETER 0x020
+#define RTSP_TEARDOWN 0x040
+#define RTSP_PLAY 0x080
+#define RTSP_RECORD 0x100
+
+
typedef struct rtsp_s rtsp_t;
rtsp_t* rtsp_connect (int fd, char *mrl, char *path, char *host, int port, char *user_agent);
diff --git a/stream/librtsp/rtsp_session.c b/stream/librtsp/rtsp_session.c
index e5ee55893d..d999323fcd 100644
--- a/stream/librtsp/rtsp_session.c
+++ b/stream/librtsp/rtsp_session.c
@@ -31,12 +31,15 @@
#include <sys/types.h>
#include "config.h"
#ifndef HAVE_WINSOCK2
+#define closesocket close
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#else
#include <winsock2.h>
#endif
+
+
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>