summaryrefslogtreecommitdiff
path: root/lib/avtp_pipeline/include/openavb_audio_pub.h
blob: 769481ff1891353249b0a422f9d167ff5409ab0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*************************************************************************************************************
Copyright (c) 2012-2015, Symphony Teleca Corporation, a Harman International Industries, Incorporated company
All rights reserved.
 
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
 
1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.
 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS LISTED "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS LISTED BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
Attributions: The inih library portion of the source code is licensed from 
Brush Technology and Ben Hoyt - Copyright (c) 2009, Brush Technology and Copyright (c) 2009, Ben Hoyt. 
Complete license and copyright information can be found at 
https://github.com/benhoyt/inih/commit/74d2ca064fb293bc60a77b0bd068075b293cf175.
*************************************************************************************************************/

/*
* MODULE SUMMARY : General Audio Types Public
*/

#ifndef AVB_AUDIO_PUB_H
#define AVB_AUDIO_PUB_H 1

/** \file
 * General audio types
 */

/** Audio rate
 */
typedef enum {
	/// 8000
	AVB_AUDIO_RATE_8KHZ 		= 8000,
	/// 11025
	AVB_AUDIO_RATE_11_025KHZ 	= 11025,
	/// 16000
	AVB_AUDIO_RATE_16KHZ 		= 16000,
	/// 22050
	AVB_AUDIO_RATE_22_05KHZ		= 22050,
	/// 32000
	AVB_AUDIO_RATE_32KHZ		= 32000,
	/// 44100
	AVB_AUDIO_RATE_44_1KHZ		= 44100,
	/// 48000
	AVB_AUDIO_RATE_48KHZ		= 48000,
	/// 64000
	AVB_AUDIO_RATE_64KHZ		= 64000,
	/// 88200
	AVB_AUDIO_RATE_88_2KHZ		= 88200,
	/// 96000
	AVB_AUDIO_RATE_96KHZ		= 96000,
	/// 176400
	AVB_AUDIO_RATE_176_4KHZ		= 176400,
	/// 192000
	AVB_AUDIO_RATE_192KHZ		= 192000
} avb_audio_rate_t;

/** Defines what type is data.
 *
 * Information is needed together with endianes and bit depth to configure the
 * sample format correctly
 */
typedef enum {
	/// Data type undefined
	AVB_AUDIO_TYPE_UNSPEC,
	/// Data type int
	AVB_AUDIO_TYPE_INT,
	/// Data type unsigned int
	AVB_AUDIO_TYPE_UINT,
	/// Data type float
	AVB_AUDIO_TYPE_FLOAT,
} avb_audio_type_t;

/** Defines endianess of data.
 *
 * Information is needed together with data type and bit depth to configure the
 * sample format correctly
 */
typedef enum {
	/// Unspecified
	AVB_AUDIO_ENDIAN_UNSPEC,
	/// Little endian
	AVB_AUDIO_ENDIAN_LITTLE,
	/// Big endian
	AVB_AUDIO_ENDIAN_BIG,
} avb_audio_endian_t;

/** Bit depth of audio.
 *
 * Information is needed together with endianes and data type to configure the
 * sample format correctly
 */
typedef enum {
	/// 1 bit
	AVB_AUDIO_BIT_DEPTH_1BIT	= 1,
	/// 8 bit
	AVB_AUDIO_BIT_DEPTH_8BIT	= 8,
	/// 16 bit
	AVB_AUDIO_BIT_DEPTH_16BIT	= 16,
	/// 20 bit
	AVB_AUDIO_BIT_DEPTH_20BIT	= 20,
	/// 24 bit
	AVB_AUDIO_BIT_DEPTH_24BIT	= 24,
	/// 32 bit
	AVB_AUDIO_BIT_DEPTH_32BIT	= 32,
	/// 48 bit
	AVB_AUDIO_BIT_DEPTH_48BIT	= 48,
	/// 64 bit
	AVB_AUDIO_BIT_DEPTH_64BIT	= 64
} avb_audio_bit_depth_t;

/** Number of channels
 */
typedef enum {
	/// 1 channel
	AVB_AUDIO_CHANNELS_1		= 1,
	/// 2 channels
	AVB_AUDIO_CHANNELS_2		= 2,
	/// 3 channels
	AVB_AUDIO_CHANNELS_3		= 3,
	/// 4 channels
	AVB_AUDIO_CHANNELS_4		= 4,
	/// 5 channels
	AVB_AUDIO_CHANNELS_5		= 5,
	/// 6 channels
	AVB_AUDIO_CHANNELS_6		= 6,
	/// 7 channels
	AVB_AUDIO_CHANNELS_7		= 7,
	/// 8 channels
	AVB_AUDIO_CHANNELS_8		= 8
} avb_audio_channels_t;

/** Media Clock Recovery.
 */
typedef enum {
	/// No Media Clock Recovery is Done, this is the default
	AVB_MCR_NONE,
	/// Media Clock Recovery done by using AVTP timestamps
	AVB_MCR_AVTP_TIMESTAMP,
	/// Media Clock Recovery done by using 1722(a), Clock Reference Stream (CRS)
	AVB_MCR_CRS
}avb_audio_mcr_t;

#endif // AVB_AUDIO_PUB_H