UniMRCP  1.7.0
mrcp_engine_types.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 MRCP_ENGINE_TYPES_H
18 #define MRCP_ENGINE_TYPES_H
19 
20 /**
21  * @file mrcp_engine_types.h
22  * @brief MRCP Engine Types
23  */
24 
25 #include <apr_tables.h>
26 #include <apr_hash.h>
27 #include "mrcp_state_machine.h"
28 #include "mpf_types.h"
29 #include "apt_string.h"
30 
32 
33 /** MRCP engine declaration */
35 /** MRCP engine config declaration */
37 /** MRCP engine profile settings declaration */
39 /** MRCP engine vtable declaration */
41 /** MRCP engine event vtable declaration */
43 /** MRCP engine channel declaration */
45 /** MRCP engine channel virtual method table declaration */
47 /** MRCP engine channel virtual event table declaration */
49 
50 /** Table of channel virtual methods */
52  /** Virtual destroy */
54  /** Virtual open */
56  /** Virtual close */
58  /** Virtual process_request */
60 };
61 
62 /** Table of channel virtual event handlers */
64  /** Open event handler */
65  apt_bool_t (*on_open)(mrcp_engine_channel_t *channel, apt_bool_t status);
66  /** Close event handler */
67  apt_bool_t (*on_close)(mrcp_engine_channel_t *channel);
68  /** Message event handler */
69  apt_bool_t (*on_message)(mrcp_engine_channel_t *channel, mrcp_message_t *message);
70 };
71 
72 /** MRCP engine channel declaration */
74  /** Table of virtual methods */
76  /** External object used with virtual methods */
77  void *method_obj;
78  /** Table of virtual event handlers */
80  /** External object used with event handlers */
81  void *event_obj;
82  /** Media termination */
84  /** Back pointer to engine */
86  /** Unique identifier to be used in traces */
88  /** MRCP version */
90  /** Is channel successfully opened */
92  /** Pool to allocate memory from */
93  apr_pool_t *pool;
94  /** Name/value attributes */
95  apr_table_t *attribs;
96 };
97 
98 /** Table of MRCP engine virtual methods */
100  /** Virtual destroy */
102  /** Virtual open */
104  /** Virtual close */
106  /** Virtual channel create */
107  mrcp_engine_channel_t* (*create_channel)(mrcp_engine_t *engine, apr_pool_t *pool);
108 };
109 
110 /** Table of MRCP engine virtual event handlers */
112  /** Open event handler */
113  apt_bool_t (*on_open)(mrcp_engine_t *channel, apt_bool_t status);
114  /** Close event handler */
115  apt_bool_t (*on_close)(mrcp_engine_t *channel);
116 };
117 
118 /** MRCP engine */
120  /** Identifier of the engine */
121  const char *id;
122  /** Resource identifier */
124  /** External object associated with engine */
125  void *obj;
126  /** Table of virtual methods */
128  /** Table of virtual event handlers */
130  /** External object used with event handlers */
131  void *event_obj;
132  /** Codec manager */
134  /** Dir layout structure */
136  /** Config of engine */
138  /** Number of simultaneous channels currently in use */
139  apr_size_t cur_channel_count;
140  /** Is engine successfully opened */
142  /** Pool to allocate memory from */
143  apr_pool_t *pool;
144 
145  /** Create state machine */
146  mrcp_state_machine_t* (*create_state_machine)(void *obj, mrcp_version_e version, apr_pool_t *pool);
147 };
148 
149 /** MRCP engine config */
151  /** Max number of simultaneous channels */
152  apr_size_t max_channel_count;
153  /** Table of name/value string params */
154  apr_table_t *params;
155 };
156 
157 /** MRCP engine profile settings */
159  /** Identifier of the resource loaded from configuration */
160  const char *resource_id;
161  /** Identifier of the engine loaded from configuration */
162  const char *engine_id;
163  /** Table of name/value string attributes loaded from configuration */
164  apr_table_t *attribs;
165  /** Associated engine */
167 };
168 
170 
171 #endif /* MRCP_ENGINE_TYPES_H */
apt_bool_t is_open
Definition: mrcp_engine_types.h:91
const mrcp_engine_method_vtable_t * method_vtable
Definition: mrcp_engine_types.h:127
apr_size_t cur_channel_count
Definition: mrcp_engine_types.h:139
const mrcp_engine_event_vtable_t * event_vtable
Definition: mrcp_engine_types.h:129
struct apt_dir_layout_t apt_dir_layout_t
Definition: apt_dir_layout.h:38
Definition: mpf_termination.h:51
apt_bool_t(* destroy)(mrcp_engine_channel_t *channel)
Definition: mrcp_engine_types.h:53
void * event_obj
Definition: mrcp_engine_types.h:81
const char * resource_id
Definition: mrcp_engine_types.h:160
#define APT_END_EXTERN_C
Definition: apt.h:38
apt_bool_t(* close)(mrcp_engine_channel_t *channel)
Definition: mrcp_engine_types.h:57
int apt_bool_t
Definition: apt.h:57
void * method_obj
Definition: mrcp_engine_types.h:77
mrcp_engine_t * engine
Definition: mrcp_engine_types.h:85
Definition: mrcp_engine_types.h:99
apr_table_t * params
Definition: mrcp_engine_types.h:154
void * event_obj
Definition: mrcp_engine_types.h:131
Definition: mrcp_engine_types.h:73
mrcp_version_e
Definition: mrcp_types.h:30
Definition: mrcp_state_machine.h:34
apr_pool_t * pool
Definition: mrcp_engine_types.h:93
apt_bool_t(* open)(mrcp_engine_channel_t *channel)
Definition: mrcp_engine_types.h:55
const mrcp_engine_channel_event_vtable_t * event_vtable
Definition: mrcp_engine_types.h:79
Definition: mrcp_engine_types.h:158
apr_pool_t * pool
Definition: mrcp_engine_types.h:143
apr_size_t max_channel_count
Definition: mrcp_engine_types.h:152
Definition: mrcp_engine_types.h:63
const mpf_codec_manager_t * codec_manager
Definition: mrcp_engine_types.h:133
const apt_dir_layout_t * dir_layout
Definition: mrcp_engine_types.h:135
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
MPF Types Declarations.
apt_str_t id
Definition: mrcp_engine_types.h:87
apr_size_t mrcp_resource_id
Definition: mrcp_types.h:68
Definition: mrcp_engine_types.h:150
mrcp_engine_t * engine
Definition: mrcp_engine_types.h:166
mrcp_resource_id resource_id
Definition: mrcp_engine_types.h:123
apt_bool_t(* process_request)(mrcp_engine_channel_t *channel, mrcp_message_t *request)
Definition: mrcp_engine_types.h:59
Definition: apt_string.h:36
mpf_termination_t * termination
Definition: mrcp_engine_types.h:83
mrcp_version_e mrcp_version
Definition: mrcp_engine_types.h:89
apr_table_t * attribs
Definition: mrcp_engine_types.h:164
Definition: mrcp_engine_types.h:111
const mrcp_engine_channel_method_vtable_t * method_vtable
Definition: mrcp_engine_types.h:75
void * obj
Definition: mrcp_engine_types.h:125
Definition: mrcp_engine_types.h:51
const char * engine_id
Definition: mrcp_engine_types.h:162
mrcp_engine_config_t * config
Definition: mrcp_engine_types.h:137
apt_bool_t is_open
Definition: mrcp_engine_types.h:141
Definition: mrcp_engine_types.h:119
MRCP State Machine.
String Representation.
const char * id
Definition: mrcp_engine_types.h:121
struct mpf_codec_manager_t mpf_codec_manager_t
Definition: mpf_types.h:39
Definition: mrcp_message.h:37
apr_table_t * attribs
Definition: mrcp_engine_types.h:95