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
mpf
include
mpf_stream_descriptor.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: mpf_stream_descriptor.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17
*/
18
19
#ifndef MPF_STREAM_DESCRIPTOR_H
20
#define MPF_STREAM_DESCRIPTOR_H
21
22
/**
23
* @file mpf_stream_descriptor.h
24
* @brief MPF Stream Descriptor
25
*/
26
27
#include "
mpf_codec_descriptor.h
"
28
29
APT_BEGIN_EXTERN_C
30
31
/** Stream capabilities declaration */
32
typedef
struct
mpf_stream_capabilities_t
mpf_stream_capabilities_t
;
33
34
/** Stream directions (none, send, receive, duplex) */
35
typedef
enum
{
36
STREAM_DIRECTION_NONE
= 0x0,
/**< none */
37
STREAM_DIRECTION_SEND
= 0x1,
/**< send (sink) */
38
STREAM_DIRECTION_RECEIVE
= 0x2,
/**< receive (source) */
39
40
STREAM_DIRECTION_DUPLEX
=
STREAM_DIRECTION_SEND
|
STREAM_DIRECTION_RECEIVE
/**< duplex */
41
}
mpf_stream_direction_e
;
42
43
44
/** Stream capabilities */
45
struct
mpf_stream_capabilities_t
{
46
/** Supported directions either send, receive or bidirectional stream (bitmask of mpf_stream_direction_e) */
47
mpf_stream_direction_e
direction
;
48
/** Codec capabilities (supported codecs and named events) */
49
mpf_codec_capabilities_t
codecs
;
50
};
51
52
/** Create stream capabilities */
53
MPF_DECLARE
(
mpf_stream_capabilities_t
*)
mpf_stream_capabilities_create
(
mpf_stream_direction_e
directions, apr_pool_t *pool);
54
55
/** Create source stream capabilities */
56
static APR_INLINE
mpf_stream_capabilities_t
* mpf_source_stream_capabilities_create(apr_pool_t *pool)
57
{
58
return
mpf_stream_capabilities_create
(
STREAM_DIRECTION_RECEIVE
,pool);
59
}
60
61
/** Create sink stream capabilities */
62
static
APR_INLINE
mpf_stream_capabilities_t
* mpf_sink_stream_capabilities_create(apr_pool_t *pool)
63
{
64
return
mpf_stream_capabilities_create
(
STREAM_DIRECTION_SEND
,pool);
65
}
66
67
/** Clone stream capabilities */
68
MPF_DECLARE
(
mpf_stream_capabilities_t
*)
mpf_stream_capabilities_clone
(const
mpf_stream_capabilities_t
*src_capabilities, apr_pool_t *pool);
69
70
/** Merge stream capabilities */
71
MPF_DECLARE
(
apt_bool_t
)
mpf_stream_capabilities_merge
(
mpf_stream_capabilities_t
*capabilities, const
mpf_stream_capabilities_t
*src_capabilities, apr_pool_t *pool);
72
73
74
/** Get reverse direction */
75
static APR_INLINE
mpf_stream_direction_e
mpf_stream_reverse_direction_get(
mpf_stream_direction_e
direction)
76
{
77
mpf_stream_direction_e
rev_direction = direction;
78
if
(rev_direction ==
STREAM_DIRECTION_SEND
) {
79
rev_direction =
STREAM_DIRECTION_RECEIVE
;
80
}
81
else
if
(rev_direction ==
STREAM_DIRECTION_RECEIVE
) {
82
rev_direction =
STREAM_DIRECTION_SEND
;
83
}
84
return
rev_direction;
85
}
86
87
88
APT_END_EXTERN_C
89
90
#endif
/* MPF_STREAM_DESCRIPTOR_H */
Generated on Mon Feb 2 2015 19:41:38 for UniMRCP by
1.8.3.1