diff --git a/src/flowgraph/ChannelCountConverter.cpp b/src/flowgraph/ChannelCountConverter.cpp index 03de262ca..b56f8b270 100644 --- a/src/flowgraph/ChannelCountConverter.cpp +++ b/src/flowgraph/ChannelCountConverter.cpp @@ -18,7 +18,7 @@ #include "FlowGraphNode.h" #include "ChannelCountConverter.h" -using namespace flowgraph; +using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; ChannelCountConverter::ChannelCountConverter( int32_t inputChannelCount, diff --git a/src/flowgraph/ChannelCountConverter.h b/src/flowgraph/ChannelCountConverter.h index e4b6f4e66..bf90608e7 100644 --- a/src/flowgraph/ChannelCountConverter.h +++ b/src/flowgraph/ChannelCountConverter.h @@ -22,6 +22,7 @@ #include "FlowGraphNode.h" +namespace FLOWGRAPH_OUTER_NAMESPACE { namespace flowgraph { /** @@ -48,5 +49,6 @@ namespace flowgraph { }; } /* namespace flowgraph */ +} /* namespace oboe */ #endif //FLOWGRAPH_CHANNEL_COUNT_CONVERTER_H diff --git a/src/flowgraph/ClipToRange.cpp b/src/flowgraph/ClipToRange.cpp index d2f8a02ac..c6ad0b0fe 100644 --- a/src/flowgraph/ClipToRange.cpp +++ b/src/flowgraph/ClipToRange.cpp @@ -19,7 +19,7 @@ #include "FlowGraphNode.h" #include "ClipToRange.h" -using namespace flowgraph; +using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; ClipToRange::ClipToRange(int32_t channelCount) : FlowGraphFilter(channelCount) { diff --git a/src/flowgraph/ClipToRange.h b/src/flowgraph/ClipToRange.h index 22b780496..cd7d1c156 100644 --- a/src/flowgraph/ClipToRange.h +++ b/src/flowgraph/ClipToRange.h @@ -23,6 +23,7 @@ #include "FlowGraphNode.h" +namespace FLOWGRAPH_OUTER_NAMESPACE { namespace flowgraph { // This is 3 dB, (10^(3/20)), to match the maximum headroom in AudioTrack for float data. @@ -64,5 +65,6 @@ class ClipToRange : public FlowGraphFilter { }; } /* namespace flowgraph */ +} /* namespace oboe */ #endif //FLOWGRAPH_CLIP_TO_RANGE_H diff --git a/src/flowgraph/FlowGraphNode.cpp b/src/flowgraph/FlowGraphNode.cpp index fd2674894..c7e3ff9d0 100644 --- a/src/flowgraph/FlowGraphNode.cpp +++ b/src/flowgraph/FlowGraphNode.cpp @@ -19,7 +19,7 @@ #include #include "FlowGraphNode.h" -using namespace flowgraph; +using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; /***************************************************************************/ int32_t FlowGraphNode::pullData(int32_t numFrames, int64_t callCount) { diff --git a/src/flowgraph/FlowGraphNode.h b/src/flowgraph/FlowGraphNode.h index e31cab853..642d83910 100644 --- a/src/flowgraph/FlowGraphNode.h +++ b/src/flowgraph/FlowGraphNode.h @@ -40,8 +40,16 @@ // Set this to 1 if using it inside the Android framework. // This code is kept here so that it can be moved easily between Oboe and AAudio. +#ifndef FLOWGRAPH_ANDROID_INTERNAL #define FLOWGRAPH_ANDROID_INTERNAL 0 +#endif +// Set this to a name that will prevent AAudio from calling into Oboe. +#ifndef FLOWGRAPH_OUTER_NAMESPACE +#define FLOWGRAPH_OUTER_NAMESPACE oboe +#endif + +namespace FLOWGRAPH_OUTER_NAMESPACE { namespace flowgraph { // Default block size that can be overridden when the FlowGraphPortFloat is created. @@ -429,5 +437,6 @@ class FlowGraphFilter : public FlowGraphNode { }; } /* namespace flowgraph */ +} /* namespace oboe */ #endif /* FLOWGRAPH_FLOW_GRAPH_NODE_H */ diff --git a/src/flowgraph/ManyToMultiConverter.cpp b/src/flowgraph/ManyToMultiConverter.cpp index 879685e87..4f973bc3f 100644 --- a/src/flowgraph/ManyToMultiConverter.cpp +++ b/src/flowgraph/ManyToMultiConverter.cpp @@ -18,7 +18,7 @@ #include "ManyToMultiConverter.h" -using namespace flowgraph; +using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; ManyToMultiConverter::ManyToMultiConverter(int32_t channelCount) : inputs(channelCount) diff --git a/src/flowgraph/ManyToMultiConverter.h b/src/flowgraph/ManyToMultiConverter.h index eca4a8ed7..b4811bf58 100644 --- a/src/flowgraph/ManyToMultiConverter.h +++ b/src/flowgraph/ManyToMultiConverter.h @@ -23,6 +23,9 @@ #include "FlowGraphNode.h" +namespace FLOWGRAPH_OUTER_NAMESPACE { +namespace flowgraph { + /** * Combine multiple mono inputs into one interleaved multi-channel output. */ @@ -46,4 +49,7 @@ class ManyToMultiConverter : public flowgraph::FlowGraphNode { private: }; +} /* namespace flowgraph */ +} /* namespace oboe */ + #endif //FLOWGRAPH_MANY_TO_MULTI_CONVERTER_H diff --git a/src/flowgraph/MonoToMultiConverter.cpp b/src/flowgraph/MonoToMultiConverter.cpp index 803caec80..bb471a0f1 100644 --- a/src/flowgraph/MonoToMultiConverter.cpp +++ b/src/flowgraph/MonoToMultiConverter.cpp @@ -18,7 +18,7 @@ #include "FlowGraphNode.h" #include "MonoToMultiConverter.h" -using namespace flowgraph; +using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; MonoToMultiConverter::MonoToMultiConverter(int32_t outputChannelCount) : input(*this, 1) diff --git a/src/flowgraph/MonoToMultiConverter.h b/src/flowgraph/MonoToMultiConverter.h index 893d9cd09..4185b3328 100644 --- a/src/flowgraph/MonoToMultiConverter.h +++ b/src/flowgraph/MonoToMultiConverter.h @@ -22,6 +22,7 @@ #include "FlowGraphNode.h" +namespace FLOWGRAPH_OUTER_NAMESPACE { namespace flowgraph { /** @@ -45,5 +46,6 @@ class MonoToMultiConverter : public FlowGraphNode { }; } /* namespace flowgraph */ +} /* namespace oboe */ #endif //FLOWGRAPH_MONO_TO_MULTI_CONVERTER_H diff --git a/src/flowgraph/MultiToMonoConverter.cpp b/src/flowgraph/MultiToMonoConverter.cpp index 21f61246c..8e895bf69 100644 --- a/src/flowgraph/MultiToMonoConverter.cpp +++ b/src/flowgraph/MultiToMonoConverter.cpp @@ -18,7 +18,7 @@ #include "FlowGraphNode.h" #include "MultiToMonoConverter.h" -using namespace flowgraph; +using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; MultiToMonoConverter::MultiToMonoConverter(int32_t inputChannelCount) : input(*this, inputChannelCount) diff --git a/src/flowgraph/MultiToMonoConverter.h b/src/flowgraph/MultiToMonoConverter.h index 37c53bde6..374558c10 100644 --- a/src/flowgraph/MultiToMonoConverter.h +++ b/src/flowgraph/MultiToMonoConverter.h @@ -22,6 +22,7 @@ #include "FlowGraphNode.h" +namespace FLOWGRAPH_OUTER_NAMESPACE { namespace flowgraph { /** @@ -45,5 +46,6 @@ namespace flowgraph { }; } /* namespace flowgraph */ +} /* namespace oboe */ #endif //FLOWGRAPH_MULTI_TO_MONO_CONVERTER_H diff --git a/src/flowgraph/RampLinear.cpp b/src/flowgraph/RampLinear.cpp index afef0181c..33b2712c8 100644 --- a/src/flowgraph/RampLinear.cpp +++ b/src/flowgraph/RampLinear.cpp @@ -19,7 +19,7 @@ #include "FlowGraphNode.h" #include "RampLinear.h" -using namespace flowgraph; +using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; RampLinear::RampLinear(int32_t channelCount) : FlowGraphFilter(channelCount) { diff --git a/src/flowgraph/RampLinear.h b/src/flowgraph/RampLinear.h index f285704c7..cb52d21f7 100644 --- a/src/flowgraph/RampLinear.h +++ b/src/flowgraph/RampLinear.h @@ -23,6 +23,7 @@ #include "FlowGraphNode.h" +namespace FLOWGRAPH_OUTER_NAMESPACE { namespace flowgraph { /** @@ -92,5 +93,6 @@ class RampLinear : public FlowGraphFilter { }; } /* namespace flowgraph */ +} /* namespace oboe */ #endif //FLOWGRAPH_RAMP_LINEAR_H diff --git a/src/flowgraph/SampleRateConverter.cpp b/src/flowgraph/SampleRateConverter.cpp index 708c684fc..0c92d7fdf 100644 --- a/src/flowgraph/SampleRateConverter.cpp +++ b/src/flowgraph/SampleRateConverter.cpp @@ -16,7 +16,7 @@ #include "SampleRateConverter.h" -using namespace flowgraph; +using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; using namespace resampler; SampleRateConverter::SampleRateConverter(int32_t channelCount, MultiChannelResampler &resampler) diff --git a/src/flowgraph/SampleRateConverter.h b/src/flowgraph/SampleRateConverter.h index d940b22b9..d54bcbf50 100644 --- a/src/flowgraph/SampleRateConverter.h +++ b/src/flowgraph/SampleRateConverter.h @@ -23,6 +23,7 @@ #include "FlowGraphNode.h" #include "resampler/MultiChannelResampler.h" +namespace FLOWGRAPH_OUTER_NAMESPACE { namespace flowgraph { class SampleRateConverter : public FlowGraphFilter { @@ -52,5 +53,8 @@ class SampleRateConverter : public FlowGraphFilter { int64_t mInputFramePosition = 0; // monotonic counter of input frames used for pullData }; + } /* namespace flowgraph */ +} /* namespace oboe */ + #endif //OBOE_SAMPLE_RATE_CONVERTER_H diff --git a/src/flowgraph/SinkFloat.cpp b/src/flowgraph/SinkFloat.cpp index 20c0ffa03..e0ac6e931 100644 --- a/src/flowgraph/SinkFloat.cpp +++ b/src/flowgraph/SinkFloat.cpp @@ -19,7 +19,7 @@ #include "FlowGraphNode.h" #include "SinkFloat.h" -using namespace flowgraph; +using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; SinkFloat::SinkFloat(int32_t channelCount) : FlowGraphSink(channelCount) { diff --git a/src/flowgraph/SinkFloat.h b/src/flowgraph/SinkFloat.h index 418f6d7c6..eaf679f5a 100644 --- a/src/flowgraph/SinkFloat.h +++ b/src/flowgraph/SinkFloat.h @@ -23,6 +23,7 @@ #include "FlowGraphNode.h" +namespace FLOWGRAPH_OUTER_NAMESPACE { namespace flowgraph { /** @@ -40,5 +41,6 @@ class SinkFloat : public FlowGraphSink { }; } /* namespace flowgraph */ +} /* namespace oboe */ #endif //FLOWGRAPH_SINK_FLOAT_H diff --git a/src/flowgraph/SinkI16.cpp b/src/flowgraph/SinkI16.cpp index da7fd6b7c..690431ceb 100644 --- a/src/flowgraph/SinkI16.cpp +++ b/src/flowgraph/SinkI16.cpp @@ -23,7 +23,7 @@ #include #endif -using namespace flowgraph; +using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; SinkI16::SinkI16(int32_t channelCount) : FlowGraphSink(channelCount) {} diff --git a/src/flowgraph/SinkI16.h b/src/flowgraph/SinkI16.h index 1e1ce3af4..5e758d27e 100644 --- a/src/flowgraph/SinkI16.h +++ b/src/flowgraph/SinkI16.h @@ -22,6 +22,7 @@ #include "FlowGraphNode.h" +namespace FLOWGRAPH_OUTER_NAMESPACE { namespace flowgraph { /** @@ -39,5 +40,6 @@ class SinkI16 : public FlowGraphSink { }; } /* namespace flowgraph */ +} /* namespace oboe */ #endif //FLOWGRAPH_SINK_I16_H diff --git a/src/flowgraph/SinkI24.cpp b/src/flowgraph/SinkI24.cpp index a9fb5d224..d4f68b684 100644 --- a/src/flowgraph/SinkI24.cpp +++ b/src/flowgraph/SinkI24.cpp @@ -25,7 +25,7 @@ #include #endif -using namespace flowgraph; +using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; SinkI24::SinkI24(int32_t channelCount) : FlowGraphSink(channelCount) {} diff --git a/src/flowgraph/SinkI24.h b/src/flowgraph/SinkI24.h index 44078a96d..326917800 100644 --- a/src/flowgraph/SinkI24.h +++ b/src/flowgraph/SinkI24.h @@ -22,6 +22,7 @@ #include "FlowGraphNode.h" +namespace FLOWGRAPH_OUTER_NAMESPACE { namespace flowgraph { /** @@ -40,5 +41,6 @@ class SinkI24 : public FlowGraphSink { }; } /* namespace flowgraph */ +} /* namespace oboe */ #endif //FLOWGRAPH_SINK_I24_H diff --git a/src/flowgraph/SourceFloat.cpp b/src/flowgraph/SourceFloat.cpp index f574d8420..3161ec184 100644 --- a/src/flowgraph/SourceFloat.cpp +++ b/src/flowgraph/SourceFloat.cpp @@ -20,7 +20,7 @@ #include "FlowGraphNode.h" #include "SourceFloat.h" -using namespace flowgraph; +using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; SourceFloat::SourceFloat(int32_t channelCount) : FlowGraphSourceBuffered(channelCount) { diff --git a/src/flowgraph/SourceFloat.h b/src/flowgraph/SourceFloat.h index 4de1b41c3..6cea67ef3 100644 --- a/src/flowgraph/SourceFloat.h +++ b/src/flowgraph/SourceFloat.h @@ -22,6 +22,7 @@ #include "FlowGraphNode.h" +namespace FLOWGRAPH_OUTER_NAMESPACE { namespace flowgraph { /** @@ -39,5 +40,6 @@ class SourceFloat : public FlowGraphSourceBuffered { }; } /* namespace flowgraph */ +} /* namespace oboe */ #endif //FLOWGRAPH_SOURCE_FLOAT_H diff --git a/src/flowgraph/SourceI16.cpp b/src/flowgraph/SourceI16.cpp index 881302390..16cd2b3dc 100644 --- a/src/flowgraph/SourceI16.cpp +++ b/src/flowgraph/SourceI16.cpp @@ -24,7 +24,7 @@ #include #endif -using namespace flowgraph; +using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; SourceI16::SourceI16(int32_t channelCount) : FlowGraphSourceBuffered(channelCount) { diff --git a/src/flowgraph/SourceI16.h b/src/flowgraph/SourceI16.h index fe440b200..c2cfb1708 100644 --- a/src/flowgraph/SourceI16.h +++ b/src/flowgraph/SourceI16.h @@ -22,6 +22,7 @@ #include "FlowGraphNode.h" +namespace FLOWGRAPH_OUTER_NAMESPACE { namespace flowgraph { /** * AudioSource that reads a block of pre-defined 16-bit integer data. @@ -38,5 +39,6 @@ class SourceI16 : public FlowGraphSourceBuffered { }; } /* namespace flowgraph */ +} /* namespace oboe */ #endif //FLOWGRAPH_SOURCE_I16_H diff --git a/src/flowgraph/SourceI24.cpp b/src/flowgraph/SourceI24.cpp index 197587879..321f732f1 100644 --- a/src/flowgraph/SourceI24.cpp +++ b/src/flowgraph/SourceI24.cpp @@ -24,7 +24,7 @@ #include "FlowGraphNode.h" #include "SourceI24.h" -using namespace flowgraph; +using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph; constexpr int kBytesPerI24Packed = 3; diff --git a/src/flowgraph/SourceI24.h b/src/flowgraph/SourceI24.h index 377953432..31a430571 100644 --- a/src/flowgraph/SourceI24.h +++ b/src/flowgraph/SourceI24.h @@ -22,6 +22,7 @@ #include "FlowGraphNode.h" +namespace FLOWGRAPH_OUTER_NAMESPACE { namespace flowgraph { /** @@ -39,5 +40,6 @@ class SourceI24 : public FlowGraphSourceBuffered { }; } /* namespace flowgraph */ +} /* namespace oboe */ #endif //FLOWGRAPH_SOURCE_I24_H