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