blob: 0b7ce9f373c2942bcf44e83e46b13a10e7f4c4b7 [file] [log] [blame]
Phil Burk7386a832019-03-21 16:07:27 -07001/*
2 * Copyright 2019 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
17#ifndef OBOETESTER_FULL_DUPLEX_ANALYZER_H
18#define OBOETESTER_FULL_DUPLEX_ANALYZER_H
19
20#include <unistd.h>
21#include <sys/types.h>
22
23#include "oboe/Oboe.h"
24#include "FullDuplexStream.h"
25#include "LatencyAnalyzer.h"
26
27class FullDuplexAnalyzer : public FullDuplexStream {
28public:
29 FullDuplexAnalyzer() {}
30
31 /**
32 * Called when data is available on both streams.
33 * Caller should override this method.
34 */
35 oboe::DataCallbackResult onBothStreamsReady(
36 const void *inputData,
37 int numInputFrames,
38 void *outputData,
39 int numOutputFrames
40 ) override;
41
42 oboe::Result start() override;
43
44 bool isDone() {
45 return false;
46 }
47
48 virtual LoopbackProcessor *getLoopbackProcessor() = 0;
49
50};
51
52
53#endif //OBOETESTER_FULL_DUPLEX_ANALYZER_H
54