UniMRCP  1.4.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 obj the external object to send events to
55  * @param handler the request handler
56  * @param pool the pool to allocate memory from
57  */
59  const char *id,
60  const char *listen_ip,
61  apr_port_t listen_port,
62  apr_size_t max_connection_count,
63  void *obj,
64  const rtsp_server_vtable_t *handler,
65  apr_pool_t *pool);
66 
67 /**
68  * Destroy RTSP server.
69  * @param server the server to destroy
70  */
72 
73 /**
74  * Start server and wait for incoming requests.
75  * @param server the server to start
76  */
78 
79 /**
80  * Terminate server.
81  * @param server the server to terminate
82  */
84 
85 /**
86  * Get task.
87  * @param server the server to get task from
88  */
90 
91 /**
92  * Get external object.
93  * @param server the server to get object from
94  */
96 
97 /**
98  * Send RTSP message.
99  * @param server the server to use
100  * @param session the session to send RTSP response for
101  * @param message the RTSP response to send
102  */
104 
105 /**
106  * Terminate RTSP session (respond to terminate request).
107  * @param server the server to use
108  * @param session the session to terminate
109  */
111 
112 /**
113  * Get object associated with the session.
114  * @param session the session to get object from
115  */
117 
118 /**
119  * Set object associated with the session.
120  * @param session the session to set object for
121  * @param obj the object to set
122  */
124 
125 /**
126  * Get the session identifier.
127  * @param session the session to get identifier from
128  */
130 
131 /**
132  * Get active (in-progress) session request.
133  * @param session the session to get from
134  */
136 
137 /**
138  * Get the session destination (client) IP address.
139  * @param session the session to get IP address from
140  */
142 
144 
145 #endif /* RTSP_SERVER_H */
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)
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
apt_bool_t(* terminate_session)(rtsp_server_t *server, rtsp_server_session_t *session)
Definition: rtsp_server.h:43
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)
apt_bool_t(* handle_message)(rtsp_server_t *server, rtsp_server_session_t *session, rtsp_message_t *message)
Definition: rtsp_server.h:45
apt_bool_t(* create_session)(rtsp_server_t *server, rtsp_server_session_t *session)
Definition: rtsp_server.h:41
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)
Definition: apt_string.h:36
Thread Execution Abstraction.
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)
rtsp_server_t * rtsp_server_create(const char *id, const char *listen_ip, apr_port_t listen_port, apr_size_t max_connection_count, void *obj, const rtsp_server_vtable_t *handler, apr_pool_t *pool)
apt_bool_t rtsp_server_terminate(rtsp_server_t *server)