# HG changeset patch # User lu_zero # Date 1214398998 0 # Node ID 83d160a30ca77f60c7c73de54e349db498d73309 # Parent a3f6dc43b5854700a074c97e5379920a8f00ce4b Complete the code move across librtsp, fixes the rtsp_close collision with libnemesi diff -r a3f6dc43b585 -r 83d160a30ca7 stream/librtsp/rtsp.c --- a/stream/librtsp/rtsp.c Wed Jun 25 09:53:45 2008 +0000 +++ b/stream/librtsp/rtsp.c Wed Jun 25 13:03:18 2008 +0000 @@ -33,14 +33,6 @@ #include #include #include "config.h" -#ifndef HAVE_WINSOCK2 -#define closesocket close -#include -#include -#include -#else -#include -#endif #include #include #include @@ -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 -r a3f6dc43b585 -r 83d160a30ca7 stream/librtsp/rtsp.h --- a/stream/librtsp/rtsp.h Wed Jun 25 09:53:45 2008 +0000 +++ b/stream/librtsp/rtsp.h Wed Jun 25 13:03:18 2008 +0000 @@ -32,6 +32,7 @@ #ifndef MPLAYER_RTSP_H #define MPLAYER_RTSP_H +#include /* 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 -r a3f6dc43b585 -r 83d160a30ca7 stream/librtsp/rtsp_session.c --- a/stream/librtsp/rtsp_session.c Wed Jun 25 09:53:45 2008 +0000 +++ b/stream/librtsp/rtsp_session.c Wed Jun 25 13:03:18 2008 +0000 @@ -31,12 +31,15 @@ #include #include "config.h" #ifndef HAVE_WINSOCK2 +#define closesocket close #include #include #include #else #include #endif + + #include #include #include