-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathLavAudioSettingsInterface.pas
198 lines (162 loc) · 7.14 KB
/
LavAudioSettingsInterface.pas
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
(*
* Copyright (C) 2010-2018 Hendrik Leppkes
* http://www.1f0.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* porting for Delphi By Red5goahead ([email protected])
*)
unit LavAudioSettingsInterface;
interface
uses DirectShow9, ActiveX, Windows;
const
CLSID_LavAudioDecoder: TGuid = '{E8E73B6B-4CB3-44A4-BE99-4F7BCB96E491}';
IID_ILAVAudioSettings: TGuid = '{4158A22B-6553-45D0-8069-24716F8FF171}';
LAV_MIXING_FLAG_UNTOUCHED_STEREO = 1;
LAV_MIXING_FLAG_NORMALIZE_MATRIX = 2;
LAV_MIXING_FLAG_CLIP_PROTECTION = 4;
type
// Codecs supported in the LAV Audio configuration
// Codecs not listed here cannot be turned off. You can request codecs to be added to this list, if you wish.
TLAVAudioCodec = (
Codec_AAC,
Codec_AC3,
Codec_EAC3,
Codec_DTS,
Codec_MP2,
Codec_MP3,
Codec_TRUEHD,
Codec_FLAC,
Codec_VORBIS,
Codec_LPCM,
Codec_PCM,
Codec_WAVPACK,
Codec_TTA,
Codec_WMA2,
Codec_WMAPRO,
Codec_Cook,
Codec_RealAudio,
Codec_WMALL,
Codec_ALAC,
Codec_Opus,
Codec_AMR,
Codec_Nellymoser,
Codec_MSPCM,
Codec_Truespeech,
Codec_TAK,
Codec_ATRAC,
Codec_NB);
// Supported Sample Formats in LAV Audio
TLAVBitstreamCodec = (
Bitstream_AC3,
Bitstream_EAC3,
Bitstream_TRUEHD,
Bitstream_DTS,
Bitstream_DTSHD,
Bitstream_NB);
// Supported Sample Formats in LAV Audio
TLAVAudioSampleFormat = (
SampleFormat_16,
SampleFormat_24,
SampleFormat_32,
SampleFormat_U8,
SampleFormat_FP32,
SampleFormat_Bitstream,
SampleFormat_NB);
TLAVAudioMixingMode = (
MatrixEncoding_None,
MatrixEncoding_Dolby,
MatrixEncoding_DPLII,
MatrixEncoding_NB);
// LAV Audio configuration interface
ILAVAudioSettings = interface(IUnknown)
['{4158A22B-6553-45D0-8069-24716F8FF171}']
// Switch to Runtime Config mode. This will reset all settings to default, and no changes to the settings will be saved
// You can use this to programmatically configure LAV Video without interfering with the users settings in the registry.
// Subsequent calls to this function will reset all settings back to defaults, even if the mode does not change.
//
// Note that calling this function during playback is not supported and may exhibit undocumented behaviour.
// For smooth operations, it must be called before LAV Video is connected to other filters.
Procedure SetRuntimeConfig(bRuntimeConfig : boolean); stdcall;
// Dynamic Range Compression
// pbDRCEnabled: The state of DRC
// piDRCLevel: The DRC strength (0-100, 100 is maximum)
Procedure GetDRC(out pbDRCEnabled : boolean; out piDRCLevel : Integer); stdcall;
Procedure SetDRC(bDRCEnabled : boolean; iDRCLevel : Integer); stdcall;
// Configure which codecs are enabled
// If vCodec is invalid (possibly a version difference), Get will return FALSE, and Set E_FAIL.
Function GetFormatConfiguration(vCodec : TLAVAudioCodec): boolean ; stdcall;
Procedure SetFormatConfiguration(vCodec : TLAVAudioCodec; bEnabled : boolean); stdcall;
// Control Bitstreaming
// If bsCodec is invalid (possibly a version difference), Get will return FALSE, and Set E_FAIL.
Function GetBitstreamConfig(bsCodec : TLAVBitstreamCodec): boolean ; stdcall;
Procedure SetBitstreamConfig(bsCodec : TLAVBitstreamCodec; bEnabled : boolean); stdcall;
// Should "normal" DTS frames be encapsulated in DTS-HD frames when bitstreaming?
Function GetDTSHDFraming(): boolean ; stdcall;
Procedure SetDTSHDFraming(bHDFraming : boolean); stdcall;
// Control Auto A/V syncing
Function GetAutoAVSync(): boolean ; stdcall;
Procedure SetAutoAVSync(bAutoSync : boolean); stdcall;
// Convert all Channel Layouts to standard layouts
// Standard are: Mono, Stereo, 5.1, 6.1, 7.1
Function GetOutputStandardLayout(): boolean ; stdcall;
Procedure SetOutputStandardLayout(bStdLayout : boolean); stdcall;
// Expand Mono to Stereo by simply doubling the audio
Function GetExpandMono(): boolean ; stdcall;
Procedure SetExpandMono(bExpandMono : boolean); stdcall;
// Expand 6.1 to 7.1 by doubling the back center
Function GetExpand61(): boolean ; stdcall;
Procedure SetExpand61(bExpand61 : boolean); stdcall;
// Allow Raw PCM and SPDIF encoded input
Function GetAllowRawSPDIFInput(): boolean ; stdcall;
Procedure SetAllowRawSPDIFInput(bAllow : boolean); stdcall;
// Configure which sample formats are enabled
// Note: SampleFormat_Bitstream cannot be controlled by this
Function GetSampleFormat(format : TLAVAudioSampleFormat): boolean ; stdcall;
Procedure SetSampleFormat(format : TLAVAudioSampleFormat; bEnabled : boolean); stdcall;
// Configure a delay for the audio
Procedure GetAudioDelay(out pbEnabled : boolean; out pDelay : Integer); stdcall;
Procedure SetAudioDelay(bEnabled : boolean; delay : Integer); stdcall;
// Enable/Disable Mixing
Procedure SetMixingEnabled(bEnabled : boolean); stdcall;
Function GetMixingEnabled(): boolean ; stdcall;
// Control Mixing Layout
Procedure SetMixingLayout(dwLayout : DWORD); stdcall;
Function GetMixingLayout(): DWORD ; stdcall;
// Set Mixing Flags
Procedure SetMixingFlags(dwFlags : DWORD); stdcall;
Function GetMixingFlags(): DWORD ; stdcall;
// Set Mixing Mode
Procedure SetMixingMode(mixingMode : TLAVAudioMixingMode); stdcall;
Function GetMixingMode(): TLAVAudioMixingMode ; stdcall;
// Set Mixing Levels
Procedure SetMixingLevels(dwCenterLevel : DWORD; dwSurroundLevel : DWORD; dwLFELevel : DWORD); stdcall;
Procedure GetMixingLevels(out dwCenterLevel : DWORD; out dwSurroundLevel : DWORD; out dwLFELevel : DWORD); stdcall;
// Toggle Tray Icon
Procedure SetTrayIcon(bEnabled : boolean); stdcall;
Function GetTrayIcon(): boolean ; stdcall;
// Toggle Dithering for sample format conversion
Procedure SetSampleConvertDithering(bEnabled : boolean); stdcall;
Function GetSampleConvertDithering(): boolean ; stdcall;
// Suppress sample format changes. This will allow channel count to increase, but not to reduce, instead adding empty channels
// This option is NOT persistent
Procedure SetSuppressFormatChanges(bEnabled : boolean); stdcall;
Function GetSuppressFormatChanges(): boolean ; stdcall;
// Use 5.1 legacy layout (using back channels instead of side)
Procedure SetOutput51LegacyLayout(b51Legacy : boolean); stdcall;
Function GetOutput51LegacyLayout(): boolean ; stdcall;
end;
implementation
end.