-
Notifications
You must be signed in to change notification settings - Fork 356
Expand file tree
/
Copy pathDtsSofInterface.h
More file actions
112 lines (90 loc) · 3.45 KB
/
DtsSofInterface.h
File metadata and controls
112 lines (90 loc) · 3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2021 Xperi. All rights reserved.
//
// Author: Mark Barton <mark.barton@xperi.com>
#ifndef __SOF_AUDIO_DTS_SOF_INTERFACE_H__
#define __SOF_AUDIO_DTS_SOF_INTERFACE_H__
#include "DtsSofInterfaceResult.h"
#include "DtsSofInterfaceVersion.h"
#include <stddef.h>
#if defined(__cplusplus)
extern "C" {
#endif
#ifdef _WINDOWS
#define DTS_SOF_INTERFACE_API __declspec(dllexport)
#else
#define DTS_SOF_INTERFACE_API
#endif
#if !defined(DTS_SOF_INTERFACE_NOEXCEPT)
#if (defined(__cplusplus) && __cplusplus >= 201103L) && (defined(_MSC_VER) && _MSC_VER >= 1900 && defined(_CPPUNWIND))
#define DTS_SOF_INTERFACE_NOEXCEPT noexcept
#elif (defined(_MSC_VER) && defined(_CPPUNWIND))
#define DTS_SOF_INTERFACE_NOEXCEPT throw()
#else
#define DTS_SOF_INTERFACE_NOEXCEPT
#endif
#endif
typedef struct DtsSofInterfaceInst DtsSofInterfaceInst;
typedef enum {
// Supported parameter ids
DTS_SOF_INTERFACE_PARAMETER_ID_SINGLE_CONFIGURATION = 1,
} DtsSofInterfaceParameterId;
typedef enum
{
DTS_SOF_INTERFACE_BUFFER_LAYOUT_INTERLEAVED = 0,
DTS_SOF_INTERFACE_BUFFER_LAYOUT_NONINTERLEAVED,
} DtsSofInterfaceBufferLayout;
typedef enum
{
DTS_SOF_INTERFACE_BUFFER_FORMAT_SINT16LE = 0,
DTS_SOF_INTERFACE_BUFFER_FORMAT_SINT24LE,
DTS_SOF_INTERFACE_BUFFER_FORMAT_SINT32LE,
DTS_SOF_INTERFACE_BUFFER_FORMAT_FLOAT32,
} DtsSofInterfaceBufferFormat;
typedef struct DtsSofInterfaceBufferConfiguration
{
DtsSofInterfaceBufferLayout bufferLayout;
DtsSofInterfaceBufferFormat bufferFormat;
unsigned int sampleRate;
unsigned int numChannels;
unsigned int periodInFrames;
} DtsSofInterfaceBufferConfiguration;
typedef void* (*DtsSofInterfaceAllocateMemory)(
void *pMemoryAllocationContext,
unsigned int length,
unsigned int alignment);
typedef void (*DtsSofInterfaceFreeMemory)(void *pMemoryAllocationContext, void *pMemory);
DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfaceInit(
DtsSofInterfaceInst **ppInst,
DtsSofInterfaceAllocateMemory pMemoryAllocationFn,
DtsSofInterfaceFreeMemory pMemoryFreeFn,
void *MemoryAllocationContext) DTS_SOF_INTERFACE_NOEXCEPT;
DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfacePrepare(
DtsSofInterfaceInst* pInst,
const DtsSofInterfaceBufferConfiguration* pBufferConfiguration,
void** ppSofInputBuffer,
unsigned int* pSofInputBufferSize,
void** ppSofOutputBuffer,
unsigned int* pSofOutputBufferSize) DTS_SOF_INTERFACE_NOEXCEPT;
DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfaceInitProcess(
DtsSofInterfaceInst* pInst) DTS_SOF_INTERFACE_NOEXCEPT;
DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfaceProcess(
DtsSofInterfaceInst* pInst,
unsigned int* pNumBytesProcessed) DTS_SOF_INTERFACE_NOEXCEPT;
DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfaceApplyConfig(
DtsSofInterfaceInst* pInst,
int parameterId,
const void *pData,
unsigned int dataSize) DTS_SOF_INTERFACE_NOEXCEPT;
DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfaceReset(
DtsSofInterfaceInst* pInst) DTS_SOF_INTERFACE_NOEXCEPT;
DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfaceFree(
DtsSofInterfaceInst* pInst) DTS_SOF_INTERFACE_NOEXCEPT;
DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfaceGetVersion(
DtsSofInterfaceVersionInfo* pInterfaceVersion,
DtsSofInterfaceVersionInfo* pSdkVersion) DTS_SOF_INTERFACE_NOEXCEPT;
#if defined(__cplusplus)
}
#endif
#endif // __SOF_AUDIO_DTS_SOF_INTERFACE_H__