Phil Burk | e5985ed | 2018-12-06 11:38:30 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Phil Burk | 0817a2b | 2019-01-03 14:50:18 -0800 | [diff] [blame] | 17 | #ifndef FLOWGRAPH_MANY_TO_MULTI_CONVERTER_H |
| 18 | #define FLOWGRAPH_MANY_TO_MULTI_CONVERTER_H |
Phil Burk | e5985ed | 2018-12-06 11:38:30 -0800 | [diff] [blame] | 19 | |
| 20 | #include <unistd.h> |
| 21 | #include <sys/types.h> |
| 22 | #include <vector> |
| 23 | |
Phil Burk | 328860f | 2019-11-04 18:43:40 -0800 | [diff] [blame] | 24 | #include "FlowGraphNode.h" |
Phil Burk | e5985ed | 2018-12-06 11:38:30 -0800 | [diff] [blame] | 25 | |
Phil Burk | 9425ffd | 2020-07-09 13:21:09 -0700 | [diff] [blame^] | 26 | namespace FLOWGRAPH_OUTER_NAMESPACE { |
| 27 | namespace flowgraph { |
| 28 | |
Phil Burk | e5985ed | 2018-12-06 11:38:30 -0800 | [diff] [blame] | 29 | /** |
Phil Burk | 78e7413 | 2019-03-01 10:08:25 -0800 | [diff] [blame] | 30 | * Combine multiple mono inputs into one interleaved multi-channel output. |
Phil Burk | e5985ed | 2018-12-06 11:38:30 -0800 | [diff] [blame] | 31 | */ |
Phil Burk | 328860f | 2019-11-04 18:43:40 -0800 | [diff] [blame] | 32 | class ManyToMultiConverter : public flowgraph::FlowGraphNode { |
Phil Burk | e5985ed | 2018-12-06 11:38:30 -0800 | [diff] [blame] | 33 | public: |
| 34 | explicit ManyToMultiConverter(int32_t channelCount); |
| 35 | |
| 36 | virtual ~ManyToMultiConverter() = default; |
| 37 | |
Phil Burk | 22f2113 | 2019-03-08 12:43:19 -0800 | [diff] [blame] | 38 | int32_t onProcess(int numFrames) override; |
Phil Burk | e5985ed | 2018-12-06 11:38:30 -0800 | [diff] [blame] | 39 | |
Phil Burk | 84e7e65 | 2019-05-13 16:29:15 -0700 | [diff] [blame] | 40 | void setEnabled(bool enabled) {} |
Phil Burk | e5985ed | 2018-12-06 11:38:30 -0800 | [diff] [blame] | 41 | |
Phil Burk | 328860f | 2019-11-04 18:43:40 -0800 | [diff] [blame] | 42 | std::vector<std::unique_ptr<flowgraph::FlowGraphPortFloatInput>> inputs; |
| 43 | flowgraph::FlowGraphPortFloatOutput output; |
Phil Burk | e5985ed | 2018-12-06 11:38:30 -0800 | [diff] [blame] | 44 | |
Phil Burk | f67a97f | 2019-05-30 12:48:17 -0700 | [diff] [blame] | 45 | const char *getName() override { |
| 46 | return "ManyToMultiConverter"; |
| 47 | } |
| 48 | |
Phil Burk | e5985ed | 2018-12-06 11:38:30 -0800 | [diff] [blame] | 49 | private: |
| 50 | }; |
| 51 | |
Phil Burk | 9425ffd | 2020-07-09 13:21:09 -0700 | [diff] [blame^] | 52 | } /* namespace flowgraph */ |
| 53 | } /* namespace oboe */ |
| 54 | |
Phil Burk | 0817a2b | 2019-01-03 14:50:18 -0800 | [diff] [blame] | 55 | #endif //FLOWGRAPH_MANY_TO_MULTI_CONVERTER_H |