oboe: renamed flowgraph classes
AudioProcessorBase to FlowGraphNode
AudioInputPort to FlowGraphPortInput
etcetera
There should be no change in functionality with this commit.
diff --git a/src/common/AudioSourceCaller.h b/src/common/AudioSourceCaller.h
index f1ef972..d196d41 100644
--- a/src/common/AudioSourceCaller.h
+++ b/src/common/AudioSourceCaller.h
@@ -20,7 +20,7 @@
#include "OboeDebug.h"
#include "oboe/Oboe.h"
-#include "flowgraph/AudioProcessorBase.h"
+#include "flowgraph/FlowGraphNode.h"
#include "FixedBlockReader.h"
namespace oboe {
@@ -32,10 +32,10 @@
* For output streams that use a callback, call the application for more data.
* For input streams that do not use a callback, read from the stream.
*/
-class AudioSourceCaller : public flowgraph::AudioSource, public FixedBlockProcessor {
+class AudioSourceCaller : public flowgraph::FlowGraphSource, public FixedBlockProcessor {
public:
AudioSourceCaller(int32_t channelCount, int32_t framesPerCallback, int32_t bytesPerSample)
- : AudioSource(channelCount)
+ : FlowGraphSource(channelCount)
, mBlockReader(*this) {
mBlockReader.open(channelCount * framesPerCallback * bytesPerSample);
}
diff --git a/src/common/DataConversionFlowGraph.cpp b/src/common/DataConversionFlowGraph.cpp
index 36af115..98536a9 100644
--- a/src/common/DataConversionFlowGraph.cpp
+++ b/src/common/DataConversionFlowGraph.cpp
@@ -72,7 +72,7 @@
//
Result DataConversionFlowGraph::configure(AudioStream *sourceStream, AudioStream *sinkStream) {
- AudioFloatOutputPort *lastOutput = nullptr;
+ FlowGraphPortFloatOutput *lastOutput = nullptr;
bool isOutput = sourceStream->getDirection() == Direction::Output;
mFilterStream = isOutput ? sourceStream : sinkStream;
diff --git a/src/common/DataConversionFlowGraph.h b/src/common/DataConversionFlowGraph.h
index 2afa3d9..b1d5ebe 100644
--- a/src/common/DataConversionFlowGraph.h
+++ b/src/common/DataConversionFlowGraph.h
@@ -65,12 +65,12 @@
}
private:
- std::unique_ptr<flowgraph::AudioSourceBuffered> mSource;
+ std::unique_ptr<flowgraph::FlowGraphSourceBuffered> mSource;
std::unique_ptr<AudioSourceCaller> mSourceCaller;
std::unique_ptr<flowgraph::MonoToMultiConverter> mChannelConverter;
std::unique_ptr<resampler::MultiChannelResampler> mResampler;
std::unique_ptr<flowgraph::SampleRateConverter> mRateConverter;
- std::unique_ptr<flowgraph::AudioSink> mSink;
+ std::unique_ptr<flowgraph::FlowGraphSink> mSink;
FixedBlockWriter mBlockWriter;
DataCallbackResult mCallbackResult = DataCallbackResult::Continue;
diff --git a/src/common/SourceFloatCaller.cpp b/src/common/SourceFloatCaller.cpp
index 3ccf90b..631af85 100644
--- a/src/common/SourceFloatCaller.cpp
+++ b/src/common/SourceFloatCaller.cpp
@@ -16,7 +16,7 @@
#include <algorithm>
#include <unistd.h>
-#include "flowgraph/AudioProcessorBase.h"
+#include "flowgraph/FlowGraphNode.h"
#include "SourceFloatCaller.h"
using namespace oboe;
diff --git a/src/common/SourceFloatCaller.h b/src/common/SourceFloatCaller.h
index c4253b6..85a1585 100644
--- a/src/common/SourceFloatCaller.h
+++ b/src/common/SourceFloatCaller.h
@@ -20,7 +20,7 @@
#include <unistd.h>
#include <sys/types.h>
-#include "flowgraph/AudioProcessorBase.h"
+#include "flowgraph/FlowGraphNode.h"
#include "AudioSourceCaller.h"
#include "FixedBlockReader.h"
diff --git a/src/common/SourceI16Caller.cpp b/src/common/SourceI16Caller.cpp
index 889593d..2ab372b 100644
--- a/src/common/SourceI16Caller.cpp
+++ b/src/common/SourceI16Caller.cpp
@@ -16,7 +16,7 @@
#include <algorithm>
#include <unistd.h>
-#include "flowgraph/AudioProcessorBase.h"
+#include "flowgraph/FlowGraphNode.h"
#include "SourceI16Caller.h"
#if FLOWGRAPH_ANDROID_INTERNAL
diff --git a/src/common/SourceI16Caller.h b/src/common/SourceI16Caller.h
index 5d1ec8f..22c1b9a 100644
--- a/src/common/SourceI16Caller.h
+++ b/src/common/SourceI16Caller.h
@@ -20,7 +20,7 @@
#include <unistd.h>
#include <sys/types.h>
-#include "flowgraph/AudioProcessorBase.h"
+#include "flowgraph/FlowGraphNode.h"
#include "AudioSourceCaller.h"
#include "FixedBlockReader.h"
diff --git a/src/flowgraph/ClipToRange.cpp b/src/flowgraph/ClipToRange.cpp
index ceec0ec..d2f8a02 100644
--- a/src/flowgraph/ClipToRange.cpp
+++ b/src/flowgraph/ClipToRange.cpp
@@ -16,13 +16,13 @@
#include <algorithm>
#include <unistd.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
#include "ClipToRange.h"
using namespace flowgraph;
ClipToRange::ClipToRange(int32_t channelCount)
- : AudioFilter(channelCount) {
+ : FlowGraphFilter(channelCount) {
}
int32_t ClipToRange::onProcess(int32_t numFrames) {
diff --git a/src/flowgraph/ClipToRange.h b/src/flowgraph/ClipToRange.h
index ee8d3f2..22b7804 100644
--- a/src/flowgraph/ClipToRange.h
+++ b/src/flowgraph/ClipToRange.h
@@ -21,7 +21,7 @@
#include <unistd.h>
#include <sys/types.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
namespace flowgraph {
@@ -30,7 +30,7 @@
constexpr float kDefaultMaxHeadroom = 1.41253754f;
constexpr float kDefaultMinHeadroom = -kDefaultMaxHeadroom;
-class ClipToRange : public AudioFilter {
+class ClipToRange : public FlowGraphFilter {
public:
explicit ClipToRange(int32_t channelCount);
diff --git a/src/flowgraph/AudioProcessorBase.cpp b/src/flowgraph/FlowGraphNode.cpp
similarity index 79%
rename from src/flowgraph/AudioProcessorBase.cpp
rename to src/flowgraph/FlowGraphNode.cpp
index d0b768a..bb6ecc9 100644
--- a/src/flowgraph/AudioProcessorBase.cpp
+++ b/src/flowgraph/FlowGraphNode.cpp
@@ -17,12 +17,12 @@
#include "stdio.h"
#include <algorithm>
#include <sys/types.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
using namespace flowgraph;
/***************************************************************************/
-int32_t AudioProcessorBase::pullData(int64_t framePosition, int32_t numFrames) {
+int32_t FlowGraphNode::pullData(int64_t framePosition, int32_t numFrames) {
int32_t frameCount = numFrames;
// Prevent recursion and multiple execution of nodes.
if (framePosition <= mLastFramePosition && !mBlockRecursion) {
@@ -46,7 +46,7 @@
return frameCount;
}
-void AudioProcessorBase::pullReset() {
+void FlowGraphNode::pullReset() {
if (!mBlockRecursion) {
mBlockRecursion = true; // for cyclic graphs
// Pull reset from all the upstream nodes.
@@ -58,15 +58,15 @@
}
}
-void AudioProcessorBase::reset() {
+void FlowGraphNode::reset() {
mLastFrameCount = 0;
}
/***************************************************************************/
-AudioFloatBufferPort::AudioFloatBufferPort(AudioProcessorBase &parent,
+FlowGraphPortFloat::FlowGraphPortFloat(FlowGraphNode &parent,
int32_t samplesPerFrame,
int32_t framesPerBuffer)
- : AudioPort(parent, samplesPerFrame)
+ : FlowGraphPort(parent, samplesPerFrame)
, mFramesPerBuffer(framesPerBuffer)
, mBuffer(nullptr) {
size_t numFloats = static_cast<size_t>(framesPerBuffer * getSamplesPerFrame());
@@ -74,37 +74,37 @@
}
/***************************************************************************/
-int32_t AudioFloatOutputPort::pullData(int64_t framePosition, int32_t numFrames) {
+int32_t FlowGraphPortFloatOutput::pullData(int64_t framePosition, int32_t numFrames) {
numFrames = std::min(getFramesPerBuffer(), numFrames);
return mContainingNode.pullData(framePosition, numFrames);
}
-void AudioFloatOutputPort::pullReset() {
+void FlowGraphPortFloatOutput::pullReset() {
mContainingNode.pullReset();
}
// These need to be in the .cpp file because of forward cross references.
-void AudioFloatOutputPort::connect(AudioFloatInputPort *port) {
+void FlowGraphPortFloatOutput::connect(FlowGraphPortFloatInput *port) {
port->connect(this);
}
-void AudioFloatOutputPort::disconnect(AudioFloatInputPort *port) {
+void FlowGraphPortFloatOutput::disconnect(FlowGraphPortFloatInput *port) {
port->disconnect(this);
}
/***************************************************************************/
-int32_t AudioFloatInputPort::pullData(int64_t framePosition, int32_t numFrames) {
+int32_t FlowGraphPortFloatInput::pullData(int64_t framePosition, int32_t numFrames) {
return (mConnected == nullptr)
? std::min(getFramesPerBuffer(), numFrames)
: mConnected->pullData(framePosition, numFrames);
}
-void AudioFloatInputPort::pullReset() {
+void FlowGraphPortFloatInput::pullReset() {
if (mConnected != nullptr) mConnected->pullReset();
}
-float *AudioFloatInputPort::getBuffer() {
+float *FlowGraphPortFloatInput::getBuffer() {
if (mConnected == nullptr) {
- return AudioFloatBufferPort::getBuffer(); // loaded using setValue()
+ return FlowGraphPortFloat::getBuffer(); // loaded using setValue()
} else {
return mConnected->getBuffer();
}
diff --git a/src/flowgraph/AudioProcessorBase.h b/src/flowgraph/FlowGraphNode.h
similarity index 79%
rename from src/flowgraph/AudioProcessorBase.h
rename to src/flowgraph/FlowGraphNode.h
index a2380c0..007131e 100644
--- a/src/flowgraph/AudioProcessorBase.h
+++ b/src/flowgraph/FlowGraphNode.h
@@ -15,13 +15,15 @@
*/
/*
- * AudioProcessorBase.h
+ * FlowGraph.h
*
- * Audio processing node and ports that can be used in a simple data flow graph.
+ * Processing node and ports that can be used in a simple data flow graph.
+ * This was designed to work with audio but could be used for other
+ * types of data.
*/
-#ifndef FLOWGRAPH_AUDIO_PROCESSOR_BASE_H
-#define FLOWGRAPH_AUDIO_PROCESSOR_BASE_H
+#ifndef FLOWGRAPH_FLOW_GRAPH_NODE_H
+#define FLOWGRAPH_FLOW_GRAPH_NODE_H
#include <cassert>
#include <cstring>
@@ -33,7 +35,6 @@
#include <vector>
// TODO Move these classes into separate files.
-// TODO Maybe remove "Audio" prefix from these class names: AudioProcessorBase to ProcessorNode
// TODO Review use of raw pointers for connect(). Maybe use smart pointers but need to avoid
// run-time deallocation in audio thread.
@@ -43,22 +44,22 @@
namespace flowgraph {
-// Default block size that can be overridden when the AudioFloatBufferPort is created.
+// Default block size that can be overridden when the FlowGraphPortFloat is created.
// If it is too small then we will have too much overhead from switching between nodes.
// If it is too high then we will thrash the caches.
constexpr int kDefaultBufferSize = 8; // arbitrary
-class AudioPort;
-class AudioFloatInputPort;
+class FlowGraphPort;
+class FlowGraphPortFloatInput;
/***************************************************************************/
/**
* Base class for all nodes in the flowgraph.
*/
-class AudioProcessorBase {
+class FlowGraphNode {
public:
- AudioProcessorBase() {}
- virtual ~AudioProcessorBase() = default;
+ FlowGraphNode() {}
+ virtual ~FlowGraphNode() = default;
/**
* Read from the input ports,
@@ -92,7 +93,7 @@
*/
virtual void reset();
- void addInputPort(AudioPort &port) {
+ void addInputPort(FlowGraphPort &port) {
mInputPorts.push_back(port);
}
@@ -114,7 +115,7 @@
}
virtual const char *getName() {
- return "AudioProcessorBase";
+ return "FlowGraph";
}
int64_t getLastFramePosition() {
@@ -124,7 +125,7 @@
protected:
int64_t mLastFramePosition = 0;
- std::vector<std::reference_wrapper<AudioPort>> mInputPorts;
+ std::vector<std::reference_wrapper<FlowGraphPort>> mInputPorts;
private:
bool mDataPulledAutomatically = true;
@@ -141,16 +142,16 @@
* So they are generally declared as public.
*
*/
-class AudioPort {
+class FlowGraphPort {
public:
- AudioPort(AudioProcessorBase &parent, int32_t samplesPerFrame)
+ FlowGraphPort(FlowGraphNode &parent, int32_t samplesPerFrame)
: mContainingNode(parent)
, mSamplesPerFrame(samplesPerFrame) {
}
// Ports are often declared public. So let's make them non-copyable.
- AudioPort(const AudioPort&) = delete;
- AudioPort& operator=(const AudioPort&) = delete;
+ FlowGraphPort(const FlowGraphPort&) = delete;
+ FlowGraphPort& operator=(const FlowGraphPort&) = delete;
int32_t getSamplesPerFrame() const {
return mSamplesPerFrame;
@@ -161,7 +162,7 @@
virtual void pullReset() {}
protected:
- AudioProcessorBase &mContainingNode;
+ FlowGraphNode &mContainingNode;
private:
const int32_t mSamplesPerFrame = 1;
@@ -174,14 +175,14 @@
*
* The size is framesPerBuffer * samplesPerFrame).
*/
-class AudioFloatBufferPort : public AudioPort {
+class FlowGraphPortFloat : public FlowGraphPort {
public:
- AudioFloatBufferPort(AudioProcessorBase &parent,
+ FlowGraphPortFloat(FlowGraphNode &parent,
int32_t samplesPerFrame,
int32_t framesPerBuffer = kDefaultBufferSize
);
- virtual ~AudioFloatBufferPort() = default;
+ virtual ~FlowGraphPortFloat() = default;
int32_t getFramesPerBuffer() const {
return mFramesPerBuffer;
@@ -205,15 +206,15 @@
/**
* The results of a node's processing are stored in the buffers of the output ports.
*/
-class AudioFloatOutputPort : public AudioFloatBufferPort {
+class FlowGraphPortFloatOutput : public FlowGraphPortFloat {
public:
- AudioFloatOutputPort(AudioProcessorBase &parent, int32_t samplesPerFrame)
- : AudioFloatBufferPort(parent, samplesPerFrame) {
+ FlowGraphPortFloatOutput(FlowGraphNode &parent, int32_t samplesPerFrame)
+ : FlowGraphPortFloat(parent, samplesPerFrame) {
}
- virtual ~AudioFloatOutputPort() = default;
+ virtual ~FlowGraphPortFloatOutput() = default;
- using AudioFloatBufferPort::getBuffer;
+ using FlowGraphPortFloat::getBuffer;
/**
* Connect to the input of another module.
@@ -225,13 +226,13 @@
* This not thread safe. Do not modify the graph topology from another thread while running.
* Also do not delete a module while it is connected to another port if the graph is running.
*/
- void connect(AudioFloatInputPort *port);
+ void connect(FlowGraphPortFloatInput *port);
/**
* Disconnect from the input of another module.
* This not thread safe.
*/
- void disconnect(AudioFloatInputPort *port);
+ void disconnect(FlowGraphPortFloatInput *port);
/**
* Call the parent module's onProcess() method.
@@ -253,15 +254,15 @@
* You can set a value that will be used for processing.
* If you connect an output port to this port then its value will be used instead.
*/
-class AudioFloatInputPort : public AudioFloatBufferPort {
+class FlowGraphPortFloatInput : public FlowGraphPortFloat {
public:
- AudioFloatInputPort(AudioProcessorBase &parent, int32_t samplesPerFrame)
- : AudioFloatBufferPort(parent, samplesPerFrame) {
+ FlowGraphPortFloatInput(FlowGraphNode &parent, int32_t samplesPerFrame)
+ : FlowGraphPortFloat(parent, samplesPerFrame) {
// Add to parent so it can pull data from each input.
parent.addInputPort(*this);
}
- virtual ~AudioFloatInputPort() = default;
+ virtual ~FlowGraphPortFloatInput() = default;
/**
* If connected to an output port then this will return
@@ -290,12 +291,12 @@
* An output port can have multiple connections.
* This not thread safe.
*/
- void connect(AudioFloatOutputPort *port) {
+ void connect(FlowGraphPortFloatOutput *port) {
assert(getSamplesPerFrame() == port->getSamplesPerFrame());
mConnected = port;
}
- void disconnect(AudioFloatOutputPort *port) {
+ void disconnect(FlowGraphPortFloatOutput *port) {
assert(mConnected == port);
(void) port;
mConnected = nullptr;
@@ -313,7 +314,7 @@
void pullReset() override;
private:
- AudioFloatOutputPort *mConnected = nullptr;
+ FlowGraphPortFloatOutput *mConnected = nullptr;
};
/***************************************************************************/
@@ -323,15 +324,15 @@
* It outputs data but does not consume data.
* By default, it will read its data from an external buffer.
*/
-class AudioSource : public AudioProcessorBase {
+class FlowGraphSource : public FlowGraphNode {
public:
- explicit AudioSource(int32_t channelCount)
+ explicit FlowGraphSource(int32_t channelCount)
: output(*this, channelCount) {
}
- virtual ~AudioSource() = default;
+ virtual ~FlowGraphSource() = default;
- AudioFloatOutputPort output;
+ FlowGraphPortFloatOutput output;
};
/***************************************************************************/
@@ -341,12 +342,12 @@
* It outputs data but does not consume data.
* By default, it will read its data from an external buffer.
*/
-class AudioSourceBuffered : public AudioSource {
+class FlowGraphSourceBuffered : public FlowGraphSource {
public:
- explicit AudioSourceBuffered(int32_t channelCount)
- : AudioSource(channelCount) {}
+ explicit FlowGraphSourceBuffered(int32_t channelCount)
+ : FlowGraphSource(channelCount) {}
- virtual ~AudioSourceBuffered() = default;
+ virtual ~FlowGraphSourceBuffered() = default;
/**
* Specify buffer that the node will read from.
@@ -373,15 +374,15 @@
* This graph will be executed when data is read() from this node
* by pulling data from upstream nodes.
*/
-class AudioSink : public AudioProcessorBase {
+class FlowGraphSink : public FlowGraphNode {
public:
- explicit AudioSink(int32_t channelCount)
+ explicit FlowGraphSink(int32_t channelCount)
: input(*this, channelCount) {
}
- virtual ~AudioSink() = default;
+ virtual ~FlowGraphSink() = default;
- AudioFloatInputPort input;
+ FlowGraphPortFloatInput input;
/**
* Dummy processor. The work happens in the read() method.
@@ -403,19 +404,19 @@
* This may include traditional filters, eg. FIR, but also include
* any processing node that converts input to output.
*/
-class AudioFilter : public AudioProcessorBase {
+class FlowGraphFilter : public FlowGraphNode {
public:
- explicit AudioFilter(int32_t channelCount)
+ explicit FlowGraphFilter(int32_t channelCount)
: input(*this, channelCount)
, output(*this, channelCount) {
}
- virtual ~AudioFilter() = default;
+ virtual ~FlowGraphFilter() = default;
- AudioFloatInputPort input;
- AudioFloatOutputPort output;
+ FlowGraphPortFloatInput input;
+ FlowGraphPortFloatOutput output;
};
} /* namespace flowgraph */
-#endif /* FLOWGRAPH_AUDIO_PROCESSOR_BASE_H */
+#endif /* FLOWGRAPH_FLOW_GRAPH_NODE_H */
diff --git a/src/flowgraph/ManyToMultiConverter.cpp b/src/flowgraph/ManyToMultiConverter.cpp
index f51384c..879685e 100644
--- a/src/flowgraph/ManyToMultiConverter.cpp
+++ b/src/flowgraph/ManyToMultiConverter.cpp
@@ -24,7 +24,7 @@
: inputs(channelCount)
, output(*this, channelCount) {
for (int i = 0; i < channelCount; i++) {
- inputs[i] = std::make_unique<AudioFloatInputPort>(*this, 1);
+ inputs[i] = std::make_unique<FlowGraphPortFloatInput>(*this, 1);
}
}
diff --git a/src/flowgraph/ManyToMultiConverter.h b/src/flowgraph/ManyToMultiConverter.h
index 8a2c480..eca4a8e 100644
--- a/src/flowgraph/ManyToMultiConverter.h
+++ b/src/flowgraph/ManyToMultiConverter.h
@@ -21,12 +21,12 @@
#include <sys/types.h>
#include <vector>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
/**
* Combine multiple mono inputs into one interleaved multi-channel output.
*/
-class ManyToMultiConverter : public flowgraph::AudioProcessorBase {
+class ManyToMultiConverter : public flowgraph::FlowGraphNode {
public:
explicit ManyToMultiConverter(int32_t channelCount);
@@ -36,8 +36,8 @@
void setEnabled(bool enabled) {}
- std::vector<std::unique_ptr<flowgraph::AudioFloatInputPort>> inputs;
- flowgraph::AudioFloatOutputPort output;
+ std::vector<std::unique_ptr<flowgraph::FlowGraphPortFloatInput>> inputs;
+ flowgraph::FlowGraphPortFloatOutput output;
const char *getName() override {
return "ManyToMultiConverter";
diff --git a/src/flowgraph/MonoToMultiConverter.cpp b/src/flowgraph/MonoToMultiConverter.cpp
index 772a74d..11cea78 100644
--- a/src/flowgraph/MonoToMultiConverter.cpp
+++ b/src/flowgraph/MonoToMultiConverter.cpp
@@ -15,7 +15,7 @@
*/
#include <unistd.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
#include "MonoToMultiConverter.h"
using namespace flowgraph;
diff --git a/src/flowgraph/MonoToMultiConverter.h b/src/flowgraph/MonoToMultiConverter.h
index 9426e9d..376f7a3 100644
--- a/src/flowgraph/MonoToMultiConverter.h
+++ b/src/flowgraph/MonoToMultiConverter.h
@@ -20,7 +20,7 @@
#include <unistd.h>
#include <sys/types.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
namespace flowgraph {
@@ -28,7 +28,7 @@
* Convert a monophonic stream to a multi-channel stream
* with the same signal on each channel.
*/
-class MonoToMultiConverter : public AudioProcessorBase {
+class MonoToMultiConverter : public FlowGraphNode {
public:
explicit MonoToMultiConverter(int32_t channelCount);
@@ -40,8 +40,8 @@
return "MonoToMultiConverter";
}
- AudioFloatInputPort input;
- AudioFloatOutputPort output;
+ FlowGraphPortFloatInput input;
+ FlowGraphPortFloatOutput output;
};
} /* namespace flowgraph */
diff --git a/src/flowgraph/RampLinear.cpp b/src/flowgraph/RampLinear.cpp
index a076923..afef018 100644
--- a/src/flowgraph/RampLinear.cpp
+++ b/src/flowgraph/RampLinear.cpp
@@ -16,13 +16,13 @@
#include <algorithm>
#include <unistd.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
#include "RampLinear.h"
using namespace flowgraph;
RampLinear::RampLinear(int32_t channelCount)
- : AudioFilter(channelCount) {
+ : FlowGraphFilter(channelCount) {
mTarget.store(1.0f);
}
diff --git a/src/flowgraph/RampLinear.h b/src/flowgraph/RampLinear.h
index 63cb124..f285704 100644
--- a/src/flowgraph/RampLinear.h
+++ b/src/flowgraph/RampLinear.h
@@ -21,7 +21,7 @@
#include <unistd.h>
#include <sys/types.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
namespace flowgraph {
@@ -33,7 +33,7 @@
* The target may be updated while a ramp is in progress, which will trigger
* a new ramp from the current value.
*/
-class RampLinear : public AudioFilter {
+class RampLinear : public FlowGraphFilter {
public:
explicit RampLinear(int32_t channelCount);
diff --git a/src/flowgraph/SampleRateConverter.cpp b/src/flowgraph/SampleRateConverter.cpp
index da88494..708c684 100644
--- a/src/flowgraph/SampleRateConverter.cpp
+++ b/src/flowgraph/SampleRateConverter.cpp
@@ -20,7 +20,7 @@
using namespace resampler;
SampleRateConverter::SampleRateConverter(int32_t channelCount, MultiChannelResampler &resampler)
- : AudioFilter(channelCount)
+ : FlowGraphFilter(channelCount)
, mResampler(resampler) {
setDataPulledAutomatically(false);
}
diff --git a/src/flowgraph/SampleRateConverter.h b/src/flowgraph/SampleRateConverter.h
index 243b68c..d940b22 100644
--- a/src/flowgraph/SampleRateConverter.h
+++ b/src/flowgraph/SampleRateConverter.h
@@ -20,12 +20,12 @@
#include <unistd.h>
#include <sys/types.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
#include "resampler/MultiChannelResampler.h"
namespace flowgraph {
-class SampleRateConverter : public AudioFilter {
+class SampleRateConverter : public FlowGraphFilter {
public:
explicit SampleRateConverter(int32_t channelCount, resampler::MultiChannelResampler &mResampler);
diff --git a/src/flowgraph/SinkFloat.cpp b/src/flowgraph/SinkFloat.cpp
index bd3435f..f830daf 100644
--- a/src/flowgraph/SinkFloat.cpp
+++ b/src/flowgraph/SinkFloat.cpp
@@ -16,13 +16,13 @@
#include <algorithm>
#include <unistd.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
#include "SinkFloat.h"
using namespace flowgraph;
SinkFloat::SinkFloat(int32_t channelCount)
- : AudioSink(channelCount) {
+ : FlowGraphSink(channelCount) {
}
int32_t SinkFloat::read(int64_t framePosition, void *data, int32_t numFrames) {
diff --git a/src/flowgraph/SinkFloat.h b/src/flowgraph/SinkFloat.h
index a0335fd..b6474d1 100644
--- a/src/flowgraph/SinkFloat.h
+++ b/src/flowgraph/SinkFloat.h
@@ -21,14 +21,14 @@
#include <unistd.h>
#include <sys/types.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
namespace flowgraph {
/**
* AudioSink that lets you read data as 32-bit floats.
*/
-class SinkFloat : public AudioSink {
+class SinkFloat : public FlowGraphSink {
public:
explicit SinkFloat(int32_t channelCount);
diff --git a/src/flowgraph/SinkI16.cpp b/src/flowgraph/SinkI16.cpp
index 3cb7b45..a5904e8 100644
--- a/src/flowgraph/SinkI16.cpp
+++ b/src/flowgraph/SinkI16.cpp
@@ -26,7 +26,7 @@
using namespace flowgraph;
SinkI16::SinkI16(int32_t channelCount)
- : AudioSink(channelCount) {}
+ : FlowGraphSink(channelCount) {}
int32_t SinkI16::read(int64_t framePosition, void *data, int32_t numFrames) {
int16_t *shortData = (int16_t *) data;
diff --git a/src/flowgraph/SinkI16.h b/src/flowgraph/SinkI16.h
index f91903b..2cfdfb0 100644
--- a/src/flowgraph/SinkI16.h
+++ b/src/flowgraph/SinkI16.h
@@ -20,14 +20,14 @@
#include <unistd.h>
#include <sys/types.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
namespace flowgraph {
/**
* AudioSink that lets you read data as 16-bit signed integers.
*/
-class SinkI16 : public AudioSink {
+class SinkI16 : public FlowGraphSink {
public:
explicit SinkI16(int32_t channelCount);
diff --git a/src/flowgraph/SinkI24.cpp b/src/flowgraph/SinkI24.cpp
index d2b948c..b944b77 100644
--- a/src/flowgraph/SinkI24.cpp
+++ b/src/flowgraph/SinkI24.cpp
@@ -18,7 +18,7 @@
#include <unistd.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
#include "SinkI24.h"
#if FLOWGRAPH_ANDROID_INTERNAL
@@ -28,7 +28,7 @@
using namespace flowgraph;
SinkI24::SinkI24(int32_t channelCount)
- : AudioSink(channelCount) {}
+ : FlowGraphSink(channelCount) {}
int32_t SinkI24::read(int64_t framePosition, void *data, int32_t numFrames) {
uint8_t *byteData = (uint8_t *) data;
diff --git a/src/flowgraph/SinkI24.h b/src/flowgraph/SinkI24.h
index 980419b..7477c8d 100644
--- a/src/flowgraph/SinkI24.h
+++ b/src/flowgraph/SinkI24.h
@@ -20,7 +20,7 @@
#include <unistd.h>
#include <sys/types.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
namespace flowgraph {
@@ -28,7 +28,7 @@
* AudioSink that lets you read data as packed 24-bit signed integers.
* The sample size is 3 bytes.
*/
-class SinkI24 : public AudioSink {
+class SinkI24 : public FlowGraphSink {
public:
explicit SinkI24(int32_t channelCount);
diff --git a/src/flowgraph/SourceFloat.cpp b/src/flowgraph/SourceFloat.cpp
index 431e1d0..f574d84 100644
--- a/src/flowgraph/SourceFloat.cpp
+++ b/src/flowgraph/SourceFloat.cpp
@@ -17,13 +17,13 @@
#include "common/OboeDebug.h"
#include <algorithm>
#include <unistd.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
#include "SourceFloat.h"
using namespace flowgraph;
SourceFloat::SourceFloat(int32_t channelCount)
- : AudioSourceBuffered(channelCount) {
+ : FlowGraphSourceBuffered(channelCount) {
}
int32_t SourceFloat::onProcess(int32_t numFrames) {
diff --git a/src/flowgraph/SourceFloat.h b/src/flowgraph/SourceFloat.h
index 16d8e17..4de1b41 100644
--- a/src/flowgraph/SourceFloat.h
+++ b/src/flowgraph/SourceFloat.h
@@ -20,14 +20,14 @@
#include <unistd.h>
#include <sys/types.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
namespace flowgraph {
/**
* AudioSource that reads a block of pre-defined float data.
*/
-class SourceFloat : public AudioSourceBuffered {
+class SourceFloat : public FlowGraphSourceBuffered {
public:
explicit SourceFloat(int32_t channelCount);
diff --git a/src/flowgraph/SourceI16.cpp b/src/flowgraph/SourceI16.cpp
index 86d5148..8813023 100644
--- a/src/flowgraph/SourceI16.cpp
+++ b/src/flowgraph/SourceI16.cpp
@@ -17,7 +17,7 @@
#include <algorithm>
#include <unistd.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
#include "SourceI16.h"
#if FLOWGRAPH_ANDROID_INTERNAL
@@ -27,7 +27,7 @@
using namespace flowgraph;
SourceI16::SourceI16(int32_t channelCount)
- : AudioSourceBuffered(channelCount) {
+ : FlowGraphSourceBuffered(channelCount) {
}
int32_t SourceI16::onProcess(int32_t numFrames) {
diff --git a/src/flowgraph/SourceI16.h b/src/flowgraph/SourceI16.h
index efca138..fe440b2 100644
--- a/src/flowgraph/SourceI16.h
+++ b/src/flowgraph/SourceI16.h
@@ -20,13 +20,13 @@
#include <unistd.h>
#include <sys/types.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
namespace flowgraph {
/**
* AudioSource that reads a block of pre-defined 16-bit integer data.
*/
-class SourceI16 : public AudioSourceBuffered {
+class SourceI16 : public FlowGraphSourceBuffered {
public:
explicit SourceI16(int32_t channelCount);
diff --git a/src/flowgraph/SourceI24.cpp b/src/flowgraph/SourceI24.cpp
index 2f2f334..1975878 100644
--- a/src/flowgraph/SourceI24.cpp
+++ b/src/flowgraph/SourceI24.cpp
@@ -21,7 +21,7 @@
#include <audio_utils/primitives.h>
#endif
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
#include "SourceI24.h"
using namespace flowgraph;
@@ -29,7 +29,7 @@
constexpr int kBytesPerI24Packed = 3;
SourceI24::SourceI24(int32_t channelCount)
- : AudioSourceBuffered(channelCount) {
+ : FlowGraphSourceBuffered(channelCount) {
}
int32_t SourceI24::onProcess(int32_t numFrames) {
diff --git a/src/flowgraph/SourceI24.h b/src/flowgraph/SourceI24.h
index f9f8d02..3779534 100644
--- a/src/flowgraph/SourceI24.h
+++ b/src/flowgraph/SourceI24.h
@@ -20,14 +20,14 @@
#include <unistd.h>
#include <sys/types.h>
-#include "AudioProcessorBase.h"
+#include "FlowGraphNode.h"
namespace flowgraph {
/**
* AudioSource that reads a block of pre-defined 24-bit packed integer data.
*/
-class SourceI24 : public AudioSourceBuffered {
+class SourceI24 : public FlowGraphSourceBuffered {
public:
explicit SourceI24(int32_t channelCount);