UniMRCP  1.7.0
rtsp_server.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2015 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 
17 #ifndef RTSP_SERVER_H
18 #define RTSP_SERVER_H
19 
20 /**
21  * @file rtsp_server.h
22  * @brief RTSP Server
23  */
24 
25 #include "apt_task.h"
26 #include "rtsp_message.h"
27 
29 
30 /** Opaque RTSP server declaration */
32 /** Opaque RTSP server session declaration */
34 
35 /** RTSP server vtable declaration */
37 
38 /** RTSP server vtable declaration */
40  /** Virtual create session */
42  /** Virtual terminate session */
44  /** Virtual message handler */
46 };
47 
48 /**
49  * Create RTSP server.
50  * @param id the identifier of the server
51  * @param listen_ip the listen IP address
52  * @param listen_port the listen port
53  * @param max_connection_count the number of max RTSP connections
54  * @param connection_timeout the inactivity timeout for an RTSP connection [sec]
55  * @param obj the external object to send events to
56  * @param handler the request handler
57  * @param pool the pool to allocate memory from
58  */
60  const char *id,
61  const char *listen_ip,
62  apr_port_t listen_port,
63  apr_size_t max_connection_count,
64  apr_size_t connection_timeout,
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  */
74 
75 /**
76  * Start server and wait for incoming requests.
77  * @param server the server to start
78  */
80 
81 /**
82  * Terminate server.
83  * @param server the server to terminate
84  */
86 
87 /**
88  * Get task.
89  * @param server the server to get task from
90  */
92 
93 /**
94  * Get external object.
95  * @param server the server to get object from
96  */
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  */
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  */
113 
114 /**
115  * Release RTSP session (internal release event/request).
116  * @param server the server to use
117  * @param session the session to release
118  */
120 
121 /**
122  * Get object associated with the session.
123  * @param session the session to get object from
124  */
126 
127 /**
128  * Set object associated with the session.
129  * @param session the session to set object for
130  * @param obj the object to set
131  */
133 
134 /**
135  * Get the session identifier.
136  * @param session the session to get identifier from
137  */
139 
140 /**
141  * Get active (in-progress) session request.
142  * @param session the session to get from
143  */
145 
146 /**
147  * Get the session destination (client) IP address.
148  * @param session the session to get IP address from
149  */
151 
153 
154 #endif /* RTSP_SERVER_H */
apt_bool_t rtsp_server_session_release(rtsp_server_t *server, rtsp_server_session_t *session)
apt_task_t * rtsp_server_task_get(const rtsp_server_t *server)
#define APT_END_EXTERN_C
Definition: apt.h:38
int apt_bool_t
Definition: apt.h:57
const rtsp_message_t * rtsp_server_session_request_get(const rtsp_server_session_t *session)
struct rtsp_server_session_t rtsp_server_session_t
Definition: rtsp_server.h:33
apt_bool_t rtsp_server_session_respond(rtsp_server_t *server, rtsp_server_session_t *session, rtsp_message_t *message)
const apt_str_t * rtsp_server_session_id_get(const rtsp_server_session_t *session)
apt_bool_t(* terminate_session)(rtsp_server_t *server, rtsp_server_session_t *session)
Definition: rtsp_server.h:43
const char * rtsp_server_session_destination_get(const rtsp_server_session_t *session)
typedefAPT_BEGIN_EXTERN_C struct rtsp_server_t rtsp_server_t
Definition: rtsp_server.h:31
Definition: rtsp_server.h:39
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
Definition: rtsp_message.h:34
void * rtsp_server_session_object_get(const rtsp_server_session_t *session)
apt_bool_t rtsp_server_destroy(rtsp_server_t *server)
#define RTSP_DECLARE(type)
Definition: rtsp.h:41
RTSP Message Definition.
void rtsp_server_session_object_set(rtsp_server_session_t *session, void *obj)
rtsp_server_t * rtsp_server_create(const char *id, const char *listen_ip, apr_port_t listen_port, apr_size_t max_connection_count, apr_size_t connection_timeout, void *obj, const rtsp_server_vtable_t *handler, apr_pool_t *pool)
typedefAPT_BEGIN_EXTERN_C struct apt_task_t apt_task_t
Definition: apt_task.h:31
void * rtsp_server_object_get(const rtsp_server_t *server)
apt_bool_t(* handle_message)(rtsp_server_t *server, rtsp_server_session_t *session, rtsp_message_t *message)
Definition: rtsp_server.h:45
Definition: apt_string.h:36
Thread Execution Abstraction.
apt_bool_t(* create_session)(rtsp_server_t *server, rtsp_server_session_t *session)
Definition: rtsp_server.h:41
apt_bool_t rtsp_server_start(rtsp_server_t *server)
apt_bool_t rtsp_server_session_terminate(rtsp_server_t *server, rtsp_server_session_t *session)
apt_bool_t rtsp_server_terminate(rtsp_server_t *server)