root/branches/streaming-rework/src/libavc/avc_definitions.cpp

Revision 415, 3.1 kB (checked in by pieterpalmers, 16 years ago)

ieee1394service:
- implemented 64bit compare-swap-lock operation (needed for DICE)
- small name change of (un)registerARMhandler to (un)registerARMHandler

iavdevice.h:
- made the stream start/stop functions return bool instead of int
- updated function documentation for consistency and to reflect changes

BeBoB avdevice:
- replaced the 2 fixed streamprocessor pointers with a 2 vectors of streamprocessors
- implemented the 'snoop mode' (cannot be activated yet)

libstreaming:
- removed unused 'type' attribute from AmdtpPortInfo? & children

mh_avdevice, motu_avdevice, rme_avdevice:
- replaced m_1394service with m_p1394service for consistence

maudio_avdevice.cpp:
- removed unused code

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /* avc_defintions.cpp
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 #include "avc_definitions.h"
22
23
24 int
25 convertESamplingFrequency(ESamplingFrequency freq)
26 {
27     int value = 0;
28
29     switch ( freq ) {
30     case eSF_22050Hz:
31         value = 22050;
32         break;
33     case eSF_24000Hz:
34         value = 24000;
35         break;
36     case eSF_32000Hz:
37         value = 32000;
38         break;
39     case eSF_44100Hz:
40         value = 44100;
41         break;
42     case eSF_48000Hz:
43         value = 48000;
44         break;
45     case eSF_88200Hz:
46         value = 88200;
47         break;
48     case eSF_96000Hz:
49         value = 96000;
50         break;
51     case eSF_176400Hz:
52         value = 176400;
53         break;
54     case eSF_192000Hz:
55         value = 192000;
56         break;
57     case eSF_AnyLow:
58         value = 48000;
59         break;
60     case eSF_AnyMid:
61         value = 96000;
62         break;
63     case eSF_AnyHigh:
64         value = 192000;
65         break;
66     default:
67         value = 0;
68     }
69
70
71     return value;
72 }
73
74 ESamplingFrequency
75 parseSampleRate( int sampleRate )
76 {
77     ESamplingFrequency efreq;
78     switch ( sampleRate ) {
79     case 22050:
80         efreq = eSF_22050Hz;
81         break;
82     case 24000:
83         efreq = eSF_24000Hz;
84         break;
85     case 32000:
86         efreq = eSF_32000Hz;
87         break;
88     case 44100:
89         efreq = eSF_44100Hz;
90         break;
91     case 48000:
92         efreq = eSF_48000Hz;
93         break;
94     case 88200:
95         efreq = eSF_88200Hz;
96         break;
97     case 96000:
98         efreq = eSF_96000Hz;
99         break;
100     case 176400:
101         efreq = eSF_176400Hz;
102         break;
103     case 192000:
104         efreq = eSF_192000Hz;
105         break;
106     default:
107         efreq = eSF_DontCare;
108     }
109
110     return efreq;
111 }
112
113 std::ostream& operator<<( std::ostream& stream, ESamplingFrequency samplingFrequency )
114 {
115     char* str;
116     switch ( samplingFrequency ) {
117     case eSF_22050Hz:
118         str = "22050";
119         break;
120     case eSF_24000Hz:
121         str = "24000";
122         break;
123     case eSF_32000Hz:
124         str = "32000";
125         break;
126     case eSF_44100Hz:
127         str = "44100";
128         break;
129     case eSF_48000Hz:
130         str = "48000";
131         break;
132     case eSF_88200Hz:
133         str = "88200";
134         break;
135     case eSF_96000Hz:
136         str = "96000";
137         break;
138     case eSF_176400Hz:
139         str = "176400";
140         break;
141     case eSF_192000Hz:
142         str = "192000";
143         break;
144     case eSF_DontCare:
145     default:
146         str = "unknown";
147     }
148     return stream << str;
149 };
Note: See TracBrowser for help on using the browser.