]> code.delx.au - pulseaudio/blob - src/modules/rtp/rtsp_client.h
Remove $Id$ lines left over from SVN
[pulseaudio] / src / modules / rtp / rtsp_client.h
1 #ifndef foortspclienthfoo
2 #define foortspclienthfoo
3
4 /***
5 This file is part of PulseAudio.
6
7 Copyright 2008 Colin Guthrie
8
9 PulseAudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published
11 by the Free Software Foundation; either version 2 of the License,
12 or (at your option) any later version.
13
14 PulseAudio is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with PulseAudio; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA.
23 ***/
24
25 #include <inttypes.h>
26 #include <sys/socket.h>
27 #include <sys/types.h>
28 #include <netdb.h>
29
30 #include <pulsecore/memblockq.h>
31 #include <pulsecore/memchunk.h>
32 #include <pulsecore/socket-client.h>
33 #include <pulse/mainloop-api.h>
34
35 #include "headerlist.h"
36
37 typedef struct pa_rtsp_client pa_rtsp_client;
38 typedef enum {
39 STATE_CONNECT,
40 STATE_ANNOUNCE,
41 STATE_SETUP,
42 STATE_RECORD,
43 STATE_FLUSH,
44 STATE_TEARDOWN,
45 STATE_SET_PARAMETER,
46 STATE_DISCONNECTED
47 } pa_rtsp_state;
48 typedef void (*pa_rtsp_cb_t)(pa_rtsp_client *c, pa_rtsp_state state, pa_headerlist* hl, void *userdata);
49
50 pa_rtsp_client* pa_rtsp_client_new(pa_mainloop_api *mainloop, const char* hostname, uint16_t port, const char* useragent);
51 void pa_rtsp_client_free(pa_rtsp_client* c);
52
53 int pa_rtsp_connect(pa_rtsp_client* c);
54 void pa_rtsp_set_callback(pa_rtsp_client *c, pa_rtsp_cb_t callback, void *userdata);
55
56 void pa_rtsp_disconnect(pa_rtsp_client* c);
57
58 const char* pa_rtsp_localip(pa_rtsp_client* c);
59 uint32_t pa_rtsp_serverport(pa_rtsp_client* c);
60 void pa_rtsp_set_url(pa_rtsp_client* c, const char* url);
61 void pa_rtsp_add_header(pa_rtsp_client *c, const char* key, const char* value);
62 void pa_rtsp_remove_header(pa_rtsp_client *c, const char* key);
63
64 int pa_rtsp_announce(pa_rtsp_client* c, const char* sdp);
65
66 int pa_rtsp_setup(pa_rtsp_client* c);
67 int pa_rtsp_record(pa_rtsp_client* c, uint16_t* seq, uint32_t* rtptime);
68 int pa_rtsp_teardown(pa_rtsp_client* c);
69
70 int pa_rtsp_setparameter(pa_rtsp_client* c, const char* param);
71 int pa_rtsp_flush(pa_rtsp_client* c, uint16_t seq, uint32_t rtptime);
72
73 #endif