Ring Daemon 16.0.0
Loading...
Searching...
No Matches
audiodevice.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2025 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
62
63bool
65{
66 return id_ != kAudioDeviceUnknown;
67}
68
69void
86
87int
88AudioDevice::countChannels() const
89{
92 int result = 0;
93
96
99 0}; // channel
100
102 if (err)
103 return 0;
104
107 if (!err) {
108 for (UInt32 i = 0; i < buflist->mNumberBuffers; ++i) {
109 result += buflist->mBuffers[i].mNumberChannels;
110 }
111 }
112 free(buflist);
113 return result;
114}
115
116std::string
117AudioDevice::getName() const
118{
119 char buf[256];
120 UInt32 maxlen = sizeof(buf) - 1;
121
124
126
128 return buf;
129}
130
131} // namespace jami
132
133#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 ring_signal.h:64