1 |
/* avc_definitions.h |
---|
2 |
* Copyright (C) 2005 by Daniel Wagner |
---|
3 |
* |
---|
4 |
* This file is part of FreeBoB. |
---|
5 |
* |
---|
6 |
* FreeBoB is free software; you can redistribute it and/or modify |
---|
7 |
* it under the terms of the GNU General Public License as published by |
---|
8 |
* the Free Software Foundation; either version 2 of the License, or |
---|
9 |
* (at your option) any later version. |
---|
10 |
* FreeBoB is distributed in the hope that it will be useful, |
---|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 |
* GNU General Public License for more details. |
---|
14 |
* |
---|
15 |
* You should have received a copy of the GNU General Public License |
---|
16 |
* along with FreeBoB; if not, write to the Free Software |
---|
17 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
---|
18 |
* MA 02111-1307 USA. |
---|
19 |
*/ |
---|
20 |
|
---|
21 |
#ifndef AVCDefinitions_h |
---|
22 |
#define AVCDefinitions_h |
---|
23 |
|
---|
24 |
#include <libavc1394/avc1394.h> |
---|
25 |
#include <ostream> |
---|
26 |
#include "freebob-interface.h" |
---|
27 |
|
---|
28 |
typedef byte_t ctype_t; |
---|
29 |
typedef byte_t unit_t; |
---|
30 |
typedef byte_t unit_type_t; |
---|
31 |
typedef byte_t subunit_t; |
---|
32 |
typedef byte_t opcode_t; |
---|
33 |
typedef byte_t plug_type_t; |
---|
34 |
typedef byte_t plug_id_t; |
---|
35 |
typedef byte_t reserved_t; |
---|
36 |
typedef byte_t function_block_type_t; |
---|
37 |
typedef byte_t function_block_id_t; |
---|
38 |
typedef byte_t control_attribute_t; |
---|
39 |
typedef byte_t plug_direction_t; |
---|
40 |
typedef byte_t plug_address_mode_t; |
---|
41 |
typedef byte_t status_t; |
---|
42 |
typedef byte_t number_of_channels_t; |
---|
43 |
typedef byte_t stream_format_t; |
---|
44 |
typedef byte_t sampling_frequency_t; |
---|
45 |
typedef byte_t rate_control_t; |
---|
46 |
typedef byte_t number_of_stream_format_infos_t; |
---|
47 |
typedef byte_t nr_of_plugs_t; |
---|
48 |
typedef byte_t subunit_id_t; |
---|
49 |
typedef byte_t subfunction_t; |
---|
50 |
typedef byte_t opcode_t; |
---|
51 |
typedef byte_t page_t; |
---|
52 |
typedef byte_t extension_code_t; |
---|
53 |
typedef byte_t subunit_type_t; |
---|
54 |
typedef byte_t max_subunit_id_t; |
---|
55 |
typedef byte_t nr_of_channels_t; |
---|
56 |
typedef byte_t stream_position_t; |
---|
57 |
typedef byte_t stream_position_location_t; |
---|
58 |
typedef byte_t nr_of_clusters_t; |
---|
59 |
typedef byte_t string_length_t; |
---|
60 |
typedef byte_t cluster_index_t; |
---|
61 |
typedef byte_t port_type_t; |
---|
62 |
typedef byte_t number_of_output_plugs_t; |
---|
63 |
typedef byte_t function_block_type_t; |
---|
64 |
typedef byte_t function_block_id_t; |
---|
65 |
typedef byte_t function_block_special_purpose_t; |
---|
66 |
typedef byte_t no_of_input_plugs_t; |
---|
67 |
typedef byte_t no_of_output_plugs_t; |
---|
68 |
typedef byte_t info_type_t; |
---|
69 |
typedef byte_t audio_channel_number_t; |
---|
70 |
typedef byte_t selector_length_t; |
---|
71 |
typedef byte_t control_selector_t; |
---|
72 |
typedef byte_t control_data_length_t; |
---|
73 |
typedef uint16_t control_data_ext_length_t; |
---|
74 |
typedef uint16_t mixer_level_t; |
---|
75 |
typedef byte_t mixer_programmable_state_t; |
---|
76 |
typedef byte_t input_fb_plug_number_t; |
---|
77 |
typedef byte_t input_audio_channel_number_t; |
---|
78 |
typedef byte_t output_audio_channel_number_t; |
---|
79 |
typedef byte_t status_selector_t; |
---|
80 |
|
---|
81 |
typedef quadlet_t company_id_t; |
---|
82 |
|
---|
83 |
/** |
---|
84 |
* \brief the possible sampling frequencies |
---|
85 |
*/ |
---|
86 |
enum ESamplingFrequency { |
---|
87 |
eSF_AVC_22050Hz = 0x00, |
---|
88 |
eSF_AVC_24000Hz = 0x01, |
---|
89 |
eSF_AVC_32000Hz = 0x02, |
---|
90 |
eSF_AVC_44100Hz = 0x03, |
---|
91 |
eSF_AVC_48000Hz = 0x04, |
---|
92 |
eSF_AVC_88200Hz = 0x0A, |
---|
93 |
eSF_AVC_96000Hz = 0x05, |
---|
94 |
eSF_AVC_176400Hz = 0x06, |
---|
95 |
eSF_AVC_192000Hz = 0x07, |
---|
96 |
eSF_AVC_DontCare = 0x0F, |
---|
97 |
}; |
---|
98 |
|
---|
99 |
/** |
---|
100 |
* \brief Convert from ESamplingFrequency to an integer |
---|
101 |
* @param freq |
---|
102 |
* @return |
---|
103 |
*/ |
---|
104 |
int convertAvcSamplingFrequency(ESamplingFrequency freq); |
---|
105 |
/** |
---|
106 |
* \brief Convert from integer to ESamplingFrequency |
---|
107 |
* @param sampleRate |
---|
108 |
* @return |
---|
109 |
*/ |
---|
110 |
ESamplingFrequency parseAvcSamplingFrequency( int sampleRate ); |
---|
111 |
|
---|
112 |
ESampleRate fromAvcSamplingFrequency( ESamplingFrequency r ); |
---|
113 |
ESamplingFrequency toAvcSamplingFrequency( ESampleRate r ); |
---|
114 |
|
---|
115 |
std::ostream& operator<<( std::ostream& stream, ESamplingFrequency samplingFrequency ); |
---|
116 |
|
---|
117 |
#define AVC1394_SUBUNIT_AUDIO 1 |
---|
118 |
#define AVC1394_SUBUNIT_PRINTER 2 |
---|
119 |
#define AVC1394_SUBUNIT_CA 6 |
---|
120 |
#define AVC1394_SUBUNIT_PANEL 9 |
---|
121 |
#define AVC1394_SUBUNIT_BULLETIN_BOARD 0xA |
---|
122 |
#define AVC1394_SUBUNIT_CAMERA_STORAGE 0xB |
---|
123 |
#define AVC1394_SUBUNIT_MUSIC 0xC |
---|
124 |
#define AVC1394_SUBUNIT_RESERVED 0x1D |
---|
125 |
|
---|
126 |
#define AVC1394_SUBUNIT_ID_RESERVED 0x06 |
---|
127 |
|
---|
128 |
#endif // AVCDefinitions_h |
---|