xine-lib  1.2.10
rtsp.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2017 the xine project
3  *
4  * This file is part of xine, a free video player.
5  *
6  * xine is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * xine is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19  *
20  * a minimalistic implementation of rtsp protocol,
21  * *not* RFC 2326 compilant yet.
22  */
23 
24 #ifndef HAVE_RTSP_H
25 #define HAVE_RTSP_H
26 
27 /*#include <inttypes.h> */
28 #include <xine/xine_internal.h>
29 
30 #ifdef __CYGWIN__
31 #define uint32_t unsigned int
32 #define uint16_t unsigned short int
33 #define uint8_t unsigned char
34 #endif
35 
36 /* some codes returned by rtsp_request_* functions */
37 
38 #define RTSP_STATUS_SET_PARAMETER 10
39 #define RTSP_STATUS_OK 200
40 
41 typedef struct rtsp_s rtsp_t;
42 
43 rtsp_t* rtsp_connect (xine_stream_t *stream, const char *mrl, const char *user_agent) XINE_MALLOC;
44 
45 int rtsp_request_options(rtsp_t *s, const char *what);
46 int rtsp_request_describe(rtsp_t *s, const char *what);
47 int rtsp_request_setup(rtsp_t *s, const char *what);
48 int rtsp_request_setparameter(rtsp_t *s, const char *what);
49 int rtsp_request_play(rtsp_t *s, const char *what);
50 #if 0
51 int rtsp_request_tearoff(rtsp_t *s, const char *what);
52 #endif
53 
54 int rtsp_send_ok(rtsp_t *s);
55 
56 int rtsp_read_data(rtsp_t *s, void *buffer, unsigned int size);
57 
58 const char* rtsp_search_answers(rtsp_t *s, const char *tag);
59 void rtsp_add_to_payload(char **payload, const char *string);
60 
61 void rtsp_free_answers(rtsp_t *this);
62 
63 int rtsp_read (rtsp_t *this, char *data, int len);
64 void rtsp_close (rtsp_t *this);
65 
66 #if 0
67 void rtsp_set_session(rtsp_t *s, const char *id);
68 char *rtsp_get_session(rtsp_t *s);
69 #endif
70 
71 char *rtsp_get_mrl(rtsp_t *s);
72 
73 /*int rtsp_peek_header (rtsp_t *this, char *data); */
74 
75 void rtsp_schedule_field(rtsp_t *s, const char *string);
76 #if 0
77 void rtsp_unschedule_field(rtsp_t *s, const char *string);
78 #endif
80 
81 #endif
82 
rtsp_s::auth
char * auth
Definition: rtsp.c:66
rtsp_request_play
int rtsp_request_play(rtsp_t *s, const char *what)
Definition: rtsp.c:352
xine_stream_s::xine
xine_t * xine
Definition: xine_internal.h:126
rtsp_close
void rtsp_close(rtsp_t *this)
Definition: rtsp.c:563
rtsp_s::path
char * path
Definition: rtsp.c:57
rtsp_send_ok
int rtsp_send_ok(rtsp_t *s)
Definition: rtsp.c:282
rtsp_search_answers
const char * rtsp_search_answers(rtsp_t *s, const char *tag)
Definition: rtsp.c:583
xine_stream_s
Definition: xine_internal.h:123
_x_io_tcp_write
off_t _x_io_tcp_write(xine_stream_t *stream, int s, const void *wbuf_gen, off_t todo)
Definition: io_helper.c:607
rtsp_schedule_field
void rtsp_schedule_field(rtsp_t *s, const char *string)
Definition: rtsp.c:633
XINE_MALLOC
#define XINE_MALLOC
Definition: attributes.h:139
_x_io_tcp_read_line
int _x_io_tcp_read_line(xine_stream_t *stream, int sock, char *str, int size)
Definition: io_helper.c:714
xineutils.h
rtsp_send_ok
int rtsp_send_ok(rtsp_t *s)
Definition: rtsp.c:282
rtsp_free_answers
void rtsp_free_answers(rtsp_t *this)
Definition: rtsp.c:688
rtsp_s::mrl
char * mrl
Definition: rtsp.c:58
rtsp_s::session
char * session
Definition: rtsp.c:65
rtsp_s::server_caps
uint32_t server_caps
Definition: rtsp.c:62
rtsp_s::cseq
unsigned int cseq
Definition: rtsp.c:64
io_helper.h
rtsp_request_options
int rtsp_request_options(rtsp_t *s, const char *what)
Definition: rtsp.c:297
_x_message
int _x_message(xine_stream_t *stream, int type,...)
Definition: xine_interface.c:1000
rtsp_schedule_field
void rtsp_schedule_field(rtsp_t *s, const char *string)
Definition: rtsp.c:633
rtsp.h
rtsp_protocol_version
static const char rtsp_protocol_version[]
Definition: rtsp.c:76
lprintf
#define lprintf(...)
Definition: xineutils.h:620
rtsp_send_request
static void rtsp_send_request(rtsp_t *s, const char *type, const char *what)
Definition: rtsp.c:171
rtsp_request_options
int rtsp_request_options(rtsp_t *s, const char *what)
Definition: rtsp.c:297
NULL
NULL
Definition: xine_plugin.c:78
rtsp_read_data
int rtsp_read_data(rtsp_t *s, void *buffer_gen, unsigned int size)
Definition: rtsp.c:381
BUF_SIZE
#define BUF_SIZE
Definition: rtsp.c:45
rtsp_s::port
int port
Definition: rtsp.c:56
XINE_VERBOSITY_LOG
#define XINE_VERBOSITY_LOG
Definition: xine.h:425
rtsp_connect
rtsp_t * rtsp_connect(xine_stream_t *stream, const char *mrl, const char *user_agent)
Definition: rtsp.c:444
rtsp_s::server
char * server
Definition: rtsp.c:61
rtsp_add_to_payload
void rtsp_add_to_payload(char **payload, const char *string)
rtsp_free_answers
void rtsp_free_answers(rtsp_t *s)
Definition: rtsp.c:688
rtsp_read_data
int rtsp_read_data(rtsp_t *s, void *buffer, unsigned int size)
Definition: rtsp.c:381
rtsp_connect
rtsp_t * rtsp_connect(xine_stream_t *stream, const char *mrl, const char *user_agent)
Definition: rtsp.c:444
_
#define _(String)
Definition: vcdplayer.h:39
rtsp_s::stream
xine_stream_t * stream
Definition: rtsp.c:51
rtsp_s::s
int s
Definition: rtsp.c:53
rtsp_get_mrl
char * rtsp_get_mrl(rtsp_t *s)
Definition: rtsp.c:623
rtsp_request_setup
int rtsp_request_setup(rtsp_t *s, const char *what)
Definition: rtsp.c:329
rtsp_request_setparameter
int rtsp_request_setparameter(rtsp_t *s, const char *what)
Definition: rtsp.c:336
RTSP_STATUS_SET_PARAMETER
#define RTSP_STATUS_SET_PARAMETER
Definition: rtsp.h:38
rtsp_request_setparameter
int rtsp_request_setparameter(rtsp_t *s, const char *what)
Definition: rtsp.c:336
XINE_VERBOSITY_DEBUG
#define XINE_VERBOSITY_DEBUG
Definition: xine.h:426
code
char code
Definition: xmllexer.c:606
rtsp_request_describe
int rtsp_request_describe(rtsp_t *s, const char *what)
Definition: rtsp.c:313
rtsp_get_code
static int rtsp_get_code(rtsp_t *s, const char *string)
Definition: rtsp.c:143
rtsp_unschedule_all
void rtsp_unschedule_all(rtsp_t *s)
Definition: rtsp.c:672
rtsp_get_mrl
char * rtsp_get_mrl(rtsp_t *s)
Definition: rtsp.c:623
rtsp_put
static int rtsp_put(rtsp_t *s, const char *string)
Definition: rtsp.c:118
rtsp_s::user_agent
char * user_agent
Definition: rtsp.c:59
rtsp_get_answers
static int rtsp_get_answers(rtsp_t *s)
Definition: rtsp.c:216
rtsp_request_setup
int rtsp_request_setup(rtsp_t *s, const char *what)
Definition: rtsp.c:329
rtsp_s::host
char * host
Definition: rtsp.c:55
rtsp_request_play
int rtsp_request_play(rtsp_t *s, const char *what)
Definition: rtsp.c:352
xine_internal.h
rtsp_close
void rtsp_close(rtsp_t *s)
Definition: rtsp.c:563
rtsp_unschedule_all
void rtsp_unschedule_all(rtsp_t *s)
Definition: rtsp.c:672
config.h
_x_io_tcp_connect
int _x_io_tcp_connect(xine_stream_t *stream, const char *host, int port)
Definition: io_helper.c:159
rtsp_get
static char * rtsp_get(rtsp_t *s)
Definition: rtsp.c:101
MAX_FIELDS
#define MAX_FIELDS
Definition: rtsp.c:47
rtsp_request_describe
int rtsp_request_describe(rtsp_t *s, const char *what)
Definition: rtsp.c:313
rtsp_s::scheduled
char * scheduled[256]
Definition: rtsp.c:69
_x_io_tcp_close
int _x_io_tcp_close(xine_stream_t *stream, int fd)
Definition: io_helper.c:740
rtsp_s::answers
char * answers[256]
Definition: rtsp.c:68
xine_base64_encode
size_t xine_base64_encode(uint8_t *from, char *to, size_t size)
Definition: utils.c:918
rtsp_schedule_standard
static void rtsp_schedule_standard(rtsp_t *s)
Definition: rtsp.c:198
_x_asprintf
char * _x_asprintf(const char *format,...)
Definition: utils.c:783
rtsp_read
int rtsp_read(rtsp_t *this, char *data, int len)
string
static char string[1024]
Definition: goomsl_lex.c:637
XINE_MSG_AUTHENTICATION_NEEDED
#define XINE_MSG_AUTHENTICATION_NEEDED
Definition: xine.h:2205
xprintf
#define xprintf(xine, verbose,...)
Definition: xineutils.h:664
rtsp_s
Definition: rtsp.c:49
rtsp_basicauth
static void rtsp_basicauth(const char *user, const char *password, char **dest)
Definition: rtsp.c:433
_x_io_tcp_read
off_t _x_io_tcp_read(xine_stream_t *stream, int s, void *buf_gen, off_t todo)
Definition: io_helper.c:524
rtsp_search_answers
const char * rtsp_search_answers(rtsp_t *s, const char *tag)
Definition: rtsp.c:583