Ring Daemon 16.0.0
Loading...
Searching...
No Matches
null_audio_processor.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
19
20#include <cassert>
21
22namespace jami {
23
25 : AudioProcessor(format, frameSize)
26{
27 JAMI_DBG("[null_audio] NullAudioProcessor, frame size = %d (=%d ms), channels = %d",
28 frameSize,
30 format.nb_channels);
31}
32
33std::shared_ptr<AudioFrame>
35{
36 if (tidyQueues()) {
37 return {};
38 }
39
41 return recordQueue_.dequeue();
42};
43
44} // namespace jami
std::shared_ptr< AudioFrame > dequeue()
Notifies owner of a new frame.
unsigned int frameDurationMs_
AudioFrameResizer playbackQueue_
bool tidyQueues()
Helper method for audio processors, should be called at start of getProcessed() Pops frames from audi...
AudioFrameResizer recordQueue_
NullAudioProcessor(AudioFormat format, unsigned frameSize)
std::shared_ptr< AudioFrame > getProcessed() override
Process and return a single AudioFrame.
#define JAMI_DBG(...)
Definition logger.h:216
Structure to hold sample rate and channel number associated with audio data.