UniMRCP
1.3.0
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
libs
uni-rtsp
include
rtsp_server.h
Go to the documentation of this file.
1
/*
2
* Copyright 2008-2014 Arsen Chaloyan
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*
16
* $Id: rtsp_server.h 2252 2014-11-21 02:45:15Z achaloyan@gmail.com $
17
*/
18
19
#ifndef RTSP_SERVER_H
20
#define RTSP_SERVER_H
21
22
/**
23
* @file rtsp_server.h
24
* @brief RTSP Server
25
*/
26
27
#include "
apt_task.h
"
28
#include "
rtsp_message.h
"
29
30
APT_BEGIN_EXTERN_C
31
32
/** Opaque RTSP server declaration */
33
typedef
struct
rtsp_server_t
rtsp_server_t
;
34
/** Opaque RTSP server session declaration */
35
typedef
struct
rtsp_server_session_t
rtsp_server_session_t
;
36
37
/** RTSP server vtable declaration */
38
typedef
struct
rtsp_server_vtable_t
rtsp_server_vtable_t
;
39
40
/** RTSP server vtable declaration */
41
struct
rtsp_server_vtable_t
{
42
/** Virtual create session */
43
apt_bool_t
(*
create_session
)(
rtsp_server_t
*server,
rtsp_server_session_t
*session);
44
/** Virtual terminate session */
45
apt_bool_t
(*
terminate_session
)(
rtsp_server_t
*server,
rtsp_server_session_t
*session);
46
/** Virtual message handler */
47
apt_bool_t
(*
handle_message
)(
rtsp_server_t
*server,
rtsp_server_session_t
*session,
rtsp_message_t
*message);
48
};
49
50
/**
51
* Create RTSP server.
52
* @param id the identifier of the server
53
* @param listen_ip the listen IP address
54
* @param listen_port the listen port
55
* @param max_connection_count the number of max RTSP connections
56
* @param obj the external object to send events to
57
* @param handler the request handler
58
* @param pool the pool to allocate memory from
59
*/
60
RTSP_DECLARE
(
rtsp_server_t
*)
rtsp_server_create
(
61
const
char
*
id
,
62
const
char
*listen_ip,
63
apr_port_t listen_port,
64
apr_size_t max_connection_count,
65
void
*obj,
66
const
rtsp_server_vtable_t
*handler,
67
apr_pool_t *pool);
68
69
/**
70
* Destroy RTSP server.
71
* @param server the server to destroy
72
*/
73
RTSP_DECLARE
(
apt_bool_t
)
rtsp_server_destroy
(
rtsp_server_t
*server);
74
75
/**
76
* Start server and wait for incoming requests.
77
* @param server the server to start
78
*/
79
RTSP_DECLARE
(
apt_bool_t
)
rtsp_server_start
(
rtsp_server_t
*server);
80
81
/**
82
* Terminate server.
83
* @param server the server to terminate
84
*/
85
RTSP_DECLARE
(
apt_bool_t
)
rtsp_server_terminate
(
rtsp_server_t
*server);
86
87
/**
88
* Get task.
89
* @param server the server to get task from
90
*/
91
RTSP_DECLARE
(
apt_task_t
*)
rtsp_server_task_get
(const
rtsp_server_t
*server);
92
93
/**
94
* Get external object.
95
* @param server the server to get object from
96
*/
97
RTSP_DECLARE
(
void
*)
rtsp_server_object_get
(const
rtsp_server_t
*server);
98
99
/**
100
* Send RTSP message.
101
* @param server the server to use
102
* @param session the session to send RTSP response for
103
* @param message the RTSP response to send
104
*/
105
RTSP_DECLARE
(
apt_bool_t
)
rtsp_server_session_respond
(
rtsp_server_t
*server,
rtsp_server_session_t
*session,
rtsp_message_t
*message);
106
107
/**
108
* Terminate RTSP session (respond to terminate request).
109
* @param server the server to use
110
* @param session the session to terminate
111
*/
112
RTSP_DECLARE
(
apt_bool_t
)
rtsp_server_session_terminate
(
rtsp_server_t
*server,
rtsp_server_session_t
*session);
113
114
/**
115
* Get object associated with the session.
116
* @param session the session to get object from
117
*/
118
RTSP_DECLARE
(
void
*)
rtsp_server_session_object_get
(const
rtsp_server_session_t
*session);
119
120
/**
121
* Set object associated with the session.
122
* @param session the session to set object for
123
* @param obj the object to set
124
*/
125
RTSP_DECLARE
(
void
)
rtsp_server_session_object_set
(
rtsp_server_session_t
*session,
void
*obj);
126
127
/**
128
* Get the session identifier.
129
* @param session the session to get identifier from
130
*/
131
RTSP_DECLARE
(const
apt_str_t
*)
rtsp_server_session_id_get
(const
rtsp_server_session_t
*session);
132
133
/**
134
* Get active (in-progress) session request.
135
* @param session the session to get from
136
*/
137
RTSP_DECLARE
(const
rtsp_message_t
*)
rtsp_server_session_request_get
(const
rtsp_server_session_t
*session);
138
139
/**
140
* Get the session destination (client) IP address.
141
* @param session the session to get IP address from
142
*/
143
RTSP_DECLARE
(const
char
*)
rtsp_server_session_destination_get
(const
rtsp_server_session_t
*session);
144
145
APT_END_EXTERN_C
146
147
#endif
/* RTSP_SERVER_H */
Generated on Mon Feb 2 2015 19:41:39 for UniMRCP by
1.8.3.1