Ring Daemon
Loading...
Searching...
No Matches
audiodevice.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2026 Savoir-faire Linux Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#include "audiodevice.h"
19
20#if !TARGET_OS_IPHONE
21
22namespace jami {
23
28
29void
58
59bool
61{
62 return id_ != kAudioDeviceUnknown;
63}
64
65void
78
79int
80AudioDevice::countChannels() const
81{
84 int result = 0;
85
87
89
91 if (err)
92 return 0;
93
96 if (!err) {
97 for (UInt32 i = 0; i < buflist->mNumberBuffers; ++i) {
98 result += buflist->mBuffers[i].mNumberChannels;
99 }
100 }
101 free(buflist);
102 return result;
103}
104
105std::string
106AudioDevice::getName() const
107{
108 char buf[256];
109 UInt32 maxlen = sizeof(buf) - 1;
110
112
114
116 return buf;
117}
118
119} // namespace jami
120
121#endif // TARGET_OS_IPHONE
UInt32 bufferSizeFrames_
Definition audiodevice.h:50
void init(AudioDeviceID devid, bool isInput)
bool valid() const
AudioStreamBasicDescription format_
Definition audiodevice.h:51
void setBufferSize(UInt32 size)
AudioDeviceID id_
Definition audiodevice.h:45
std::string name_
Definition audiodevice.h:46
void emitSignal(Args... args)
Definition jami_signal.h:64