]> git.sesse.net Git - vlc/blob - modules/access/rtsp/rtsp.h
Update LGPL license blurb, choosing v2.1+.
[vlc] / modules / access / rtsp / rtsp.h
1 /*
2  * Copyright (C) 2002-2003 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
19  *
20  * $Id$
21  *
22  * a minimalistic implementation of rtsp protocol,
23  * *not* RFC 2326 compilant yet.
24  */
25  
26 #ifndef HAVE_RTSP_H
27 #define HAVE_RTSP_H
28
29 /* some codes returned by rtsp_request_* functions */
30
31 #define RTSP_STATUS_SET_PARAMETER  10
32 #define RTSP_STATUS_OK            200
33
34 typedef struct rtsp_s rtsp_t;
35
36 typedef struct
37 {
38     void *p_userdata;
39
40     int (*pf_connect)( void *p_userdata, char *p_server, int i_port );
41     int (*pf_disconnect)( void *p_userdata );
42     int (*pf_read)( void *p_userdata, uint8_t *p_buffer, int i_buffer );
43     int (*pf_read_line)( void *p_userdata, uint8_t *p_buffer, int i_buffer );
44     int (*pf_write)( void *p_userdata, uint8_t *p_buffer, int i_buffer );
45
46     rtsp_t *p_private;
47
48 } rtsp_client_t;
49
50 int rtsp_connect( rtsp_client_t *, const char *mrl, const char *user_agent );
51
52 int rtsp_request_options( rtsp_client_t *, const char *what );
53 int rtsp_request_describe( rtsp_client_t *, const char *what );
54 int rtsp_request_setup( rtsp_client_t *, const char *what );
55 int rtsp_request_setparameter( rtsp_client_t *, const char *what );
56 int rtsp_request_play( rtsp_client_t *, const char *what );
57 int rtsp_request_tearoff( rtsp_client_t *, const char *what );
58
59 int rtsp_send_ok( rtsp_client_t * );
60
61 int rtsp_read_data( rtsp_client_t *, uint8_t *buffer, unsigned int size );
62
63 char* rtsp_search_answers( rtsp_client_t *, const char *tag );
64 void rtsp_free_answers( rtsp_client_t * );
65
66 void rtsp_add_to_payload( char **payload, const char *string );
67
68 int rtsp_read( rtsp_client_t *, char *data, int len );
69 void rtsp_close( rtsp_client_t * );
70
71 void  rtsp_set_session( rtsp_client_t *, const char *id );
72 char *rtsp_get_session( rtsp_client_t * );
73
74 char *rtsp_get_mrl( rtsp_client_t * );
75
76 /* int rtsp_peek_header( rtsp_client_t *, char *data ); */
77
78 void rtsp_schedule_field( rtsp_client_t *, const char *string );
79 void rtsp_unschedule_field( rtsp_client_t *, const char *string );
80 void rtsp_unschedule_all( rtsp_client_t * );
81
82 #endif
83