blob: 202cdf993f0acc841d6350f439dd9cbfbd8f5bdd [file] [log] [blame]
Keun young Park4bbb5d72012-03-26 18:31:29 -07001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
6 * 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, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16
17#ifndef CTSAUDIO_SIGNALPROCESSINGINTERFACE_H
18#define CTSAUDIO_SIGNALPROCESSINGINTERFACE_H
19
20#include <utils/String8.h>
21
22#include "task/TaskGeneric.h"
23
24/**
25 * Interface to Signal processing module to run signal processing script and retrieve the result
26 * After construction, init() should be called before doing anything else.
27 */
28class SignalProcessingInterface {
29public:
30 virtual ~SignalProcessingInterface() {};
31
32 virtual bool init(const android::String8& script) = 0;
33 /**
34 * run the script with given input / output parameters. Note that this function does not
35 * do any type check.
36 * @param functionScript function name (python script name to run for this call)
37 * @param nInputs number of inputs. This is the length of inputTypes and inputs array
38 * @param inputTypes represent types of each input.
39 * when true: android::sp<Buffer>*, false: Value*
40 * @param inputs pointer to input. Either android::sp<Buffer>* or Value*
41 * @param nOutputs
42 * @param outputTypes
43 * @param outputs
44 */
45 virtual TaskGeneric::ExecutionResult run(const android::String8& functionScript,
46 int nInputs, bool* inputTypes, void** inputs,
47 int nOutputs, bool* outputTypes, void** outputs) = 0;
48};
49
50#endif //CTSAUDIO_SIGNALPROCESSINGINTERFACE_H