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
mrcp-engine
include
mrcp_engine_impl.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: mrcp_engine_impl.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17
*/
18
19
#ifndef MRCP_ENGINE_IMPL_H
20
#define MRCP_ENGINE_IMPL_H
21
22
/**
23
* @file mrcp_engine_impl.h
24
* @brief MRCP Engine Realization Interface (typically should be implemented in plugins)
25
*/
26
27
#include "
mrcp_engine_types.h
"
28
#include "
mpf_stream.h
"
29
30
APT_BEGIN_EXTERN_C
31
32
/** Create engine */
33
mrcp_engine_t
*
mrcp_engine_create
(
34
mrcp_resource_id
resource_id,
35
void
*obj,
36
const
mrcp_engine_method_vtable_t
*vtable,
37
apr_pool_t *pool);
38
39
/** Send engine open response */
40
static
APR_INLINE
apt_bool_t
mrcp_engine_open_respond(
mrcp_engine_t
*engine,
apt_bool_t
status)
41
{
42
return
engine->
event_vtable
->
on_open
(engine,status);
43
}
44
45
/** Send engine close response */
46
static
APR_INLINE
apt_bool_t
mrcp_engine_close_respond(
mrcp_engine_t
*engine)
47
{
48
return
engine->
event_vtable
->
on_close
(engine);
49
}
50
51
52
/** Get engine config */
53
const
mrcp_engine_config_t
*
mrcp_engine_config_get
(
const
mrcp_engine_t
*engine);
54
55
/** Get engine param by name */
56
const
char
*
mrcp_engine_param_get
(
const
mrcp_engine_t
*engine,
const
char
*name);
57
58
59
/** Create engine channel */
60
mrcp_engine_channel_t
*
mrcp_engine_channel_create
(
61
mrcp_engine_t
*engine,
62
const
mrcp_engine_channel_method_vtable_t
*method_vtable,
63
void
*method_obj,
64
mpf_termination_t
*termination,
65
apr_pool_t *pool);
66
67
/** Create audio termination */
68
mpf_termination_t
*
mrcp_engine_audio_termination_create
(
69
void
*obj,
70
const
mpf_audio_stream_vtable_t
*stream_vtable,
71
mpf_stream_capabilities_t
*capabilities,
72
apr_pool_t *pool);
73
74
/** Create engine channel and source media termination
75
* @deprecated @see mrcp_engine_channel_create() and mrcp_engine_audio_termination_create()
76
*/
77
mrcp_engine_channel_t
*
mrcp_engine_source_channel_create
(
78
mrcp_engine_t
*engine,
79
const
mrcp_engine_channel_method_vtable_t
*channel_vtable,
80
const
mpf_audio_stream_vtable_t
*stream_vtable,
81
void
*method_obj,
82
mpf_codec_descriptor_t
*codec_descriptor,
83
apr_pool_t *pool);
84
85
/** Create engine channel and sink media termination
86
* @deprecated @see mrcp_engine_channel_create() and mrcp_engine_audio_termination_create()
87
*/
88
mrcp_engine_channel_t
*
mrcp_engine_sink_channel_create
(
89
mrcp_engine_t
*engine,
90
const
mrcp_engine_channel_method_vtable_t
*channel_vtable,
91
const
mpf_audio_stream_vtable_t
*stream_vtable,
92
void
*method_obj,
93
mpf_codec_descriptor_t
*codec_descriptor,
94
apr_pool_t *pool);
95
96
/** Send channel open response */
97
static
APR_INLINE
apt_bool_t
mrcp_engine_channel_open_respond(
mrcp_engine_channel_t
*channel,
apt_bool_t
status)
98
{
99
return
channel->
event_vtable
->
on_open
(channel,status);
100
}
101
102
/** Send channel close response */
103
static
APR_INLINE
apt_bool_t
mrcp_engine_channel_close_respond(
mrcp_engine_channel_t
*channel)
104
{
105
return
channel->
event_vtable
->
on_close
(channel);
106
}
107
108
/** Send response/event message */
109
static
APR_INLINE
apt_bool_t
mrcp_engine_channel_message_send(
mrcp_engine_channel_t
*channel,
mrcp_message_t
*message)
110
{
111
return
channel->
event_vtable
->
on_message
(channel,message);
112
}
113
114
/** Get channel identifier */
115
static
APR_INLINE
const
char
* mrcp_engine_channel_id_get(
mrcp_engine_channel_t
*channel)
116
{
117
return
channel->
id
.
buf
;
118
}
119
120
/** Get MRCP version channel is created in the scope of */
121
static
APR_INLINE
mrcp_version_e
mrcp_engine_channel_version_get(
const
mrcp_engine_channel_t
*channel)
122
{
123
return
channel->
mrcp_version
;
124
}
125
126
/** Get codec descriptor of the audio source stream */
127
const
mpf_codec_descriptor_t
*
mrcp_engine_source_stream_codec_get
(
const
mrcp_engine_channel_t
*channel);
128
129
/** Get codec descriptor of the audio sink stream */
130
const
mpf_codec_descriptor_t
*
mrcp_engine_sink_stream_codec_get
(
const
mrcp_engine_channel_t
*channel);
131
132
133
APT_END_EXTERN_C
134
135
#endif
/* MRCP_ENGINE_IMPL_H */
Generated on Mon Feb 2 2015 19:41:39 for UniMRCP by
1.8.3.1