1 /*
2  * Copyright (C) 2017 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 _Included_org_drrickorang_loopback_lb2_loopback2
18 #define _Included_org_drrickorang_loopback_lb2_loopback2
19 
20 #include "loopback.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 int lb2ComputeDefaultSettings(int performanceMode, int *samplingRate,
27              int *playerBufferFrameCount, int *recorderBufferFrameCount);
28 int lb2Init(void ** ppCtx, int samplingRate, int frameCount, int micSource,
29              int performanceMode,
30              int testType, double frequency1, char* byteBufferPtr, int byteBufferLength,
31              short* loopbackTone, int maxRecordedLateCallbacks, int ignoreFirstFrames);
32 int lb2Destroy(void ** ppCtx);
33 int lb2ProcessNext(void *pCtx, double *pSamples, long maxSamples);
34 int* lb2GetRecorderBufferPeriod(void *pCtx);
35 int lb2GetRecorderMaxBufferPeriod(void *pCtx);
36 int64_t lb2GetRecorderVarianceBufferPeriod(void *pCtx);
37 int* lb2GetPlayerBufferPeriod(void *pCtx);
38 int lb2GetPlayerMaxBufferPeriod(void *pCtx);
39 int64_t lb2GetPlayerVarianceBufferPeriod(void *pCtx);
40 int lb2GetCaptureRank(void *pCtx);
41 int lb2GetPlayerTimeStampsAndExpectedBufferPeriod(void *pCtx, callbackTimeStamps **ppTSs);
42 int lb2GetRecorderTimeStampsAndExpectedBufferPeriod(void *pCtx, callbackTimeStamps **ppTSs);
43 
44 #ifdef __cplusplus
45 }
46 #endif
47 
48 #endif  // _Included_org_drrickorang_loopback_lb2_loopback2
49