blob: c60e0704b8fa9cc781896b6521fe78222deb37a3 [file] [log] [blame]
Phil Burke5985ed2018-12-06 11:38:30 -08001/*
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 Burk0817a2b2019-01-03 14:50:18 -080017#ifndef FLOWGRAPH_MANY_TO_MULTI_CONVERTER_H
18#define FLOWGRAPH_MANY_TO_MULTI_CONVERTER_H
Phil Burke5985ed2018-12-06 11:38:30 -080019
20#include <unistd.h>
21#include <sys/types.h>
22#include <vector>
23
Phil Burk328860f2019-11-04 18:43:40 -080024#include "FlowGraphNode.h"
Phil Burke5985ed2018-12-06 11:38:30 -080025
Phil Burk9425ffd2020-07-09 13:21:09 -070026namespace FLOWGRAPH_OUTER_NAMESPACE {
27namespace flowgraph {
28
Phil Burke5985ed2018-12-06 11:38:30 -080029/**
Phil Burk78e74132019-03-01 10:08:25 -080030 * Combine multiple mono inputs into one interleaved multi-channel output.
Phil Burke5985ed2018-12-06 11:38:30 -080031 */
Phil Burk328860f2019-11-04 18:43:40 -080032class ManyToMultiConverter : public flowgraph::FlowGraphNode {
Phil Burke5985ed2018-12-06 11:38:30 -080033public:
34 explicit ManyToMultiConverter(int32_t channelCount);
35
36 virtual ~ManyToMultiConverter() = default;
37
Phil Burk22f21132019-03-08 12:43:19 -080038 int32_t onProcess(int numFrames) override;
Phil Burke5985ed2018-12-06 11:38:30 -080039
Phil Burk84e7e652019-05-13 16:29:15 -070040 void setEnabled(bool enabled) {}
Phil Burke5985ed2018-12-06 11:38:30 -080041
Phil Burk328860f2019-11-04 18:43:40 -080042 std::vector<std::unique_ptr<flowgraph::FlowGraphPortFloatInput>> inputs;
43 flowgraph::FlowGraphPortFloatOutput output;
Phil Burke5985ed2018-12-06 11:38:30 -080044
Phil Burkf67a97f2019-05-30 12:48:17 -070045 const char *getName() override {
46 return "ManyToMultiConverter";
47 }
48
Phil Burke5985ed2018-12-06 11:38:30 -080049private:
50};
51
Phil Burk9425ffd2020-07-09 13:21:09 -070052} /* namespace flowgraph */
Phil Burk2c8f2812020-07-13 10:55:04 -070053} /* namespace FLOWGRAPH_OUTER_NAMESPACE */
Phil Burk9425ffd2020-07-09 13:21:09 -070054
Phil Burk0817a2b2019-01-03 14:50:18 -080055#endif //FLOWGRAPH_MANY_TO_MULTI_CONVERTER_H