UniMRCP  1.7.0
rtsp_client.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_CLIENT_H
18 #define RTSP_CLIENT_H
19 
20 /**
21  * @file rtsp_client.h
22  * @brief RTSP Client
23  */
24 
25 #include "apt_task.h"
26 #include "rtsp_message.h"
27 
29 
30 /** Opaque RTSP client declaration */
32 /** Opaque RTSP client session declaration */
34 
35 /** RTSP client vtable declaration */
37 
38 /** RTSP client vtable */
40  /** Sesssion termination response handler */
42  /** Sesssion termination event handler */
44  /** Sesssion setup response handler */
46  /** Sesssion event handler */
48 };
49 
50 /**
51  * Create RTSP client.
52  * @param id the identifier of the client
53  * @param max_connection_count the number of max RTSP connections
54  * @param request_timeout the request timeout to set
55  * @param obj the external object to send event to
56  * @param handler the response/event handler
57  * @param pool the pool to allocate memory from
58  */
60  const char *id,
61  apr_size_t max_connection_count,
62  apr_size_t request_timeout,
63  void *obj,
64  const rtsp_client_vtable_t *handler,
65  apr_pool_t *pool);
66 
67 /**
68  * Destroy RTSP client.
69  * @param client the client to destroy
70  */
72 
73 /**
74  * Start client and wait for incoming requests.
75  * @param client the client to start
76  */
78 
79 /**
80  * Terminate client.
81  * @param client the client to terminate
82  */
84 
85 /**
86  * Get task.
87  * @param client the client to get task from
88  */
90 
91 /**
92  * Get external object.
93  * @param client the client to get object from
94  */
96 
97 
98 /**
99  * Create RTSP session.
100  * @param client the client to create session for
101  * @param server_ip the IP address of RTSP server
102  * @param server_port the port of RTSP server
103  * @param resource_location the location of RTSP resource (path in RTSP URI)
104  */
106  rtsp_client_t *client,
107  const char *server_ip,
108  apr_port_t server_port,
109  const char *resource_location);
110 
111 /**
112  * Destroy RTSP session.
113  * @param session the session to destroy
114  */
116 
117 /**
118  * Terminate RTSP session.
119  * @param client the client to use
120  * @param session the session to terminate
121  */
123 
124 /**
125  * Send RTSP message.
126  * @param client the client to use
127  * @param session the session to send RTSP request for
128  * @param message the RTSP request to send
129  */
131 
132 /**
133  * Get object associated with the session.
134  * @param session the session to get object from
135  */
137 
138 /**
139  * Set object associated with the session.
140  * @param session the session to set object for
141  * @param obj the object to set
142  */
144 
145 /**
146  * Get the session identifier.
147  * @param session the session to get identifier from
148  */
150 
152 
153 #endif /* RTSP_CLIENT_H */
apt_bool_t rtsp_client_start(rtsp_client_t *client)
Definition: rtsp_client.h:39
apt_bool_t rtsp_client_session_terminate(rtsp_client_t *client, rtsp_client_session_t *session)
void * rtsp_client_session_object_get(const rtsp_client_session_t *session)
void rtsp_client_session_object_set(rtsp_client_session_t *session, void *obj)
apt_bool_t rtsp_client_terminate(rtsp_client_t *client)
#define APT_END_EXTERN_C
Definition: apt.h:38
int apt_bool_t
Definition: apt.h:57
apt_bool_t rtsp_client_destroy(rtsp_client_t *client)
apt_bool_t(* on_session_event)(rtsp_client_t *client, rtsp_client_session_t *session, rtsp_message_t *message)
Definition: rtsp_client.h:47
void * rtsp_client_object_get(const rtsp_client_t *client)
struct rtsp_client_session_t rtsp_client_session_t
Definition: rtsp_client.h:33
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
apt_bool_t rtsp_client_session_request(rtsp_client_t *client, rtsp_client_session_t *session, rtsp_message_t *message)
Definition: rtsp_message.h:34
typedefAPT_BEGIN_EXTERN_C struct rtsp_client_t rtsp_client_t
Definition: rtsp_client.h:31
apt_bool_t(* on_session_terminate_response)(rtsp_client_t *client, rtsp_client_session_t *session)
Definition: rtsp_client.h:41
#define RTSP_DECLARE(type)
Definition: rtsp.h:41
RTSP Message Definition.
void rtsp_client_session_destroy(rtsp_client_session_t *session)
apt_bool_t(* on_session_response)(rtsp_client_t *client, rtsp_client_session_t *session, rtsp_message_t *request, rtsp_message_t *response)
Definition: rtsp_client.h:45
const apt_str_t * rtsp_client_session_id_get(const rtsp_client_session_t *session)
typedefAPT_BEGIN_EXTERN_C struct apt_task_t apt_task_t
Definition: apt_task.h:31
Definition: apt_string.h:36
Thread Execution Abstraction.
apt_bool_t(* on_session_terminate_event)(rtsp_client_t *client, rtsp_client_session_t *session)
Definition: rtsp_client.h:43
rtsp_client_session_t * rtsp_client_session_create(rtsp_client_t *client, const char *server_ip, apr_port_t server_port, const char *resource_location)
apt_task_t * rtsp_client_task_get(const rtsp_client_t *client)
rtsp_client_t * rtsp_client_create(const char *id, apr_size_t max_connection_count, apr_size_t request_timeout, void *obj, const rtsp_client_vtable_t *handler, apr_pool_t *pool)